libtoolize: remove sed based configure scanning.

* 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>
This commit is contained in:
Gary V. Vaughan 2011-11-04 17:08:32 +07:00
parent ae9967c797
commit c6bbcb35f5
2 changed files with 52 additions and 59 deletions

7
NEWS
View File

@ -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:

View 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