* autogen.sh: If all else fails, try using pkg-config to find pkg.m4.
authorGlenn Morris <rgm@gnu.org>
Sat, 3 May 2014 18:24:10 +0000 (11:24 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 3 May 2014 18:24:10 +0000 (11:24 -0700)
This is an attempt to get hydra builds working again.

ChangeLog
autogen.sh

index a93a93c..35b690d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-03  Glenn Morris  <rgm@gnu.org>
+
+       * autogen.sh: If all else fails, try using pkg-config to find pkg.m4.
+
 2014-05-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        Get --enable-gcc-warnings to work after touching configure.ac.
index b780454..cc68f13 100755 (executable)
@@ -234,6 +234,28 @@ ac_dir=`aclocal --print-ac-dir` && test -r "$ac_dir/pkg.m4" || {
   done
   IFS=$oIFS
 
+  ## OK, maybe pkg-config is in a weird place (eg on hydra).
+  if test -z "$AUTORECONF_ENV"; then
+    oIFS=$IFS
+    IFS=:
+    for dir in $PATH; do
+      if test -x "$dir/pkg-config"; then
+        ac_dir=`echo "$dir" | sed 's|bin$|share/aclocal|'`
+        if test -r "$ac_dir/pkg.m4"; then
+          case $ACLOCAL_PATH in
+            '') ACLOCAL_PATH=$ac_dir;;
+            ?*) ACLOCAL_PATH=$ACLOCAL_PATH:$ac_dir;;
+          esac
+          export ACLOCAL_PATH
+          AUTORECONF_ENV="ACLOCAL_PATH='$ACLOCAL_PATH'"
+          env_space=' '
+          break
+        fi
+      fi
+    done
+    IFS=$oIFS
+  fi
+
   if test -z "$AUTORECONF_ENV"; then
     cat <<EOF
 The version of aclocal that you are using cannot find the pkg.m4 file that