I did a fresh checkout of revision 1917 and autogen.sh produces several warnings, although the configure and make stages are OK. I am using relatively new versions of autoconf and automake:

automake (GNU automake) 1.11
autoconf (GNU Autoconf) 2.64

When building, a lot of warnings is a red flag to me. I've studied the code and am attaching the fixes. autogen.sh now runs cleanly for me with a few informational messages.

Below are explanations of what was going on and attached are patches to remove all the warnings.

  -- Bruce


acinclude.m4:17: warning: underquoted definition of grub_PROG_TARGET_CC
acinclude.m4:17:   run info '(automake)Extending aclocal'
acinclude.m4:17: or see http://sources.redhat.com/automake/automake.html#Extending-aclocal

This can be fixed by adding [] around AC_DEFUN values in acinclude.m4, e.g.:

AC_DEFUN(grub_PROG_TARGET_CC,

needs to be changed to

AC_DEFUN([grub_PROG_TARGET_CC],

-- 16 places.
-------------

configure.ac:42: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1839: AC_CANONICAL_TARGET is expanded from...
configure.ac:42: the top level
configure.ac:42: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1839: AC_CANONICAL_TARGET is expanded from...
configure.ac:42: the top level
configure.ac:42: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1839: AC_CANONICAL_TARGET is expanded from...
configure.ac:42: the top level
configure.ac:42: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1839: AC_CANONICAL_TARGET is expanded from...
configure.ac:42: the top level

This can be fixed by moving line

  AM_INIT_AUTOMAKE()

to right after the line  AC_CANONICAL_TARGET.
------------------

configure.ac:176: required file `./config.rpath' not found

The can be fixed by `touch config.rpath`
-----------------
automake: no `Makefile.am' found for any configure output

I created a one line Makefile.am with the contents:

SUBDIRS = . po

This also fixes a warning generated by AM_GNU_GETTEXT which needed to be changed to AM_GNU_GETTEXT([external]) to avoid a complaint about a missing intl/ directory. Adding an empty ABOUT-NLS was also needed.
-----------------
WARNING: C file isn't a module: hash-common.c
WARNING: C file isn't a module: pubkey.c
WARNING: C file isn't a module: ecc.c
WARNING: C file isn't a module: elgamal.c
WARNING: C file isn't a module: hmac-tests.c
WARNING: C file isn't a module: md.c
WARNING: C file isn't a module: rsa.c
WARNING: C file isn't a module: ac.c
WARNING: C file isn't a module: dsa.c
WARNING: C file isn't a module: primegen.c
WARNING: C file isn't a module: cipher.c

These are generated by util/import_gcry.py by copying (and in some cases modifying) the files in lib/libgcrypt to lib/libgcrypt-grub. It also creates cipher.h, memory.h, and types.h.

The warnings above appear to be spurious for autogen.sh

I added code to util/import_gcry.py supress the warnings if a third parameter is passed. I then changed autogen.sh to use:

python util/import_gcry.py lib/libgcrypt/ . NoWarn

In a release, the lib/libgcrypt-grub/ directory should be released and the lib/libgcrypt/ should probably be suppressed to avoid dependence on ruby for non-developers.

=== added file 'ABOUT-NLS'
=== modified file 'ChangeLog'
--- ChangeLog   2009-12-06 09:20:01 +0000
+++ ChangeLog   2009-12-07 17:19:50 +0000
@@ -1,3 +1,18 @@
+2009-12-07 Bruce Dubbs <bruce.du...@gmail.com>
+
+   Remove spurious warnings when running autogen.sh.
+
+   * util/import_gcry.py: Add optional third parameter to supress spurious
+   warnings.
+   * autogen.sh: Add third parameter to invocation of util/import_gcry.py.
+   * acinclude.m4: Add quotes to underquoted variables.
+   * configure.ac: Move  AM_INIT_AUTOMAKE() to below AC_CANONICAL_TARGET
+   to supress warnings.  Also changed to AM_GNU_GETTEXT([external]).
+   * Makefile.am: Add one line file to supress spurious warnings.
+   * config.rpath: Add empty file to prevent complaint by automake.
+   * ABOUT-NLS: Add empty file wanted by AM_GNU_GETTEXT.
+
+
 2009-12-06 Felix Zielcke <fziel...@z-51.de>
 
        * util/misc.c (make_system_path_relative_to_its_root): Correctly cope 
with

=== added file 'Makefile.am'
--- Makefile.am 1970-01-01 00:00:00 +0000
+++ Makefile.am 2009-12-07 09:05:57 +0000
@@ -0,0 +1,1 @@
+SUBDIRS = . po 

=== modified file 'acinclude.m4'
--- acinclude.m4        2009-11-16 19:31:29 +0000
+++ acinclude.m4        2009-12-07 08:55:44 +0000
@@ -14,7 +14,7 @@
 
 
 dnl Check whether target compiler is working
-AC_DEFUN(grub_PROG_TARGET_CC,
+AC_DEFUN([grub_PROG_TARGET_CC],
 [AC_MSG_CHECKING([whether target compiler is working])
 AC_CACHE_VAL(grub_cv_prog_target_cc,
 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
@@ -36,7 +36,7 @@
 dnl compiling to assembler.
 dnl Written by Pavel Roskin. Based on grub_ASM_EXT_C written by
 dnl Erich Boleyn and modified by Yoshinori K. Okuji.
-AC_DEFUN(grub_ASM_USCORE,
+AC_DEFUN([grub_ASM_USCORE],
 [AC_REQUIRE([AC_PROG_CC])
 AC_MSG_CHECKING([if C symbols get an underscore after compilation])
 AC_CACHE_VAL(grub_cv_asm_uscore,
@@ -75,7 +75,7 @@
 
 dnl Some versions of `objcopy -O binary' vary their output depending
 dnl on the link address.
-AC_DEFUN(grub_PROG_OBJCOPY_ABSOLUTE,
+AC_DEFUN([grub_PROG_OBJCOPY_ABSOLUTE],
 [AC_MSG_CHECKING([whether ${OBJCOPY} works for absolute addresses])
 AC_CACHE_VAL(grub_cv_prog_objcopy_absolute,
 [cat > conftest.c <<\EOF
@@ -119,7 +119,7 @@
 
 dnl Supply --build-id=none to ld if building modules.
 dnl This suppresses warnings from ld on some systems
-AC_DEFUN(grub_PROG_LD_BUILD_ID_NONE,
+AC_DEFUN([grub_PROG_LD_BUILD_ID_NONE],
 [AC_MSG_CHECKING([whether linker accepts --build-id=none])
 AC_CACHE_VAL(grub_cv_prog_ld_build_id_none,
 [save_LDFLAGS="$LDFLAGS"
@@ -150,7 +150,7 @@
 dnl We only support the newer versions, because the old versions cause
 dnl major pain, by requiring manual assembly to get 16-bit instructions into
 dnl asm files.
-AC_DEFUN(grub_I386_ASM_ADDR32,
+AC_DEFUN([grub_I386_ASM_ADDR32],
 [AC_REQUIRE([AC_PROG_CC])
 AC_REQUIRE([grub_I386_ASM_PREFIX_REQUIREMENT])
 AC_MSG_CHECKING([for .code16 addr32 assembler support])
@@ -178,7 +178,7 @@
 
 dnl check if our compiler is apple cc
 dnl because it requires numerous workarounds
-AC_DEFUN(grub_apple_cc,
+AC_DEFUN([grub_apple_cc],
 [AC_REQUIRE([AC_PROG_CC])
 AC_MSG_CHECKING([whether our compiler is apple cc])
 AC_CACHE_VAL(grub_cv_apple_cc,
@@ -193,7 +193,7 @@
 
 dnl check if our target compiler is apple cc
 dnl because it requires numerous workarounds
-AC_DEFUN(grub_apple_target_cc,
+AC_DEFUN([grub_apple_target_cc],
 [AC_REQUIRE([AC_PROG_CC])
 AC_MSG_CHECKING([whether our target compiler is apple cc])
 AC_CACHE_VAL(grub_cv_apple_target_cc,
@@ -210,7 +210,7 @@
 dnl Later versions of GAS requires that addr32 and data32 prefixes
 dnl appear in the same lines as the instructions they modify, while
 dnl earlier versions requires that they appear in separate lines.
-AC_DEFUN(grub_I386_ASM_PREFIX_REQUIREMENT,
+AC_DEFUN([grub_I386_ASM_PREFIX_REQUIREMENT],
 [AC_REQUIRE([AC_PROG_CC])
 AC_MSG_CHECKING(dnl
 [whether addr32 must be in the same line as the instruction])
@@ -246,7 +246,7 @@
 
 dnl Older versions of GAS require that absolute indirect calls/jumps are
 dnl not prefixed with `*', while later versions warn if not prefixed.
-AC_DEFUN(grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK,
+AC_DEFUN([grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK],
 [AC_REQUIRE([AC_PROG_CC])
 AC_MSG_CHECKING(dnl
 [whether an absolute indirect call/jump must not be prefixed with an asterisk])
@@ -276,7 +276,7 @@
 
 dnl Check what symbol is defined as a bss start symbol.
 dnl Written by Michael Hohmoth and Yoshinori K. Okuji.
-AC_DEFUN(grub_CHECK_BSS_START_SYMBOL,
+AC_DEFUN([grub_CHECK_BSS_START_SYMBOL],
 [AC_REQUIRE([AC_PROG_CC])
 AC_MSG_CHECKING([if __bss_start is defined by the compiler])
 AC_CACHE_VAL(grub_cv_check_uscore_uscore_bss_start_symbol,
@@ -320,7 +320,7 @@
 
 dnl Check what symbol is defined as an end symbol.
 dnl Written by Yoshinori K. Okuji.
-AC_DEFUN(grub_CHECK_END_SYMBOL,
+AC_DEFUN([grub_CHECK_END_SYMBOL],
 [AC_REQUIRE([AC_PROG_CC])
 AC_MSG_CHECKING([if end is defined by the compiler])
 AC_CACHE_VAL(grub_cv_check_end_symbol,
@@ -352,7 +352,7 @@
 ])
 
 dnl Check if the C compiler generates calls to `__enable_execute_stack()'.
-AC_DEFUN(grub_CHECK_ENABLE_EXECUTE_STACK,[
+AC_DEFUN([grub_CHECK_ENABLE_EXECUTE_STACK],[
 AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()'])
 AC_LANG_CONFTEST([[
 void f (int (*p) (void));
@@ -379,7 +379,7 @@
 
 
 dnl Check if the C compiler supports `-fstack-protector'.
-AC_DEFUN(grub_CHECK_STACK_PROTECTOR,[
+AC_DEFUN([grub_CHECK_STACK_PROTECTOR],[
 [# Smashing stack protector.
 ssp_possible=yes]
 AC_MSG_CHECKING([whether `$CC' accepts `-fstack-protector'])
@@ -398,7 +398,7 @@
 ])
 
 dnl Check if the C compiler supports `-mstack-arg-probe' (Cygwin).
-AC_DEFUN(grub_CHECK_STACK_ARG_PROBE,[
+AC_DEFUN([grub_CHECK_STACK_ARG_PROBE],[
 [# Smashing stack arg probe.
 sap_possible=yes]
 AC_MSG_CHECKING([whether `$CC' accepts `-mstack-arg-probe'])
@@ -414,7 +414,7 @@
 ])
 
 dnl Check if ln can handle directories properly (mingw).
-AC_DEFUN(grub_CHECK_LINK_DIR,[
+AC_DEFUN([grub_CHECK_LINK_DIR],[
 AC_MSG_CHECKING([whether ln can handle directories properly])
 [mkdir testdir 2>/dev/null
 case $srcdir in
@@ -432,7 +432,7 @@
 ])
 
 dnl Check if the C compiler supports `-fPIE'.
-AC_DEFUN(grub_CHECK_PIE,[
+AC_DEFUN([grub_CHECK_PIE],[
 [# Position independent executable.
 pie_possible=yes]
 AC_MSG_CHECKING([whether `$CC' has `-fPIE' as default])

=== modified file 'autogen.sh'
--- autogen.sh  2009-11-24 18:51:35 +0000
+++ autogen.sh  2009-12-07 09:31:59 +0000
@@ -11,7 +11,7 @@
 
 echo timestamp > stamp-h.in
 
-python util/import_gcry.py lib/libgcrypt/ .
+python util/import_gcry.py lib/libgcrypt/ . NoWarn
 
 for rmk in conf/*.rmk ${GRUB_CONTRIB}/*/conf/*.rmk; do
   if test -e $rmk ; then

=== added file 'config.rpath'
=== modified file 'configure.ac'
--- configure.ac        2009-12-05 10:08:26 +0000
+++ configure.ac        2009-12-07 09:05:44 +0000
@@ -32,7 +32,6 @@
 
 
 AC_INIT([GRUB],[1.97],[bug-g...@gnu.org])
-AM_INIT_AUTOMAKE()
 AC_PREREQ(2.60)
 AC_CONFIG_SRCDIR([include/grub/dl.h])
 AC_CONFIG_HEADER([config.h])
@@ -41,6 +40,8 @@
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
+AM_INIT_AUTOMAKE()
+
 # Program name transformations
 AC_ARG_PROGRAM
 
@@ -173,7 +174,7 @@
 test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
 
 AC_GNU_SOURCE
-AM_GNU_GETTEXT
+AM_GNU_GETTEXT([external])
 AC_SYS_LARGEFILE
 
 # Identify characteristics of the host architecture.

=== modified file 'util/import_gcry.py'
--- util/import_gcry.py 2009-11-17 10:22:54 +0000
+++ util/import_gcry.py 2009-12-07 09:17:04 +0000
@@ -26,18 +26,24 @@
     exit (0)
 indir = sys.argv[1]
 outdir = sys.argv[2]
+warn = True
+
+if len (sys.argv) > 3:
+   warn = False
 
 basedir = os.path.join (outdir, "lib/libgcrypt-grub")
 try:
     os.makedirs (basedir)
 except:
-    print ("WARNING: %s already exists" % basedir)
+    if warn:
+      print ("WARNING: %s already exists" % basedir)
 cipher_dir_in = os.path.join (indir, "cipher")
 cipher_dir_out = os.path.join (basedir, "cipher")
 try:
     os.makedirs (cipher_dir_out)
 except:
-    print ("WARNING: %s already exists" % cipher_dir_out)
+    if warn:
+      print ("WARNING: %s already exists" % cipher_dir_out)
 
 cipher_files = os.listdir (cipher_dir_in)
 conf = open (os.path.join (outdir, "conf", "gcry.rmk"), "w")
@@ -223,7 +229,8 @@
             conf.write ("%s_mod_CFLAGS = $(COMMON_CFLAGS) 
-Wno-missing-field-initializers -Wno-error\n" % modname)
             conf.write ("%s_mod_LDFLAGS = $(COMMON_LDFLAGS)\n\n" % modname)
         elif isc and cipher_file != "camellia.c":
-            print ("WARNING: C file isn't a module: %s" % cipher_file)
+            if warn:
+               print ("WARNING: C file isn't a module: %s" % cipher_file)
         f.close ()
         fw.close ()
         if nch:

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to