]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
bootstrap: support automake README requirement.
authorGary V. Vaughan <gary@gnu.org>
Fri, 3 Jan 2014 03:45:18 +0000 (16:45 +1300)
committerGary V. Vaughan <gary@gnu.org>
Fri, 3 Jan 2014 03:48:46 +0000 (16:48 +1300)
* gl/build-aux/bootstrap.in (func_ensure_README): New function.
Link missing README to existing alternative naming.
(require_automake_options): New functions. Fetch AM_INIT_AUTOMAKE
options from configure.ac.
(func_reconfigure): If we're using automake, and it's not in
foreign mode, link a README file if possible.
* bootstrap: Regenerate.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
bootstrap
gl/build-aux/bootstrap.in

index c3edaf1bc0fe39ff9897fb5e8ee6f8fc612196bf..44cd0cdcafe3beb55e7f3532453233c0e3d4fb5d 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -2690,6 +2690,14 @@ func_reconfigure ()
 {
     $debug_cmd
 
+    $require_automake_options
+
+    # Automake (without 'foreign' option) requires that README exists.
+    case " $automake_options " in
+      " foreign ") ;;
+      *) func_ensure_README ;;
+    esac
+
     # Ensure ChangeLog presence.
     if test -n "$gnulib_modules"; then
       func_ifcontains "$gnulib_modules" gitlog-to-changelog \
@@ -2704,7 +2712,7 @@ func_reconfigure ()
     fi
 
     # Released 'autopoint' has the tendency to install macros that have
-    # been obsoleted in current 'gnulib., so run this before 'gnulib-tool'.
+    # been obsoleted in current 'gnulib', so run this before 'gnulib-tool'.
     func_autopoint
 
     # Autoreconf runs 'aclocal' before 'libtoolize', which causes spurious
@@ -3016,6 +3024,29 @@ EOT
 }
 
 
+# func_ensure_README
+# ------------------
+# Without AM_INIT_AUTOMAKE([foreign]), automake will not run to
+# completion with no README file, even though README.md or README.txt
+# is often preferable.
+func_ensure_changelog ()
+{
+    $debug_cmd
+
+    test -f README || {
+      _G_README=
+      for _G_readme in README.txt README.md README.rst; do
+        test -f $_G_readme && break
+      done
+
+      test -f $_G_readme && $LN_S $_G_readme README
+      func_verbose "$LN_S $_G_readme README"
+    }
+
+    return 0
+}
+
+
 # func_autoreconf [SUBDIR]
 # ------------------------
 # Being careful not to re-run 'autopoint' or 'libtoolize', and not to
@@ -3272,6 +3303,21 @@ func_require_autoheader ()
 }
 
 
+# require_automake_options
+# ------------------------
+# Extract options from AM_AUTOMAKE_INIT.
+require_automake_options=func_require_automake_options
+func_require_automake_options ()
+{
+    $debug_cmd
+
+    func_extract_trace AM_INIT_AUTOMAKE
+    automake_options=$func_extract_trace_result
+
+    require_automake_options=:
+}
+
+
 # require_autopoint
 # -----------------
 # Skip autopoint if it's not needed.
@@ -4068,7 +4114,6 @@ func_require_macro_dir ()
 # require_makefile_am
 # -------------------
 # Ensure there is a 'Makefile.am' in the current directory.
-# names an existing file.
 require_makefile_am=func_require_makefile_am
 func_require_makefile_am ()
 {
index 93f1c25d8975b47e67773dfa95b84c16d26ef5c5..d596c847c69f3dc90356998de69e887bfc2dcd8d 100755 (executable)
@@ -356,6 +356,14 @@ func_reconfigure ()
 {
     $debug_cmd
 
+    $require_automake_options
+
+    # Automake (without 'foreign' option) requires that README exists.
+    case " $automake_options " in
+      " foreign ") ;;
+      *) func_ensure_README ;;
+    esac
+
     # Ensure ChangeLog presence.
     if test -n "$gnulib_modules"; then
       func_ifcontains "$gnulib_modules" gitlog-to-changelog \
@@ -370,7 +378,7 @@ func_reconfigure ()
     fi
 
     # Released 'autopoint' has the tendency to install macros that have
-    # been obsoleted in current 'gnulib., so run this before 'gnulib-tool'.
+    # been obsoleted in current 'gnulib', so run this before 'gnulib-tool'.
     func_autopoint
 
     # Autoreconf runs 'aclocal' before 'libtoolize', which causes spurious
@@ -682,6 +690,29 @@ EOT
 }
 
 
+# func_ensure_README
+# ------------------
+# Without AM_INIT_AUTOMAKE([foreign]), automake will not run to
+# completion with no README file, even though README.md or README.txt
+# is often preferable.
+func_ensure_changelog ()
+{
+    $debug_cmd
+
+    test -f README || {
+      _G_README=
+      for _G_readme in README.txt README.md README.rst; do
+        test -f $_G_readme && break
+      done
+
+      test -f $_G_readme && $LN_S $_G_readme README
+      func_verbose "$LN_S $_G_readme README"
+    }
+
+    return 0
+}
+
+
 # func_autoreconf [SUBDIR]
 # ------------------------
 # Being careful not to re-run 'autopoint' or 'libtoolize', and not to
@@ -938,6 +969,21 @@ func_require_autoheader ()
 }
 
 
+# require_automake_options
+# ------------------------
+# Extract options from AM_AUTOMAKE_INIT.
+require_automake_options=func_require_automake_options
+func_require_automake_options ()
+{
+    $debug_cmd
+
+    func_extract_trace AM_INIT_AUTOMAKE
+    automake_options=$func_extract_trace_result
+
+    require_automake_options=:
+}
+
+
 # require_autopoint
 # -----------------
 # Skip autopoint if it's not needed.
@@ -1734,7 +1780,6 @@ func_require_macro_dir ()
 # require_makefile_am
 # -------------------
 # Ensure there is a 'Makefile.am' in the current directory.
-# names an existing file.
 require_makefile_am=func_require_makefile_am
 func_require_makefile_am ()
 {