From 8f9a632b96321457a61c03ddff1faf2a373d52bc Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 6 Mar 2010 17:22:04 +0100 Subject: [PATCH] 2010-03-05 Vladimir Serbinenko Fix FreeBSD compilation. * Makefile.in (TARGET_CPPFLAGS): Remove -nostdinc -isystem. * configure.ac: Add -nostdinc -isystem to TARGET_CPPFLAGS if it works. --- ChangeLog | 7 +++++++ Makefile.in | 2 +- configure.ac | 13 +++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fa2f1ff05..c9356b222 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-03-05 Vladimir Serbinenko + + Fix FreeBSD compilation. + + * Makefile.in (TARGET_CPPFLAGS): Remove -nostdinc -isystem. + * configure.ac: Add -nostdinc -isystem to TARGET_CPPFLAGS if it works. + 2010-03-05 Vladimir Serbinenko * util/import_gcry.py: Add autogenerated files to MAINTAINER_CLEANFILES. diff --git a/Makefile.in b/Makefile.in index 4144dfb5a..47584cdde 100644 --- a/Makefile.in +++ b/Makefile.in @@ -89,7 +89,7 @@ TARGET_ASFLAGS = @TARGET_ASFLAGS@ TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ TARGET_APPLE_CC = @TARGET_APPLE_CC@ OBJCONV = @OBJCONV@ -TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include) -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \ +TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \ -Wall -W TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ diff --git a/configure.ac b/configure.ac index 1f7d6125c..cf43608d1 100644 --- a/configure.ac +++ b/configure.ac @@ -517,6 +517,19 @@ enable_efiemu=no fi AC_SUBST([enable_efiemu]) +AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [ + SAVED_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +int va_arg_func (int fixed, va_list args);]], [[]])], + [grub_cv_cc_isystem=yes], + [grub_cv_cc_isystem=no]) + CPPFLAGS="$SAVED_CPPFLAGS" +]) + +if test x"$grub_cv_cc_isystem" = xyes ; then + TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" +fi # Restore the flags. CC="$tmp_CC"