]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-03-05 Vladimir Serbinenko <phcoder@gmail.com>
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 6 Mar 2010 16:22:04 +0000 (17:22 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 6 Mar 2010 16:22:04 +0000 (17:22 +0100)
Fix FreeBSD compilation.

* Makefile.in (TARGET_CPPFLAGS): Remove -nostdinc -isystem.
* configure.ac: Add -nostdinc -isystem to TARGET_CPPFLAGS if it works.

ChangeLog
Makefile.in
configure.ac

index fa2f1ff059398827022430cce68fc0f0df7561c4..c9356b222cb592f5c90accf924370556756c0247 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-05  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       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  <phcoder@gmail.com>
 
        * util/import_gcry.py: Add autogenerated files to MAINTAINER_CLEANFILES.
index 4144dfb5a7da99ed2dd2316a914f3e47b1c1732c..47584cdde5590e16969522a54c11b0ddd2821c75 100644 (file)
@@ -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@
index 1f7d6125c67526c701b90a3ef7594237d12e572c..cf43608d1a8120bfa8e531183d1852a36bd758f4 100644 (file)
@@ -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 <stdarg.h>
+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"