]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (_AC_PROG_LIBTOOL): Run before AC_LIBTOOL_GCJ.
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Fri, 26 May 2000 05:41:51 +0000 (05:41 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Fri, 26 May 2000 05:41:51 +0000 (05:41 +0000)
Add ltcf-c.sh to LIBTOOL_DEPS.  Run AC_LIBTOOL_CXX and
AC_LIBTOOL_GCJ on demand.
(AC_PROVIDE_IFELSE): Define for non-CVS autoconf compatibility.
(AC_LIBTOOL_CXX): Accept multiple executions.  Add ltcf-cxx.sh
to LIBTOOL_DEPS.  Reset config.log output.
(AC_LIBTOOL_GCJ): New macro.
* libtoolize.in: Copy ltcf-cxx.sh if AC_PROG_CXX is found.
Copy ltcf-gcj.sh when appropriate.
* doc/libtool.texi (AC_LIBTOOL_CXX): Doesn't have to be
explicitly called.
(AC_LIBTOOL_GCJ): Document.
* tagdemo/configure.in (AC_LIBTOOL_CXX): Don't call.

ChangeLog
doc/libtool.texi
libtool.m4
libtoolize.in
tagdemo/configure.in

index 196409e8b7226b79a35848d1482a30d132c67aef..7c686806f5c0f2ff6aa22f13bed6390bdcc12b5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2000-05-26  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
 
+       * libtool.m4 (_AC_PROG_LIBTOOL): Run before AC_LIBTOOL_GCJ.
+       Add ltcf-c.sh to LIBTOOL_DEPS.  Run AC_LIBTOOL_CXX and
+       AC_LIBTOOL_GCJ on demand.
+       (AC_PROVIDE_IFELSE): Define for non-CVS autoconf compatibility.
+       (AC_LIBTOOL_CXX): Accept multiple executions.  Add ltcf-cxx.sh
+       to LIBTOOL_DEPS.  Reset config.log output.
+       (AC_LIBTOOL_GCJ): New macro.
+       * libtoolize.in: Copy ltcf-cxx.sh if AC_PROG_CXX is found.
+       Copy ltcf-gcj.sh when appropriate.
+       * doc/libtool.texi (AC_LIBTOOL_CXX): Doesn't have to be
+       explicitly called.
+       (AC_LIBTOOL_GCJ): Document.
+       * tagdemo/configure.in (AC_LIBTOOL_CXX): Don't call.
+
        * ltmain.in (xform): Recognize *.class and *.java.
        (pic_flag): Do not add -DPIC.
        * ltcf-c.sh (ac_cv_prog_cc_pic): Add -DPIC.
index 23b3657c80618aa02f17787084dfafc4185d0712..9ba209e4ec38f70bd63cd44ab3d2570a1fb007e8 100644 (file)
@@ -1862,11 +1862,24 @@ on @file{libtool}.
 @end defmac
 
 @defmac AC_LIBTOOL_CXX
-Enable C++ shared library support. This macro should be used if libtool
+Enable C++ shared library support.  This macro should be used if libtool
 will be used to generate C++ shared libraries.  It causes a C++-specific
 configuration to be appended to the @file{libtool} script.  The C++
 support can coexist with other configurations, including the default C
-shared library configuration.
+shared library configuration.  It is not necessary to invoke this macro
+explicitly, as long as @code{AC_PROG_CXX} is called within the configure
+script.
+@end defmac
+
+@defmac AC_LIBTOOL_GCJ
+Enable GCJ shared library support.  This macro should be used if libtool
+will be used to generate GCJ shared libraries.  It causes a GCJ-specific
+configuration to be appended to the @file{libtool} script.  The GCJ
+support can coexist with other configurations, including the default C
+shared library configuration.  It is not necessary to invoke this macro
+explicitly, as long as @code{AM_PROG_GCJ} (or @code{AC_PROG_GCJ},
+whenever it is implemented in autoconf) is called within the configure
+script.
 @end defmac
 
 @defmac AC_LIBTOOL_DLOPEN
index c8922ef63c5e8086877745b3546105779bacf416..7506a4873cc5f0b24c66dc2459dc425046f9ac4c 100644 (file)
@@ -26,6 +26,7 @@ AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL])])
 AC_DEFUN(_AC_PROG_LIBTOOL,
 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
 
 # Save cache, so that ltconfig can load it
 AC_CACHE_SAVE
@@ -45,7 +46,7 @@ $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $lt_target \
 AC_CACHE_LOAD
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -705,11 +706,20 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   fi
 ])
 
+# If this macro is not defined by Autoconf, define it here.
+ifdef([AC_PROVIDE_IFELSE],
+      [],
+      [define([AC_PROVIDE_IFELSE],
+              [ifdef([AC_PROVIDE_$1],
+                     [$2], [$3])])])
+
 # AC_LIBTOOL_CXX - enable support for C++ libraries
-AC_DEFUN(AC_LIBTOOL_CXX,
-[AC_REQUIRE([AC_PROG_CXX])
+AC_DEFUN(AC_LIBTOOL_CXX,[AC_REQUIRE([_AC_LIBTOOL_CXX])])
+AC_DEFUN(_AC_LIBTOOL_CXX,
+[AC_REQUIRE([AC_PROG_LIBTOOL])
+AC_REQUIRE([AC_PROG_CXX])
 AC_REQUIRE([AC_PROG_CXXCPP])
-AC_REQUIRE([AC_PROG_LIBTOOL])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
 lt_save_CC="$CC"
 lt_save_CFLAGS="$CFLAGS"
 dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
@@ -726,8 +736,84 @@ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
 || AC_MSG_ERROR([libtool tag configuration failed])
 CC="$lt_save_CC"
 CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+# AC_LIBTOOL_GCJ - enable support for GCJ libraries
+AC_DEFUN(AC_LIBTOOL_GCJ,[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
+AC_DEFUN(_AC_LIBTOOL_GCJ,
+[AC_REQUIRE([AC_PROG_LIBTOOL])
+AC_REQUIRE([AC_PROG_GCJ])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
+dnl is set to the C++ compiler.
+AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="" \
+MAGIC="$MAGIC" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $lt_target \
+|| AC_MSG_ERROR([libtool tag configuration failed])
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
 ])
 
+# If both AC_PROG_CXX and AC_PROG_LIBTOOL have already been expanded,
+# run AC_LIBTOOL_CXX immediately, otherwise, only expand it after the
+# latter of them.
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
+       [AC_LIBTOOL_CXX],
+       [define([AC_PROG_LIBTOOL],
+               defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_CXX
+])])],
+    [define([AC_PROG_CXX],
+           defn([AC_PROG_CXX])[AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
+       [AC_LIBTOOL_CXX],
+       [define([AC_PROG_LIBTOOL],
+               defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_CXX
+])])])])
+
+# If both A[CM]_PROG_CXX and AC_PROG_LIBTOOL have already been
+# expanded, run AC_LIBTOOL_GCJ immediately, otherwise, only expand it
+# after the latter of them.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
+       [AC_LIBTOOL_GCJ],
+       [define([AC_PROG_LIBTOOL],
+               defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_GCJ
+])])],
+    [define([AC_PROG_GCJ],
+           defn([AC_PROG_GCJ])[AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
+       [AC_LIBTOOL_GCJ],
+       [define([AC_PROG_LIBTOOL],
+               defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_GCJ
+])])])])
+AC_PROVIDE_IFELSE([AM_PROG_GCJ],
+    [AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
+       [AC_LIBTOOL_GCJ],
+       [define([AC_PROG_LIBTOOL],
+               defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_GCJ
+])])],
+    [define([AM_PROG_GCJ],
+           defn([AM_PROG_GCJ])[AC_PROVIDE_IFELSE([AC_PROG_LIBTOOL],
+       [AC_LIBTOOL_GCJ],
+       [define([AC_PROG_LIBTOOL],
+               defn([AC_PROG_LIBTOOL])[AC_LIBTOOL_GCJ
+])])])])
+
 dnl old names
 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
index 81b554572a4ef161f5aa83e2e4b8c073ca3b116b..59024eaddfc1b90532ccc77c4c1e5801055a187d 100644 (file)
@@ -148,11 +148,15 @@ if test -z "$files"; then
 fi
 files='config.guess config.sub ltconfig ltmain.sh ltcf-c.sh'
 
-#Add C++ support if configure.in uses AC_LIBTOOL_CXX.
-if egrep '^[ ]*AC_LIBTOOL_CXX' configure.in > /dev/null 2>&1; then
+#Add C++ support if configure.in uses AC_LIBTOOL_CXX or AC_PROG_CXX.
+if egrep '^[ ]*AC_(PROG|LIBTOOL)_CXX' configure.in > /dev/null 2>&1; then
   files="$files ltcf-cxx.sh"
 fi
 
+#Add GCJ support if configure.in uses AC_LIBTOOL_GCJ or A[CM]_PROG_GCJ.
+if egrep '^[ ]*A([CM]_PROG|C_LIBTOOL)_GCJ' configure.in > /dev/null 2>&1; then
+  files="$files ltcf-gcj.sh"
+fi
 
 auxdir=.
 auxdirline=`egrep '^AC_CONFIG_AUX_DIR' configure.in 2>/dev/null`
index 34c4a718ad16e583d9a5ee6e75a7c1dadd602c34..ab17f3613e84c5b2882166badf47784927b60778 100644 (file)
@@ -50,11 +50,6 @@ dnl Setup Libtool
 dnl Check for libtool and turn on Automake processing for Libtool
 AM_PROG_LIBTOOL
 
-dnl Enable C++ support in libtool
-dnl This causes a C++ configuration tag to be appended to the libtool
-dnl script generated during the above AM_PROG_LIBTOOL macro execution.
-AC_LIBTOOL_CXX
-
 AC_CHECK_HEADERS(math.h)
 
 AC_CHECK_LIBM