[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix some bootstrap issues arising from multi-lang support.
From: |
Scott James Remnant |
Subject: |
[PATCH] Fix some bootstrap issues arising from multi-lang support. |
Date: |
Tue, 23 Mar 2004 00:30:42 +0000 |
User-agent: |
Mutt/1.5.5.1+cvs20040105i |
I finally figured out why tagdemo gets run even if we've got no C++
support, AC_PROG_CXX leaves CXX defined to "g++" even if it can't find a
compiler.
So instead we catch errors, and don't do the tests if an error occurred.
This also tidies up a few loose ends left over from the LT_LANG patch to
ensure GCJ and RC support are enabled correctly.
Okay to apply?
Scott
--
Have you ever, ever felt like this?
Had strange things happen? Are you going round the twist?
diff -ruNp libtool-CVS~/ChangeLog libtool-CVS/ChangeLog
--- libtool-CVS~/ChangeLog 2004-03-21 16:06:55.000000000 +0000
+++ libtool-CVS/ChangeLog 2004-03-23 00:16:15.000000000 +0000
@@ -0,0 +1,14 @@
+2004-03-22 Scott James Remnant <address@hidden>
+
+ * 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 -ruNp libtool-CVS~/configure.ac libtool-CVS/configure.ac
--- libtool-CVS~/configure.ac 2004-03-21 16:05:28.000000000 +0000
+++ libtool-CVS/configure.ac 2004-03-23 00:07:20.000000000 +0000
@@ -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 -ruNp libtool-CVS~/m4/libtool.m4 libtool-CVS/m4/libtool.m4
--- libtool-CVS~/m4/libtool.m4 2004-03-21 16:05:28.000000000 +0000
+++ libtool-CVS/m4/libtool.m4 2004-03-22 23:11:35.000000000 +0000
@@ -5502,7 +5502,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
@@ -5556,7 +5557,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
@@ -5589,14 +5591,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])
signature.asc
Description: Digital signature
- [PATCH] Fix some bootstrap issues arising from multi-lang support.,
Scott James Remnant <=