全面升级autoconf/automake

刚刚装了autoconf261和automake110,还没找到哪里写的有what's
new.不过粗略的看了一下文档,感觉差别蛮大的。
至少我以前的autotoolset的LC_CONFIGUERE_CC和LC_CONFIGUERE_CXX
应当被抛弃了。
autotoolset在2003年就停止开发了。我曾经试图修补过它,但是无奈的是我对m4也是一知半解,唉。。。。
顺便说一下,以前的
AC_PROG_CC
AC_PROG_CXX
要被修改为
AC_LANG(C)
AC_LANG(C++)
看了下,autoconf支持的主要语言还是C,C++,fortran,object C,不过今天在这里看见了Erlang的影子。
另外一个改变就是
AM_CONFIG_HEADER(config.h)
被改为
AC_CONFIG_HEADERS([config.h])
automake110的一个好处就是,以往会显示满屏幕的
/usr/X11R6/share/aclocal/xmms.m4:17: warning: underquoted definition of
XMMS_TEST_VERSION
run info '(automake)Extending aclocal'
or see
http://sources.redhat.com/automake/automake.html\#Extending-aclocal
/usr/X11R6/share/aclocal/xmms.m4:62: warning: underquoted definition of
AM_PATH_XMMS
/usr/X11R6/share/aclocal/KXL.m4:6: warning: underquoted definition of
AM_PATH_KXL
这样的信息,检测到一个就显示一个,现
在它只显示一次。
$ aclocal110
/usr/local/share/aclocal/speex.m4:10: warning: underquoted definition
of XIPH_PATH_SPEEX
/usr/local/share/aclocal/speex.m4:10: run info '(automake)Extending
aclocal'
/usr/local/share/aclocal/speex.m4:10: or see
http://sources.redhat.com/automake/automake.html\#Extending-aclocal
不过我的automake10似乎安装的有点问题。aclocal110总是失败,这是详细的调试日志的(只取
了最后几行)
aclocal110: saw macro gt_CHECK_DECL
aclocal110: saw macro AM_LANGINFO_CODESET
aclocal110: saw macro gt_LC_MESSAGES
aclocal110: saw macro AM_GNU_GETTEXT_VERSION
aclocal110: running autom4te259 --language Autoconf-without-aclocal-m4
/usr/X11R6/share/aclocal/wxwin.m4 /usr/local/share/aclocal/codeset.m4
/usr/local/share/aclocal/gettext.m4 /usr/local/share/aclocal/glibc2.m4
/usr/local/share/aclocal/glibc21.m4 /usr/local/share/aclocal/iconv.m4
/usr/local/share/aclocal/intdiv0.m4 /usr/local/share/aclocal/intmax.m4
/usr/local/share/aclocal/inttypes-pri.m4
/usr/local/share/aclocal/inttypes.m4
/usr/local/share/aclocal/inttypes_h.m4
/usr/local/share/aclocal/isc-posix.m4
/usr/local/share/aclocal/lcmessage.m4
/usr/local/share/aclocal/lf_warnings.m4
/usr/local/share/aclocal/lib-ld.m4 /usr/local/share/aclocal/lib-link.m4
/usr/local/share/aclocal/lib-prefix.m4
/usr/local/share/aclocal/longdouble.m4
/usr/local/share/aclocal/longlong.m4 /usr/local/share/aclocal/nls.m4
/usr/local/share/aclocal/pkg.m4 /usr/local/share/aclocal/po.m4
/usr/local/share/aclocal/printf-posix.m4
/usr/local/share/aclocal/progtest.m4 /usr/local/share/aclocal/signed.m4
/usr/local/share/aclocal/size_max.m4
/usr/local/share/aclocal/stdint_h.m4
/usr/local/share/aclocal/uintmax_t.m4
/usr/local/share/aclocal/ulonglong.m4
/usr/local/share/aclocal/wchar_t.m4 /usr/local/share/aclocal/wint_t.m4
/usr/local/share/aclocal/xsize.m4
/usr/local/share/aclocal110/amversion.m4
/usr/local/share/aclocal110/auxdir.m4
/usr/local/share/aclocal110/cond.m4
/usr/local/share/aclocal110/depend.m4
/usr/local/share/aclocal110/depout.m4
/usr/local/share/aclocal110/init.m4
/usr/local/share/aclocal110/install-sh.m4
/usr/local/share/aclocal110/lead-dot.m4
/usr/local/share/aclocal110/make.m4
/usr/local/share/aclocal110/missing.m4
/usr/local/share/aclocal110/mkdirp.m4
/usr/local/share/aclocal110/options.m4
/usr/local/share/aclocal110/runlog.m4
/usr/local/share/aclocal110/sanity.m4
/usr/local/share/aclocal110/strip.m4
/usr/local/share/aclocal110/substnot.m4
/usr/local/share/aclocal110/tar.m4 --trace='AC_DEFUN:$f::$n::$1'
--trace='AC_DEFUN_ONCE:$f::$n::$1' --trace='AU_DEFUN:$f::$n::$1'
--trace='_AM_AUTOCONF_VERSION:$f::$n::$1'
--trace='gt_INTTYPES_PRI:$f::$n' --trace='AM_PO_SUBDIRS:$f::$n'
--trace='AC_LIB_PREPARE_PREFIX:$f::$n'
--trace='gl_AC_HEADER_STDINT_H:$f::$n' --trace='AM_PROG_MKDIR_P:$f::$n'
--trace='AM_PATH_WXCONFIG:$f::$n' --trace='AM_AUTOMAKE_VERSION:$f::$n'
--trace='gl_SIZE_MAX:$f::$n' --trace='AM_MISSING_HAS_RUN:$f::$n'
--trace='AC_LIB_RPATH:$f::$n' --trace='gt_PRINTF_POSIX:$f::$n'
--trace='AM_MISSING_PROG:$f::$n'
--trace='AM_GNU_GETTEXT_VERSION:$f::$n'
--trace='AC_LIB_PROG_LD_GNU:$f::$n' --trace='AM_NLS:$f::$n'
--trace='AM_PROG_INSTALL_STRIP:$f::$n'
--trace='_PKG_SHORT_ERRORS_SUPPORTED:$f::$n'
--trace='LF_CHECK_CC_FLAG:$f::$n' --trace='AM_SANITY_CHECK:$f::$n'
--trace='PKG_CHECK_EXISTS:$f::$n' --trace='LF_SET_WARNINGS:$f::$n'
--trace='gl_AC_TYPE_LONG_LONG:$f::$n' --trace='_AM_PROG_TAR:$f::$n'
--trace='AM_DEP_TRACK:$f::$n' --trace='AC_LIB_ARG_WITH:$f::$n'
--trace='_AM_IF_OPTION:$f::$n' --trace='_AM_SUBST_NOTMAKE:$f::$n'
--trace='LF_CHECK_CXX_FLAG:$f::$n'
--trace='AM_PATH_PROG_WITH_TEST:$f::$n'
--trace='AM_SET_LEADING_DOT:$f::$n' --trace='AM_PATH_WXRC:$f::$n'
--trace='_AM_DEPENDENCIES:$f::$n' --trace='gt_CHECK_DECL:$f::$n'
--trace='gt_INTL_MACOSX:$f::$n' --trace='AM_ICONV_LINK:$f::$n'
--trace='AC_LIB_LINKFLAGS:$f::$n' --trace='PKG_CHECK_MODULES:$f::$n'
--trace='AM_MKINSTALLDIRS:$f::$n' --trace='bh_C_SIGNED:$f::$n'
--trace='gt_TYPE_INTMAX_T:$f::$n'
--trace='AM_SET_CURRENT_AUTOMAKE_VERSION:$f::$n'
--trace='gl_XSIZE:$f::$n' --trace='AC_LIB_HAVE_LINKFLAGS:$f::$n'
--trace='AM_ICONV_LINKFLAGS_BODY:$f::$n'
--trace='_AM_SET_OPTION:$f::$n' --trace='gt_GLIBC2:$f::$n'
--trace='_WX_PRIVATE_CHECK_VERSION:$f::$n'
--trace='AM_INIT_AUTOMAKE:$f::$n' --trace='gl_AC_TYPE_UINTMAX_T:$f::$n'
--trace='AC_LIB_PREFIX:$f::$n' --trace='AM_INTL_SUBDIR:$f::$n'
--trace='gt_TYPE_LONGDOUBLE:$f::$n' --trace='gt_TYPE_WCHAR_T:$f::$n'
--trace='AM_OUTPUT_DEPENDENCY_COMMANDS:$f::$n' --trace='AC_:$f::$n'
--trace='gt_INTDIV0:$f::$n' --trace='AM_ICONV:$f::$n'
--trace='gl_AC_TYPE_UNSIGNED_LONG_LONG:$f::$n'
--trace='AM_AUX_DIR_EXPAND:$f::$n' --trace='AC_LIB_APPENDTOVAR:$f::$n'
--trace='AM_GNU_GETTEXT:$f::$n' --trace='gl_GLIBC21:$f::$n'
--trace='AM_POSTPROCESS_PO_MAKEFILE:$f::$n'
--trace='_AM_SET_OPTIONS:$f::$n'
--trace='_AM_OUTPUT_DEPENDENCY_COMMANDS:$f::$n'
--trace='AM_RUN_LOG:$f::$n' --trace='AC_LIB_WITH_FINAL_PREFIX:$f::$n'
--trace='gt_TYPE_WINT_T:$f::$n' --trace='AC_LIB_LINKFLAGS_BODY:$f::$n'
--trace='AC_ISC_POSIX:$f::$n' --trace='gt_LC_MESSAGES:$f::$n'
--trace='gt_HEADER_INTTYPES_H:$f::$n'
--trace='_AM_MANGLE_OPTION:$f::$n' --trace='AM_CONDITIONAL:$f::$n'
--trace='AM_LANGINFO_CODESET:$f::$n' --trace='AM_SET_DEPDIR:$f::$n'
--trace='gl_AC_HEADER_INTTYPES_H:$f::$n'
--trace='PKG_PROG_PKG_CONFIG:$f::$n' --trace='LF_CHECK_F77_FLAG:$f::$n'
--trace='AM_PROG_INSTALL_SH:$f::$n'
--trace='_AC_AM_CONFIG_HEADER_HOOK:$f::$n'
--trace='AC_LIB_PROG_LD:$f::$n' --trace='AM_OPTIONS_WXCONFIG:$f::$n'
--trace='AM_MAKE_INCLUDE:$f::$n' configure.ac
configure.ac:16: error: Autoconf version 2.60 or higher is required
/usr/local/share/aclocal110/init.m4:26: AM_INIT_AUTOMAKE is expanded
from...
configure.ac:16: the top level
autom4te259: /usr/local/bin/gm4 failed with exit status: 63
aclocal110: autom4te259 failed with exit status: 63
我发现究其原因在于这一行
"aclocal110: running autom4te259"
aclocal110应该调用的是autom4te261。幸好aclocal110只是一个简单的perl脚本。打开,跳到651行,把这个改过来即
可。
为什么会出错呢?
我在ports tree的devel/automake110/Makefile中看见这样一行被注释掉的东西
"#CONFIGURE_ENV= AUTOCONF=autoconf259 AUTOHEADER=autoheader259
MAKEINFO=makeinfo"
与之有关吗?
我不敢确定。
但是我发现aclocal110是aclocal.in生成的。但是该文件的651行也是
"my $traces = ($ENV{AUTOM4TE} || 'autom4te259');"
这是我非常好奇的
回退几个目录,到devel/automake110/files,
# grep 259 *
patch-aclocal.in:18:+ my $traces = ($ENV{AUTOM4TE} || 'autom4te259');
patch-automake.in:11:+ my $traces = ($ENV{AUTOCONF} || 'autoconf259')
. " ";
看来果真不出我所料,是这个补丁打的有问题。
p.s.buffer的overrun可以用Valgrind (http://valgrind.org/)来检测,或者用gcc4.x的-fmudflap
另外,发现gcc4.x加入了不少现代的编译器的调试功能,例如-fbounds-check -fmudflap -fmudflapth
-fmudflapir。
gcc4.x另外一个十分实用的flag就是-Wsign-promo,用于探测整数符号提升漏洞。
嗯,发现一个怪物,objective-c++.

此博客中的热门博文

少写代码,多读别人写的代码

在windows下使用llvm+clang

tensorflow distributed runtime初窥