-
aclocal ; autoheader; automake ; autoconf
- ./configure 自动生成makefile文件
- http://www.2cto.com/net/201609/547736.html
- 把make过程打印的所有信息都保存在xxx.log中。
$make 2>&1|tee xxx.log
- ./configure --prefix=/tmp/prefix
- ./configure --help
- make install DESTDIR=/whereto
- make uninstall
- make V=99 //make时显示详细信息
- ./configure --disable-static 不编译静态文件
- aclocal 根据configure.in 文件的内容,自动生成aclocal.m4 文件
- aclocal -I /usr/share/aclocal -I /usr/m4-1.4.9/m4 --install
- autoconf 从configure.in 这个列举编译软件时所需要各种参数的模板文件中创建configure
- automake 会根据你写的Makefile.am 来自动生成Makefile.in
- 执行configure 生成Makefile
-
make -f pax.mk // run pax.mk
-
automake --force-missing --add-missing
-
ldd --version 查看glibc版本
CFLAGS: 指定头文件(.h文件)的路径,如:CFLAGS=-I/usr/include -I/path/include。同样地,安装一个包时会在安装路径下建立一个include目录,当安装过程中出现问题时,试着把以前安装的包的include目录加入到该变量中来。
LDFLAGS:gcc 等编译器会用到的一些优化参数,也可以在里面指定库文件的位置。用法:LDFLAGS=-L/usr/lib -L/path/to/your/lib。每安装一个包都几乎一定的会在安装目录里建立一个lib目录。如果明明安装了某个包,而安装另一个包时,它愣是 说找不到,可以抒那个包的lib路径加入的LDFALGS中试一下。
LIBS:告诉链接器要链接哪些库文件,如LIBS = -lpthread -liconv
简单地说,LDFLAGS是告诉链接器从哪里寻找库文件,而LIBS是告诉链接器要链接哪些库文件。不过使用时链接阶段这两个参数都会加上,所以你即使将这两个的值互换,也没有问题。
有时候LDFLAGS指定-L虽然能让链接器找到库进行链接,但是运行时链接器却找不到这个库,如果要让软件运行时库文件的路径也得到扩展,那么我们需要增加这两个库给”-Wl,R”:
config.log 搜索关键字cannot1.error
configure.in:7: version mismatch. This is Automake 1.9.6,
configure.in:7: but the definition used by this AM_INIT_AUTOMAKE
configure.in:7: comes from Automake 1.9.5. You should recreate
configure.in:7: aclocal.m4 with aclocal and run automake again.
解决方法
$aclocal
$automake
将重新生成makefile文件
2.[root@localhost src]# ./configure
-bash: ./configure: No such file or directory
[root@localhost src]# aclocal
aclocal: `configure.ac' and `configure.in' both present.
aclocal: proceeding with `configure.ac'.
[root@localhost src]# autoconf
autoconf: warning: both `configure.ac' and `configure.in' are present.
autoconf: warning: proceeding with `configure.ac'.
root@localhost src]# ./configure
checking which defines needed for makedepend...
checking for a BSD-compatible install... /usr/bin/install -c
aclocal, autoconf, 之后可以正常运行./configure了
3.
+ autoreconf --install
configure.ac:32: warning: macro 'AM_PROG_LIBTOOL' not found in library
configure.ac:32: error: possibly undefined macro: AM_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
autoreconf -fvi
to make sure everything is updated.
4.
configure.ac:10: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
apt-get install libtool
5.
$ sudo pacman -S pkg-config xorg-server-devel libtool automake
$ libtoolize --force
Consider adding AC_CONFIG_MACRO_DIR([m4]) to configure.ac
and re-run libtoolize --force.
$ vim configure.ac
$ libtoolize --force
$ aclocal
$ autoheader
$ automake --force-missing --add-missing
$ autoconf
6. ./configure: line 17661: syntax error near unexpected token `HARFBUZZ,'
slove: aclocal /usr/pkg-config-0.25/share/aclocal --install
7.[root@localhost src]# ./autogen.sh
which: no gtkdocize in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
*** No GTK-Doc found, please install it ***
8.[root@localhost src]# libtoolize
-bash: libtoolize: command not found
export PATH='/path/to/libtool/bin'