+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.
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@
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"