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.
48 AC_CONFIG_SRCDIR([include/grub/dl.h])
49 AC_CONFIG_HEADER([config-util.h])
51 # Program name transformations
53 grub_TRANSFORM([grub-bios-setup])
54 grub_TRANSFORM([grub-editenv])
55 grub_TRANSFORM([grub-install])
56 grub_TRANSFORM([grub-mkconfig])
57 grub_TRANSFORM([grub-mkfont])
58 grub_TRANSFORM([grub-mkimage])
59 grub_TRANSFORM([grub-mklayout])
60 grub_TRANSFORM([grub-mkpasswd-pbkdf2])
61 grub_TRANSFORM([grub-mkrelpath])
62 grub_TRANSFORM([grub-mkrescue])
63 grub_TRANSFORM([grub-probe])
64 grub_TRANSFORM([grub-reboot])
65 grub_TRANSFORM([grub-script-check])
66 grub_TRANSFORM([grub-set-default])
67 grub_TRANSFORM([grub-sparc64-setup])
69 # Optimization flag. Allow user to override.
70 if test "x$TARGET_CFLAGS" = x; then
71 TARGET_CFLAGS="$TARGET_CFLAGS -Os"
74 # Default HOST_CPPFLAGS
75 HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
76 HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
77 HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1"
78 HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_LIBDIR=\\\"\$(pkglibdir)\\\""
79 HOST_CPPFLAGS="$HOST_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\""
81 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W"
82 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include"
83 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include"
86 i[[3456]]86) target_cpu=i386 ;;
87 amd64) target_cpu=x86_64 ;;
88 sparc) target_cpu=sparc64 ;;
91 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1";
95 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1";
99 # Specify the platform (such as firmware).
100 AC_ARG_WITH([platform],
101 AS_HELP_STRING([--with-platform=PLATFORM],
102 [select the host platform [[guessed]]]))
104 # Guess the platform if not specified.
105 if test "x$with_platform" = x; then
106 case "$target_cpu"-"$target_vendor" in
107 i386-apple) platform=efi ;;
108 i386-*) platform=pc ;;
109 x86_64-apple) platform=efi ;;
110 x86_64-*) platform=pc ;;
111 powerpc-*) platform=ieee1275 ;;
112 powerpc64-*) platform=ieee1275 ;;
113 sparc64-*) platform=ieee1275 ;;
114 mipsel-*) platform=loongson ;;
115 mips-*) platform=arc ;;
116 ia64-*) platform=efi ;;
117 *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
120 platform="$with_platform"
123 case "$target_cpu"-"$platform" in
126 x86_64-*) target_cpu=i386 ;;
127 powerpc64-ieee1275) target_cpu=powerpc ;;
130 # Check if the platform is supported, make final adjustments.
131 case "$target_cpu"-"$platform" in
137 i386-linuxbios) platform=coreboot ;;
144 mips-qemu-mips) platform=qemu_mips;;
147 mipsel-qemu-mips) platform=qemu_mips;;
148 mipsel-yeeloong) platform=loongson ;;
149 mipsel-fuloong) platform=loongson ;;
152 *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
155 case "$target_cpu" in
156 i386 | powerpc) target_m32=1 ;;
157 x86_64 | sparc64) target_m64=1 ;;
161 mingw32*) host_os=cygwin ;;
164 # This normalizes the names, and creates a new variable ("host_kernel")
165 # while at it, since the mapping is not always 1:1 (e.g. different OSes
166 # using the same kernel type).
168 gnu*) host_kernel=hurd ;;
169 linux*) host_kernel=linux ;;
170 freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;;
171 netbsd*) host_kernel=netbsd ;;
172 solaris*) host_kernel=illumos ;;
173 darwin*) host_kernel=xnu ;;
174 cygwin) host_kernel=windows ;;
178 coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;;
179 multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;;
180 efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;;
181 ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;;
182 qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
183 pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
184 emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
185 loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
186 qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
187 arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
189 case "$target_cpu" in
190 mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
191 sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
193 if test x${target_cpu} = xmipsel ; then
194 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
196 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"
199 TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
203 AC_SUBST(host_kernel)
208 # Define default variables
211 AC_ARG_WITH([bootdir],
212 AS_HELP_STRING([--with-bootdir=DIR],
213 [set the name of /boot directory [[guessed]]]),
214 [have_with_bootdir=y],
215 [have_with_bootdir=n])
216 if test x$have_with_bootdir = xy; then
217 bootdirname="$with_bootdir"
221 # Because /boot is used for the boot block in NetBSD and OpenBSD,
223 *) bootdirname='boot' ;;
227 AC_SUBST(bootdirname)
228 AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname",
229 [Default boot directory name]")
231 AC_ARG_WITH([grubdir],
232 AS_HELP_STRING([--with-grubdir=DIR],
233 [set the name of grub directory [[guessed]]]),
234 [grubdirname="$with_grubdir"],
235 [grubdirname="$PACKAGE"])
237 AC_SUBST(grubdirname)
238 AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
239 [Default grub directory name])
242 # Checks for build programs.
245 # Although cmp is listed in the GNU Coding Standards as a command which
246 # can used directly, OpenBSD lacks cmp in the default installation.
247 AC_CHECK_PROGS([CMP], [cmp])
248 if test "x$CMP" = x; then
249 AC_MSG_ERROR([cmp is not found])
252 AC_CHECK_PROGS([YACC], [bison])
253 if test "x$YACC" = x; then
254 AC_MSG_ERROR([bison is not found])
259 for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
260 for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni; do
261 if test -f "$dir/unifont.$ext"; then
262 FONT_SOURCE="$dir/unifont.$ext"
268 if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips); then
269 AC_MSG_ERROR([qemu and loongson ports need unifont])
272 AC_SUBST([FONT_SOURCE])
283 if test "x$LEX" = "x:"; then
284 AC_MSG_ERROR([flex is not found])
286 version=`$LEX --version | $AWK '{ split($NF,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'`
287 if test -n "$version" -a "$version" -ge 20535; then
290 AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above])
294 # These are not a "must".
295 AC_PATH_PROGS(MAKEINFO, makeinfo true)
298 # Checks for host programs.
307 test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
310 AM_GNU_GETTEXT([external])
313 # Identify characteristics of the host architecture.
315 AC_CHECK_SIZEOF(void *)
316 AC_CHECK_SIZEOF(long)
319 if test x$grub_cv_apple_cc = xyes ; then
320 HOST_CPPFLAGS="$HOST_CPPFLAGS -fnested-functions"
321 HOST_LDFLAGS="$HOST_LDFLAGS -Wl,-allow_stack_execute"
324 if test x$USE_NLS = xno; then
325 HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext"
328 if test "x$cross_compiling" = xyes; then
329 AC_MSG_WARN([cannot generate manual pages while cross compiling])
331 AC_PATH_PROG(HELP2MAN, help2man)
334 # Check for functions and headers.
335 AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
336 AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
338 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
339 #include <sys/param.h>
340 #include <sys/mount.h>])
342 AC_CHECK_MEMBERS([struct statfs.f_mntfromname],,,[$ac_includes_default
343 #include <sys/param.h>
344 #include <sys/mount.h>])
346 # For opendisk() and getrawpartition() on NetBSD.
347 # Used in util/deviceiter.c and in util/hostdisk.c.
348 AC_CHECK_HEADER([util.h], [
349 AC_CHECK_LIB([util], [opendisk], [
351 AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used])
353 AC_CHECK_LIB([util], [getrawpartition], [
355 AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition() in -lutil can be used])
360 AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
361 SAVED_CFLAGS="$CFLAGS"
362 CFLAGS="$HOST_CFLAGS -Wtrampolines"
363 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
364 int va_arg_func (int fixed, va_list args);]], [[]])],
365 [grub_cv_host_cc_wtrampolines=yes],
366 [grub_cv_host_cc_wtrampolines=no])
367 CFLAGS="$SAVED_CFLAGS"
370 if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then
371 HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines"
375 # Check for host and build compilers.
378 AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
379 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
385 # Check for target programs.
388 # Find tools for the target.
389 if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
390 tmp_ac_tool_prefix="$ac_tool_prefix"
391 ac_tool_prefix=$target_alias-
393 AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
394 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
395 AC_CHECK_TOOL(OBJCOPY, objcopy)
396 AC_CHECK_TOOL(STRIP, strip)
397 AC_CHECK_TOOL(NM, nm)
399 ac_tool_prefix="$tmp_ac_tool_prefix"
401 if test "x$TARGET_CC" = x; then
404 AC_CHECK_TOOL(OBJCOPY, objcopy)
405 AC_CHECK_TOOL(STRIP, strip)
406 AC_CHECK_TOOL(NM, nm)
412 # Test the C compiler for the target environment.
415 tmp_LDFLAGS="$LDFLAGS"
416 tmp_CPPFLAGS="$CPPFLAGS"
419 CFLAGS="$TARGET_CFLAGS"
420 CPPFLAGS="$TARGET_CPPFLAGS"
421 LDFLAGS="$TARGET_LDFLAGS"
425 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"
426 HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
427 TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
428 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
430 # Force no alignment to save space on i386.
431 if test "x$target_cpu" = xi386; then
432 AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
433 CFLAGS="$CFLAGS -falign-loops=1"
434 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
435 [grub_cv_cc_falign_loop=yes],
436 [grub_cv_cc_falign_loop=no])
439 if test "x$grub_cv_cc_falign_loop" = xyes; then
440 TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
442 TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
445 # Some toolchains enable these features by default, but they need
446 # registers that aren't set up properly in GRUB.
447 TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
450 # By default, GCC 4.4 generates .eh_frame sections containing unwind
451 # information in some cases where it previously did not. GRUB doesn't need
452 # these and they just use up vital space. Restore the old compiler
454 AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
455 SAVE_CFLAGS="$CFLAGS"
456 CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
457 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
458 [grub_cv_cc_fno_dwarf2_cfi_asm=yes],
459 [grub_cv_cc_fno_dwarf2_cfi_asm=no])
460 CFLAGS="$SAVE_CFLAGS"
463 if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
464 TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
467 # By default, GCC 4.6 generates .eh_frame sections containing unwind
468 # information in some cases where it previously did not. GRUB doesn't need
469 # these and they just use up vital space. Restore the old compiler
471 AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [
472 SAVE_CFLAGS="$CFLAGS"
473 CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
474 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
475 [grub_cv_cc_fno_asynchronous_unwind_tables=yes],
476 [grub_cv_cc_fno_asynchronous_unwind_tables=no])
477 CFLAGS="$SAVE_CFLAGS"
480 if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then
481 TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables"
485 if test x$grub_cv_apple_target_cc = xyes ; then
486 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -fnested-functions"
488 CFLAGS="$CFLAGS -fnested-functions"
490 AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
491 if test "x$OBJCONV" = x ; then
492 AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.])
494 if test "x$OBJCONV" = x ; then
495 AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
498 TARGET_IMG_CFLAGS="-static"
499 TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
500 TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
501 TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
502 TARGET_LDFLAGS_OLDMAGIC=""
505 TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
506 # Use linker script if present, otherwise use builtin -N script.
507 if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
508 TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
509 TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
510 TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
511 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
514 TARGET_IMG_LDFLAGS='-Wl,-N'
515 TARGET_IMG_LDFLAGS_AC='-Wl,-N'
516 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
521 AC_SUBST(TARGET_LDFLAGS_OLDMAGIC)
523 # For platforms where ELF is not the default link format.
524 AC_MSG_CHECKING([for command to convert module to ELF format])
526 cygwin) TARGET_OBJ2ELF='$(top_builddir)/grub-pe2elf';
527 # FIXME: put proper test here
528 NEED_REGISTER_FRAME_INFO=1
530 *) NEED_REGISTER_FRAME_INFO=0 ;;
532 AC_MSG_RESULT([$TARGET_OBJ2ELF])
535 AC_ARG_ENABLE([efiemu],
536 [AS_HELP_STRING([--enable-efiemu],
537 [build and install the efiemu runtimes (default=guessed)])])
538 if test x"$enable_efiemu" = xno ; then
539 efiemu_excuse="explicitly disabled"
541 if test x"$target_cpu" != xi386 ; then
542 efiemu_excuse="only available on i386"
544 if test x"$platform" = xefi ; then
545 efiemu_excuse="not available on efi"
547 if test x"$efiemu_excuse" = x ; then
548 AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
549 SAVED_CFLAGS="$CFLAGS"
550 CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
551 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
552 [grub_cv_cc_efiemu=yes],
553 [grub_cv_cc_efiemu=no])
554 CFLAGS="$SAVED_CFLAGS"
556 if test x$grub_cv_cc_efiemu = xno; then
557 efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
560 if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
561 AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
563 if test x"$efiemu_excuse" = x ; then
568 AC_SUBST([enable_efiemu])
570 if test "x$target_m32" = x1; then
572 TARGET_CFLAGS="$TARGET_CFLAGS -m32"
573 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
574 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
575 TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
576 TARGET_MODULE_FORMAT="elf32"
579 if test "x$target_m64" = x1; then
581 TARGET_CFLAGS="$TARGET_CFLAGS -m64"
582 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
583 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64"
584 TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
585 TARGET_MODULE_FORMAT="elf64"
588 if test "$target_cpu"-"$platform" = x86_64-efi; then
589 # Use large model to support 4G memory
590 AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
592 CFLAGS="$CFLAGS -m64 -mcmodel=large"
593 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
594 [grub_cv_cc_mcmodel=yes],
595 [grub_cv_cc_mcmodel=no])
597 if test "x$grub_cv_cc_mcmodel" = xno; then
598 AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.])
600 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
603 # EFI writes to stack below %rsp, we must not use the red zone
604 AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
605 CFLAGS="$CFLAGS -m64 -mno-red-zone"
606 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
607 [grub_cv_cc_no_red_zone=yes],
608 [grub_cv_cc_no_red_zone=no])
610 if test "x$grub_cv_cc_no_red_zone" = xno; then
611 AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
614 TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
621 # Position independent executable.
623 [# Need that, because some distributions ship compilers that include
624 # `-fPIE' in the default specs.
625 if [ x"$pie_possible" = xyes ]; then
626 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
629 # Position independent executable.
631 [# Need that, because some distributions ship compilers that include
632 # `-fPIC' in the default specs.
633 if [ x"$pic_possible" = xyes ]; then
634 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC"
637 # Smashing stack protector.
638 grub_CHECK_STACK_PROTECTOR
639 # Need that, because some distributions ship compilers that include
640 # `-fstack-protector' in the default specs.
641 if test "x$ssp_possible" = xyes; then
642 TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
644 grub_CHECK_STACK_ARG_PROBE
645 # Cygwin's GCC uses alloca() to probe the stackframe on static
646 # stack allocations above some threshold.
647 if test x"$sap_possible" = xyes; then
648 TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
651 AC_ARG_ENABLE([werror],
652 [AS_HELP_STRING([--disable-werror],
653 [do not use -Werror when building GRUB])])
654 if test x"$enable_werror" != xno ; then
655 TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
656 HOST_CFLAGS="$HOST_CFLAGS -Werror"
659 TARGET_CPP="$TARGET_CC -E"
660 TARGET_CCAS=$TARGET_CC
662 GRUB_TARGET_CPU="${target_cpu}"
663 GRUB_PLATFORM="${platform}"
665 AC_SUBST(GRUB_TARGET_CPU)
666 AC_SUBST(GRUB_PLATFORM)
670 AC_SUBST(TARGET_CCAS)
671 AC_SUBST(TARGET_OBJ2ELF)
672 AC_SUBST(TARGET_APPLE_CC)
673 AC_SUBST(TARGET_MODULE_FORMAT)
675 AC_SUBST(TARGET_CFLAGS)
676 AC_SUBST(TARGET_LDFLAGS)
677 AC_SUBST(TARGET_CPPFLAGS)
678 AC_SUBST(TARGET_CCASFLAGS)
680 AC_SUBST(TARGET_IMG_LDSCRIPT)
681 AC_SUBST(TARGET_IMG_LDFLAGS)
682 AC_SUBST(TARGET_IMG_CFLAGS)
683 AC_SUBST(TARGET_IMG_BASE_LDOPT)
685 AC_SUBST(HOST_CFLAGS)
686 AC_SUBST(HOST_LDFLAGS)
687 AC_SUBST(HOST_CPPFLAGS)
688 AC_SUBST(HOST_CCASFLAGS)
690 # Set them to their new values for the tests below.
692 if test "x$TARGET_APPLE_CC" = x1 ; then
693 CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
695 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
697 CPPFLAGS="$TARGET_CPPFLAGS"
698 if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 ; then
705 if test x$grub_cv_asm_uscore = xyes; then
706 CFLAGS="$CFLAGS -Wl,--defsym,_abort=_main"
708 CFLAGS="$CFLAGS -Wl,--defsym,abort=main"
711 # Check for libgcc symbols
712 AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2)
714 if test "x$TARGET_APPLE_CC" = x1 ; then
715 CFLAGS="$TARGET_CFLAGS -nostdlib"
717 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
721 # Defined in aclocal.m4.
723 if test "x$TARGET_APPLE_CC" != x1 ; then
724 grub_PROG_OBJCOPY_ABSOLUTE
726 grub_PROG_LD_BUILD_ID_NONE
727 if test "x$target_cpu" = xi386; then
728 if test "$platform" != emu && test "x$TARGET_APPLE_CC" != x1 ; then
729 if test ! -z "$TARGET_IMG_LDSCRIPT"; then
730 # Check symbols provided by linker script.
731 CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},8000 -Wl,--defsym,___main=0x8100"
733 grub_CHECK_BSS_START_SYMBOL
734 grub_CHECK_END_SYMBOL
736 CFLAGS="$TARGET_CFLAGS"
737 grub_I386_ASM_PREFIX_REQUIREMENT
741 if test "$platform" != emu; then
742 AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
743 SAVED_CPPFLAGS="$CPPFLAGS"
744 CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
745 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
747 int va_arg_func (int fixed, va_list args);]], [[]])],
748 [grub_cv_cc_isystem=yes],
749 [grub_cv_cc_isystem=no])
750 CPPFLAGS="$SAVED_CPPFLAGS"
753 if test x"$grub_cv_cc_isystem" = xyes ; then
754 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
758 AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [
759 SAVED_CFLAGS="$CFLAGS"
760 CFLAGS="$TARGET_CFLAGS -Wtrampolines"
761 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
762 int va_arg_func (int fixed, va_list args);]], [[]])],
763 [grub_cv_cc_wtrampolines=yes],
764 [grub_cv_cc_wtrampolines=no])
765 CFLAGS="$SAVED_CFLAGS"
768 if test x"$grub_cv_cc_wtrampolines" = xyes ; then
769 TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines"
775 CPPFLAGS="$tmp_CPPFLAGS"
776 LDFLAGS="$tmp_LDFLAGS"
783 # Memory manager debugging.
784 AC_ARG_ENABLE([mm-debug],
785 AS_HELP_STRING([--enable-mm-debug],
786 [include memory manager debugging]),
787 [AC_DEFINE([MM_DEBUG], [1],
788 [Define to 1 if you enable memory manager debugging.])])
790 AC_ARG_ENABLE([cache-stats],
791 AS_HELP_STRING([--enable-cache-stats],
792 [enable disk cache statistics collection]))
794 if test x$enable_cache_stats = xyes; then
799 AC_SUBST([DISK_CACHE_STATS])
801 AC_ARG_ENABLE([boot-time],
802 AS_HELP_STRING([--enable-boot-time],
803 [enable boot time statistics collection]))
805 if test x$enable_boot_time = xyes; then
810 AC_SUBST([BOOT_TIME_STATS])
812 AC_ARG_ENABLE([grub-emu-usb],
813 [AS_HELP_STRING([--enable-grub-emu-usb],
814 [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
816 AC_ARG_ENABLE([grub-emu-sdl],
817 [AS_HELP_STRING([--enable-grub-emu-sdl],
818 [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])])
820 AC_ARG_ENABLE([grub-emu-pci],
821 [AS_HELP_STRING([--enable-grub-emu-pci],
822 [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
824 if test "$platform" = emu; then
826 [# Check for curses libraries.]
827 AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
828 [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
829 [missing_ncurses=[true]])])
830 AC_SUBST([LIBCURSES])
831 [if [ x"$missing_ncurses" = x ]; then ]
832 [# Check for headers.]
833 AC_CHECK_HEADERS([ncurses/curses.h], [],
834 [AC_CHECK_HEADERS([ncurses.h], [],
835 [AC_CHECK_HEADERS([curses.h], [],
836 [missing_ncurses=[true]])])])
838 if test x"$missing_ncurses" = xtrue ; then
839 AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
842 if test x"$enable_grub_emu_usb" != xyes ; then
843 grub_emu_usb_excuse="not enabled"
846 if test x"$enable_grub_emu_pci" = xyes ; then
847 grub_emu_usb_excuse="conflicts with PCI support"
850 [if [ x"$grub_emu_usb_excuse" = x ]; then
851 # Check for libusb libraries.]
852 AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
853 [grub_emu_usb_excuse=["need libusb library"]])
856 [if [ x"$grub_emu_usb_excuse" = x ]; then
857 # Check for headers.]
858 AC_CHECK_HEADERS([usb.h], [],
859 [grub_emu_usb_excuse=["need libusb headers"]])
861 if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
862 AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
864 if test x"$grub_emu_usb_excuse" = x ; then
865 enable_grub_emu_usb=yes
867 enable_grub_emu_usb=no
870 if test x"$enable_grub_emu_sdl" = xno ; then
871 grub_emu_sdl_excuse="explicitely disabled"
873 [if [ x"$grub_emu_sdl_excuse" = x ]; then
874 # Check for libSDL libraries.]
875 AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
876 [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]])
880 [if [ x"$grub_emu_sdl_excuse" = x ]; then
881 # Check for headers.]
882 AC_CHECK_HEADERS([SDL/SDL.h], [],
883 [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]])
886 if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
887 AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled])
889 if test x"$grub_emu_sdl_excuse" = x ; then
890 enable_grub_emu_sdl=yes
892 enable_grub_emu_sdl=no
895 if test x"$enable_grub_emu_pci" != xyes ; then
896 grub_emu_pci_excuse="not enabled"
899 if test x"$enable_grub_emu_usb" = xyes ; then
900 grub_emu_pci_excuse="conflicts with USB support"
903 [if [ x"$grub_emu_pci_excuse" = x ]; then
904 # Check for libpci libraries.]
905 AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"],
906 [grub_emu_pci_excuse=["need libpciaccess library"]])
907 AC_SUBST([LIBPCIACCESS])
909 [if [ x"$grub_emu_pci_excuse" = x ]; then
910 # Check for headers.]
911 AC_CHECK_HEADERS([pci/pci.h], [],
912 [grub_emu_pci_excuse=["need libpciaccess headers"]])
915 if test x"$grub_emu_pci_excuse" = x ; then
916 enable_grub_emu_pci=yes
919 enable_grub_emu_pci=no
922 AC_SUBST([enable_grub_emu_sdl])
923 AC_SUBST([enable_grub_emu_usb])
924 AC_SUBST([enable_grub_emu_pci])
927 AC_ARG_ENABLE([grub-mkfont],
928 [AS_HELP_STRING([--enable-grub-mkfont],
929 [build and install the `grub-mkfont' utility (default=guessed)])])
930 if test x"$enable_grub_mkfont" = xno ; then
931 grub_mkfont_excuse="explicitly disabled"
934 if test x"$grub_mkfont_excuse" = x ; then
935 # Check for freetype libraries.
936 AC_CHECK_PROGS([FREETYPE], [freetype-config])
937 if test "x$FREETYPE" = x ; then
938 grub_mkfont_excuse=["need freetype2 library"]
942 if test x"$grub_mkfont_excuse" = x ; then
943 # Check for freetype libraries.
944 freetype_cflags=`freetype-config --cflags`
945 freetype_libs=`freetype-config --libs`
946 SAVED_CPPFLAGS="$CPPFLAGS"
947 CPPFLAGS="$CPPFLAGS $freetype_cflags"
948 AC_CHECK_HEADERS([ft2build.h], [],
949 [grub_mkfont_excuse=["need freetype2 headers"]])
950 CPPFLAGS="$SAVED_CPPFLAGS"
953 if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
954 AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
956 if test x"$grub_mkfont_excuse" = x ; then
957 enable_grub_mkfont=yes
959 enable_grub_mkfont=no
961 if test x"$enable_grub_mkfont" = xno && test "x$platform" = xloongson; then
962 AC_MSG_ERROR([loongson port needs grub-mkfont])
964 AC_SUBST([enable_grub_mkfont])
965 AC_SUBST([freetype_cflags])
966 AC_SUBST([freetype_libs])
972 if test x$enable_grub_mkfont = xno; then
973 starfield_excuse="No grub-mkfont"
976 if test x"$starfield_excuse" = x; then
977 for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
978 for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do
979 if test -f "$dir/DejaVuSans.$ext"; then
980 DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext"
986 if test "x$DJVU_FONT_SOURCE" = x; then
987 starfield_excuse="No DejaVu found"
991 AC_SUBST([DJVU_FONT_SOURCE])
993 AC_ARG_ENABLE([grub-mount],
994 [AS_HELP_STRING([--enable-grub-mount],
995 [build and install the `grub-mount' utility (default=guessed)])])
996 if test x"$enable_grub_mount" = xno ; then
997 grub_mount_excuse="explicitly disabled"
1000 if test x"$grub_mount_excuse" = x ; then
1001 AC_CHECK_LIB([fuse], [fuse_main_real], [],
1002 [grub_mount_excuse="need FUSE library"])
1005 if test x"$grub_mount_excuse" = x ; then
1006 # Check for fuse headers.
1007 SAVED_CPPFLAGS="$CPPFLAGS"
1008 CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26"
1009 AC_CHECK_HEADERS([fuse/fuse.h], [],
1010 [grub_mount_excuse=["need FUSE headers"]])
1011 CPPFLAGS="$SAVED_CPPFLAGS"
1014 if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then
1015 AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled])
1017 if test x"$grub_mount_excuse" = x ; then
1018 enable_grub_mount=yes
1020 enable_grub_mount=no
1022 AC_SUBST([enable_grub_mount])
1024 AC_ARG_ENABLE([device-mapper],
1025 [AS_HELP_STRING([--enable-device-mapper],
1026 [enable Linux device-mapper support (default=guessed)])])
1027 if test x"$enable_device_mapper" = xno ; then
1028 device_mapper_excuse="explicitly disabled"
1031 if test x"$device_mapper_excuse" = x ; then
1032 # Check for device-mapper header.
1033 AC_CHECK_HEADER([libdevmapper.h], [],
1034 [device_mapper_excuse="need libdevmapper header"])
1037 if test x"$device_mapper_excuse" = x ; then
1038 # Check for device-mapper library.
1039 AC_CHECK_LIB([devmapper], [dm_task_create], [],
1040 [device_mapper_excuse="need devmapper library"])
1043 if test x"$device_mapper_excuse" = x ; then
1044 # Check for device-mapper library.
1045 AC_CHECK_LIB([devmapper], [dm_log_with_errno_init],
1047 [device_mapper_excuse="need devmapper library"])
1050 if test x"$device_mapper_excuse" = x ; then
1051 LIBDEVMAPPER="-ldevmapper";
1052 AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
1053 [Define to 1 if you have the devmapper library.])
1056 AC_SUBST([LIBDEVMAPPER])
1059 if test x$host_kernel = xkfreebsd; then
1060 AC_CHECK_LIB([geom], [geom_gettree], [],
1061 [AC_MSG_ERROR([Your platform requires libgeom])])
1067 AC_CHECK_LIB([lzma], [lzma_code],
1069 AC_DEFINE([HAVE_LIBLZMA], [1],
1070 [Define to 1 if you have the LZMA library.])],)
1073 AC_ARG_ENABLE([libzfs],
1074 [AS_HELP_STRING([--enable-libzfs],
1075 [enable libzfs integration (default=guessed)])])
1076 if test x"$enable_libzfs" = xno ; then
1077 libzfs_excuse="explicitly disabled"
1080 if test x"$libzfs_excuse" = x ; then
1081 # Only check for system headers if libzfs support has not been disabled.
1082 AC_CHECK_HEADERS(libzfs.h libnvpair.h)
1085 if test x"$libzfs_excuse" = x ; then
1086 AC_CHECK_LIB([zfs], [libzfs_init],
1088 [libzfs_excuse="need zfs library"])
1091 if test x"$libzfs_excuse" = x ; then
1092 AC_CHECK_LIB([nvpair], [nvlist_print],
1094 [libzfs_excuse="need nvpair library"])
1097 if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then
1098 AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied])
1101 if test x"$libzfs_excuse" = x ; then
1102 # We need both libzfs and libnvpair for a successful build.
1104 AC_DEFINE([HAVE_LIBZFS], [1],
1105 [Define to 1 if you have the ZFS library.])
1106 LIBNVPAIR="-lnvpair"
1107 AC_DEFINE([HAVE_LIBNVPAIR], [1],
1108 [Define to 1 if you have the NVPAIR library.])
1112 AC_SUBST([LIBNVPAIR])
1116 AC_SUBST([FONT_SOURCE])
1117 AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
1118 [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
1119 AS_IF([test x$TARGET_APPLE_CC = x1],
1120 [AC_SUBST([USE_APPLE_CC_FIXES], yes)])
1122 AC_SUBST(HAVE_ASM_USCORE)
1125 AC_SUBST(BSS_START_SYMBOL)
1126 AC_SUBST(END_SYMBOL)
1129 AC_SUBST(NEED_ENABLE_EXECUTE_STACK)
1130 AC_SUBST(NEED_REGISTER_FRAME_INFO)
1133 # Automake conditionals
1136 AM_CONDITIONAL([COND_emu], [test x$platform = xemu])
1137 AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc])
1138 AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi])
1139 AM_CONDITIONAL([COND_ia64_efi], [test x$target_cpu = xia64 -a x$platform = xefi])
1140 AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu])
1141 AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275])
1142 AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
1143 AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
1144 AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
1145 AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
1146 AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
1147 AM_CONDITIONAL([COND_mips_arc], [test x$target_cpu = xmips -a x$platform = xarc])
1148 AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
1149 AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
1150 AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
1151 AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
1152 AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
1154 AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
1155 AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
1156 AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
1157 AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
1158 AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
1159 AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu])
1160 AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos])
1162 AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
1163 AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
1164 AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
1165 AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
1166 AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
1167 AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes])
1168 AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
1169 AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x])
1170 AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1])
1171 AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
1172 AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1])
1173 AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1])
1175 AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
1176 AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin])
1177 AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x])
1180 cpudir="${target_cpu}"
1181 if test x${cpudir} = xmipsel; then
1185 if test x"$link_dir" = xyes ; then
1186 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir])
1187 if test "$platform" != emu ; then
1188 AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform])
1191 mkdir -p include/grub 2>/dev/null
1192 rm -rf include/grub/cpu
1193 cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null
1194 if test "$platform" != emu ; then
1195 rm -rf include/grub/machine
1196 cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null
1200 AC_CONFIG_FILES([Makefile])
1201 AC_CONFIG_FILES([grub-core/Makefile])
1202 AC_CONFIG_FILES([grub-core/gnulib/Makefile])
1203 AC_CONFIG_FILES([po/Makefile.in])
1204 AC_CONFIG_FILES([docs/Makefile])
1205 AC_CONFIG_FILES([util/bash-completion.d/Makefile])
1206 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
1207 AC_CONFIG_FILES([config.h])
1211 echo "*******************************************************"
1212 echo GRUB2 will be compiled with following components:
1213 echo Platform: "$target_cpu"-"$platform"
1214 if [ x"$platform" = xemu ]; then
1215 if [ x"$grub_emu_usb_excuse" = x ]; then
1216 echo USB support for grub-emu: Yes
1218 echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
1220 if [ x"$grub_emu_sdl_excuse" = x ]; then
1221 echo SDL support for grub-emu: Yes
1223 echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)"
1225 if [ x"$grub_emu_pci_excuse" = x ]; then
1226 echo PCI support for grub-emu: Yes
1228 echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
1231 if test x"$device_mapper_excuse" = x ; then
1232 echo With devmapper support: Yes
1234 echo With devmapper support: No "($device_mapper_excuse)"
1236 if [ x"$enable_mm_debug" = xyes ]; then
1237 echo With memory debugging: Yes
1239 echo With memory debugging: No
1241 if [ x"$enable_cache_stats" = xyes ]; then
1242 echo With disk cache statistics: Yes
1244 echo With disk cache statistics: No
1247 if [ x"$enable_boot_time" = xyes ]; then
1248 echo With boot time statistics: Yes
1250 echo With boot time statistics: No
1253 if [ x"$efiemu_excuse" = x ]; then
1254 echo efiemu runtime: Yes
1256 echo efiemu runtime: No "($efiemu_excuse)"
1258 if [ x"$grub_mkfont_excuse" = x ]; then
1259 echo grub-mkfont: Yes
1261 echo grub-mkfont: No "($grub_mkfont_excuse)"
1263 if [ x"$grub_mount_excuse" = x ]; then
1264 echo grub-mount: Yes
1266 echo grub-mount: No "($grub_mount_excuse)"
1268 if [ x"$starfield_excuse" = x ]; then
1269 echo starfield theme: Yes
1271 echo starfield theme: No "($starfield_excuse)"
1273 if [ x"$libzfs_excuse" = x ]; then
1274 echo With libzfs support: Yes
1276 echo With libzfs support: No "($libzfs_excuse)"
1278 echo "*******************************************************"