From: Jim Meyering <jim@meyering.net>
Date: Sat, 17 Mar 2007 11:52:47 +0000 (+0000)
Subject: Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
X-Git-Tag: cvs-readonly~773
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=d2d49399bf95fc4e24001db5cddbd8880c6877e7;p=gnulib.git

Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
* build-aux/bootstrap: Put ""s around use of $build_aux, in case
someone uses a name containing shell meta-characters.
Reported by Alfred M. Szmidt.
---

diff --git a/ChangeLog b/ChangeLog
index 86bc25ae8f..8880c98521 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-03-17  Jim Meyering  <jim@meyering.net>
 
+	Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
+	* build-aux/bootstrap: Put ""s around use of $build_aux, in case
+	someone uses a name containing shell meta-characters.
+	Reported by Alfred M. Szmidt.
+
 	* build-aux/bootstrap: Don't use \> in grep regexp.  For HP-UX.
 
 2007-03-16  Alfred M. Szmidt  <ams@gnu.org>
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index eadf9f5cd5..5c4b8556a8 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -169,10 +169,15 @@ insert_sorted_if_absent() {
 }
 
 # Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
-grep '^[	 ]*AC_CONFIG_AUX_DIR('$build_aux')' configure.ac >/dev/null ||
+found_aux_dir=no
+grep '^[	 ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
+    >/dev/null && found_aux_dir=yes
+grep '^[	 ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
+    >/dev/null && found_aux_dir=yes
+if test $found_aux_dir = no; then
   {
     echo "$0: expected line not found in configure.ac. Add the following:" >&2
-    echo "  AC_CONFIG_AUX_DIR($build_aux)" >&2.
+    echo "  AC_CONFIG_AUX_DIR([$build_aux])" >&2.
   }
 
 # If $build_aux doesn't exist, create it now, otherwise some bits