]> Savannah Git Hosting - gnulib.git/commitdiff
bootstrap: Fix parsing of package name.
authorSimon Josefsson <simon@josefsson.org>
Fri, 8 Jan 2021 10:49:59 +0000 (11:49 +0100)
committerSimon Josefsson <simon@josefsson.org>
Fri, 8 Jan 2021 10:49:59 +0000 (11:49 +0100)
* build-aux/bootstrap (package): Attempt to use autoconf --trace
to parse AC_INIT before falling back to sed expression.

ChangeLog
build-aux/bootstrap

index 3eab13d2280bdea659ad901a45941d20fff45c9b..df676e6bafd55490a47b9194a7c322bce5792be8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-06  Simon Josefsson  <simon@josefsson.org>
+
+       bootstrap: Fix parsing of package name.
+       * build-aux/bootstrap (package): Attempt to use autoconf --trace
+       to parse AC_INIT before falling back to sed expression.
+
 2021-01-07  Bruno Haible  <bruno@clisp.org>
 
        localename: Fix link error with duplocale on AIX 7.2 (regr. 2019-12-18).
index 7523f65b490451ca6768715dc22f18f8a23e7484..8a61c1a586371d250f28bf52dc66dd574532272e 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2020-11-18.17; # UTC
+scriptversion=2021-01-08.10; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -184,7 +184,7 @@ po_download_command_format=\
  https://translationproject.org/latest/%s/"
 
 # Prefer a non-empty tarname (4th argument of AC_INIT if given), else
-# fall back to the package name (1st argument with munging)
+# fall back to the package name (1st argument with munging).
 extract_package_name='
   /^AC_INIT(\[*/{
      s///
@@ -201,8 +201,11 @@ extract_package_name='
      p
   }
 '
-package=$(sed -n "$extract_package_name" configure.ac) \
-  || die 'cannot find package name in configure.ac'
+package=$(${AUTOCONF:-autoconf} --trace AC_INIT:\$4 configure.ac 2>/dev/null)
+if test -z "$package"; then
+  package=$(sed -n "$extract_package_name" configure.ac) \
+      || die 'cannot find package name in configure.ac'
+fi
 gnulib_name=lib$package
 
 build_aux=build-aux