From: Scott James Remnant Date: Wed, 24 Mar 2004 14:10:25 +0000 (+0000) Subject: * configure.ac: Catch errors during calls to AC_PROG_CXX, X-Git-Tag: release-1-9b~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcdd39d604e210a6c2260b13e2bbeba86d6176d2;p=thirdparty%2Flibtool.git * configure.ac: Catch errors during calls to AC_PROG_CXX, AC_PROG_CXXCPP and AC_PROG_F77 before LT_INIT. Only set the HAVE_CXX and HAVE_F77 conditions to true if an error didn't occur (AC_PROG_CXX leaves CXX="g++" even if it didn't find one). Set HAVE_GCJ and HAVE_RC to true correctly as well. * m4/libtool.m4 (LT_PROG_GCJ): If AC_PROG_GCJ or AM_PROG_GCJ are defined, expand to the definition of those instead of our own. Define GCJ to '' instead of 'no' if not found. (LT_PROG_RC) Define RC to '' instead of 'no' if not found. (_LT_LANG_GCJ_CONFIG): Require LT_PROG_GCJ to be expanded first. (_LT_LANG_RC_CONFIG): Require LT_PROG_RC to be expanded first. --- diff --git a/ChangeLog b/ChangeLog index 597d159cf..89b5b511c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2004-03-24 Scott James Remnant + * configure.ac: Catch errors during calls to AC_PROG_CXX, + AC_PROG_CXXCPP and AC_PROG_F77 before LT_INIT. Only set the + HAVE_CXX and HAVE_F77 conditions to true if an error didn't + occur (AC_PROG_CXX leaves CXX="g++" even if it didn't find one). + Set HAVE_GCJ and HAVE_RC to true correctly as well. + * m4/libtool.m4 (LT_PROG_GCJ): If AC_PROG_GCJ or AM_PROG_GCJ are + defined, expand to the definition of those instead of our own. + Define GCJ to '' instead of 'no' if not found. + (LT_PROG_RC) Define RC to '' instead of 'no' if not found. + (_LT_LANG_GCJ_CONFIG): Require LT_PROG_GCJ to be expanded first. + (_LT_LANG_RC_CONFIG): Require LT_PROG_RC to be expanded first. + * libltdl/ltdl.c (sys_dl_open): Don't load libraries with global symbol resolution. * NEWS: Updated. diff --git a/configure.ac b/configure.ac index 9fa69bca7..7cd5beec0 100644 --- a/configure.ac +++ b/configure.ac @@ -155,25 +155,19 @@ AC_PROG_LD AC_PROG_NM AC_PROG_LN_S -pushdef([AC_MSG_ERROR], [CXX=no]) +# Other languages get automatically inferred by the all-lang option passed +# to LT_INIT below, however the Autoconf tests for C++ and Fortran 77 +# sometimes call AC_MSG_ERROR and we don't want that to be an error while +# creating the libtool script, as these macros are AC_REQUIREd we can simply +# call them here and catch the errors. +pushdef([AC_MSG_ERROR], [caught_CXX_error=yes]) AC_PROG_CXX +AC_PROG_CXXCPP popdef([AC_MSG_ERROR]) -AM_CONDITIONAL(HAVE_CXX, [test "x$CXX" != xno]) -pushdef([AC_MSG_ERROR], [F77=no]) +pushdef([AC_MSG_ERROR], [caught_F77_error=yes]) AC_PROG_F77 popdef([AC_MSG_ERROR]) -if test -z "$F77"; then - F77="no" -fi -AM_CONDITIONAL(HAVE_F77, [test "x$F77" != xno]) - -LT_AC_PROG_GCJ -AM_CONDITIONAL(HAVE_GCJ, [test "x$GCJ" != xno]) - -LT_AC_PROG_RC -AM_CONDITIONAL(HAVE_RC, [test "x$RC" != xno]) - ## ----------------------- ## @@ -185,6 +179,18 @@ LT_INIT([dlopen win32-dll all-lang]) AC_LIB_LTDL +## --------------------------- ## +## Work out which tests to run ## +## --------------------------- ## +AM_CONDITIONAL(HAVE_CXX, +[test "X$caught_CXX_error" != "Xyes" && + test -n "[$]_LT_AC_TAGVAR(compiler, CXX)"]) +AM_CONDITIONAL(HAVE_F77, +[test "X$caught_F77_error" != "Xyes" && + test -n "[$]_LT_AC_TAGVAR(compiler, F77)"]) +AM_CONDITIONAL(HAVE_GCJ, [test -n "[$]_LT_AC_TAGVAR(compiler, GCJ)"]) +AM_CONDITIONAL(HAVE_RC, [test -n "[$]_LT_AC_TAGVAR(compiler, RC)"]) + ## -------- ## ## Outputs. ## diff --git a/m4/libtool.m4 b/m4/libtool.m4 index ecc8ce7f2..76fd1b8a2 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -5515,7 +5515,8 @@ CC="$lt_save_CC" # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_define([_LT_LANG_GCJ_CONFIG], -[AC_LANG_SAVE +[AC_REQUIRE([LT_PROG_GCJ]) +AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java @@ -5569,7 +5570,8 @@ CC="$lt_save_CC" # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_define([_LT_LANG_RC_CONFIG], -[AC_LANG_SAVE +[AC_REQUIRE([LT_PROG_RC]) +AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc @@ -5602,14 +5604,16 @@ CC="$lt_save_CC" AC_DEFUN([LT_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])dnl ]) AU_DEFUN([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) +[AC_CHECK_TOOL(RC, windres,) ]) AU_DEFUN([LT_AC_PROG_RC], [LT_PROG_RC])