文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>自动编译工具AutoTools使用测试

自动编译工具AutoTools使用测试

时间:2009-03-04  来源:creatory

自动编译工具AutoTools使用测试
1.检查系统必装工具包(保证可用)automake,autoconf,aclocal,autoheader,libtool,m4,perl
2.mkdir test && vi test/test.c
输入测试代码:
#include <stdio.h>
int main(int argc,char **argv)
{
printf("GNU AutoTools Test.The test works well if you see this
message.");
return 0;
}
3.$autoscan
生成如下文件:
autoscan.log configure.scan test.c
4.$mv configure.scan configure.in && vi configure.in
源文件如下:
#            -*-Autoconf-*-
#Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(FULL-PACKAGE-NAME,VERSION,BUG-REPORT-ADDRESS)
AC_CONFIG_SRCDIR([test.c])
AC_CONFIG_HEADER([config.h])
#Checks for programs
AC_PROG_CC
#Checks for libraries
#Checks for header files
#Checks for typedefs,structures,and compiler characteristics.
#Checks for library functions.
AC_OUTPUT
修改如下:
#            -*-Autoconf-*-
#Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(test.c,1.0,[email protected])
AM_INIT_AUTOMAKE(test,1.0)
AC_CONFIG_SRCDIR([test.c])
AC_CONFIG_HEADER([config.h])
#Checks for programs
AC_PROG_CC
#Checks for libraries
#Checks for header files
#Checks for typedefs,structures,and compiler characteristics.
#Checks for library functions.
AC_OUTPUT(Makefile)
5.$aclocal && autoheader && autoconf
生成文件如下:
aclocal.m4 autoscan.log configure test.c autom4te.cache config.h.in configure.in
6.$vi Makefile.am
新建文件内容如下:
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=test
test_SOURCES=test.c
7.$automake --add-missing
至此配置完毕
先用./configure进行检测配置
再用make dist打包为test-1.0.tar.gz即可发行.
相关阅读 更多 +
排行榜 更多 +
爱是小事最新版

爱是小事最新版

休闲益智 下载
悬案2刹那惊颤游戏

悬案2刹那惊颤游戏

冒险解谜 下载
几何飞行内购修改版

几何飞行内购修改版

飞行射击 下载