libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] New language support interface


From: Scott James Remnant
Subject: [PATCH] New language support interface
Date: Wed, 17 Mar 2004 20:20:09 +0000

Finally, here it is ... the patch you've all been waiting for (really!).

This removes the AC_LIBTOOL_TAGS macro in favour of a set of LT_INIT
options and a new LT_LANG macro to select language support.

The three LT_INIT options are:

        no-lang         No language support other than C.
        all-lang        All supported languages
        auto-lang       Automatically detect required support

The first is intended for when you want total control over the supported
language set.  Languages can be added using the LT_LANG macro.

        LT_PREREQ(1.5a)
        LT_INIT([no-lang])
        LT_LANG(C++)

The second is intended for Libtool itself, it switches on everything.
The LT_LANG macro is a null-op after you've done this.  This is what 1.5
did (but wasn't really supposed to).

        LT_PREREQ(1.5a)
        LT_INIT([all-lang])

The third is (potentially controversially) the default, and is the
behaviour that was *intended* for 1.5.  It hooks the expansion of the
Autoconf/Automake macros that check for the appropriate compilers and
enables support if they are invoked.

        AC_PROG_CXX
            :
        LT_PREREQ(1.5a)
        LT_INIT
            :
        AC_PROG_F77

Because the logic for all of this is now written in m4 instead of shell,
it actually works now.  There's no order requirement, so this is the
most elegant I think, which is why I've made it the default.


The options cause LT_LANG to be called for each required language.  This
can be passed either a tag name ("CXX") or an Autoconf-style language
name ("C++").

LT_LANG always calls _LT_LANG with the tag name which it appends onto
_LT_TAGS.  Hopefully this is sufficient for Automake to figure out what
tags Libtool is going to support.

descent libtool-bootstrap% autoconf --trace=_LT_LANG
configure.ac:184:_LT_LANG:CXX
configure.ac:184:_LT_LANG:GCJ
configure.ac:184:_LT_LANG:F77
configure.ac:184:_LT_LANG:RC


A couple of monkeys may have been harmed during the writing of this
patch, but only in a superficial way.

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-14 15:05:24.000000000 +0000
+++ libtool-CVS/ChangeLog       2004-03-17 19:37:29.000000000 +0000
@@ -0,0 +1,67 @@
+2004-03-17  Scott James Remnant  <address@hidden>
+
+       Further sweeping changes to the user interface to libtool from
+       `configure.ac' to allow users to better control the list of
+       supported languages.  Three LT_INIT options 'no-lang', 'all-lang'
+       and 'auto-lang' (the default) control the initial list and others
+       may be added with LT_LANG.
+
+       * m4/libtool.m4 (_LT_CONFIG): Renamed AC_LIBTOOL_CONFIG to _LT_CONFIG
+       which is more consistent with our own namespace and gets us further out
+       of Autoconf's.
+       (_LT_LIBTOOL_TAGS): Output available_tags variable based entirely
+       on the value of _LT_TAGS.
+       (_LT_COPYING): Call _LT_LIBTOOL_TAGS to output available tags,
+       always append tag configuration if the tag is available.
+       (LT_LANG): New macro to enable support for a language that accepts
+       tag names (eg. "CXX") or human language names (eg. "C++").
+       (_LT_LANG): Internal support macro for above that appends the
+       tag to _LT_TAGS and calls the appropriate config macro.
+       (LT_INIT): Ensure that LT_LANG is not called before LT_INIT.
+       (AC_LIBTOOL_TAGS): Removed, call LT_LANG for each language now.
+       (_LT_AC_TAG_CHECK): Removed, _LT_LANG handles duplicate calls.
+       (_LT_LANG_DEFAULT_CONFIG): Macro to set initial language support
+       based on options passed to LT_INIT.
+       (_LT_SETUP): Call _LT_LANG_DEFAULT_CONFIG.
+       (_LT_AC_TAG_CONFIG): Removed, handled by _LT_LANG_DEFAULT_CONFIG.
+       (_LT_AC_LANG_CXX, _LT_AC_LANG_F77, _LT_AC_LANG_GCJ): Removed,
+       automatic language support inclusion now handled by
+       _LT_LANG_DEFAULT_CONFIG.
+       (AC_LIBTOOL_CXX): Obsolete macro, update to LT_LANG(C++).
+       (AC_LIBTOOL_F77): Obsolete macro, update to LT_LANG(Fortran 77).
+       (AC_LIBTOOL_GCJ): Obsolete macro, update to LT_LANG(Java).
+       (AC_LIBTOOL_LANG_C_CONFIG_: Removed.
+       (_LT_AC_LANG_C_CONFIG): Renamed to _LT_LANG_C_CONFIG, call
+       _LT_CONFIG instead of AC_LIBTOOL_CONFIG.
+       (_LT_SETUP): Replace call to AC_LIBTOOL_LANG_C_CONFIG with call to
+       new _LT_LANG_C_CONFIG macro.
+       (AC_LIBTOOL_LANG_CXX_CONFIG): Removed.
+       (_LT_AC_LANG_CXX_CONFIG): Renamed to _LT_LANG_CXX_CONFIG, call
+       _LT_CONFIG instead of AC_LIBTOOL_CONFIG.
+       (AC_LIBTOOL_LANG_F77_CONFIG): Removed.
+       (_LT_AC_LANG_F77_CONFIG): Renamed to _LT_LANG_F77_CONFIG, call
+       _LT_CONFIG instead of AC_LIBTOOL_CONFIG.
+       (AC_LIBTOOL_LANG_GCJ_CONFIG): Removed.
+       (_LT_AC_LANG_GCJ_CONFIG): Renamed to _LT_LANG_GCJ_CONFIG, call
+       _LT_CONFIG instead of AC_LIBTOOL_CONFIG.
+       (AC_LIBTOOL_LANG_RC_CONFIG): Removed.
+       (_LT_AC_LANG_RC_CONFIG): Renamed to _LT_LANG_RC_CONFIG, call
+       _LT_CONFIG instead of AC_LIBTOOL_CONFIG.
+       (LT_AC_PROG_GCJ): Renamed to LT_PROG_GCJ.
+       (LT_AC_PROG_RC): Renamed to LT_PROG_RC.
+       * m4/ltoptions.m4: Define new 'no-lang', 'auto-lang' and 'all-lang'
+       options which set the default for _LT_LANG_DEFAULT_CONFIG.
+       * m4/lt~obsolete.m4: Removed AC_LIBTOOL_CONFIG, _LT_AC_LANG_C_CONFIG,
+       _LT_AC_LANG_GCJ_CONFIG, _LT_AC_LANG_RC_CONFIG; all of which are no
+       long referenced in any way.
+       * configure.ac: Enable all languages.
+       * tests/cdemo/configure.ac, tests/demo/configure,ac,
+       tests/depdemo/configure.ac, tests/f77demo/configure.ac,
+       tests/mdemo/configure.ac, tests/pdemo/configure,ac,
+       tests/tagdemo/configure.ac: Remove calls to AC_LIBTOOL_TAGS,
+       the default 'auto-lang' mode now does the right thing.
+       * doc/libtool.texi (The LT_INIT macro): Add documentation for
+       new LT_INIT options and the LT_LANG macro, replacing the old
+       documentation of AC_LIBTOOL_TAGS which is no more.
+       * NEWS: Updated.
+
diff -ruNp libtool-CVS~/m4/libtool.m4 libtool-CVS/m4/libtool.m4
--- libtool-CVS~/m4/libtool.m4  2004-03-14 15:05:37.000000000 +0000
+++ libtool-CVS/m4/libtool.m4   2004-03-17 18:59:32.000000000 +0000
@@ -54,9 +54,7 @@ AC_REQUIRE([LTOPTIONS_VERSION])dnl
 AC_REQUIRE([LTSUGAR_VERSION])dnl
 AC_REQUIRE([LTVERSION_VERSION])dnl
 AC_REQUIRE([_LT_PROG_LTMAIN])dnl
-AC_BEFORE([$0], [AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0], [AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0], [AC_LIBTOOL_GCJ])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
 
 # This can be used to rebuild libtool when needed
 LIBTOOL_DEPS="$ltmain"
@@ -188,8 +186,8 @@ AC_ARG_ENABLE([libtool-lock],
 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
 # Use C for the default configuration in the libtool script
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAG_CONFIG
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
 _LT_CONFIG_COMMANDS
 ])# _LT_SETUP
 
@@ -367,6 +365,14 @@ m4_define([_LT_CONFIG_STATUS_DECLARATION
     [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
 
 
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_define([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this 
script])dnl
+available_tags="[]_LT_TAGS[]"dnl
+])
+
 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
 # -----------------------------------
 # Extract the dictionary values for VARNAME (optionally with TAG) and
@@ -454,13 +460,13 @@ _LT_OUTPUT_LIBTOOL_INIT
 ])#_LT_CONFIG_COMMANDS
 
 
-# AC_LIBTOOL_CONFIG([TAGNAME])
+# _LT_CONFIG(TAG)
 # ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars.  Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-m4_define([AC_LIBTOOL_CONFIG],
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_define([_LT_CONFIG],
 [_LT_CONFIG_SAVE_COMMANDS([
   m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
   m4_if(_LT_TAG, [C], [
@@ -484,8 +490,7 @@ m4_define([AC_LIBTOOL_CONFIG],
 #
 _LT_COPYING
 
-# The names of the tagged configurations supported by this script.
-available_tags=
+_LT_LIBTOOL_TAGS
 
 # ### BEGIN LIBTOOL CONFIG
 _LT_LIBTOOL_CONFIG_VARS
@@ -524,8 +529,7 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 ],
-[if test -n "[$]_LT_TAG" && test "X[$]_LT_TAG" != "Xno"; then
-  cat <<_LT_EOF >> "$ofile"
+[cat <<_LT_EOF >> "$ofile"
 
 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
 dnl in a comment (ie after a #).
@@ -533,7 +537,6 @@ dnl in a comment (ie after a #).
 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
 # ### END LIBTOOL TAG CONFIG: $1
 _LT_EOF
-fi
 ])dnl /m4_if
 ],
 [m4_if([$1], [], [
@@ -543,7 +546,79 @@ fi
     rm='$rm'
     ofile='$ofile'], [$1='[$]$1'])
 ])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# AC_LIBTOOL_CONFIG
+])# _LT_CONFIG
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+m4_define([_LT_LANG_DEFAULT], [AUTO])
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[m4_case([$1],
+  [C],                 [_LT_LANG(C)],
+  [C++],               [_LT_LANG(CXX)],
+  [Java],              [_LT_LANG(GCJ)],
+  [Fortran 77],                [_LT_LANG(F77)],
+  [Windows Resource],  [_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+# _LT_LANG(LANGNAME, TAG)
+# ------------------------
+m4_define([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_define([_LT_LANG_DEFAULT_CONFIG],
+[m4_case(m4_defn([_LT_LANG_DEFAULT]),
+  [NONE], [m4_define([_LT_TAGS], [])],
+  [ALL],  [m4_foreach(LT_Lang, [CXX, GCJ, F77, RC], [LT_LANG(LT_Lang)])],
+  [AUTO], [
+    AC_PROVIDE_IFELSE([AC_PROG_CXX],
+      [LT_LANG(CXX)],
+      [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+    AC_PROVIDE_IFELSE([AC_PROG_F77],
+      [LT_LANG(F77)],
+      [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+    dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+    dnl pulling things in needlessly.
+    AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+       [LT_LANG(GCJ)],
+       [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+         [LT_LANG(GCJ)],
+         [m4_ifdef([AC_PROG_GCJ],
+           [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+          m4_ifdef([A][M_PROG_GCJ],
+           [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+          m4_ifdef([LT_PROG_GCJ],
+           [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+    AC_PROVIDE_IFELSE([LT_PROG_RC],
+      [LT_LANG(RC)],
+      [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+  ],
+  [])dnl
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java])])
 
 
 # _LT_AC_SYS_COMPILER
@@ -2041,85 +2116,6 @@ _LT_DECL([], [sys_lib_dlsearch_path_spec
 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
 
-# AC_LIBTOOL_TAGS
-# ---------------
-# tags to enable
-AC_DEFUN([AC_LIBTOOL_TAGS],
-[m4_define([_LT_TAGS],[$1])
-]) # AC_LIBTOOL_TAGS
-
-# _LT_AC_TAG_CHECK
-# ----------------
-m4_define([_LT_AC_TAG_CHECK],
-[m4_ifdef([_LT_TAG_]$1,
-  [m4_errprintn(m4_location[: error: duplicate tag: ]"$1")
-  m4_exit(1)],
-  [m4_define([_LT_TAG_]$1, [])])
-]) # _LT_AC_TAG_CHECK
-
-# _LT_AC_TAG_CONFIG
-# -----------------
-m4_define([_LT_AC_TAG_CONFIG],
-[AC_PROVIDE_IFELSE([AC_LIBTOOL_TAGS], [], [
-  AC_LIBTOOL_TAGS([CXX F77 GCJ RC])])dnl
-  available_tags=""
-  AC_FOREACH([_LT_TAG], _LT_TAGS,
-      [m4_case(_LT_TAG,
-      [CXX], [_LT_AC_TAG_CHECK([CXX])
-  if test -n "$CXX" && test "X$CXX" != "Xno"; then
-      AC_LIBTOOL_LANG_CXX_CONFIG
-      available_tags="$available_tags _LT_TAG"
-  fi],
-      [F77], [_LT_AC_TAG_CHECK(_LT_TAG)
-  if test -n "$F77" && test "X$F77" != "Xno"; then
-      AC_LIBTOOL_LANG_F77_CONFIG
-      available_tags="$available_tags _LT_TAG"
-  fi],
-      [GCJ], [_LT_AC_TAG_CHECK(_LT_TAG)
-  if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-      AC_LIBTOOL_LANG_GCJ_CONFIG
-      available_tags="$available_tags _LT_TAG"
-  fi],
-      [RC], [_LT_AC_TAG_CHECK(_LT_TAG)
-  if test -n "$RC" && test "X$RC" != "Xno"; then
-      AC_LIBTOOL_LANG_RC_CONFIG
-      available_tags="$available_tags _LT_TAG"
-  fi],
-      [m4_errprintn(m4_location[: error: invalid tag name: ]"_LT_TAG")
-      m4_exit(1)])
-  ])
-
-  _LT_CONFIG_SAVE_COMMANDS([
-    _LT_PROG_LTMAIN
-    if test -f "$ltmain"; then
-      if test ! -f "${ofile}"; then
-        AC_MSG_ERROR([output file `$ofile' does not exist])
-      fi
-      if test -z "$LTCC"; then
-        eval "`$SHELL ${ofile} --config | $GREP '^LTCC='`"
-        if test -z "$LTCC"; then
-          AC_MSG_ERROR([output file `$ofile' does not look like a libtool 
script])
-        else
-          AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
-        fi
-      fi
-
-      # Now substitute the updated list of available tags.
-      if eval "sed -e 
's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > 
\"${ofile}T\""; then
-        mv "${ofile}T" "$ofile"
-        chmod +x "$ofile"
-      else
-        rm -f "${ofile}T"
-        AC_MSG_ERROR([unable to update list of available tagged 
configurations.])
-      fi
-    fi
-  ], [
-    libtool='$ofile'
-    available_tags='$available_tags'
-  ])dnl
-])# _LT_AC_TAG_CONFIG
-
-
 # AC_PATH_TOOL_PREFIX
 # -------------------
 # find a file program which can recognise shared library
@@ -4262,76 +4258,12 @@ dnl    [Compiler flag to generate thread
 ])# AC_LIBTOOL_PROG_LD_SHLIBS
 
 
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
-    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
-      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
-        [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
-          [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# --------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
+# _LT_LANG_C_CONFIG([TAG])
 # ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-m4_define([_LT_AC_LANG_C_CONFIG],
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_define([_LT_LANG_C_CONFIG],
 [AC_REQUIRE([LT_AC_PROG_EGREP])
 lt_save_CC="$CC"
 AC_LANG_PUSH(C)
@@ -4420,20 +4352,19 @@ AC_MSG_CHECKING([whether to build static
 test "$enable_shared" = yes || enable_static=yes
 AC_MSG_RESULT([$enable_static])
 
-AC_LIBTOOL_CONFIG($1)
+_LT_CONFIG($1)
 
 AC_LANG_POP
 CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
+])# _LT_LANG_C_CONFIG
 
 
-# AC_LIBTOOL_LANG_CXX_CONFIG
+# _LT_LANG_CXX_CONFIG([TAG])
 # --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_define([_LT_LANG_CXX_CONFIG],
 [AC_LANG_PUSH(C++)
 AC_REQUIRE([LT_AC_PROG_EGREP])
 AC_REQUIRE([AC_PROG_CXX])
@@ -5300,7 +5231,7 @@ AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 AC_LIBTOOL_SYS_LIB_STRIP
 AC_LIBTOOL_DLOPEN_SELF($1)
 
-AC_LIBTOOL_CONFIG($1)
+_LT_CONFIG($1)
 
 AC_LANG_POP
 CC=$lt_save_CC
@@ -5313,7 +5244,7 @@ lt_cv_path_LDCXX=$lt_cv_path_LD
 lt_cv_path_LD=$lt_save_path_LD
 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
+])# _LT_LANG_CXX_CONFIG
 
 
 # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
@@ -5468,13 +5399,12 @@ _LT_TAGDECL([], [compiler_lib_search_pat
     a shared library])
 ])# AC_LIBTOOL_POSTDEP_PREDEP
 
-# AC_LIBTOOL_LANG_F77_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_define([_LT_LANG_F77_CONFIG],
 [AC_REQUIRE([AC_PROG_F77])
 AC_LANG_PUSH(Fortran 77)
 
@@ -5561,20 +5491,19 @@ AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 AC_LIBTOOL_SYS_LIB_STRIP
 
 
-AC_LIBTOOL_CONFIG($1)
+_LT_CONFIG($1)
 
 AC_LANG_POP
 CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
+])# _LT_LANG_F77_CONFIG
 
 
-# AC_LIBTOOL_LANG_GCJ_CONFIG
+# _LT_LANG_GCJ_CONFIG([TAG])
 # --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-m4_define([_LT_AC_LANG_GCJ_CONFIG],
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# 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
 
 # Source file extension for Java test sources.
@@ -5616,20 +5545,19 @@ AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 AC_LIBTOOL_SYS_LIB_STRIP
 AC_LIBTOOL_DLOPEN_SELF($1)
 
-AC_LIBTOOL_CONFIG($1)
+_LT_CONFIG($1)
 
 AC_LANG_RESTORE
 CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
+])# _LT_LANG_GCJ_CONFIG
 
 
-# AC_LIBTOOL_LANG_RC_CONFIG
+# _LT_LANG_RC_CONFIG([TAG])
 # --------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-m4_define([_LT_AC_LANG_RC_CONFIG],
+# Ensure that the configuration variables for the Windows resource compiler
+# 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
 
 # Source file extension for RC test sources.
@@ -5655,22 +5583,24 @@ compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
-AC_LIBTOOL_CONFIG($1)
+_LT_CONFIG($1)
 
 AC_LANG_RESTORE
 CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
+])# _LT_LANG_RC_CONFIG
 
 
-AC_DEFUN([LT_AC_PROG_GCJ],
+AC_DEFUN([LT_PROG_GCJ],
 [AC_CHECK_TOOL(GCJ, gcj, no)
   test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
   AC_SUBST(GCJFLAGS)
 ])
+AU_DEFUN([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
 
-AC_DEFUN([LT_AC_PROG_RC],
+AC_DEFUN([LT_PROG_RC],
 [AC_CHECK_TOOL(RC, windres, no)
 ])
+AU_DEFUN([LT_AC_PROG_RC], [LT_PROG_RC])
 
 
 # LT_AC_PROG_EGREP
diff -ruNp libtool-CVS~/m4/ltoptions.m4 libtool-CVS/m4/ltoptions.m4
--- libtool-CVS~/m4/ltoptions.m4        2004-02-22 11:13:45.000000000 +0000
+++ libtool-CVS/m4/ltoptions.m4 2004-03-17 18:49:25.000000000 +0000
@@ -356,3 +356,11 @@ AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
 put the `pic-only' option into LT_LIBTOOL_INIT's first parameter.])
 ])
+
+
+# _LT_LANG_DEFAULT is predefined in libtool.m4 and used by
+# _LT_LANG_DEFAULT_CONFIG()
+
+LT_OPTION_DEFINE([no-lang],   [m4_define([_LT_LANG_DEFAULT], [NONE])])
+LT_OPTION_DEFINE([auto-lang], [m4_define([_LT_LANG_DEFAULT], [AUTO])])
+LT_OPTION_DEFINE([all-lang],  [m4_define([_LT_LANG_DEFAULT], [ALL])])
diff -ruNp libtool-CVS~/configure.ac libtool-CVS/configure.ac
--- libtool-CVS~/configure.ac   2004-02-22 11:13:44.000000000 +0000
+++ libtool-CVS/configure.ac    2004-03-17 19:13:57.000000000 +0000
@@ -181,7 +181,7 @@ AM_CONDITIONAL(HAVE_RC, [test "x$RC" != 
 ## ----------------------- ##
 AC_CONFIG_FILES([config/ltmain.sh:./ltmain.in])
 AC_CONFIG_FILES([libtoolize], [chmod a+x libtoolize])
-LT_INIT([dlopen win32-dll])
+LT_INIT([dlopen win32-dll all-lang])
 AC_LIB_LTDL
 
 
diff -ruNp libtool-CVS~/tests/cdemo/configure.ac 
libtool-CVS/tests/cdemo/configure.ac
--- libtool-CVS~/tests/cdemo/configure.ac       2004-02-22 11:13:45.000000000 
+0000
+++ libtool-CVS/tests/cdemo/configure.ac        2004-03-17 19:08:00.000000000 
+0000
@@ -41,7 +41,6 @@ AC_PROG_CC
 ## ----------------------- ##
 ## Libtool initialisation. ##
 ## ----------------------- ##
-AC_LIBTOOL_TAGS([])
 LT_INIT
 AC_SUBST([LIBTOOL_DEPS])
 
diff -ruNp libtool-CVS~/tests/demo/configure.ac 
libtool-CVS/tests/demo/configure.ac
--- libtool-CVS~/tests/demo/configure.ac        2004-02-22 11:13:45.000000000 
+0000
+++ libtool-CVS/tests/demo/configure.ac 2004-03-17 19:08:04.000000000 +0000
@@ -44,7 +44,6 @@ AC_EXEEXT
 ## ----------------------- ##
 ## Libtool initialisation. ##
 ## ----------------------- ##
-AC_LIBTOOL_TAGS([])
 LT_INIT([dlopen win32-dll])
 AC_SUBST([LIBTOOL_DEPS])
 
diff -ruNp libtool-CVS~/tests/depdemo/configure.ac 
libtool-CVS/tests/depdemo/configure.ac
--- libtool-CVS~/tests/depdemo/configure.ac     2004-02-22 11:13:45.000000000 
+0000
+++ libtool-CVS/tests/depdemo/configure.ac      2004-03-17 19:08:05.000000000 
+0000
@@ -42,7 +42,6 @@ AC_EXEEXT
 ## ----------------------- ##
 ## Libtool initialisation. ##
 ## ----------------------- ##
-AC_LIBTOOL_TAGS([])
 LT_INIT([win32-dll])
 AC_SUBST([LIBTOOL_DEPS])
 
diff -ruNp libtool-CVS~/tests/f77demo/configure.ac 
libtool-CVS/tests/f77demo/configure.ac
--- libtool-CVS~/tests/f77demo/configure.ac     2004-02-22 11:13:45.000000000 
+0000
+++ libtool-CVS/tests/f77demo/configure.ac      2004-03-17 19:08:15.000000000 
+0000
@@ -61,7 +61,6 @@ AC_LANG_POP
 ## ----------------------- ##
 ## Libtool initialisation. ##
 ## ----------------------- ##
-AC_LIBTOOL_TAGS([F77])
 LT_INIT
 AC_SUBST([LIBTOOL_DEPS])
 
diff -ruNp libtool-CVS~/tests/mdemo/configure.ac 
libtool-CVS/tests/mdemo/configure.ac
--- libtool-CVS~/tests/mdemo/configure.ac       2004-02-22 11:13:45.000000000 
+0000
+++ libtool-CVS/tests/mdemo/configure.ac        2004-03-17 19:08:18.000000000 
+0000
@@ -47,7 +47,6 @@ AC_LIBLTDL_CONVENIENCE([../../libltdl])
 AC_SUBST([INCLTDL])
 AC_SUBST([LIBLTDL])
 
-AC_LIBTOOL_TAGS([])
 LT_INIT([dlopen win32-dll])
 AC_SUBST(LIBTOOL_DEPS)
 
diff -ruNp libtool-CVS~/tests/mdemo2/configure.ac 
libtool-CVS/tests/mdemo2/configure.ac
--- libtool-CVS~/tests/mdemo2/configure.ac      2004-02-22 11:13:45.000000000 
+0000
+++ libtool-CVS/tests/mdemo2/configure.ac       2004-03-17 19:08:20.000000000 
+0000
@@ -43,7 +43,6 @@ AC_C_CONST
 ## ----------------------- ##
 ## Libtool initialisation. ##
 ## ----------------------- ##
-AC_LIBTOOL_TAGS([])
 LT_INIT([dlopen])
 AC_SUBST(LIBTOOL_DEPS)
 
diff -ruNp libtool-CVS~/tests/pdemo/configure.ac 
libtool-CVS/tests/pdemo/configure.ac
--- libtool-CVS~/tests/pdemo/configure.ac       2004-02-22 11:13:45.000000000 
+0000
+++ libtool-CVS/tests/pdemo/configure.ac        2004-03-17 19:08:22.000000000 
+0000
@@ -43,7 +43,6 @@ AC_C_CONST
 ## ----------------------- ##
 ## Libtool initialisation. ##
 ## ----------------------- ##
-AC_LIBTOOL_TAGS([])
 LT_INIT([dlopen])
 AC_SUBST([LIBTOOL_DEPS])
 
diff -ruNp libtool-CVS~/tests/tagdemo/configure.ac 
libtool-CVS/tests/tagdemo/configure.ac
--- libtool-CVS~/tests/tagdemo/configure.ac     2004-02-22 11:13:45.000000000 
+0000
+++ libtool-CVS/tests/tagdemo/configure.ac      2004-03-17 19:08:33.000000000 
+0000
@@ -64,7 +64,6 @@ AC_LANG_POP
 
 # Set the test language to C++.
 AC_LANG([C++])
-AC_LIBTOOL_TAGS([CXX])
 LT_INIT
 
 
diff -ruNp libtool-CVS~/doc/libtool.texi libtool-CVS/doc/libtool.texi
--- libtool-CVS~/doc/libtool.texi       2004-03-14 10:14:32.000000000 +0000
+++ libtool-CVS/doc/libtool.texi        2004-03-17 19:33:28.000000000 +0000
@@ -1831,19 +1831,37 @@ Change the default behaviour of @command
 non-PIC objects.  The user may still override this default by
 specifying @samp{--without-pic} to @command{configure}.
 
address@hidden no-lang
+Change the default list of additional languages @command{libtool} supports
+to none, only the built-in C language support will be enabled.  Additional
+languages such as C++ will only be enabled if appropriate @code{LT_LANG}
+macros are added to your @file{configure.ac}.
+
address@hidden all-lang
+Change the default list of additional languages @command{libtool} supports
+to all that the host system supports.
+
address@hidden auto-lang
+Change the default list of additional languages @command{libtool} supports
+to be determined automatically by detecting macros such as
address@hidden in your @file{configure.ac}.  Additional languages can
+be added by adding appropriate @code{LT_LANG} macros to your
address@hidden
+
 @end itemize
 
 @end defmac
 
address@hidden AC_LIBTOOL_TAGS ([tag1 tag2 ...])
-Change the default behaviour for @code{LT_INIT} to limit
-configuration to a specified set of language tags. This is valuable in
-case libtool is embedded in a package which only uses a subset of the
-languages libtool supports. Configuring a subset of the supported
-languages results in a smaller configure script, and faster libtool
-configuration. Tag names accepted are "CXX", "F77", "GCJ", and
-"RC". Support for the C language is integral to libtool and can not be
-disabled.
address@hidden LT_LANG (@var{LANGUAGE})
+Enable @command{libtool} support for the language given if it
+has not yet already been enabled.  Languages accepted are "C++",
+"Fortran 77", "Java" and "Windows Resource"@footnote{These may also be
+referred to by their generated tag names, "CXX", "F77", "GCJ" and "RC".}.
+
+By default, the set of languages @command{libtool} will support is
+determined automatically by detected macros such as @code{AC_PROG_CXX}
+in your @file{configure.ac}.  This behaviour may be changed by passing
+either the "no-lang" or "all-lang" options to @code{LT_INIT}.
 @end defmac
 
 The tests in @code{LT_INIT} also recognize the following
diff -ruNp libtool-CVS~/NEWS libtool-CVS/NEWS
--- libtool-CVS~/NEWS   2004-03-05 17:34:10.000000000 +0000
+++ libtool-CVS/NEWS    2004-03-17 19:14:17.000000000 +0000
@@ -11,6 +11,9 @@ New in 1.5b: 2004-??-??; CVS version 1.5
   AC_ENABLE_FAST_INSTALL, AC_DISABLE_FAST_INSTALL, AC_LIBTOOL_DLOPEN,
   AC_LIBTOOL_WIN32_DLL and AC_LIBTOOL_PIC_MODE.  Use autoupdate to modernise
   your configure.ac files after installing this release.
+* New LT_LANG interface to enable libtool support for a specific language.
+* Language support is now only included if your configure.ac enables it,
+  either through a call to AC_PROG_CXX etc. or LT_LANG.
 * The libtool script will complain if it was built from mismatched ltmain.sh
   and libtool m4 macro versions.
 * Like automake, libtoolize no longer installs config.guess and config.sub by
@@ -28,7 +31,6 @@ New in 1.5b: 2004-??-??; CVS version 1.5
 * If you configure libtool with --disable-shared (or if libtool does not
   support shared libraries on your platform) trying to build a library using
   `-shared' is a fatal error.
-* New AC_LIBTOOL_TAGS macro to limit configure checks to only the listed tags.
 * libtoolize installs libtool.m4 (and ltdl.m4 if used) to AC_CONFIG_MACRO_DIR.
 * Mode inferrence removed, shorthand for choosing modes added.
 * Specifying -allow-undefined is now an error.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]