dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
dnl type.
-AC_INIT([GRUB],[2.00~beta4],[bug-grub@gnu.org])
+AC_INIT([GRUB],[2.00],[bug-grub@gnu.org])
AC_CONFIG_AUX_DIR([build-aux])
# Program name transformations
AC_ARG_PROGRAM
+grub_TRANSFORM([grub-bios-setup])
+grub_TRANSFORM([grub-editenv])
+grub_TRANSFORM([grub-install])
+grub_TRANSFORM([grub-mkconfig])
+grub_TRANSFORM([grub-mkfont])
+grub_TRANSFORM([grub-mkimage])
+grub_TRANSFORM([grub-glue-efi])
+grub_TRANSFORM([grub-mklayout])
+grub_TRANSFORM([grub-mkpasswd-pbkdf2])
+grub_TRANSFORM([grub-mkrelpath])
+grub_TRANSFORM([grub-mkrescue])
+grub_TRANSFORM([grub-probe])
+grub_TRANSFORM([grub-reboot])
+grub_TRANSFORM([grub-script-check])
+grub_TRANSFORM([grub-set-default])
+grub_TRANSFORM([grub-sparc64-setup])
+grub_TRANSFORM([grub-render-label])
# Optimization flag. Allow user to override.
if test "x$TARGET_CFLAGS" = x; then
mips-qemu_mips) ;;
mips-qemu-mips) platform=qemu_mips;;
mips-arc) ;;
+ mipsel-arc) ;;
mipsel-qemu_mips) ;;
mipsel-qemu-mips) platform=qemu_mips;;
mipsel-yeeloong) platform=loongson ;;
freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;;
netbsd*) host_kernel=netbsd ;;
solaris*) host_kernel=illumos ;;
+ darwin*) host_kernel=xnu ;;
cygwin) host_kernel=windows ;;
esac
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,` -DGRUB_TARGET_CPU_`echo ${target_cpu} | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`=1"
fi
+case "${target_cpu}-$platform" in
+ mips-arc)
+ TARGET_LINK_ADDR=0x88200000
+ TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000
+ ;;
+ mipsel-arc)
+ TARGET_LINK_ADDR=0x80700000
+ TARGET_DECOMPRESSOR_LINK_ADDR=0x80600000
+ ;;
+ mips*-qemu_mips | mips*-loongson)
+ TARGET_DECOMPRESSOR_LINK_ADDR=0x80100000
+ ;;
+esac
+
+AC_SUBST(TARGET_LINK_ADDR)
+AC_SUBST(TARGET_DECOMPRESSOR_LINK_ADDR)
+
TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
AC_SUBST(host_cpu)
FONT_SOURCE=
for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
- for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont; do
+ for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni /usr/share/fonts/truetype/unifont /usr/share/fonts/misc; do
if test -f "$dir/unifont.$ext"; then
FONT_SOURCE="$dir/unifont.$ext"
break 2
AC_PROG_CC
gl_EARLY
+AC_PROG_CXX
AM_PROG_CC_C_O
AM_PROG_AS
# Must be GCC.
test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
+AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
+
AC_GNU_SOURCE
AM_GNU_GETTEXT([external])
AC_SYS_LARGEFILE
grub_apple_cc
if test x$grub_cv_apple_cc = xyes ; then
- HOST_CPPFLAGS="$HOST_CPPFLAGS -DAPPLE_CC=1 -fnested-functions"
- HOST_CFLAGS="$HOST_CFLAGS"
+ HOST_CPPFLAGS="$HOST_CPPFLAGS -fnested-functions"
+ HOST_LDFLAGS="$HOST_LDFLAGS -Wl,-allow_stack_execute"
fi
if test x$USE_NLS = xno; then
fi
# Check for functions and headers.
-AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
+AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
])
AC_SUBST([LIBUTIL])
+AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
+ SAVED_CFLAGS="$CFLAGS"
+ CFLAGS="$HOST_CFLAGS -Wtrampolines"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
+int va_arg_func (int fixed, va_list args);]], [[]])],
+ [grub_cv_host_cc_wtrampolines=yes],
+ [grub_cv_host_cc_wtrampolines=no])
+ CFLAGS="$SAVED_CFLAGS"
+])
+
+if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then
+ HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines"
+fi
+
#
# Check for host and build compilers.
#
LIBS=""
# debug flags.
-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
+WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
else
TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
fi
+fi
+if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then
# Some toolchains enable these features by default, but they need
# registers that aren't set up properly in GRUB.
TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
grub_apple_target_cc
if test x$grub_cv_apple_target_cc = xyes ; then
- TARGET_CPPFLAGS="$TARGET_CPPFLAGS -DAPPLE_CC=1"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -fnested-functions"
- CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
+ CFLAGS="$CFLAGS -fnested-functions"
TARGET_APPLE_CC=1
AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
if test "x$OBJCONV" = x ; then
TARGET_MODULE_FORMAT="elf64"
fi
-if test "$target_cpu"-"$platform" = x86_64-efi; then
+if test "$target_cpu" = x86_64; then
# Use large model to support 4G memory
AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
SAVED_CFLAGS=$CFLAGS
else
TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
fi
+fi
+if test "$target_cpu"-"$platform" = x86_64-efi; then
# EFI writes to stack below %rsp, we must not use the red zone
AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
CFLAGS="$CFLAGS -m64 -mno-red-zone"
# Compiler features.
#
-# Need __enable_execute_stack() for nested function trampolines?
-grub_CHECK_ENABLE_EXECUTE_STACK
-
# Position independent executable.
grub_CHECK_PIE
[# Need that, because some distributions ship compilers that include
fi
# Check for libgcc symbols
-AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x __ia64_trampoline __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2)
+AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2)
if test "x$TARGET_APPLE_CC" = x1 ; then
CFLAGS="$TARGET_CFLAGS -nostdlib"
SAVED_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
+#include <stddef.h>
int va_arg_func (int fixed, va_list args);]], [[]])],
[grub_cv_cc_isystem=yes],
[grub_cv_cc_isystem=no])
fi
fi
-AC_CACHE_CHECK([whether -Wno-trampolines work], [grub_cv_cc_wnotrampolines], [
+AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [
SAVED_CFLAGS="$CFLAGS"
- # Test for -Wtrampolines rather than -Wno-trampolines to reduce confusion
- # in the event of later failures (since -Wno-* is always accepted, but
- # produces a diagnostic if something else is wrong).
CFLAGS="$TARGET_CFLAGS -Wtrampolines"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
int va_arg_func (int fixed, va_list args);]], [[]])],
- [grub_cv_cc_wnotrampolines=yes],
- [grub_cv_cc_wnotrampolines=no])
+ [grub_cv_cc_wtrampolines=yes],
+ [grub_cv_cc_wtrampolines=no])
CFLAGS="$SAVED_CFLAGS"
])
-if test x"$grub_cv_cc_wnotrampolines" = xyes ; then
- TARGET_CFLAGS="$TARGET_CFLAGS -Wno-trampolines"
+if test x"$grub_cv_cc_wtrampolines" = xyes ; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines"
fi
# Restore the flags.
fi
AC_SUBST([DISK_CACHE_STATS])
+AC_ARG_ENABLE([boot-time],
+ AS_HELP_STRING([--enable-boot-time],
+ [enable boot time statistics collection]))
+
+if test x$enable_boot_time = xyes; then
+ BOOT_TIME_STATS=1
+else
+ BOOT_TIME_STATS=0
+fi
+AC_SUBST([BOOT_TIME_STATS])
+
AC_ARG_ENABLE([grub-emu-usb],
[AS_HELP_STRING([--enable-grub-emu-usb],
[build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
[build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
if test "$platform" = emu; then
- missing_ncurses=
-[# Check for curses libraries.]
- AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
- [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
- [missing_ncurses=[true]])])
- AC_SUBST([LIBCURSES])
-[if [ x"$missing_ncurses" = x ]; then ]
- [# Check for headers.]
- AC_CHECK_HEADERS([ncurses/curses.h], [],
- [AC_CHECK_HEADERS([ncurses.h], [],
- [AC_CHECK_HEADERS([curses.h], [],
- [missing_ncurses=[true]])])])
-[fi]
-if test x"$missing_ncurses" = xtrue ; then
- AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
-fi
if test x"$enable_grub_emu_usb" != xyes ; then
grub_emu_usb_excuse="not enabled"
if test x"$grub_mkfont_excuse" = x ; then
# Check for freetype libraries.
- AC_CHECK_PROGS([FREETYPE], [freetype-config])
+ AC_CHECK_TOOLS([FREETYPE], [freetype-config])
if test "x$FREETYPE" = x ; then
grub_mkfont_excuse=["need freetype2 library"]
fi
if test x"$grub_mkfont_excuse" = x ; then
# Check for freetype libraries.
- freetype_cflags=`freetype-config --cflags`
- freetype_libs=`freetype-config --libs`
+ freetype_cflags=`$FREETYPE --cflags`
+ freetype_libs=`$FREETYPE --libs`
SAVED_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $freetype_cflags"
AC_CHECK_HEADERS([ft2build.h], [],
starfield_excuse="No grub-mkfont"
fi
-if test x"$starfield_excuse" != x; then
+if test x"$starfield_excuse" = x; then
for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
- for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu; do
+ for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do
if test -f "$dir/DejaVuSans.$ext"; then
DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext"
break 2
AC_SUBST(END_SYMBOL)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
-AC_SUBST(NEED_ENABLE_EXECUTE_STACK)
AC_SUBST(NEED_REGISTER_FRAME_INFO)
#
AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
-AM_CONDITIONAL([COND_mips_arc], [test x$target_cpu = xmips -a x$platform = xarc])
+AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc])
AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
+AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
+AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
+AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu])
AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos])
AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1])
AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1])
+AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1])
+
+AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes])
AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin])
else
echo With disk cache statistics: No
fi
+
+if [ x"$enable_boot_time" = xyes ]; then
+echo With boot time statistics: Yes
+else
+echo With boot time statistics: No
+fi
+
if [ x"$efiemu_excuse" = x ]; then
echo efiemu runtime: Yes
else
else
echo With libzfs support: No "($libzfs_excuse)"
fi
+if test "x$FONT_SOURCE" = x ; then
+echo "Without unifont"
+else
+echo "With unifont from $FONT_SOURCE"
+fi
echo "*******************************************************"
+if test "x$LIBLZMA" = x ; then
+echo "Without liblzma (no support for XZ-compressed mips images)"
+else
+echo "With liblzma from $LIBLZMA (support for XZ-compressed mips images)"
+fi
]