|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
AM_CONDITIONAL seems failure, helphi all:
I write these lines in configure.in: AC_CHECK_LIB([pcre], [pcre_compile], [build_pcre=true], [build_pcre=false]) AM_CONDITIONAL([BUILD_PCRE],[test "$build_pcre" = "true"]) AC_MSG_CHECKING(pcrecpp) AC_COMPILE_IFELSE([ #include <pcrecpp.h> ], [build_pcrecpp=true; AC_MSG_RESULT(yes)], [build_pcrecpp=false; AC_MSG_RESULT(no)] ) AM_CONDITIONAL([BUILD_PCRECPP],[test "$build_pcrecpp"="true"]) AC_CHECK_LIB([iconv], [libiconv_open], [build_libiconv=yes], [build_libiconv=no]) AM_CONDITIONAL([BUILD_LIBICONV],[test "$build_libiconv"="yes"]) ... AC_CONFIG_FILES([Makefile \ other/Makefile \ performance/Makefile \ posix/Makefile \ stdc/Makefile]) AC_OUTPUT ./configure outputs: ... checking for pcre_compile in -lpcre... no checking pcrecpp... no checking for libiconv_open in -liconv... no ... the content of other/Makefile: bin_PROGRAMS = if BUILD_PCRE bin_PROGRAMS += pcre_test pcre_test_LDADD = -lpcre endif if BUILD_PCRECPP bin_PROGRAMS += pcrecpp_test pcrecpp_test_SOURCES = pcrecpp_test.cpp pcrecpp_test_LDADD = -lpcrecpp endif if BUILD_LIBICONV bin_PROGRAMS += libiconv_test libiconv_test_LDADD = -liconv endif When I make, pcre_test is not to be compiled, but pcrecpp_test and libiconv_test are to be compiled, which generates compiling errors. make -n outputs: ... make[1]: Entering directory `/data1/ad_plus/kimizhang/kimi-tests/other' if g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -Wall -Werror -MT pcrecpp_test.o -MD -MP -MF ".deps/pcrecpp_test.Tpo" -c -o pcrecpp_test.o pcrecpp_test.cpp; \ then mv -f ".deps/pcrecpp_test.Tpo" ".deps/pcrecpp_test.Po"; else rm -f ".deps/pcrecpp_test.Tpo"; exit 1; fi rm -f pcrecpp_test g++ -g -Wall -Werror -o pcrecpp_test pcrecpp_test.o -lpcrecpp if gcc -DHAVE_CONFIG_H -I. -I. -I../include -g -Wall -Werror -MT libiconv_test.o -MD -MP -MF ".deps/libiconv_test.Tpo" -c -o libiconv_test.o libiconv_test.c; \ then mv -f ".deps/libiconv_test.Tpo" ".deps/libiconv_test.Po"; else rm -f ".deps/libiconv_test.Tpo"; exit 1; fi rm -f libiconv_test gcc -g -Wall -Werror -o libiconv_test libiconv_test.o -liconv make[1]: Leaving directory `/data1/ad_plus/kimizhang/kimi-tests/other' ... my environment: linux-suse-64 autoconf 2.63 automake 1.11 Help, thanks all!!! _______________________________________________ Autoconf mailing list Autoconf@... http://lists.gnu.org/mailman/listinfo/autoconf |
|
|
Re: AM_CONDITIONAL seems failure, helpOn Fri, Oct 9, 2009 at 09:34, 张亚霏 <zhangyafeikimi@...> wrote:
> hi all: > > I write these lines in configure.in: > > AC_CHECK_LIB([pcre], [pcre_compile], > [build_pcre=true], > [build_pcre=false]) > AM_CONDITIONAL([BUILD_PCRE],[test "$build_pcre" = "true"]) > > AC_MSG_CHECKING(pcrecpp) > AC_COMPILE_IFELSE([ > #include <pcrecpp.h> > ], > [build_pcrecpp=true; AC_MSG_RESULT(yes)], > [build_pcrecpp=false; AC_MSG_RESULT(no)] > ) > AM_CONDITIONAL([BUILD_PCRECPP],[test "$build_pcrecpp"="true"]) > > > AC_CHECK_LIB([iconv], [libiconv_open], > [build_libiconv=yes], > [build_libiconv=no]) > AM_CONDITIONAL([BUILD_LIBICONV],[test "$build_libiconv"="yes"]) > ... > AC_CONFIG_FILES([Makefile \ > other/Makefile \ > performance/Makefile \ > posix/Makefile \ > stdc/Makefile]) > AC_OUTPUT > > > ./configure outputs: > ... > checking for pcre_compile in -lpcre... no > try checking the result with: grep build_pcre ./config.status it's a bit more deterministic than checking your Makefiles, which may involve other typos and errors. -- allanc@... "金鱼" http://linkedin.com/in/goldfish please, no proprietary attachments (http://tinyurl.com/cbgq) _______________________________________________ Autoconf mailing list Autoconf@... http://lists.gnu.org/mailman/listinfo/autoconf |
|
|
Re: AM_CONDITIONAL seems failure, helpВ Fri, 09 Oct 2009 16:34:38 +0800, 张亚霏 написа:
> AM_CONDITIONAL([BUILD_PCRECPP],[test "$build_pcrecpp"="true"]) Put spaces around `=' (also for the BUILD_LIBICONV conditional). The test for pcrecpp has to be performed with a C++ compiler, otherwise the conditional will always be false. (You can enclose it in AC_LANG_PUSH/AC_LANG_POP, for example.) _______________________________________________ Autoconf mailing list Autoconf@... http://lists.gnu.org/mailman/listinfo/autoconf |
| Free embeddable forum powered by Nabble | Forum Help |