练习使用bakefile生成autoconf的makefile文件
编译http://www.bakefile.org/doc/ch02.html#id781875197996的helloworld例子时出错
症状:执行命令$ bakefilize --copy && aclocal && autoconf 时,提示
[yu@yu-MagicLinux hello]$ ls
autoconf_inc.m4 configure.ac configure.ac~ hello.bkl hello.bkl~ hello.c Makefile.in
[yu@yu-MagicLinux hello]$ bakefilize --copy && aclocal && autoconf
/usr/share/aclocal/smpeg.m4:13: warning: underquoted definition of AM_PATH_SMPEG
run info '(automake)Extending aclocal'
or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
/usr/share/aclocal/libfame.m4:6: warning: underquoted definition of AM_PATH_LIBFAME
/usr/share/aclocal/gtk.m4:7: warning: underquoted definition of AM_PATH_GTK
/usr/share/aclocal/gpg-error.m4:7: warning: underquoted definition of AM_PATH_GPG_ERROR
/usr/share/aclocal/ao.m4:9: warning: underquoted definition of XIPH_PATH_AO
/usr/share/aclocal/aalib.m4:12: warning: underquoted definition of AM_PATH_AALIB
configure.ac:5: error: possibly undefined macro: AC_BAKEFILE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:5: error: possibly undefined macro: m4_include
[yu@yu-MagicLinux hello]$ ls
autoconf_inc.m4 config.guess configure configure.ac~ hello.bkl~ INSTALL Makefile.in
autom4te.cache config.sub configure.ac hello.bkl hello.c install-sh
经过痛苦的网上搜索和调试,原因是(http://osdir.com/ml/sysutils.bakefile.devel/2005-08/msg00010.html):
This is the error which is causing all your problems, I think.
AC_BAKEFILE is a macro installed by bakefile in $PREFIX/share/aclocal as bakefile.m4; probably your installed bakefile using the prefix /usr/local and your aclocal (like mine ;)) does not look in /usr/local/share/aclocal. Copying the file from /usr/local/share/aclocal to /usr/share/aclocal will solve the problem. Another way is to install bakefile using the /usr prefix.
After doing that copy, rerun aclocal & autoconf and that error should have gone.
另外,使用AutoMake轻松生成Makefile 参阅http://www.ccw.com.cn/htm/app/linux/develop/01_7_25_7.asp。
没有评论:
发表评论