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.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-03-06 17:22:04 +01:00
parent 60b03859e8
commit 8f9a632b96
3 changed files with 21 additions and 1 deletions

View 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"