2009-09-16 Robert Millan <rmh.grub@aybabtu.com>

* aclocal.m4 (AC_LANG_PROGRAM): New macro.  Overrides stock
        AC_LANG_PROGRAM from autoconf.
        (grub_ASM_USCORE, grub_PROG_OBJCOPY_ABSOLUTE): Add missing      
        prototypes (fixes warning).

        * configure.ac: Add `-Werror' to TARGET_CFLAGS unless
        `--disable-werror' was used.
This commit is contained in:
robertmh 2009-09-16 19:32:44 +00:00
parent bbb2a70f51
commit 63f745e857
3 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,13 @@
2009-09-16 Robert Millan <rmh.grub@aybabtu.com>
* aclocal.m4 (AC_LANG_PROGRAM): New macro. Overrides stock
AC_LANG_PROGRAM from autoconf.
(grub_ASM_USCORE, grub_PROG_OBJCOPY_ABSOLUTE): Add missing
prototypes (fixes warning).
* configure.ac: Add `-Werror' to TARGET_CFLAGS unless
`--disable-werror' was used.
2009-09-16 Robert Millan <rmh.grub@aybabtu.com>
* partmap/msdos.c (pc_partition_map_iterate): Fix possible use of

17
aclocal.m4 vendored
View File

@ -1,3 +1,18 @@
dnl Redefine AC_LANG_PROGRAM with a "-Wstrict-prototypes -Werror"-friendly
dnl version. Patch submitted to bug-autoconf in 2009-09-16.
m4_define([AC_LANG_PROGRAM(C)],
[$1
int
main (void)
{
dnl Do *not* indent the following line: there may be CPP directives.
dnl Don't move the `;' right after for the same reason.
$2
;
return 0;
}])
dnl Check whether target compiler is working
AC_DEFUN(grub_PROG_TARGET_CC,
[AC_MSG_CHECKING([whether target compiler is working])
@ -26,6 +41,7 @@ AC_DEFUN(grub_ASM_USCORE,
AC_MSG_CHECKING([if C symbols get an underscore after compilation])
AC_CACHE_VAL(grub_cv_asm_uscore,
[cat > conftest.c <<\EOF
int func (int *);
int
func (int *list)
{
@ -63,6 +79,7 @@ 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
void cmain (void);
void
cmain (void)
{

View File

@ -390,6 +390,13 @@ if test x"$sap_possible" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
fi
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--disable-werror],
[do not use -Werror when building GRUB])])
if test x"$enable_werror" != xno ; then
TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
fi
AC_SUBST(TARGET_CFLAGS)
AC_SUBST(TARGET_MODULE_FORMAT)
AC_SUBST(OBJCONV)