]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tests/defs.m4sh (func_get_config): Build egrep regex to speed
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 15 Mar 2008 22:06:56 +0000 (22:06 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 15 Mar 2008 22:06:56 +0000 (22:06 +0000)
up extracting several variables at once.  Use it to extract all
default variables at once.  Also extract build_alias and
host_alias from the libtool script.
(func_configure_nofail): Use build_alias and host_alias for
--build and --host, respectively.  Pass each if nonempty.
* tests/testsuite.at: Pass --build if build_alias is nonemtpy.
* tests/quote.test: Extract ECHO and wl at once.

ChangeLog
tests/defs.m4sh
tests/quote.test
tests/testsuite.at

index 2ed153c80fdbfc61c7e4e6b6cfe3735f867093b1..ea3ebcca33f365108e934590a4f049b0b8080df2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2008-03-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * tests/defs.m4sh (func_get_config): Build egrep regex to speed
+       up extracting several variables at once.  Use it to extract all
+       default variables at once.  Also extract build_alias and
+       host_alias from the libtool script.
+       (func_configure_nofail): Use build_alias and host_alias for
+       --build and --host, respectively.  Pass each if nonempty.
+       * tests/testsuite.at: Pass --build if build_alias is nonemtpy.
+       * tests/quote.test: Extract ECHO and wl at once.
+
        * libltdl/m4/ltoptions.m4 (AC_LIBTOOL_WIN32_DLL): Require
        AC_CANONICAL_HOST.
        * THANKS: Update.
index 2ec80017ba1ffb76d31d1f5ed1a8b458dedb6fe3..d63558cc897ab516a6bdd38691f3fccf41f8b921 100644 (file)
@@ -2,7 +2,8 @@ m4_define([_m4_divert(SCRIPT)], 100)
 m4_divert_push([SCRIPT])# @configure_input@
 # defs -- Defines for Libtool testing environment.
 #
-#   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#   Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software
+#   Foundation, Inc.
 #   Written by Gord Matzigkeit, 1996
 #   Rewritten by Gary V. Vaughan, 2003
 #
@@ -96,12 +97,26 @@ func_get_config ()
   my_regex="$4"
 
   my_exitp=false
+  if test -z "$my_regex"; then
+    my_regex="^("
+    my_build_regex=:
+  else
+    my_build_regex=false
+  fi
+  my_first=:
+  
   for my_varname in $my_varname_list; do
-    test -z "$4" && my_regex="^${my_varname}="
-
+    if $my_build_regex; then
+      $my_first || my_regex="$my_regex|"
+      my_first=false
+      my_regex="$my_regex$my_varname"
+    fi
     eval $my_varname=NONE
-    eval `eval $my_src | eval $GREP \"$my_regex\"`
+  done
+  $my_build_regex && my_regex="$my_regex)="
+  eval `eval "$my_src" | eval "$EGREP \"$my_regex\""`
 
+  for my_varname in $my_varname_list; do
     if eval test x\"\$$my_varname\" = xNONE; then
       func_error "$my_varname not set in \`$my_src'"
       $my_failp && my_exitp=:
@@ -112,20 +127,15 @@ func_get_config ()
 }
 
 
-# Extract objext from the libtool configuration
-func_get_config "objext" "$LIBTOOL --config" ": fatal"
-
-# Extract objdir from the libtool configuration
-func_get_config "objdir" "$LIBTOOL --config" ": fatal"
-
-# Extract CC from the libtool configuration
-func_get_config "CC" "$LIBTOOL --config" ": fatal"
-
-# Extract host from the libtool configuration
-func_get_config "host" "$LIBTOOL --config" ": fatal"
+# Extract some variables from the libtool configuration.
+func_get_config "objext
+objdir
+CC
+host
+host_alias
+build
+build_alias" "$LIBTOOL --config" ": fatal"
 
-# Extract build from the libtool configuration
-func_get_config "build" "$LIBTOOL --config" ": fatal"
 
 # func_mkprefixdir
 func_mkprefixdir ()
@@ -185,7 +195,8 @@ func_configure_nofail ()
 
     test -n "$my_args" && my_args=" $my_args"
     my_args="--srcdir="\""$my_testdir"\"" --prefix="\""$prefix"\""$my_args"
-    test "$build" != "$host" && my_args="$my_args --host=\"$host\""
+    test -n "$host_alias" && my_args="$my_args --host=\"$host_alias\""
+    test -n "$build_alias" && my_args="$my_args --build=\"$build_alias\""
 
     func_msg "Configuring in $my_dir"
 
index f6b820da8b2f90a441b74985c341aca81e7c8bc1..12715d89fadf982ec4d3c1c5db3b8d82045eab93 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # quote.test - make sure that shell metacharacters do not blow up libtool
 #
-#   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#   Copyright (C) 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
 #   Written by Gary V. Vaughan, 2003
 #
 #   This file is part of GNU Libtool.
@@ -37,8 +37,7 @@ case $1 in
     ;;
 esac
 
-func_get_config "ECHO" "$LIBTOOL --config"
-func_get_config "wl" "$LIBTOOL --config"
+func_get_config "ECHO wl" "$LIBTOOL --config"
 
 for mode in compile link install; do
   $ECHO "== $mode mode"
index 3bd5f632a7fda3eb5028c3a4fc4491ffe9312723..bec76df2e59167311d3a06dde40e0cbd37f78621 100644 (file)
@@ -35,10 +35,13 @@ for tool in ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE AUTORECONF; do
 done
 export ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE AUTORECONF
 eval `$LIBTOOL --config | grep '^EGREP='`
-eval `$LIBTOOL --config | $EGREP '^(host|host_os|host_alias|build|ECHO)='`
+eval `$LIBTOOL --config | $EGREP '^(host|host_os|host_alias|build|build_alias|ECHO)='`
 configure_options=
 if test -n "$host_alias"; then
-  configure_options="--host $host_alias"
+  configure_options="$configure_options --host $host_alias"
+fi
+if test -n "$build_alias"; then
+  configure_options="$configure_options --build $build_alias"
 fi
 if (FOO=bar; unset FOO) >/dev/null 2>&1; then
   unset=unset