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 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@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf