gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
authorBruno Haible <bruno@clisp.org>
Fri, 30 Sep 2011 10:10:27 +0000 (12:10 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 30 Sep 2011 10:10:27 +0000 (12:10 +0200)
* gnulib-tool (func_import): If the configure.ac has an AC_PROG_CC_STDC
invocation, say "right after AC_PROG_CC_STDC", not "right after
AC_PROG_CC".
Reported by Gary V. Vaughan <gary@gnu.org>.

ChangeLog
gnulib-tool

index 5bf69f1..9e0f714 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-09-30  Bruno Haible  <bruno@clisp.org>
 
+       gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
+       * gnulib-tool (func_import): If the configure.ac has an AC_PROG_CC_STDC
+       invocation, say "right after AC_PROG_CC_STDC", not "right after
+       AC_PROG_CC".
+       Reported by Gary V. Vaughan <gary@gnu.org>.
+
+2011-09-30  Bruno Haible  <bruno@clisp.org>
+
        Centralize C99 requirement.
        * m4/gnulib-common.m4 (gl_PROG_CC_C99): New macro.
        * modules/stdarg (configure.ac-early): Invoke it instead of
index 36135e6..60d99cd 100755 (executable)
@@ -5460,7 +5460,16 @@ s,//*$,/,'
       echo "  - mention \"${val}\" in ${var} in ${dir}Makefile.am,"
     fi
   done
-  echo "  - invoke ${macro_prefix}_EARLY in $configure_ac, right after AC_PROG_CC,"
+  if grep '^ *AC_PROG_CC_STDC' "$configure_ac" > /dev/null; then
+    position_early_after=AC_PROG_CC_STDC
+  else
+    if grep '^ *AC_PROG_CC_C99' "$configure_ac" > /dev/null; then
+      position_early_after=AC_PROG_CC_C99
+    else
+      position_early_after=AC_PROG_CC
+    fi
+  fi
+  echo "  - invoke ${macro_prefix}_EARLY in $configure_ac, right after $position_early_after,"
   echo "  - invoke ${macro_prefix}_INIT in $configure_ac."
 }