From: Alexandre Oliva Date: Fri, 26 May 2000 05:41:51 +0000 (+0000) Subject: * libtool.m4 (_AC_PROG_LIBTOOL): Run before AC_LIBTOOL_GCJ. X-Git-Tag: multi-language-merge-point~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0a0d81429ef6a9e47fcfb6ab162c9d3315576c3;p=thirdparty%2Flibtool.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 196409e8b..7c686806f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2000-05-26 Alexandre Oliva + * 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. diff --git a/doc/libtool.texi b/doc/libtool.texi index 23b3657c8..9ba209e4e 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -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 diff --git a/libtool.m4 b/libtool.m4 index c8922ef63..7506a4873 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -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 diff --git a/libtoolize.in b/libtoolize.in index 81b554572..59024eadd 100644 --- a/libtoolize.in +++ b/libtoolize.in @@ -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` diff --git a/tagdemo/configure.in b/tagdemo/configure.in index 34c4a718a..ab17f3613 100644 --- a/tagdemo/configure.in +++ b/tagdemo/configure.in @@ -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