3 # Process this file with autoconf to produce a configure script.
5 # Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
7 # This configure.ac is free software; the author
8 # gives unlimited permission to copy and/or distribute it,
9 # with or without modifications, as long as this notice is preserved.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
16 dnl This configure script is complicated, because GRUB needs to deal
17 dnl with three potentially different types:
19 dnl build -- the environment for building GRUB
20 dnl host -- the environment for running utilities
21 dnl target -- the environment for running GRUB
23 dnl In addition, GRUB needs to deal with a platform specification
24 dnl which specifies the system running GRUB, such as firmware.
25 dnl This is necessary because the target type in autoconf does not
26 dnl describe such a system very well.
28 dnl The current strategy is to use variables with no prefix (such as
29 dnl CC, CFLAGS, etc.) for the host type as well as the build type,
30 dnl because GRUB does not need to use those variables for the build
31 dnl type, so there is no conflict. Variables with the prefix "TARGET_"
32 dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
35 AC_INIT([GRUB],[2.00],[bug-grub@gnu.org])
37 AC_CONFIG_AUX_DIR([build-aux])
39 # We don't want -g -O2 by default in CFLAGS
42 # Checks for host and target systems.
44 save_program_prefix="${program_prefix}"
46 program_prefix="${save_program_prefix}"
48 AM_INIT_AUTOMAKE([1.10.1])
50 AC_CONFIG_SRCDIR([include/grub/dl.h])
51 AC_CONFIG_HEADER([config-util.h])
53 # Program name transformations
55 grub_TRANSFORM([grub-bios-setup])
56 grub_TRANSFORM([grub-editenv])
57 grub_TRANSFORM([grub-install])
58 grub_TRANSFORM([grub-mkconfig])
59 grub_TRANSFORM([grub-mkfont])
60 grub_TRANSFORM([grub-mkimage])
61 grub_TRANSFORM([grub-glue-efi])
62 grub_TRANSFORM([grub-mklayout])
63 grub_TRANSFORM([grub-mkpasswd-pbkdf2])
64 grub_TRANSFORM([grub-mkrelpath])
65 grub_TRANSFORM([grub-mkrescue])
66 grub_TRANSFORM([grub-probe])
67 grub_TRANSFORM([grub-reboot])
68 grub_TRANSFORM([grub-script-check])
69 grub_TRANSFORM([grub-set-default])
70 grub_TRANSFORM([grub-sparc64-setup])
71 grub_TRANSFORM([grub-render-label])
73 # Optimization flag. Allow user to override.
74 if test "x$TARGET_CFLAGS" = x; then
75 TARGET_CFLAGS="$TARGET_CFLAGS -Os"
78 # Default HOST_CPPFLAGS
79 HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
80 HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
81 HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1"
83 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W"
84 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include"
85 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include"
88 i[[3456]]86) target_cpu=i386 ;;
89 amd64) target_cpu=x86_64 ;;
90 sparc) target_cpu=sparc64 ;;
93 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1";
97 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1";
107 # Specify the platform (such as firmware).
108 AC_ARG_WITH([platform],
109 AS_HELP_STRING([--with-platform=PLATFORM],
110 [select the host platform [[guessed]]]))
112 # Guess the platform if not specified.
113 if test "x$with_platform" = x; then
114 case "$target_cpu"-"$target_vendor" in
115 i386-apple) platform=efi ;;
116 i386-*) platform=pc ;;
117 x86_64-apple) platform=efi ;;
118 x86_64-*) platform=pc ;;
119 powerpc-*) platform=ieee1275 ;;
120 powerpc64-*) platform=ieee1275 ;;
121 sparc64-*) platform=ieee1275 ;;
122 mipsel-*) platform=loongson ;;
123 mips-*) platform=arc ;;
124 ia64-*) platform=efi ;;
125 arm-*) platform=uboot ;;
126 arm64-*) platform=efi ;;
127 *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
130 platform="$with_platform"
133 case "$target_cpu"-"$platform" in
137 x86_64-*) target_cpu=i386 ;;
138 powerpc64-ieee1275) target_cpu=powerpc ;;
141 # Check if the platform is supported, make final adjustments.
142 case "$target_cpu"-"$platform" in
150 i386-linuxbios) platform=coreboot ;;
157 mips-qemu-mips) platform=qemu_mips;;
161 mipsel-qemu-mips) platform=qemu_mips;;
162 mipsel-yeeloong) platform=loongson ;;
163 mipsel-fuloong) platform=loongson ;;
169 *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
172 if test x$platform != xemu ; then
173 case "$target_cpu" in
174 i386 | powerpc) target_m32=1 ;;
175 x86_64 | sparc64) target_m64=1 ;;
180 windows* | mingw32*) target_os=cygwin ;;
183 # This normalizes the names, and creates a new variable ("host_kernel")
184 # while at it, since the mapping is not always 1:1 (e.g. different OSes
185 # using the same kernel type).
187 gnu*) host_kernel=hurd ;;
188 linux*) host_kernel=linux ;;
189 freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;;
190 netbsd*) host_kernel=netbsd ;;
191 solaris*) host_kernel=illumos ;;
192 darwin*) host_kernel=xnu ;;
193 cygwin | windows* | mingw32*) host_kernel=windows ;;
197 cygwin | windows* | mingw32*) have_exec=n ;;
198 aros*) have_exec=n ;;
203 coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;;
204 multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;;
205 efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;;
206 xen) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_XEN=1" ;;
207 ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;;
208 uboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_UBOOT=1" ;;
209 qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
210 pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
211 emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
212 loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
213 qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
214 arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
216 case "$target_cpu" in
217 arm) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARM=1" ;;
218 arm64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARM64=1" ;;
219 mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
220 sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
222 if test x${target_cpu} = xmipsel ; then
223 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
225 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"
228 case "${target_cpu}-$platform" in
230 TARGET_LINK_ADDR=0x88200000
231 TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000
234 TARGET_LINK_ADDR=0x80700000
235 TARGET_DECOMPRESSOR_LINK_ADDR=0x80600000
237 mips*-qemu_mips | mips*-loongson)
238 TARGET_DECOMPRESSOR_LINK_ADDR=0x80100000
242 AC_SUBST(TARGET_LINK_ADDR)
243 AC_SUBST(TARGET_DECOMPRESSOR_LINK_ADDR)
245 TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
249 AC_SUBST(host_kernel)
254 # Define default variables
257 AC_ARG_WITH([bootdir],
258 AS_HELP_STRING([--with-bootdir=DIR],
259 [set the name of /boot directory [[guessed]]]),
260 [have_with_bootdir=y],
261 [have_with_bootdir=n])
262 if test x$have_with_bootdir = xy; then
263 bootdirname="$with_bootdir"
267 # Because /boot is used for the boot block in NetBSD and OpenBSD,
269 *) bootdirname='boot' ;;
273 AC_SUBST(bootdirname)
274 AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname",
275 [Default boot directory name]")
277 AC_ARG_WITH([grubdir],
278 AS_HELP_STRING([--with-grubdir=DIR],
279 [set the name of grub directory [[guessed]]]),
280 [grubdirname="$with_grubdir"],
281 [grubdirname="$PACKAGE"])
283 AC_SUBST(grubdirname)
284 AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
285 [Default grub directory name])
288 # Checks for build programs.
291 # Although cmp is listed in the GNU Coding Standards as a command which
292 # can used directly, OpenBSD lacks cmp in the default installation.
293 AC_CHECK_PROGS([CMP], [cmp])
294 if test "x$CMP" = x; then
295 AC_MSG_ERROR([cmp is not found])
298 AC_CHECK_PROGS([YACC], [bison])
299 if test "x$YACC" = x; then
300 AC_MSG_ERROR([bison is not found])
312 if test "x$LEX" = "x:"; then
313 AC_MSG_ERROR([flex is not found])
315 version=`$LEX --version | $AWK '{ split($NF,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'`
316 if test -n "$version" -a "$version" -ge 20535; then
319 AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above])
323 # These are not a "must".
324 AC_PATH_PROGS(MAKEINFO, makeinfo true)
327 # Checks for host programs.
337 test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
339 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
342 AM_GNU_GETTEXT([external])
345 # Identify characteristics of the host architecture.
346 unset ac_cv_c_bigendian
349 AC_CHECK_SIZEOF(void *)
350 AC_CHECK_SIZEOF(long)
353 cygwin | windows* | mingw32*)
354 HOST_CPPFLAGS="$HOST_CPPFLAGS -DUNICODE=1 -D_WIN32_WINNT=0x0500"
355 CPPFLAGS="$CPPFLAGS -DUNICODE=1 -D_WIN32_WINNT=0x0500"
356 AC_CHECK_SIZEOF(TCHAR,,[#include <windows.h>])
360 if test x$USE_NLS = xno; then
361 HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext"
364 if test "x$cross_compiling" = xyes; then
365 AC_MSG_WARN([cannot generate manual pages while cross compiling])
367 AC_PATH_PROG(HELP2MAN, help2man)
370 # Check for functions and headers.
371 AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
372 AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
374 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
375 #include <sys/param.h>
376 #include <sys/mount.h>])
378 AC_CHECK_MEMBERS([struct statfs.f_mntfromname],,,[$ac_includes_default
379 #include <sys/param.h>
380 #include <sys/mount.h>])
382 # For opendisk() and getrawpartition() on NetBSD.
383 # Used in util/deviceiter.c and in util/hostdisk.c.
384 AC_CHECK_HEADER([util.h], [
385 AC_CHECK_LIB([util], [opendisk], [
387 AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used])
389 AC_CHECK_LIB([util], [getrawpartition], [
391 AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition() in -lutil can be used])
396 AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
397 SAVED_CFLAGS="$CFLAGS"
398 CFLAGS="$HOST_CFLAGS -Wtrampolines -Werror"
399 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
400 int va_arg_func (int fixed, va_list args);]], [[]])],
401 [grub_cv_host_cc_wtrampolines=yes],
402 [grub_cv_host_cc_wtrampolines=no])
403 CFLAGS="$SAVED_CFLAGS"
406 if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then
407 HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines"
411 # Check for host and build compilers.
414 AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc])
415 test -z "$BUILD_CC" && AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])
416 BUILD_CPP="$BUILD_CC -E"
419 haiku*) BUILD_LIBM= ;;
425 WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Wattributes -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -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 -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"
426 EXTRA_WARN_FLAGS="-Wvla"
428 HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS -Wcast-align"
430 AC_CACHE_CHECK([which extra warnings work], [grub_cv_cc_w_extra_flags], [
431 SAVED_CFLAGS="$CFLAGS"
432 grub_cv_cc_w_extra_flags=
433 for x in $EXTRA_WARN_FLAGS; do
434 CFLAGS="$HOST_CFLAGS $x -Werror"
435 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0])
436 if test x$flag = x1 ; then
437 grub_cv_cc_w_extra_flags="$grub_cv_cc_w_extra_flags $x"
440 CFLAGS="$SAVED_CFLAGS"
443 HOST_CFLAGS="$HOST_CFLAGS $grub_cv_cc_w_extra_flags"
446 # Check for target programs.
449 # Find tools for the target.
450 if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
451 tmp_ac_tool_prefix="$ac_tool_prefix"
452 ac_tool_prefix=$target_alias-
454 AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
455 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
456 AC_CHECK_TOOL(TARGET_OBJCOPY, objcopy)
457 AC_CHECK_TOOL(TARGET_STRIP, strip)
458 AC_CHECK_TOOL(TARGET_NM, nm)
459 AC_CHECK_TOOL(TARGET_RANLIB, ranlib)
461 ac_tool_prefix="$tmp_ac_tool_prefix"
463 if test "x$TARGET_CC" = x; then
466 AC_CHECK_TOOL(TARGET_OBJCOPY, objcopy)
467 AC_CHECK_TOOL(TARGET_STRIP, strip)
468 AC_CHECK_TOOL(TARGET_NM, nm)
469 AC_CHECK_TOOL(TARGET_RANLIB, ranlib)
474 AC_SUBST(BUILD_CFLAGS)
475 AC_SUBST(BUILD_CPPFLAGS)
478 AC_SUBST(TARGET_RANLIB)
479 AC_SUBST(TARGET_STRIP)
480 AC_SUBST(TARGET_OBJCOPY)
482 # Test the C compiler for the target environment.
485 tmp_LDFLAGS="$LDFLAGS"
486 tmp_CPPFLAGS="$CPPFLAGS"
489 CFLAGS="$TARGET_CFLAGS"
490 CPPFLAGS="$TARGET_CPPFLAGS"
491 LDFLAGS="$TARGET_LDFLAGS"
495 TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
496 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
498 if test "x$target_cpu" != xi386 && test "x$target_cpu" != xx86_64; then
499 TARGET_CFLAGS="$TARGET_CFLAGS -Wcast-align"
502 AC_CACHE_CHECK([which extra warnings work], [grub_cv_target_cc_w_extra_flags], [
503 LDFLAGS="$TARGET_LDFLAGS -nostdlib -static"
505 grub_cv_target_cc_w_extra_flags=
506 for x in $EXTRA_WARN_FLAGS; do
507 CFLAGS="$TARGET_CFLAGS $x -Werror"
508 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0])
509 if test x$flag = x1 ; then
510 grub_cv_target_cc_w_extra_flags="$grub_cv_target_cc_w_extra_flags $x"
515 TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_w_extra_flags"
517 AC_CACHE_CHECK([if compiling with clang], [grub_cv_cc_target_clang]
519 CFLAGS="$TARGET_CFLAGS"
521 [AC_LANG_PROGRAM([], [[
526 [grub_cv_cc_target_clang=no], [grub_cv_cc_target_clang=yes])])
528 # on x86 clang doesn't support .code16
529 # on arm clang doesn't support .arch directive
530 # on mips clang doesn't support privilegied instructions, doubleword store/load
531 # and crashes with hand-written assembly
532 if test "x$grub_cv_cc_target_clang" = xyes && ( test "x$target_cpu" = xi386 \
533 || test "x$target_cpu" = xx86_64 || test "x$target_cpu" = xarm \
534 || test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ); then
535 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
538 if test "x$grub_cv_cc_target_clang" = xyes && test "x$target_cpu" = xpowerpc; then
539 AC_CACHE_CHECK([if clang can handle ame instruction], [grub_cv_cc_target_clang_ame]
541 CFLAGS="$TARGET_CFLAGS"
543 [AC_LANG_PROGRAM([], [[
544 unsigned int a = 0, b = 0;
545 asm volatile ("{ame|addme} %0,%1" : "=r" (a) : "r" (b));
549 [grub_cv_cc_target_clang_ame=yes], [grub_cv_cc_target_clang_ame=no])])
550 # clang <= 3.3 doesn't handle most of ppc assembly, not even inline assembly
552 if test x$grub_cv_cc_target_clang_ame = xno ; then
553 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
554 TARGET_CFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
558 if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then
559 TARGET_CFLAGS="$TARGET_CFLAGS -march=i386"
562 if test "x$target_m32" = x1; then
564 TARGET_CFLAGS="$TARGET_CFLAGS -m32"
565 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
566 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
567 TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
568 TARGET_MODULE_FORMAT="elf32"
571 if test "x$target_m64" = x1; then
573 TARGET_CFLAGS="$TARGET_CFLAGS -m64"
574 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
575 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64"
576 TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
577 TARGET_MODULE_FORMAT="elf64"
580 if test "x$grub_cv_cc_target_clang" = xno && test "x$target_cpu" = xi386 && test "x$platform" != xemu && test "x$platform" != xefi; then
581 TARGET_CFLAGS="$TARGET_CFLAGS -mrtd -mregparm=3"
584 # on mips redirect cache flushing function to non-existant one.
585 if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
586 AC_CACHE_CHECK([whether -mflush-func=grub_red_herring works], [grub_cv_cc_mflush_func], [
587 CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring -Werror"
588 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
589 [grub_cv_cc_mflush_func=yes],
590 [grub_cv_cc_mflush_func=no])
593 if test "x$grub_cv_cc_mflush_func" = xyes; then
594 TARGET_CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring"
599 # Force no alignment to save space on i386.
600 if test "x$target_cpu" = xi386; then
601 AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
602 CFLAGS="$TARGET_CFLAGS -falign-loops=1 -Werror"
603 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
604 [grub_cv_cc_falign_loop=yes],
605 [grub_cv_cc_falign_loop=no])
608 AC_CACHE_CHECK([whether -malign-loops works], [grub_cv_cc_malign_loop], [
609 CFLAGS="$TARGET_CFLAGS -malign-loops=1 -Werror"
610 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
611 [grub_cv_cc_malign_loop=yes],
612 [grub_cv_cc_malign_loop=no])
615 if test "x$grub_cv_cc_falign_loop" = xyes; then
616 TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
617 elif test "x$grub_cv_cc_malign_loop" = xyes; then
618 TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
622 AC_CACHE_CHECK([whether -freg-struct-return works], [grub_cv_cc_freg_struct_return], [
623 CFLAGS="$TARGET_CFLAGS -freg-struct-return -Werror"
624 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
625 [grub_cv_cc_freg_struct_return=yes],
626 [grub_cv_cc_freg_struct_return=no])
629 if test "x$grub_cv_cc_freg_struct_return" = xyes; then
630 TARGET_CFLAGS="$TARGET_CFLAGS -freg-struct-return"
633 if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then
634 # Some toolchains enable these features by default, but they need
635 # registers that aren't set up properly in GRUB.
636 TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
639 # By default, GCC 4.4 generates .eh_frame sections containing unwind
640 # information in some cases where it previously did not. GRUB doesn't need
641 # these and they just use up vital space. Restore the old compiler
643 AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
644 CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
645 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
646 [grub_cv_cc_fno_dwarf2_cfi_asm=yes],
647 [grub_cv_cc_fno_dwarf2_cfi_asm=no])
650 if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
651 TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
654 if test x"$target_os" = xcygwin; then
655 AC_CACHE_CHECK([whether option -fno-reorder-functions works], grub_cv_cc_no_reorder_functions, [
656 CFLAGS="$TARGET_CFLAGS -fno-reorder-functions"
657 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
658 [grub_cv_cc_no_reorder_functions=yes],
659 [grub_cv_cc_no_reorder_functions=no])
663 if test x"$target_os" = xcygwin && test "x$grub_cv_cc_no_reorder_functions" = xyes; then
664 TARGET_CFLAGS="$TARGET_CFLAGS -fno-reorder-functions"
667 # By default, GCC 4.6 generates .eh_frame sections containing unwind
668 # information in some cases where it previously did not. GRUB doesn't need
669 # these and they just use up vital space. Restore the old compiler
671 AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [
672 CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
673 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
674 [grub_cv_cc_fno_asynchronous_unwind_tables=yes],
675 [grub_cv_cc_fno_asynchronous_unwind_tables=no])
678 if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then
679 TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables"
682 # For platforms where ELF is not the default link format.
683 case "${target_os}" in
685 # FIXME: put proper test here
686 NEED_REGISTER_FRAME_INFO=1
688 *) NEED_REGISTER_FRAME_INFO=0 ;;
692 AC_ARG_ENABLE([efiemu],
693 [AS_HELP_STRING([--enable-efiemu],
694 [build and install the efiemu runtimes (default=guessed)])])
695 if test x"$enable_efiemu" = xno ; then
696 efiemu_excuse="explicitly disabled"
698 if test x"$target_os" = xcygwin ; then
699 efiemu_excuse="not available on cygwin"
701 if test x"$target_cpu" != xi386 ; then
702 efiemu_excuse="only available on i386"
704 if test x"$platform" = xefi ; then
705 efiemu_excuse="not available on efi"
707 if test x"$efiemu_excuse" = x ; then
708 AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
709 CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone"
710 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
711 [grub_cv_cc_efiemu=yes],
712 [grub_cv_cc_efiemu=no])
714 if test x$grub_cv_cc_efiemu = xno; then
715 efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
718 if test x"$efiemu_excuse" = x ; then
719 AC_CACHE_CHECK([for efiemu64 linking format], [grub_cv_target_cc_efiemu64_link_format], [
720 grub_cv_target_cc_efiemu64_link_format=unknown
721 for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd -melf_x86_64_haiku -arch,x86_64; do
722 CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone"
723 LDFLAGS="-m64 -Wl,$format -nostdlib -static"
724 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
725 asm (".globl start; start:");
726 asm (".globl _start; _start:");
727 asm (".globl __start; __start:");
729 void __main (void) {}
730 ]], [[]])], [flag=1], [flag=0])
731 if test x"$flag" = x1; then
732 grub_cv_target_cc_efiemu64_link_format="$format"
736 if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then
737 efiemu_excuse="no suitable link format for efiemu64 found"
739 EFIEMU64_LINK_FORMAT="-Wl,$grub_cv_target_cc_efiemu64_link_format"
742 if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
743 AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
745 if test x"$efiemu_excuse" = x ; then
750 AC_SUBST([enable_efiemu])
751 AC_SUBST([EFIEMU64_LINK_FORMAT])
753 CFLAGS="$TARGET_CFLAGS"
755 if test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then
756 AC_CACHE_CHECK([for target linking format], [grub_cv_target_cc_link_format], [
757 grub_cv_target_cc_link_format=unknown
758 for format in -melf_${target_cpu} -melf_${target_cpu}_fbsd -melf_${target_cpu}_obsd -melf_${target_cpu}_haiku -m${target_cpu}pe -arch,${target_cpu}; do
759 if test x${target_cpu} != xi386 && test x$format = x${target_cpu}pe; then
762 CFLAGS="$TARGET_CFLAGS"
763 LDFLAGS="$TARGET_LDFLAGS -Wl,$format -nostdlib -static"
764 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
765 asm (".globl start; start:");
766 asm (".globl _start; _start:");
767 asm (".globl __start; __start:");
769 void __main (void) {}
770 ]], [[]])], [flag=1], [flag=0])
771 if test x"$flag" = x1; then
772 grub_cv_target_cc_link_format="$format"
776 if test x"$grub_cv_target_cc_link_format" = xunknown; then
777 AC_MSG_ERROR([no suitable link format found])
779 TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format"
780 if test x"$grub_cv_target_cc_link_format" = x-mi386pe; then
781 TARGET_OBJ2ELF='./build-grub-pe2elf';
785 if test x$grub_cv_target_cc_link_format = x-arch,i386 || test x$grub_cv_target_cc_link_format = x-arch,x86_64; then
786 TARGET_APPLE_LINKER=1
787 AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [objconv], [])
788 if test "x$TARGET_OBJCONV" = x ; then
789 AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [./objconv], [], [.])
791 if test "x$TARGET_OBJCONV" = x ; then
792 AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
795 TARGET_IMG_CFLAGS="-static"
796 TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
797 TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
798 TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
799 TARGET_LDFLAGS_OLDMAGIC=""
800 elif test x$grub_cv_target_cc_link_format = x-mi386pe && test x$platform = xpc; then
801 TARGET_APPLE_LINKER=0
802 TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
803 TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/i386-pc-cygwin-img-ld.sc"
804 TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
805 TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/i386-pc-cygwin-img-ld.sc"
806 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
809 TARGET_APPLE_LINKER=0
810 TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
812 TARGET_IMG_LDFLAGS='-Wl,-N'
813 TARGET_IMG_LDFLAGS_AC='-Wl,-N'
814 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
818 AC_SUBST(TARGET_LDFLAGS_OLDMAGIC)
821 LDFLAGS="$TARGET_LDFLAGS"
823 if test "$target_cpu" = x86_64; then
824 # Use large model to support 4G memory
825 AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
826 CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large"
827 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
828 [grub_cv_cc_mcmodel=yes],
829 [grub_cv_cc_mcmodel=no])
831 if test "x$grub_cv_cc_mcmodel" = xyes; then
832 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
836 if test "$target_cpu"-"$platform" = x86_64-efi; then
837 # EFI writes to stack below %rsp, we must not use the red zone
838 AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
839 CFLAGS="$TARGET_CFLAGS -m64 -mno-red-zone"
840 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
841 [grub_cv_cc_no_red_zone=yes],
842 [grub_cv_cc_no_red_zone=no])
844 if test "x$grub_cv_cc_no_red_zone" = xno; then
845 AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
848 TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
855 CFLAGS="$TARGET_CFLAGS"
857 # Position independent executable.
859 [# Need that, because some distributions ship compilers that include
860 # `-fPIE' in the default specs.
861 if [ x"$pie_possible" = xyes ]; then
862 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
865 CFLAGS="$TARGET_CFLAGS"
867 # Position independent executable.
869 [# On most platforms we don't want PIC as it only makes relocations harder
870 # and code less efficient. On mips we want to have one got table per module
871 # and reload $gp in every function.
872 # GCC implements it using symbol __gnu_local_gp in non-PIC as well.
873 # However with clang we need PIC for this reloading to happen.
874 # Since default varies across dictributions use either -fPIC or -fno-PIC
876 if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel ) && test "x$grub_cv_cc_target_clang" = xyes ; then
877 TARGET_CFLAGS="$TARGET_CFLAGS -fPIC"
878 elif [ x"$pic_possible" = xyes ]; then
879 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC"
882 CFLAGS="$TARGET_CFLAGS"
884 # Smashing stack protector.
885 grub_CHECK_STACK_PROTECTOR
886 # Need that, because some distributions ship compilers that include
887 # `-fstack-protector' in the default specs.
888 if test "x$ssp_possible" = xyes; then
889 TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
892 CFLAGS="$TARGET_CFLAGS"
894 grub_CHECK_STACK_ARG_PROBE
895 # Cygwin's GCC uses alloca() to probe the stackframe on static
896 # stack allocations above some threshold.
897 if test x"$sap_possible" = xyes; then
898 TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
901 CFLAGS="$TARGET_CFLAGS"
903 # -mno-unaligned-access -mstrict-align
904 if test "$target_cpu" = arm; then
905 AC_CACHE_CHECK([for compile options to get strict alignment], [grub_cv_target_cc_strict_align], [
906 grub_cv_target_cc_strict_align=
907 for arg in -mno-unaligned-access "-Xclang -mstrict-align" -mstrict-align; do
908 CFLAGS="$TARGET_CFLAGS $arg -Werror"
909 LDFLAGS="$TARGET_LDFLAGS"
910 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0])
911 if test x"$flag" = x1; then
912 grub_cv_target_cc_strict_align="$arg"
917 TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_strict_align"
918 if test x"$grub_cv_target_cc_strict_align" = x"-Xclang -mstrict-align"; then
919 TARGET_LDFLAGS="$TARGET_LDFLAGS -Qunused-arguments"
921 AC_CACHE_CHECK([if compiler generates unaligned accesses], [grub_cv_cc_target_emits_unaligned],
922 [CFLAGS="$TARGET_CFLAGS"
923 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
924 #ifdef __ARM_FEATURE_UNALIGNED
928 [grub_cv_cc_target_emits_unaligned=no], [grub_cv_cc_target_emits_unaligned=yes])])
929 if test x$grub_cv_cc_target_emits_unaligned = xyes; then
930 AC_MSG_ERROR([compiler generates unaligned accesses])
934 # Set them to their new values for the tests below.
936 if test "x$TARGET_APPLE_LINKER" = x1 ; then
937 CFLAGS="$TARGET_CFLAGS -nostdlib -static -Wno-error"
939 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
941 CPPFLAGS="$TARGET_CPPFLAGS"
942 if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test "x$grub_cv_cc_target_clang" = xyes ; then
948 LIBS="$TARGET_LIBGCC"
951 if test "x$TARGET_APPLE_LINKER" = x0 ; then
952 if test x$grub_cv_asm_uscore = xyes; then
953 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,_abort=_main"
955 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,abort=main"
959 # Check for libgcc symbols
960 AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x)
962 if test "x$TARGET_APPLE_LINKER" = x1 ; then
963 CFLAGS="$TARGET_CFLAGS -nostdlib -static"
965 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
969 # Defined in aclocal.m4.
971 if test "x$TARGET_APPLE_LINKER" != x1 ; then
972 grub_PROG_OBJCOPY_ABSOLUTE
974 grub_PROG_LD_BUILD_ID_NONE
975 if test "x$target_cpu" = xi386; then
976 if test "$platform" != emu && test "x$TARGET_APPLE_LINKER" != x1 ; then
977 if test ! -z "$TARGET_IMG_LDSCRIPT"; then
978 # Check symbols provided by linker script.
979 CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},0x8000 -Wl,--defsym,___main=0x8100"
981 grub_CHECK_BSS_START_SYMBOL
982 grub_CHECK_END_SYMBOL
984 CFLAGS="$TARGET_CFLAGS"
985 grub_I386_ASM_PREFIX_REQUIREMENT
991 grub_PROG_NM_DEFINED_ONLY
992 AC_SUBST(TARGET_NMFLAGS_MINUS_P)
993 AC_SUBST(TARGET_NMFLAGS_DEFINED_ONLY)
995 if test "$platform" != emu; then
996 AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
997 SAVED_CPPFLAGS="$CPPFLAGS"
998 CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
999 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
1001 int va_arg_func (int fixed, va_list args);]], [[]])],
1002 [grub_cv_cc_isystem=yes],
1003 [grub_cv_cc_isystem=no])
1004 CPPFLAGS="$SAVED_CPPFLAGS"
1007 if test x"$grub_cv_cc_isystem" = xyes ; then
1008 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
1012 AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [
1013 CFLAGS="$TARGET_CFLAGS -Wtrampolines -Werror"
1014 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
1015 int va_arg_func (int fixed, va_list args);]], [[]])],
1016 [grub_cv_cc_wtrampolines=yes],
1017 [grub_cv_cc_wtrampolines=no])
1020 if test x"$grub_cv_cc_wtrampolines" = xyes ; then
1021 TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines"
1024 # Restore the flags.
1026 CFLAGS="$tmp_CFLAGS"
1027 CPPFLAGS="$tmp_CPPFLAGS"
1028 LDFLAGS="$tmp_LDFLAGS"
1032 # Check for options.
1035 # Memory manager debugging.
1036 AC_ARG_ENABLE([mm-debug],
1037 AS_HELP_STRING([--enable-mm-debug],
1038 [include memory manager debugging]),
1039 [AC_DEFINE([MM_DEBUG], [1],
1040 [Define to 1 if you enable memory manager debugging.])])
1042 AC_ARG_ENABLE([cache-stats],
1043 AS_HELP_STRING([--enable-cache-stats],
1044 [enable disk cache statistics collection]))
1046 if test x$enable_cache_stats = xyes; then
1051 AC_SUBST([DISK_CACHE_STATS])
1053 AC_ARG_ENABLE([boot-time],
1054 AS_HELP_STRING([--enable-boot-time],
1055 [enable boot time statistics collection]))
1057 if test x$enable_boot_time = xyes; then
1062 AC_SUBST([BOOT_TIME_STATS])
1064 AC_ARG_ENABLE([grub-emu-usb],
1065 [AS_HELP_STRING([--enable-grub-emu-usb],
1066 [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
1068 AC_ARG_ENABLE([grub-emu-sdl],
1069 [AS_HELP_STRING([--enable-grub-emu-sdl],
1070 [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])])
1072 AC_ARG_ENABLE([grub-emu-pci],
1073 [AS_HELP_STRING([--enable-grub-emu-pci],
1074 [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
1076 if test "$platform" = emu; then
1078 if test x"$enable_grub_emu_usb" != xyes ; then
1079 grub_emu_usb_excuse="not enabled"
1082 if test x"$enable_grub_emu_pci" = xyes ; then
1083 grub_emu_usb_excuse="conflicts with PCI support"
1086 [if [ x"$grub_emu_usb_excuse" = x ]; then
1087 # Check for libusb libraries.]
1088 AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
1089 [grub_emu_usb_excuse=["need libusb library"]])
1092 [if [ x"$grub_emu_usb_excuse" = x ]; then
1093 # Check for headers.]
1094 AC_CHECK_HEADERS([usb.h], [],
1095 [grub_emu_usb_excuse=["need libusb headers"]])
1097 if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
1098 AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
1100 if test x"$grub_emu_usb_excuse" = x ; then
1101 enable_grub_emu_usb=yes
1103 enable_grub_emu_usb=no
1106 if test x"$enable_grub_emu_sdl" = xno ; then
1107 grub_emu_sdl_excuse="explicitely disabled"
1109 [if [ x"$grub_emu_sdl_excuse" = x ]; then
1110 # Check for libSDL libraries.]
1111 AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
1112 [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]])
1116 [if [ x"$grub_emu_sdl_excuse" = x ]; then
1117 # Check for headers.]
1118 AC_CHECK_HEADERS([SDL/SDL.h], [],
1119 [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]])
1122 if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
1123 AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled])
1125 if test x"$grub_emu_sdl_excuse" = x ; then
1126 enable_grub_emu_sdl=yes
1128 enable_grub_emu_sdl=no
1131 if test x"$enable_grub_emu_pci" != xyes ; then
1132 grub_emu_pci_excuse="not enabled"
1135 if test x"$enable_grub_emu_usb" = xyes ; then
1136 grub_emu_pci_excuse="conflicts with USB support"
1139 [if [ x"$grub_emu_pci_excuse" = x ]; then
1140 # Check for libpci libraries.]
1141 AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"],
1142 [grub_emu_pci_excuse=["need libpciaccess library"]])
1143 AC_SUBST([LIBPCIACCESS])
1145 [if [ x"$grub_emu_pci_excuse" = x ]; then
1146 # Check for headers.]
1147 AC_CHECK_HEADERS([pci/pci.h], [],
1148 [grub_emu_pci_excuse=["need libpciaccess headers"]])
1151 if test x"$grub_emu_pci_excuse" = x ; then
1152 enable_grub_emu_pci=yes
1155 enable_grub_emu_pci=no
1158 AC_SUBST([enable_grub_emu_sdl])
1159 AC_SUBST([enable_grub_emu_usb])
1160 AC_SUBST([enable_grub_emu_pci])
1164 # Ignore --enable-emu-* if platform is not emu
1165 enable_grub_emu_sdl=no
1166 enable_grub_emu_usb=no
1167 enable_grub_emu_pci=no
1170 AC_ARG_ENABLE([grub-mkfont],
1171 [AS_HELP_STRING([--enable-grub-mkfont],
1172 [build and install the `grub-mkfont' utility (default=guessed)])])
1173 if test x"$enable_grub_mkfont" = xno ; then
1174 grub_mkfont_excuse="explicitly disabled"
1177 if test x"$grub_mkfont_excuse" = x ; then
1178 # Check for freetype libraries.
1179 AC_CHECK_TOOLS([FREETYPE], [freetype-config])
1180 if test "x$FREETYPE" = x ; then
1181 grub_mkfont_excuse=["need freetype2 library"]
1185 unset ac_cv_header_ft2build_h
1187 if test x"$grub_mkfont_excuse" = x ; then
1188 # Check for freetype libraries.
1189 freetype_cflags=`$FREETYPE --cflags`
1190 freetype_libs=`$FREETYPE --libs`
1191 SAVED_CPPFLAGS="$CPPFLAGS"
1192 CPPFLAGS="$CPPFLAGS $freetype_cflags"
1193 AC_CHECK_HEADERS([ft2build.h], [],
1194 [grub_mkfont_excuse=["need freetype2 headers"]])
1195 CPPFLAGS="$SAVED_CPPFLAGS"
1198 if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
1199 AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
1201 if test x"$grub_mkfont_excuse" = x ; then
1202 enable_grub_mkfont=yes
1204 enable_grub_mkfont=no
1206 AC_SUBST([enable_grub_mkfont])
1207 AC_SUBST([freetype_cflags])
1208 AC_SUBST([freetype_libs])
1212 SAVED_CFLAGS="$CFLAGS"
1213 SAVED_CPPFLAGS="$CPPFLAGS"
1216 CFLAGS="$BUILD_CFLAGS"
1217 CPPFLAGS="$BUILD_CPPFLAGS"
1219 unset ac_cv_c_bigendian
1220 unset ac_cv_header_ft2build_h
1222 AC_COMPUTE_INT([BUILD_SIZEOF_VOID_P], [sizeof (void *)])
1223 AC_COMPUTE_INT([BUILD_SIZEOF_LONG], [sizeof (long)])
1224 AC_C_BIGENDIAN([BUILD_WORDS_BIGENDIAN=1], [BUILD_WORDS_BIGENDIAN=0], [BUILD_WORDS_BIGENDIAN=err], [BUILD_WORDS_BIGENDIAN=err])
1226 if test x$BUILD_WORDS_BIGENDIAN = xerr ; then
1227 AC_MSG_ERROR([couldnt determine build endianness])
1230 AC_SUBST([BUILD_SIZEOF_LONG])
1231 AC_SUBST([BUILD_SIZEOF_VOID_P])
1232 AC_SUBST([BUILD_WORDS_BIGENDIAN])
1234 if test x"$grub_build_mkfont_excuse" = x ; then
1235 # Check for freetype libraries.
1236 AC_CHECK_PROGS([BUILD_FREETYPE], [freetype-config])
1237 if test "x$BUILD_FREETYPE" = x ; then
1238 grub_build_mkfont_excuse=["need freetype2 library"]
1242 if test x"$grub_build_mkfont_excuse" = x ; then
1243 # Check for freetype libraries.
1244 build_freetype_cflags=`$BUILD_FREETYPE --cflags`
1245 build_freetype_libs=`$BUILD_FREETYPE --libs`
1246 SAVED_CPPFLAGS_2="$CPPFLAGS"
1247 CPPFLAGS="$CPPFLAGS $build_freetype_cflags"
1248 AC_CHECK_HEADERS([ft2build.h], [],
1249 [grub_build_mkfont_excuse=["need freetype2 headers"]])
1250 CPPFLAGS="$SAVED_CPPFLAGS_2"
1253 if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then
1254 AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled])
1256 if test x"$grub_build_mkfont_excuse" = x ; then
1257 enable_build_grub_mkfont=yes
1259 enable_build_grub_mkfont=no
1261 if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 ); then
1262 AC_MSG_ERROR([qemu, powerpc-ieee1275 and loongson ports needs build-time grub-mkfont])
1265 AC_SUBST([build_freetype_cflags])
1266 AC_SUBST([build_freetype_libs])
1270 CFLAGS="$SAVED_CFLAGS"
1271 CPPFLAGS="$SAVED_CPPFLAGS"
1278 AC_ARG_ENABLE([grub-themes],
1279 [AS_HELP_STRING([--enable-grub-themes],
1280 [build and install GRUB themes (default=guessed)])])
1281 if test x"$enable_grub_themes" = xno ; then
1282 starfield_excuse="explicitly disabled"
1285 if test x"$starfield_excuse" = x && test x"$enable_build_grub_mkfont" = xno ; then
1286 starfield_excuse="No build-time grub-mkfont"
1289 if test x"$starfield_excuse" = x; then
1290 for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
1291 for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do
1292 if test -f "$dir/DejaVuSans.$ext"; then
1293 DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext"
1299 if test "x$DJVU_FONT_SOURCE" = x; then
1300 starfield_excuse="No DejaVu found"
1304 if test x"$enable_grub_themes" = xyes && test x"$starfield_excuse" != x; then
1305 AC_MSG_ERROR([themes were explicitly requested but requirements are not satisfied])
1308 AC_SUBST([DJVU_FONT_SOURCE])
1312 for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
1313 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
1314 if test -f "$dir/unifont.$ext"; then
1315 FONT_SOURCE="$dir/unifont.$ext"
1321 if test x"$enable_build_grub_mkfont" = xno ; then
1325 if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 ); then
1326 AC_MSG_ERROR([qemu, powerpc-ieee1275 and loongson ports need unifont])
1329 AC_SUBST([FONT_SOURCE])
1331 if test x"$FONT_SOURCE" = x && test x"$DJVU_FONT_SOURCE" = x && test x"$grub_build_mkfont_excuse" = x; then
1332 grub_build_mkfont_excuse="no fonts"
1336 AC_ARG_ENABLE([grub-mount],
1337 [AS_HELP_STRING([--enable-grub-mount],
1338 [build and install the `grub-mount' utility (default=guessed)])])
1339 if test x"$enable_grub_mount" = xno ; then
1340 grub_mount_excuse="explicitly disabled"
1343 if test x"$grub_mount_excuse" = x ; then
1344 AC_CHECK_LIB([fuse], [fuse_main_real], [],
1345 [grub_mount_excuse="need FUSE library"])
1348 if test x"$grub_mount_excuse" = x ; then
1349 # Check for fuse headers.
1350 SAVED_CPPFLAGS="$CPPFLAGS"
1351 CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26"
1352 AC_CHECK_HEADERS([fuse/fuse.h], [],
1353 [grub_mount_excuse=["need FUSE headers"]])
1354 CPPFLAGS="$SAVED_CPPFLAGS"
1357 if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then
1358 AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled])
1360 if test x"$grub_mount_excuse" = x ; then
1361 enable_grub_mount=yes
1363 enable_grub_mount=no
1365 AC_SUBST([enable_grub_mount])
1367 AC_ARG_ENABLE([device-mapper],
1368 [AS_HELP_STRING([--enable-device-mapper],
1369 [enable Linux device-mapper support (default=guessed)])])
1370 if test x"$enable_device_mapper" = xno ; then
1371 device_mapper_excuse="explicitly disabled"
1374 if test x"$device_mapper_excuse" = x ; then
1375 # Check for device-mapper header.
1376 AC_CHECK_HEADER([libdevmapper.h], [],
1377 [device_mapper_excuse="need libdevmapper header"])
1380 if test x"$device_mapper_excuse" = x ; then
1381 # Check for device-mapper library.
1382 AC_CHECK_LIB([devmapper], [dm_task_create], [],
1383 [device_mapper_excuse="need devmapper library"])
1386 if test x"$device_mapper_excuse" = x ; then
1387 # Check for device-mapper library.
1388 AC_CHECK_LIB([devmapper], [dm_log_with_errno_init],
1390 [device_mapper_excuse="need devmapper library"])
1393 if test x"$device_mapper_excuse" = x ; then
1394 LIBDEVMAPPER="-ldevmapper";
1395 AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
1396 [Define to 1 if you have the devmapper library.])
1399 AC_SUBST([LIBDEVMAPPER])
1402 if test x$host_kernel = xkfreebsd; then
1403 AC_CHECK_LIB([geom], [geom_gettree], [],
1404 [AC_MSG_ERROR([Your platform requires libgeom])])
1410 AC_ARG_ENABLE([liblzma],
1411 [AS_HELP_STRING([--enable-liblzma],
1412 [enable liblzma integration (default=guessed)])])
1413 if test x"$enable_liblzma" = xno ; then
1414 liblzma_excuse="explicitly disabled"
1417 if test x"$liblzma_excuse" = x ; then
1418 AC_CHECK_LIB([lzma], [lzma_code],
1419 [],[liblzma_excuse="need lzma library"])
1421 if test x"$liblzma_excuse" = x ; then
1422 AC_CHECK_HEADER([lzma.h], [], [liblzma_excuse="need lzma header"])
1425 if test x"$enable_liblzma" = xyes && test x"$liblzma_excuse" != x ; then
1426 AC_MSG_ERROR([liblzma support was explicitly requested but requirements are not satisfied])
1430 if test x"$liblzma_excuse" = x ; then
1432 AC_DEFINE([USE_LIBLZMA], [1],
1433 [Define to 1 if you have the LZMA library.])
1438 AC_ARG_ENABLE([libzfs],
1439 [AS_HELP_STRING([--enable-libzfs],
1440 [enable libzfs integration (default=guessed)])])
1441 if test x"$enable_libzfs" = xno ; then
1442 libzfs_excuse="explicitly disabled"
1445 if test x"$libzfs_excuse" = x ; then
1446 # Only check for system headers if libzfs support has not been disabled.
1447 AC_CHECK_HEADERS(libzfs.h libnvpair.h)
1450 if test x"$libzfs_excuse" = x ; then
1451 AC_CHECK_LIB([zfs], [libzfs_init],
1453 [libzfs_excuse="need zfs library"])
1456 if test x"$libzfs_excuse" = x ; then
1457 AC_CHECK_LIB([nvpair], [nvlist_lookup_string],
1459 [libzfs_excuse="need nvpair library"])
1462 if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then
1463 AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied])
1466 if test x"$libzfs_excuse" = x ; then
1467 # We need both libzfs and libnvpair for a successful build.
1469 AC_DEFINE([HAVE_LIBZFS], [1],
1470 [Define to 1 if you have the ZFS library.])
1471 LIBNVPAIR="-lnvpair"
1472 AC_DEFINE([HAVE_LIBNVPAIR], [1],
1473 [Define to 1 if you have the NVPAIR library.])
1477 AC_SUBST([LIBNVPAIR])
1481 AC_SUBST([FONT_SOURCE])
1482 AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
1483 [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
1485 AC_SUBST(HAVE_ASM_USCORE)
1488 AC_SUBST(BSS_START_SYMBOL)
1489 AC_SUBST(END_SYMBOL)
1492 AC_SUBST(NEED_REGISTER_FRAME_INFO)
1494 AC_ARG_ENABLE([werror],
1495 [AS_HELP_STRING([--disable-werror],
1496 [do not use -Werror when building GRUB])])
1497 if test x"$enable_werror" != xno ; then
1498 TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
1499 HOST_CFLAGS="$HOST_CFLAGS -Werror"
1502 if test "x$grub_cv_cc_target_clang" = xno; then
1503 TARGET_LDFLAGS_STATIC_LIBGCC="-static-libgcc"
1505 TARGET_LDFLAGS_STATIC_LIBGCC=
1508 TARGET_CPP="$TARGET_CC -E"
1509 TARGET_CCAS=$TARGET_CC
1511 GRUB_TARGET_CPU="${target_cpu}"
1512 GRUB_PLATFORM="${platform}"
1514 AC_SUBST(GRUB_TARGET_CPU)
1515 AC_SUBST(GRUB_PLATFORM)
1517 AC_SUBST(TARGET_OBJCONV)
1518 AC_SUBST(TARGET_LIBGCC)
1519 AC_SUBST(TARGET_LDFLAGS_STATIC_LIBGCC)
1520 AC_SUBST(TARGET_CPP)
1521 AC_SUBST(TARGET_CCAS)
1522 AC_SUBST(TARGET_OBJ2ELF)
1523 AC_SUBST(TARGET_MODULE_FORMAT)
1525 AC_SUBST(TARGET_CFLAGS)
1526 AC_SUBST(TARGET_LDFLAGS)
1527 AC_SUBST(TARGET_CPPFLAGS)
1528 AC_SUBST(TARGET_CCASFLAGS)
1530 AC_SUBST(TARGET_IMG_LDSCRIPT)
1531 AC_SUBST(TARGET_IMG_LDFLAGS)
1532 AC_SUBST(TARGET_IMG_CFLAGS)
1533 AC_SUBST(TARGET_IMG_BASE_LDOPT)
1534 AC_SUBST(TARGET_APPLE_LINKER)
1536 AC_SUBST(HOST_CFLAGS)
1537 AC_SUBST(HOST_LDFLAGS)
1538 AC_SUBST(HOST_CPPFLAGS)
1539 AC_SUBST(HOST_CCASFLAGS)
1541 AC_SUBST(BUILD_LIBM)
1544 # Automake conditionals
1547 AM_CONDITIONAL([COND_emu], [test x$platform = xemu])
1548 AM_CONDITIONAL([COND_clang], [test x$grub_cv_cc_target_clang = xyes])
1549 AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc])
1550 AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi])
1551 AM_CONDITIONAL([COND_ia64_efi], [test x$target_cpu = xia64 -a x$platform = xefi])
1552 AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu])
1553 AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275])
1554 AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
1555 AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
1556 AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
1557 AM_CONDITIONAL([COND_i386_xen], [test x$target_cpu = xi386 -a x$platform = xxen])
1558 AM_CONDITIONAL([COND_x86_64_xen], [test x$target_cpu = xx86_64 -a x$platform = xxen])
1559 AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
1560 AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
1561 AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc])
1562 AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
1563 AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
1564 AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
1565 AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
1566 AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
1567 AM_CONDITIONAL([COND_arm], [test x$target_cpu = xarm ])
1568 AM_CONDITIONAL([COND_arm_uboot], [test x$target_cpu = xarm -a x$platform = xuboot])
1569 AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi])
1570 AM_CONDITIONAL([COND_arm64], [test x$target_cpu = xarm64 ])
1571 AM_CONDITIONAL([COND_arm64_efi], [test x$target_cpu = xarm64 -a x$platform = xefi])
1573 AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
1574 AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
1575 AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
1576 AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
1577 AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
1578 AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu])
1579 AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos])
1581 AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
1582 AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
1583 AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
1584 AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
1585 AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
1586 AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes])
1587 AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
1588 if test x$FONT_SOURCE != x ; then
1593 AC_SUBST(HAVE_FONT_SOURCE)
1594 AM_CONDITIONAL([COND_APPLE_LINKER], [test x$TARGET_APPLE_LINKER = x1])
1595 AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
1596 AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1])
1597 AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1])
1599 AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes])
1601 AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
1602 AM_CONDITIONAL([COND_CYGWIN], [test x$target_os = xcygwin])
1603 AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x])
1604 AM_CONDITIONAL([COND_HAVE_EXEC], [test "x$have_exec" = xy])
1606 test "x$prefix" = xNONE && prefix="$ac_default_prefix"
1607 test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
1608 datarootdir="$(eval echo "$datarootdir")"
1609 grub_libdir="$(eval echo "$libdir")"
1610 grub_localedir="$(eval echo "$localedir")"
1611 grub_datadir="$(eval echo "$datadir")"
1612 grub_sysconfdir="$(eval echo "$sysconfdir")"
1613 AC_DEFINE_UNQUOTED(LOCALEDIR, "$grub_localedir", [Locale dir])
1614 AC_DEFINE_UNQUOTED(GRUB_LIBDIR, "$grub_libdir", [Library dir])
1615 AC_DEFINE_UNQUOTED(GRUB_DATADIR, "$grub_datadir", [Data dir])
1616 AC_DEFINE_UNQUOTED(GRUB_SYSCONFDIR, "$grub_sysconfdir", [Configuration dir])
1620 cpudir="${target_cpu}"
1621 if test x${cpudir} = xmipsel; then
1625 if test x"$link_dir" = xyes ; then
1626 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir])
1627 if test "$platform" != emu ; then
1628 AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform])
1631 mkdir -p include/grub 2>/dev/null
1632 rm -rf include/grub/cpu
1633 cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null
1634 if test "$platform" != emu ; then
1635 rm -rf include/grub/machine
1636 cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null
1640 AC_CONFIG_FILES([Makefile])
1641 AC_CONFIG_FILES([grub-core/Makefile])
1642 AC_CONFIG_FILES([grub-core/gnulib/Makefile])
1643 AC_CONFIG_FILES([po/Makefile.in])
1644 AC_CONFIG_FILES([docs/Makefile])
1645 AC_CONFIG_FILES([util/bash-completion.d/Makefile])
1646 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
1647 AC_CONFIG_FILES([config.h])
1651 echo "*******************************************************"
1652 echo GRUB2 will be compiled with following components:
1653 echo Platform: "$target_cpu"-"$platform"
1654 if [ x"$platform" = xemu ]; then
1655 if [ x"$grub_emu_usb_excuse" = x ]; then
1656 echo USB support for grub-emu: Yes
1658 echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
1660 if [ x"$grub_emu_sdl_excuse" = x ]; then
1661 echo SDL support for grub-emu: Yes
1663 echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)"
1665 if [ x"$grub_emu_pci_excuse" = x ]; then
1666 echo PCI support for grub-emu: Yes
1668 echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
1671 if test x"$device_mapper_excuse" = x ; then
1672 echo With devmapper support: Yes
1674 echo With devmapper support: No "($device_mapper_excuse)"
1676 if [ x"$enable_mm_debug" = xyes ]; then
1677 echo With memory debugging: Yes
1679 echo With memory debugging: No
1681 if [ x"$enable_cache_stats" = xyes ]; then
1682 echo With disk cache statistics: Yes
1684 echo With disk cache statistics: No
1687 if [ x"$enable_boot_time" = xyes ]; then
1688 echo With boot time statistics: Yes
1690 echo With boot time statistics: No
1693 if [ x"$efiemu_excuse" = x ]; then
1694 echo efiemu runtime: Yes
1696 echo efiemu runtime: No "($efiemu_excuse)"
1698 if [ x"$grub_mkfont_excuse" = x ]; then
1699 echo grub-mkfont: Yes
1701 echo grub-mkfont: No "($grub_mkfont_excuse)"
1703 if [ x"$grub_mount_excuse" = x ]; then
1704 echo grub-mount: Yes
1706 echo grub-mount: No "($grub_mount_excuse)"
1708 if [ x"$starfield_excuse" = x ]; then
1709 echo starfield theme: Yes
1711 echo starfield theme: No "($starfield_excuse)"
1713 if [ x"$libzfs_excuse" = x ]; then
1714 echo With libzfs support: Yes
1716 echo With libzfs support: No "($libzfs_excuse)"
1718 if [ x"$grub_build_mkfont_excuse" = x ]; then
1719 echo Build-time grub-mkfont: Yes
1720 if test "x$FONT_SOURCE" = x ; then
1721 echo "Without unifont"
1723 echo "With unifont from $FONT_SOURCE"
1726 echo Build-time grub-mkfont: No "($grub_build_mkfont_excuse)"
1727 echo "Without unifont (no build-time grub-mkfont)"
1729 if test x"$liblzma_excuse" != x ; then
1730 echo "Without liblzma (no support for XZ-compressed mips images) ($liblzma_excuse)"
1732 echo "With liblzma from $LIBLZMA (support for XZ-compressed mips images)"
1734 echo "*******************************************************"