bootstrap: check for LT_INIT more portably
authorJim Meyering <meyering@redhat.com>
Sun, 5 Oct 2008 15:49:55 +0000 (17:49 +0200)
committerJim Meyering <meyering@redhat.com>
Sun, 5 Oct 2008 15:49:55 +0000 (17:49 +0200)
* build-aux/bootstrap: Avoid using grep -E, since it's not
portable enough.  Suggestion from Bruno Haible.

ChangeLog
build-aux/bootstrap

index 9094a52..bbc3db5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-05  Jim Meyering  <meyering@redhat.com>
+
+       bootstrap: check for LT_INIT more portably
+       * build-aux/bootstrap: Avoid using grep -E, since it's not
+       portable enough.  Suggestion from Bruno Haible.
+
 2008-10-05  Bruno Haible  <bruno@clisp.org>
 
        * doc/posix-headers/sys_select.texi: Mention 'struct timeval' problem
index 74573ef..1ad154f 100755 (executable)
@@ -597,8 +597,16 @@ for command in \
   'automake --add-missing --copy --force-missing';
 do
   if test "$command" = libtool; then
-    grep -E '^[         ]*(LT_INIT|A[CM]_PROG_LIBTOOL)\>' configure.ac >/dev/null ||
-      continue
+    use_libtool=0
+    # We'd like to use grep -E, to see if any of LT_INIT,
+    # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
+    # but that's not portable enough (e.g., for Solaris).
+    grep '^[    ]*A[CM]_PROG_LIBTOOL\>' configure.ac >/dev/null \
+      && use_libtool=1
+    grep '^[    ]*LT_INIT\>' configure.ac >/dev/null \
+      && use_libtool=1
+    test $use_libtool = 0 \
+      && continue
     command='libtoolize -c -f'
   fi
   echo "$0: $command ..."