bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting AC_PROG_CC_C99


From: Bruno Haible
Subject: Re: Getting AC_PROG_CC_C99
Date: Fri, 30 Sep 2011 12:12:34 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Gary V. Vaughan wrote:
> I don't think many users will find this before they are already bitten.
> 
> IMHO, the two main places in gnulib that people see instructions are in
> the output of gnulib-tool itself:
> 
>   ...
>   Don't forget to
>   ...
>   - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC,
>   ...
> 
> Or the comment at the start of gnulib-comp.m4:
> 
>   # This macro should be invoked from ./configure.ac, in the section
>   # "Checks for programs", right after AC_PROG_CC, and certainly before
>   # any checks for libraries, header files, types and library functions.
>   AC_DEFUN([gl_EARLY],
>   ...

I agree about the first one. gnulib-comp.m4 is rarely looked at, I would say.
Fixing the recommendation like this:


2011-09-30  Bruno Haible  <address@hidden>

        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 <address@hidden>.

--- gnulib-tool.orig    Fri Sep 30 12:07:59 2011
+++ gnulib-tool Fri Sep 30 12:05:23 2011
@@ -5460,7 +5460,16 @@
       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."
 }
 
-- 
In memoriam Kelsang Namtso 
<http://en.wikipedia.org/wiki/Nangpa_La_shooting_incident>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]