The GNU configure and build system-configure的详细介绍

本文介绍如何使用autoscan、autoconf及automake等工具,通过实际案例解析这些工具的作用和基本步骤,帮助读者掌握现代软件构建流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

第一篇:The GNU configure and build system

Ian Lance Taylor
hspace="0" marginheight="0" marginwidth="0" tabindex="0" vspace="0" id="I0_1440130844285" name="I0_1440130844285" src="https://apis.google.com/se/0/_/+1/fastbutton?usegapi=1&origin=http%3A%2F%2Fwww.airs.com&url=http%3A%2F%2Fwww.airs.com%2Fian%2Fconfigure%2F&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.zh_CN.PIuK5Oi66u8.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Ft%3Dzcms%2Frs%3DAGLTcCP2WvZ0_2FqudZsqW8ZWc9EeGYLDw#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh&id=I0_1440130844285&parent=http%3A%2F%2Fwww.airs.com&pfname=&rpctoken=38220328" data-gapiattached="true" title="+1" style="position: static; top: 0px; width: 106px; margin: 0px; border-style: none; left: 0px; visibility: visible; height: 24px;" frameborder="0" scrolling="no" width="100%">


This document was generated on 1 July 1998 using the texi2html translator version 1.52.



第二篇:Autoconf


  www.delorie.com/gnu/docs/autoconf/autoconf_toc.html  search  
 
Buy the book!

 
Autoconf
[Top][Contents][Index][ ? ]

Table of Contents


  webmaster   donations   bookstore    delorie software   privacy  
  Copyright � 2003   by The Free Software Foundation    Updated Jun 2003  

第3篇  automake
automake
[Top][Contents][Index][ ? ]

Table of Contents


  webmaster   donations   bookstore    delorie software   privacy  
  Copyright � 2003   by The Free Software Foundation    Updated Jun 2003  

第4篇 弄懂autoscan, autoconf, automake, Makefile.am

弄懂autoscan, autoconf, automake, Makefile.am

之前一直把所有的h文件和c文件都放在同一个目录下,用的是通用Makefile,现在觉得需要现代化一点,于是进行了一些改造,分多个目录,多级目录,因此,学习一下autoscan,aclocal,autoconf,automake这些工具的使用。

本文不是讲解这些工具用法的,只是列出网上较好的文章。如果这些链接失效了,请通知我。

通用Makefile:http://bbs.chinaunix.net/viewthread.php?tid=909275&extra=&page=6

autoscan,autoconf,automake讲解,首先是这两篇文章,写的比较详细:

http://www.ibm.com/developerworks/cn/linux/l-makefile/

http://bbs.chinaunix.net/viewthread.php?tid=727270

然后,一个典型的实例,可以参考:

http://basiccoder.com/automake-introduction.html

最后,关于核心的Makefile.am,多级目录下Makefile.am的写法,可以参考这两篇文章:

http://bigwhite.blogbus.com/logs/80924710.html

http://jianlee.ylinux.org/Computer/C%E5%92%8CGNU%E5%BC%80%E5%8F%91/makefile-am.html

读懂这些,应该就足够了。总结一下,基本步骤如下:
1、autoscan ./
2、修改生成的configure.scan文件,增加AM_INIT_AUTOMAKE ,AC_CONFIG_FILES([Makefile])
3、aclocal
4、核心步骤:根据情况,编写Makefile.am
5、autoheader
6、touch NEWS README AUTHORS ChangeLog
7、automake -a
8、autoconf

注:运行autoscan时,会出现以下提示:

[shell]
autom4te: configure.ac: no such file or directory
autoscan: /usr/bin/autom4te failed with exit status: 1
[/shell]

这个提示不影响下面的步骤,因为configure.scan文件已经生成了。


Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
最新发布
08-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值