]> Savannah Git Hosting - gnulib.git/commitdiff
Create lib/Makefile.am after gnulib-comp.m4
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Mar 2022 18:01:22 +0000 (10:01 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Mar 2022 18:01:59 +0000 (10:01 -0800)
* gnulib-tool (func_import): Create library makefile after
creating gnulib-comp.m4.  With --gnu-make, the latter depends on
the former.  See <https://bugs.gnu.org/32452#109>.

ChangeLog
gnulib-tool

index 629ec803fd517e088d1429ced338d1d0395103c7..c5a80fd3f339568faf2b89fd6ead6604eedff7a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-03-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Create lib/Makefile.am after gnulib-comp.m4
+       * gnulib-tool (func_import): Create library makefile after
+       creating gnulib-comp.m4.  With --gnu-make, the latter depends on
+       the former.  See <https://bugs.gnu.org/32452#109>.
+
 2022-02-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        gettime-res: fix unlikely overflow bug
index 9ee756020986ec945f97e7a4cd6f2b876648c25f..e420b321d29698438c433ebebb38056b675ff2f9 100755 (executable)
@@ -5692,39 +5692,6 @@ s,//*$,/,'
     func_note_Makefile_am_edit "$dir1" EXTRA_DIST "${dir2}gnulib-cache.m4"
   }
 
-  # Create library makefile.
-  func_dest_tmpfilename $sourcebase/$source_makefile_am
-  destfile="$sourcebase/$source_makefile_am"
-  modules="$main_modules"
-  if $automake_subdir; then
-    func_emit_lib_Makefile_am | "$gnulib_dir"/build-aux/prefix-gnulib-mk --from-gnulib-tool --lib-name="$libname" --prefix="$sourcebase/" > "$tmpfile"
-  else
-    func_emit_lib_Makefile_am > "$tmpfile"
-  fi
-  if test -f "$destdir"/$sourcebase/$source_makefile_am; then
-    if cmp -s "$destdir"/$sourcebase/$source_makefile_am "$tmpfile"; then
-      rm -f "$tmpfile"
-    else
-      if $doit; then
-        echo "Updating $sourcebase/$source_makefile_am (backup in $sourcebase/$source_makefile_am~)"
-        mv -f "$destdir"/$sourcebase/$source_makefile_am "$destdir"/$sourcebase/$source_makefile_am~
-        mv -f "$tmpfile" "$destdir"/$sourcebase/$source_makefile_am
-      else
-        echo "Update $sourcebase/$source_makefile_am (backup in $sourcebase/$source_makefile_am~)"
-        rm -f "$tmpfile"
-      fi
-    fi
-  else
-    if $doit; then
-      echo "Creating $sourcebase/$source_makefile_am"
-      mv -f "$tmpfile" "$destdir"/$sourcebase/$source_makefile_am
-    else
-      echo "Create $sourcebase/$source_makefile_am"
-      rm -f "$tmpfile"
-    fi
-    func_append added_files "$sourcebase/$source_makefile_am$nl"
-  fi
-
   # Create po/ directory.
   if test -n "$pobase"; then
     # Create po makefile and auxiliary files.
@@ -6131,6 +6098,41 @@ s,//*$,/,'
     fi
   fi
 
+  # Create library makefile.
+  # Do this after creating gnulib-comp.m4, because func_emit_lib_Makefile_am
+  # can run 'autoconf -t', which reads gnulib-comp.m4.
+  func_dest_tmpfilename $sourcebase/$source_makefile_am
+  destfile="$sourcebase/$source_makefile_am"
+  modules="$main_modules"
+  if $automake_subdir; then
+    func_emit_lib_Makefile_am | "$gnulib_dir"/build-aux/prefix-gnulib-mk --from-gnulib-tool --lib-name="$libname" --prefix="$sourcebase/" > "$tmpfile"
+  else
+    func_emit_lib_Makefile_am > "$tmpfile"
+  fi
+  if test -f "$destdir"/$sourcebase/$source_makefile_am; then
+    if cmp -s "$destdir"/$sourcebase/$source_makefile_am "$tmpfile"; then
+      rm -f "$tmpfile"
+    else
+      if $doit; then
+        echo "Updating $sourcebase/$source_makefile_am (backup in $sourcebase/$source_makefile_am~)"
+        mv -f "$destdir"/$sourcebase/$source_makefile_am "$destdir"/$sourcebase/$source_makefile_am~
+        mv -f "$tmpfile" "$destdir"/$sourcebase/$source_makefile_am
+      else
+        echo "Update $sourcebase/$source_makefile_am (backup in $sourcebase/$source_makefile_am~)"
+        rm -f "$tmpfile"
+      fi
+    fi
+  else
+    if $doit; then
+      echo "Creating $sourcebase/$source_makefile_am"
+      mv -f "$tmpfile" "$destdir"/$sourcebase/$source_makefile_am
+    else
+      echo "Create $sourcebase/$source_makefile_am"
+      rm -f "$tmpfile"
+    fi
+    func_append added_files "$sourcebase/$source_makefile_am$nl"
+  fi
+
   if $gentests; then
     # Create tests makefile.
     func_dest_tmpfilename $testsbase/$tests_makefile_am