]> Savannah Git Hosting - gnulib.git/commitdiff
automake-subdir support: Look for 'subdir-objects' also in configure.ac.
authorBruno Haible <bruno@clisp.org>
Wed, 15 Dec 2021 20:49:41 +0000 (21:49 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Dec 2021 21:17:21 +0000 (22:17 +0100)
* gnulib-tool: Look for the automake options also in the first argument
of the AM_INIT_AUTOMAKE invocation in configure.ac.

ChangeLog
gnulib-tool

index 5048863fa75c1175ce97445ee0f0ad90d5f2ea11..dafd27b6638bc58ec5a17648acbb702fc9dfecbe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-12-15  Bruno Haible  <bruno@clisp.org>
+
+       automake-subdir support: Look for 'subdir-objects' also in configure.ac.
+       * gnulib-tool: Look for the automake options also in the first argument
+       of the AM_INIT_AUTOMAKE invocation in configure.ac.
+
 2021-12-15  Bruno Haible  <bruno@clisp.org>
 
        Add simple examples.
index 70ea17a4cbd4e9ed4bf818acbb034a6dd334f1f4..0d2b7e6353f0dcd86c1bac62076be6630d9b5111 100755 (executable)
@@ -1594,7 +1594,6 @@ func_determine_path_separator
     # "autoconf --trace=AC_PREREQ" fails with an error message like this:
     #   m4: aclocal.m4:851: Cannot open m4/absolute-header.m4: No such file or directory
     #   autom4te: m4 failed with exit status: 1
-    prereqs=
     my_sed_traces='
       s,#.*$,,
       s,^dnl .*$,,
@@ -1621,10 +1620,25 @@ func_determine_path_separator
   # Determine whether --automake-subdir is supported.
   if $automake_subdir; then
     found_subdir_objects=false
+    if test -n "$configure_ac"; then
+      my_sed_traces='
+        s,#.*$,,
+        s,^dnl .*$,,
+        s, dnl .*$,,
+        /AM_INIT_AUTOMAKE/ {
+          s,^.*AM_INIT_AUTOMAKE([[ ]*\([^])]*\).*$,\1,p
+        }'
+      automake_options=`sed -n -e "$my_sed_traces" < "$configure_ac"`
+      for option in $automake_options; do
+        case "$option" in
+          subdir-objects ) found_subdir_objects=true ;;
+        esac
+      done
+    fi
     if test -f "${destdir:-.}"/Makefile.am; then
       automake_options=`sed -n -e 's/^AUTOMAKE_OPTIONS[         ]*=\(.*\)$/\1/p' "${destdir:-.}"/Makefile.am`
-      for arg in $automake_options; do
-        case "$arg" in
+      for option in $automake_options; do
+        case "$option" in
           subdir-objects ) found_subdir_objects=true ;;
         esac
       done