当配置.AC中包含AC_CONFIGMACRO_DIR时,将执行两次相关性检查



我的项目有一个配置.ac文件:

#AC_CONFIG_MACRO_DIR([m4])
AC_INIT(Makefile.am)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(myproject, 11.3.8)
AC_CHECK_LIB(pthread, pthread_create, ,AC_MSG_ERROR(pthread_create not functioning))
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(rt, main)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(m, matherr)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_RANLIB
AM_PROG_LIBTOOL
#AX_BOOST_BASE([1.48], [have_boost=yes], )
#AX_BOOST_UNIT_TEST_FRAMEWORK
AM_CONDITIONAL([HAVE_BOOST], test "$have_boost" = yes)
PKG_CHECK_MODULES(LIBCCEXT2, libccext2 >= 1.7.3)
PKG_CHECK_MODULES(LIBCCGNU2, libccgnu2 >= 1.7.3)
dnl AC_OUTPUT(Makefile src/Makefile, echo timestamp > stamp-h)
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[  ]-Wall[   ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
AC_CONFIG_FILES([ myproject.pc ])
AC_OUTPUT([
Makefile 
include/Makefile
someapp2/Makefile
someapp8/Makefile
log/Makefile
someapp6/Makefile
someapp5/Makefile
extra/Makefile
app/Makefile
someapp4/Makefile
someapp7/Makefile
lib/Makefile
someapp1/Makefile
someapp9/Makefile
someapp3/Makefile
test/Makefile
])

当我运行aclocal; autoheader; libtoolize -f -c; automake -a -c; automake; autoconf; ./configure --enable-somefeature --enable-myproject; make -j4时,我得到的输出是:

acinclude.m4:10: warning: underquoted definition of AM_PATH_MYSQLCLIENT
acinclude.m4:10:   run info Automake 'Extending aclocal'
acinclude.m4:10:   or see someapp4://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'
configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:6: someapp4://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
app/Makefile.am:13: warning: compiling 'smsio.c' with per-target flags requires 'AM_PROG_CC_C_O' in 'configure.ac'
configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:6: someapp4://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
app/Makefile.am:13: warning: compiling 'smsio.c' with per-target flags requires 'AM_PROG_CC_C_O' in 'configure.ac'
configure: WARNING: unrecognized options: --enable-somefeature, --enable-myprojecttest
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for pthread_create in -lpthread... yes
checking for main in -lnsl... yes
checking for main in -lrt... yes
checking for socket in -lsocket... no
checking for matherr in -lm... yes
checking for gcc... (someapp9d) gcc
checking whether we are using the GNU C compiler... (someapp9d) yes
checking whether gcc accepts -g... (someapp9d) yes
checking for gcc option to accept ISO C89... (someapp9d) none needed
checking dependency style of gcc... (someapp9d) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
...
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (someapp9d) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (someapp9d) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (someapp9d) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBCCEXT2... yes
checking for LIBCCGNU2... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating myproject.pc
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating someapp2/Makefile
config.status: creating someapp8/Makefile
config.status: creating log/Makefile
config.status: creating someapp6/Makefile
config.status: creating someapp5/Makefile
config.status: creating extra/Makefile
config.status: creating app/Makefile
config.status: creating someapp4/Makefile
config.status: creating someapp7/Makefile
config.status: creating lib/Makefile
config.status: creating someapp1/Makefile
config.status: creating someapp9/Makefile
config.status: creating someapp3/Makefile
config.status: creating test/Makefile
config.status: creating config.h
config.status: executing depfiles someapp8ands
config.status: executing libtool someapp8ands
configure: WARNING: unrecognized options: --enable-somefeature, --enable-myprojecttest
make  all-recursive
make[1]: Entering directory `/home/someengineer/github/myproject'
...
make[2]: Leaving directory `/home/someengineer/github/myproject/test'
make[2]: Entering directory `/home/someengineer/github/myproject'
make[2]: Leaving directory `/home/someengineer/github/myproject'
make[1]: Leaving directory `/home/someengineer/github/myproject'

如果我取消对config.ac文件中注释行的注释,并将我的acinclude.m4移动到名为m4的目录中,输出将如下所示:

m4/acinclude.m4:10: warning: underquoted definition of AM_PATH_MYSQLCLIENT
m4/acinclude.m4:10:   run info Automake 'Extending aclocal'
m4/acinclude.m4:10:   or see someapp4://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'
configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:6: someapp4://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
app/Makefile.am:13: warning: compiling 'smsio.c' with per-target flags requires 'AM_PROG_CC_C_O' in 'configure.ac'
configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:6: someapp4://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
app/Makefile.am:13: warning: compiling 'smsio.c' with per-target flags requires 'AM_PROG_CC_C_O' in 'configure.ac'
configure: WARNING: unrecognized options: --enable-somefeature, --enable-myprojecttest
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for pthread_create in -lpthread... yes
checking for main in -lnsl... yes
checking for main in -lrt... yes
checking for socket in -lsocket... no
checking for matherr in -lm... yes
checking for gcc... (someapp9d) gcc
checking whether we are using the GNU C compiler... (someapp9d) yes
checking whether gcc accepts -g... (someapp9d) yes
checking for gcc option to accept ISO C89... (someapp9d) none needed
checking dependency style of gcc... (someapp9d) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
...
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (someapp9d) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (someapp9d) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (someapp9d) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for boostlib >= 1.48 (104800)... yes
checking whether the Boost::Unit_Test_Framework library is available... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBCCEXT2... yes
checking for LIBCCGNU2... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating myproject.pc
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating someapp2/Makefile
config.status: creating someapp8/Makefile
config.status: creating log/Makefile
config.status: creating someapp6/Makefile
config.status: creating someapp5/Makefile
config.status: creating extra/Makefile
config.status: creating app/Makefile
config.status: creating someapp4/Makefile
config.status: creating someapp7/Makefile
config.status: creating lib/Makefile
config.status: creating someapp1/Makefile
config.status: creating someapp9/Makefile
config.status: creating someapp3/Makefile
config.status: creating test/Makefile
config.status: creating config.h
config.status: executing depfiles someapp8ands
config.status: executing libtool someapp8ands
configure: WARNING: unrecognized options: --enable-somefeature, --enable-myprojecttest
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /home/someengineer/github/myproject/missing aclocal-1.13
m4/acinclude.m4:10: warning: underquoted definition of AM_PATH_MYSQLCLIENT
m4/acinclude.m4:10:   run info Automake 'Extending aclocal'
m4/acinclude.m4:10:   or see someapp4://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /home/someengineer/github/myproject/missing autoconf
cd . && /bin/sh /home/someengineer/github/myproject/missing automake-1.13 --gnu
/bin/sh ./config.status --recheck
configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:6: someapp4://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
running CONFIG_SHELL=/bin/sh /bin/sh ./configure --enable-somefeature --enable-myprojecttest PKG_CONFIG_PATH=/usr/local/lib/pkgconfig --no-create --no-recursion
app/Makefile.am:13: warning: compiling 'smsio.c' with per-target flags requires 'AM_PROG_CC_C_O' in 'configure.ac'
configure: WARNING: unrecognized options: --enable-somefeature, --enable-myprojecttest
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for pthread_create in -lpthread... yes
checking for main in -lnsl... yes
checking for main in -lrt... yes
checking for socket in -lsocket... no
checking for matherr in -lm... yes
checking for gcc... (someapp9d) gcc
checking whether we are using the GNU C compiler... (someapp9d) yes
checking whether gcc accepts -g... (someapp9d) yes
checking for gcc option to accept ISO C89... (someapp9d) none needed
checking dependency style of gcc... (someapp9d) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
...
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (someapp9d) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (someapp9d) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (someapp9d) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for boostlib >= 1.48 (104800)... yes
checking whether the Boost::Unit_Test_Framework library is available... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBCCEXT2... yes
checking for LIBCCGNU2... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
configure: WARNING: unrecognized options: --enable-somefeature, --enable-myprojecttest
/bin/sh ./config.status
config.status: creating myproject.pc
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating someapp2/Makefile
config.status: creating someapp8/Makefile
config.status: creating log/Makefile
config.status: creating someapp6/Makefile
config.status: creating someapp5/Makefile
config.status: creating extra/Makefile
config.status: creating app/Makefile
config.status: creating someapp4/Makefile
config.status: creating someapp7/Makefile
config.status: creating lib/Makefile
config.status: creating someapp1/Makefile
config.status: creating someapp9/Makefile
config.status: creating someapp3/Makefile
config.status: creating test/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles someapp8ands
config.status: executing libtool someapp8ands
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /home/someengineer/github/myproject/missing autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
make[1]: Entering directory `/home/someengineer/github/myproject'
...
make[2]: Leaving directory `/home/someengineer/github/myproject/test'
make[2]: Entering directory `/home/someengineer/github/myproject'
make[2]: Leaving directory `/home/someengineer/github/myproject'
make[1]: Leaving directory `/home/someengineer/github/myproject'

AC_CONFIG_MACRO_DIR([m4])包含在config.ac中时,依赖关系的检查似乎要做两次。我的m4目录还包含autoconf存档中的m4_ax_boost_base.m4和m4_ax_boost_unit_test_framework.m4。

我在m4目录中的acinclude.m4如下:

dnl Test for libmysqlclient and 
dnl define MYSQLCLIENT_CFLAGS, MYSQLCLIENT_LDFLAGS and MYSQLCLIENT_LIBS
dnl usage:
dnl AM_PATH_MYSQLCLIENT(
dnl     [MINIMUM-VERSION, 
dnl     [ACTION-IF-FOUND [, 
dnl     ACTION-IF-NOT-FOUND ]]])
dnl
AC_DEFUN(AM_PATH_MYSQLCLIENT,
[
AC_ARG_WITH(mysqlclient-prefix, 
[  --with-mysqlclient-prefix=PFX Prefix where mysqlclient is 
installed],
mysqlclient_prefix="$withval",
mysqlclient_prefix="")
AC_ARG_WITH(mysqlclient-include, [  --with-mysqlclient-include=DIR Directory pointing 
to mysqlclient include files],
mysqlclient_include="$withval",
mysqlclient_include="")
AC_ARG_WITH(mysqlclient-lib,
[  --with-mysqlclient-lib=LIB  Directory pointing to mysqlclient library
(Note: -include and -lib do override
paths found with -prefix)
],
mysqlclient_lib="$withval",
mysqlclient_lib="")
AC_MSG_CHECKING([for mysqlclient ifelse([$1], , ,[>= v$1])])
MYSQLCLIENT_LDFLAGS=""
MYSQLCLIENT_CFLAGS=""
MYSQLCLIENT_LIBS="-lmysqlclient"
mysqlclient_fail=""
dnl test --with-mysqlclient-prefix
for tryprefix in /usr /usr/local /usr/mysql /usr/local/mysql /usr/pkg $msqlclient_prefix; do
#testloop
for hloc in lib/mysql lib ; do
if test -f "$tryprefix/$hloc/libmysqlclient.so"; then
MYSQLCLIENT_LDFLAGS="-L$tryprefix/$hloc"
fi
done
for iloc in include/mysql include; do
if test -f "$tryprefix/$iloc/mysql.h"; then
MYSQLCLIENT_CFLAGS="-I$tryprefix/$iloc"
fi
done
# testloop
done
dnl test --with-mysqlclient-include
if test "x$mysqlclient_include" != "x" ; then
echo "checking for mysql includes... "
if test -d "$mysqlclient_include/mysql" ; then
MYSQLCLIENT_CFLAGS="-I$mysqlclient_include"
echo " found $MYSQLCLIENT_CFLAGS"
elif test -d "$mysqlclient_include/include/mysql" ; then
MYSQLCLIENT_CFLAGS="-I$mysqlclient_include/include"
echo " found $MYSQLCLIENT_CFLAGS"
elif test -d "$mysqlclient_include" ; then
MYSQLCLIENT_CFLAGS="-I$mysqlclient_include"
echo "found $MYSQLCLIENT_CFLAGS"
else
echo "not found!  no include dir found in $mysqlclient_include"
fi
fi
dnl test --with-mysqlclient-lib
if test "x$mysqlclient_lib" != "x" ; then
echo "checking for mysql libx... "
if test -d "$mysqlclient_lib/lib/mysql" ; then
MYSQLCLIENT_LDFLAGS="-L$mysqlclient_lib/lib/mysql"
echo "found $MYSQLCLIENT_LDFLAGS"
elif test -d "$mysqlclient_lib/lin" ; then
MYSQLCLIENT_LDFLAGS="-L$mysqlclient_lib/lib"
echo "found $MYSQLCLIENT_LDFLAGS"
else
MYSQLCLIENT_LDFLAGS="-L$mysqlclient_lib"
echo "defaultd to $MYSQLCLIENT_LDFLAGS"
fi
fi
ac_save_CFLAGS="$CFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="-v $CFLAGS $MYSQLCLIENT_CFLAGS"
LDFLAGS="$LDFLAGS $MYSQLCLIENT_LDFLAGS"
LIBS="$LIBS $MYSQLCLIENT_LIBS"
dnl if no minimum version is given, just try to compile
dnl else try to compile AND run
AC_TRY_COMPILE([
#include <mysql.h>
#include <mysql_version.h>
],[
mysql_connect( 0, 0, 0, 0);
], [AC_MSG_RESULT(yes $MYSQLCLIENT_CFLAGS $MYSQLCLIENT_LDFLAGS)
CFLAGS="$ac_save_CFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
LIBS="$ac_save_LIBS"
ifelse([$2], ,:,[$2])
],[
echo "no"
echo "can't compile a simple app with mysql_connnect in it. bad."
mysqlclient_fail="yes"
])
if test "x$mysqlclient_fail" != "x" ; then
dnl AC_MSG_RESULT(no)
echo
echo "***"
echo "*** mysqlclient test source had problems, check your config.log ."
echo "*** Also try one of the following switches :"
echo "***   --with-mysqlclient-prefix=PFX"
echo "***   --with-mysqlclient-include=DIR"
echo "***   --with-mysqlclient-lib=DIR"
echo "***"
CFLAGS="$ac_save_CFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
LIBS="$ac_save_LIBS"
ifelse([$3], ,:,[$3])
fi
CFLAGS="$ac_save_CFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
LIBS="$ac_save_LIBS"
AC_SUBST(MYSQLCLIENT_LDFLAGS)
AC_SUBST(MYSQLCLIENT_CFLAGS)
AC_SUBST(MYSQLCLIENT_LIBS)
])

如何修复我的config.ac,以便只检查一次依赖关系?

configure的第二次调用是在Makefile中执行make -j4时通过以下规则进行的

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck

可能是configure发生变化导致make触发重新检查的情况。您需要在发布之前/之后检查configure脚本的内容/配置命令

另一方面,应该在CONFIG_STATUS_DEPENDENCIES 中定义一些内容

最新更新