From: Roland McGrath Date: Thu, 11 Jan 1996 15:38:04 +0000 (+0000) Subject: Use AC_TRY_EVAL and AC_TRY_COMMAND for running all tests. X-Git-Tag: fsf-origin~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe571fd9c19e1ef84f72365100143c5c2caf3e09;p=thirdparty%2Fautoconf.git Use AC_TRY_EVAL and AC_TRY_COMMAND for running all tests. --- diff --git a/acspecific.m4 b/acspecific.m4 index f130e11ad..7b2e2cc85 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -80,7 +80,7 @@ cat > conftest.c <&AC_FD_CC | egrep yes >/dev/null 2>&1; then +if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -120,7 +120,7 @@ cat > conftest.C <&AC_FD_CC | egrep yes >/dev/null 2>&1; then +if AC_TRY_COMMAND(${CXX-g++} -E conftest.C) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -187,16 +187,17 @@ AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. -if ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC && - test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC +ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC' +if AC_TRY_EVAL(ac_try) && + test -f conftest.o && AC_TRY_EVAL(ac_try); then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if cc -c conftest.c 1>&AC_FD_CC 2>&AC_FD_CC; then - if cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC && - test -f conftest2.o && - cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC + if AC_TRY_COMMAND(cc -c conftest.c 1>&AC_FD_CC); then + ac_try='cc -c conftest.c -o conftest.o 1>&AC_FD_CC' + if AC_TRY_EVAL(ac_try) && + test -f conftest.o && AC_TRY_EVAL(ac_try); then # cc works too. : diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index f130e11ad..7b2e2cc85 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -80,7 +80,7 @@ cat > conftest.c <&AC_FD_CC | egrep yes >/dev/null 2>&1; then +if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -120,7 +120,7 @@ cat > conftest.C <&AC_FD_CC | egrep yes >/dev/null 2>&1; then +if AC_TRY_COMMAND(${CXX-g++} -E conftest.C) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -187,16 +187,17 @@ AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. -if ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC && - test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC +ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC' +if AC_TRY_EVAL(ac_try) && + test -f conftest.o && AC_TRY_EVAL(ac_try); then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if cc -c conftest.c 1>&AC_FD_CC 2>&AC_FD_CC; then - if cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC && - test -f conftest2.o && - cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC + if AC_TRY_COMMAND(cc -c conftest.c 1>&AC_FD_CC); then + ac_try='cc -c conftest.c -o conftest.o 1>&AC_FD_CC' + if AC_TRY_EVAL(ac_try) && + test -f conftest.o && AC_TRY_EVAL(ac_try); then # cc works too. :