]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtoolize: remove sed based configure scanning.
authorGary V. Vaughan <gary@gnu.org>
Fri, 4 Nov 2011 10:08:32 +0000 (17:08 +0700)
committerGary V. Vaughan <gary@gnu.org>
Tue, 8 Nov 2011 13:45:21 +0000 (20:45 +0700)
* libtoolize (func_scan_files): Removed function and callers.
(require_seen_ltdl, require_seen_libtool): Factor out remaining
functionality of former sed based scanning.
(func_check_macros): Adjust.
* NEWS: Updated.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
NEWS
libtoolize.m4sh

diff --git a/NEWS b/NEWS
index 2aa71ad4ba4b044f7dda0825dfe6541ce2db5772..9ecb6cd4ae22f657994f3c4b5c75c2aba753950b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,13 @@ NEWS - list of user-visible changes between releases of GNU Libtool
 ** New features:
 
   - Moved to gnulib release infrastructure.
+
+  - M4 is now used for scanning the M4 macros in your configure.ac that
+   `libtoolize' looks at to determine what files you want, and where you
+    would like them installed.  This means that you can compose your
+    version number or any other argument that Libtoolize needs to know at
+    M4 time using git-version-gen from gnulib, for example.
+
   - The Autotest testsuite can be run without the especially time consuming
     tests with:
 
index 5312df68c8cbe873b959552d8ae191ae9b4e5581..10e8a25adbecbcc4281ca62d9cb38a70af2c00e3 100644 (file)
@@ -378,60 +378,6 @@ func_extract_trace ()
 }
 
 
-# func_scan_files
-# Scan configure.(ac|in) and aclocal.m4 (if present) for use of libltdl
-# and libtool.  Possibly running some of these tools if necessary.
-# Libtoolize affects the contents of aclocal.m4, and should be run before
-# aclocal, so we can't use configure --trace which relies on a consistent
-# configure.(ac|in) and aclocal.m4.
-func_scan_files ()
-{
-    $debug_cmd
-
-    $require_configure_ac
-
-    test -n "$configure_ac" || return
-
-    # ---------------------------------------------------- #
-    # Probe macro usage in configure.ac and/or aclocal.m4. #
-    # ---------------------------------------------------- #
-
-    my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,
-        s,^.*AC_REQUIRE(.*$,,; s,^.*m4@&t@_require(.*$,,;
-       s,^.*m4@&t@_define(.*$,,
-       s,^.*A[CU]_DEFUN(.*$,,; s,^.*m4@&t@_defun(.*$,,
-       /\@<:@A[CM]_PROG_LIBTOOL/d
-       /A[CM]_PROG_LIBTOOL/ {
-           s,^.*$,seen_libtool=:,
-           p
-       }
-       /the.*option into.*LT_INIT.*parameter/d
-       /\@<:@LT_INIT/d
-       /LT_INIT/                {
-           s,^.*$,seen_libtool=:,
-           p
-       }
-       /\@<:@LTDL_INIT/d
-       /LTDL_INIT/          {
-           s,^.*$,seen_ltdl=:,
-           p
-       }
-       /LT_WITH_LTDL/       {
-           s,^.*$,seen_ltdl=:,
-           p
-       }
-       /AC_LIB_LTDL/        {
-           s,^.*$,seen_ltdl=:,
-           p
-       }
-       /AC_WITH_LTDL/       {
-           s,^.*$,seen_ltdl=:,
-           p
-       }
-       d'
-    eval `cat aclocal.m4 "$configure_ac" 2>/dev/null | $SED "$my_sed_traces"`
-}
-
 # func_included_files searchfile
 # Output INCLUDEFILE if SEARCHFILE m4_includes it, else output SEARCHFILE.
 func_included_files ()
@@ -1237,6 +1183,8 @@ func_check_macros ()
     $require_ltdl_dir
     $require_ltdl_mode
     $require_macro_dir
+    $require_seen_ltdl
+    $require_seen_libtool
 
     $opt_quiet && return
     test -n "$configure_ac" || return
@@ -1704,6 +1652,48 @@ func_require_makefile_am ()
 }
 
 
+# require_seen_ltdl
+# -----------------
+# Determine from contents of $configure_ac whether this project contains
+# libltdl.
+require_seen_ltdl=func_require_seen_ltdl
+func_require_seen_ltdl ()
+{
+    $debug_cmd
+
+    $require_configure_ac
+
+    if test -n "$configure_ac"; then
+      func_extract_trace AC_LIB_LTDL,AC_WITH_LTDL,LT_WITH_LTDL,LTDL_INIT
+      test -n "$func_extract_trace_result" && seen_ltdl=:
+    fi
+    test -n "$seen_ltdl" || seen_ltdl=false
+
+    require_seen_ltdl=:
+}
+
+
+# require_seen_libtool
+# --------------------
+# Determine from contents of $configure_ac whether this project is using
+# Libtool to compile (some of) its objects.
+require_seen_libtool=func_require_seen_libtool
+func_require_seen_libtool ()
+{
+    $debug_cmd
+
+    $require_configure_ac
+
+    if test -n "$configure_ac"; then
+      func_extract_trace AM_PROG_LIBTOOL,AC_PROG_LIBTOOL,LT_INIT
+      test -n "$func_extract_trace_result" && seen_libtool=:
+    fi
+    test -n "$seen_libtool" || seen_libtool=false
+
+    require_seen_libtool=:
+}
+
+
 
 ## ----------- ##
 ##    Main.    ##
@@ -1726,9 +1716,6 @@ func_require_makefile_am ()
   pkgltdldir=@pkgdatadir@
   aclocaldir=@aclocaldir@
 
-  seen_libtool=false
-  seen_ltdl=false
-
   # test EBCDIC or ASCII
   case `echo X|tr X '\101'` in
    A) # ASCII based system
@@ -1754,8 +1741,6 @@ func_require_makefile_am ()
 
   extract_trace=$pkgdatadir/config/extract-trace
 
-  func_scan_files
-
   $require_ltdl_dir
   case $ltdl_dir in
   .) ltdlprefix= ;;
@@ -1770,6 +1755,7 @@ func_require_makefile_am ()
   # conditions, or that check will be impossible.   No need to clutter the
   # rest of the code with '$opt_ltdl || $seen_ltdl' though, because we CAN
   # safely set opt_ltdl to true if LTDL_INIT was seen:
+  $require_seen_ltdl
   $seen_ltdl && opt_ltdl=:
 
   func_install_pkgconfig_files