1 # Process this file with autoconf to produce a configure script.
3 # Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
5 # This configure.ac is free software; the author
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 dnl This configure script is complicated, because GRUB needs to deal
15 dnl with three potentially different types:
17 dnl build -- the environment for building GRUB
18 dnl host -- the environment for running utilities
19 dnl target -- the environment for running GRUB
21 dnl In addition, GRUB needs to deal with a platform specification
22 dnl which specifies the system running GRUB, such as firmware.
23 dnl This is necessary because the target type in autoconf does not
24 dnl describe such a system very well.
26 dnl The current strategy is to use variables with no prefix (such as
27 dnl CC, CFLAGS, etc.) for the host type as well as the build type,
28 dnl because GRUB does not need to use those variables for the build
29 dnl type, so there is no conflict. Variables with the prefix "TARGET_"
30 dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
34 AC_INIT([GRUB],[1.97],[bug-grub@gnu.org])
37 AC_CONFIG_SRCDIR([include/grub/dl.h])
38 AC_CONFIG_HEADER([config.h])
40 # Checks for host and target systems.
44 # Program name transformations
47 # Optimization flag. Allow user to override.
48 if test "x$TARGET_CFLAGS" = x; then
49 TARGET_CFLAGS="$TARGET_CFLAGS -Os"
53 i[[3456]]86) target_cpu=i386 ;;
54 sparc) target_cpu=sparc64 ;;
57 TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPSEL=1";
58 CFLAGS="$CFLAGS -DGRUB_CPU_MIPSEL=1";
62 TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPS=1";
63 CFLAGS="$CFLAGS -DGRUB_CPU_MIPS=1";
67 # Specify the platform (such as firmware).
68 AC_ARG_WITH([platform],
69 AS_HELP_STRING([--with-platform=PLATFORM],
70 [select the host platform [[guessed]]]))
72 # Guess the platform if not specified.
73 if test "x$with_platform" = x; then
74 case "$target_cpu"-"$target_vendor" in
75 i386-apple) platform=efi ;;
76 i386-*) platform=pc ;;
77 x86_64-apple) platform=efi ;;
78 x86_64-*) platform=pc ;;
79 powerpc-*) platform=ieee1275 ;;
80 powerpc64-*) platform=ieee1275 ;;
81 sparc64-*) platform=ieee1275 ;;
82 mips-*) platform=yeeloong ;;
83 *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
86 platform="$with_platform"
89 # Adjust CPU unless target was explicitly specified.
90 if test -z "$target_alias"; then
91 case "$target_cpu"-"$platform" in
93 x86_64-*) target_cpu=i386 ;;
94 powerpc64-ieee1275) target_cpu=powerpc ;;
98 # Check if the platform is supported, make final adjustments.
99 case "$target_cpu"-"$platform" in
104 i386-linuxbios) platform=coreboot ;;
112 *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
115 case "$target_cpu" in
116 i386 | powerpc) target_m32=1 ;;
117 x86_64 | sparc64) target_m64=1 ;;
121 mingw32*) host_os=cygwin ;;
124 # This normalizes the names, and creates a new variable ("host_kernel")
125 # while at it, since the mapping is not always 1:1 (e.g. different OSes
126 # using the same kernel type).
128 gnu*) host_kernel=hurd ;;
129 linux*) host_kernel=linux ;;
130 freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;;
131 cygwin) host_kernel=windows ;;
135 coreboot) machine_CFLAGS="-DGRUB_MACHINE_COREBOOT=1" ;;
136 efi) machine_CFLAGS="-DGRUB_MACHINE_EFI=1" ;;
137 ieee1275) machine_CFLAGS="-DGRUB_MACHINE_IEEE1275=1" ;;
138 qemu) machine_CFLAGS="-DGRUB_MACHINE_QEMU=1" ;;
139 pc) machine_CFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;;
140 emu) machine_CFLAGS="-DGRUB_MACHINE_EMU=1" ;;
141 yeeloong) machine_CFLAGS="-DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
142 qemu-mips) machine_CFLAGS="-DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
144 CFLAGS="$CFLAGS $machine_CFLAGS"
145 TARGET_ASFLAGS="$TARGET_ASFLAGS $machine_CFLAGS"
146 TARGET_CFLAGS="$TARGET_CFLAGS $machine_CFLAGS"
150 AC_SUBST(host_kernel)
156 # Checks for build programs.
159 # Although cmp is listed in the GNU Coding Standards as a command which
160 # can used directly, OpenBSD lacks cmp in the default installation.
161 AC_CHECK_PROGS([CMP], [cmp])
162 if test "x$CMP" = x; then
163 AC_MSG_ERROR([cmp is not found])
166 AC_CHECK_PROGS([YACC], [bison])
167 if test "x$YACC" = x; then
168 AC_MSG_ERROR([bison is not found])
171 for file in /usr/src/unifont.bdf /usr/share/fonts/X11/misc/unifont.pcf.gz ; do
172 if test -e $file ; then
173 AC_SUBST([FONT_SOURCE], [$file])
183 # These are not a "must".
184 AC_PATH_PROG(RUBY, ruby)
185 AC_PATH_PROG(MAKEINFO, makeinfo)
188 # Checks for host programs.
193 test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
196 AM_GNU_GETTEXT([external])
199 # Identify characteristics of the host architecture.
201 AC_CHECK_SIZEOF(void *)
202 AC_CHECK_SIZEOF(long)
205 if test x$grub_cv_apple_cc = xyes ; then
206 CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
207 ASFLAGS="$ASFLAGS -DAPPLE_CC=1"
210 if test "x$cross_compiling" = xyes; then
211 AC_MSG_WARN([cannot generate manual pages while cross compiling])
213 AC_PATH_PROG(HELP2MAN, help2man)
216 # Check for functions.
217 AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf)
222 AC_CHECK_FUNCS(memmove sbrk strdup lstat getuid getgid)
223 AC_CHECK_HEADERS(sys/mkdev.h sys/sysmacros.h malloc.h termios.h sys/types.h)
224 AC_CHECK_HEADERS(unistd.h string.h strings.h sys/stat.h sys/fcntl.h)
227 # Check for target programs.
230 # Find tools for the target.
231 if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
232 tmp_ac_tool_prefix="$ac_tool_prefix"
233 ac_tool_prefix=$target_alias-
235 AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
236 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
237 AC_CHECK_TOOL(OBJCOPY, objcopy)
238 AC_CHECK_TOOL(STRIP, strip)
239 AC_CHECK_TOOL(NM, nm)
241 ac_tool_prefix="$tmp_ac_tool_prefix"
243 if test "x$TARGET_CC" = x; then
246 AC_CHECK_TOOL(OBJCOPY, objcopy)
247 AC_CHECK_TOOL(STRIP, strip)
248 AC_CHECK_TOOL(NM, nm)
253 # Test the C compiler for the target environment.
256 tmp_LDFLAGS="$LDFLAGS"
257 tmp_CPPFLAGS="$CPPFLAGS"
260 CFLAGS="$TARGET_CFLAGS"
261 CPPFLAGS="$TARGET_CPPFLAGS"
262 LDFLAGS="$TARGET_LDFLAGS"
266 TARGET_CFLAGS="$TARGET_CFLAGS -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
267 -Wundef -Wstrict-prototypes -g"
269 # Force no alignment to save space on i386.
270 if test "x$target_cpu" = xi386; then
271 AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
272 CFLAGS="$CFLAGS -falign-loops=1"
273 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
274 [grub_cv_cc_falign_loop=yes],
275 [grub_cv_cc_falign_loop=no])
278 if test "x$grub_cv_cc_falign_loop" = xyes; then
279 TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
281 TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
284 # Some toolchains enable these features by default, but they need
285 # registers that aren't set up properly in GRUB.
286 TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
289 # By default, GCC 4.4 generates .eh_frame sections containing unwind
290 # information in some cases where it previously did not. GRUB doesn't need
291 # these and they just use up vital space. Restore the old compiler
293 AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
294 SAVE_CFLAGS="$CFLAGS"
295 CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
296 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
297 [grub_cv_cc_fno_dwarf2_cfi_asm=yes],
298 [grub_cv_cc_fno_dwarf2_cfi_asm=no])
299 CFLAGS="$SAVE_CFLAGS"
302 if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
303 TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
307 if test x$grub_cv_apple_target_cc = xyes ; then
308 TARGET_CFLAGS="$TARGET_CFLAGS -DAPPLE_CC=1 -fnested-functions"
309 CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
310 TARGET_ASFLAGS="$TARGET_ASFLAGS -DAPPLE_CC=1"
312 AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
313 if test "x$OBJCONV" = x ; then
314 AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.])
316 if test "x$OBJCONV" = x ; then
317 AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
320 TARGET_IMG_CFLAGS="-static"
321 TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
322 TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
325 # Use linker script if present, otherwise use builtin -N script.
326 if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
327 TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
328 TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT} -Wl,-Ttext,"
329 TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
332 TARGET_IMG_LDFLAGS='-Wl,-N -Wl,-Ttext,'
333 TARGET_IMG_LDFLAGS_AC='-Wl,-N -Wl,-Ttext,'
338 AC_SUBST(TARGET_IMG_LDSCRIPT)
339 AC_SUBST(TARGET_IMG_LDFLAGS)
340 AC_SUBST(TARGET_IMG_CFLAGS)
342 # For platforms where ELF is not the default link format.
343 AC_MSG_CHECKING([for command to convert module to ELF format])
345 cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;;
348 AC_SUBST(TARGET_OBJ2ELF)
349 AC_MSG_RESULT([$TARGET_OBJ2ELF])
352 if test "x$target_m32" = x1; then
354 TARGET_CFLAGS="$TARGET_CFLAGS -m32"
355 TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
356 TARGET_MODULE_FORMAT="elf32"
359 if test "x$target_m64" = x1; then
361 TARGET_CFLAGS="$TARGET_CFLAGS -m64"
362 TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
363 TARGET_MODULE_FORMAT="elf64"
366 if test "$target_cpu"-"$platform" = x86_64-efi; then
367 # Use large model to support 4G memory
368 AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
370 CFLAGS="$CFLAGS -m64 -mcmodel=large"
371 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
372 [grub_cv_cc_mcmodel=yes],
373 [grub_cv_cc_mcmodel=no])
375 if test "x$grub_cv_cc_mcmodel" = xno; then
376 CFLAGS="$SAVED_CFLAGS -m64 -DMCMODEL_SMALL=1"
377 TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1"
378 AC_MSG_WARN([-mcmodel=large not supported. You won't be able to use the memory over 4GiB. Upgrade your gcc])
380 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
383 # EFI writes to stack below %rsp, we must not use the red zone
384 AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
385 CFLAGS="$CFLAGS -m64 -mno-red-zone"
386 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
387 [grub_cv_cc_no_red_zone=yes],
388 [grub_cv_cc_no_red_zone=no])
390 if test "x$grub_cv_cc_no_red_zone" = xno; then
391 AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
394 TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
401 # Need __enable_execute_stack() for nested function trampolines?
402 grub_CHECK_ENABLE_EXECUTE_STACK
404 # Position independent executable.
406 [# Need that, because some distributions ship compilers that include
407 # `-fPIE' in the default specs.
408 if [ x"$pie_possible" = xyes ]; then
409 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
412 # Smashing stack protector.
413 grub_CHECK_STACK_PROTECTOR
414 # Need that, because some distributions ship compilers that include
415 # `-fstack-protector' in the default specs.
416 if test "x$ssp_possible" = xyes; then
417 TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
419 grub_CHECK_STACK_ARG_PROBE
420 # Cygwin's GCC uses alloca() to probe the stackframe on static
421 # stack allocations above some threshold.
422 if test x"$sap_possible" = xyes; then
423 TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
426 AC_ARG_ENABLE([werror],
427 [AS_HELP_STRING([--disable-werror],
428 [do not use -Werror when building GRUB])])
429 if test x"$enable_werror" != xno ; then
430 TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
433 AC_SUBST(TARGET_CFLAGS)
434 AC_SUBST(TARGET_MODULE_FORMAT)
436 AC_SUBST(TARGET_APPLE_CC)
437 AC_SUBST(TARGET_ASFLAGS)
438 AC_SUBST(TARGET_CPPFLAGS)
439 AC_SUBST(TARGET_LDFLAGS)
441 # Check for libgcc symbols (must be performed before we add -nostdlib to LDFLAGS)
442 AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2)
444 # Set them to their new values for the tests below.
446 if test "x$TARGET_APPLE_CC" = x1 ; then
447 CFLAGS="$TARGET_CFLAGS -nostdlib"
449 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
451 CPPFLAGS="$TARGET_CPPFLAGS"
452 LDFLAGS="$TARGET_LDFLAGS"
454 # Defined in aclocal.m4.
456 if test "x$TARGET_APPLE_CC" != x1 ; then
457 grub_PROG_OBJCOPY_ABSOLUTE
459 grub_PROG_LD_BUILD_ID_NONE
461 if test "x$target_cpu" = xi386; then
462 if test ! -z "$TARGET_IMG_LDSCRIPT"; then
463 # Check symbols provided by linker script.
464 CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100"
466 if test "x$TARGET_APPLE_CC" != x1 ; then
467 grub_CHECK_BSS_START_SYMBOL
468 grub_CHECK_END_SYMBOL
470 CFLAGS="$TARGET_CFLAGS"
471 grub_I386_ASM_PREFIX_REQUIREMENT
473 grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
475 AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
478 AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL)
479 #define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
481 #define NESTED_FUNC_ATTR
484 AC_ARG_ENABLE([efiemu],
485 [AS_HELP_STRING([--enable-efiemu],
486 [build and install the efiemu runtimes (default=guessed)])])
487 if test x"$enable_efiemu" = xno ; then
488 efiemu_excuse="explicitly disabled"
490 if test x"$efiemu_excuse" = x ; then
491 AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
492 CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
493 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
494 [grub_cv_cc_efiemu=yes],
495 [grub_cv_cc_efiemu=no])
497 if test x$grub_cv_cc_efiemu = xno; then
498 efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
501 if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
502 AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
504 if test x"$efiemu_excuse" = x ; then
509 AC_SUBST([enable_efiemu])
515 CPPFLAGS="$tmp_CPPFLAGS"
516 LDFLAGS="$tmp_LDFLAGS"
523 # Memory manager debugging.
524 AC_ARG_ENABLE([mm-debug],
525 AS_HELP_STRING([--enable-mm-debug],
526 [include memory manager debugging]),
527 [AC_DEFINE([MM_DEBUG], [1],
528 [Define to 1 if you enable memory manager debugging.])])
530 AC_ARG_ENABLE([grub-emu-usb],
531 [AS_HELP_STRING([--enable-grub-emu-usb],
532 [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
534 AC_ARG_ENABLE([grub-emu-pci],
535 [AS_HELP_STRING([--enable-grub-emu-pci],
536 [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
538 if test "$platform" = emu; then
540 [# Check for curses libraries.]
541 AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
542 [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
543 [missing_ncurses=[true]])])
544 AC_SUBST([LIBCURSES])
545 [if [ x"$missing_ncurses" = x ]; then ]
546 [# Check for headers.]
547 AC_CHECK_HEADERS([ncurses/curses.h], [],
548 [AC_CHECK_HEADERS([ncurses.h], [],
549 [AC_CHECK_HEADERS([curses.h], [],
550 [missing_ncurses=[true]])])])
552 if test x"$missing_ncurses" = xtrue ; then
553 AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
556 if test x"$enable_grub_emu_usb" = xno ; then
557 grub_emu_usb_excuse="explicitly disabled"
560 if test x"$enable_grub_emu_pci" = xyes ; then
561 grub_emu_usb_excuse="conflicts with PCI support"
564 [if [ x"$grub_emu_usb_excuse" = x ]; then
565 # Check for libusb libraries.]
566 AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
567 [grub_emu_usb_excuse=["need libusb library"]])
570 [if [ x"$grub_emu_usb_excuse" = x ]; then
571 # Check for headers.]
572 AC_CHECK_HEADERS([usb.h], [],
573 [grub_emu_usb_excuse=["need libusb headers"]])
575 if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
576 AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
578 if test x"$grub_emu_usb_excuse" = x ; then
579 enable_grub_emu_usb=yes
581 enable_grub_emu_usb=no
584 if test x"$enable_grub_emu_pci" != xyes ; then
585 grub_emu_pci_excuse="not enabled"
588 if test x"$enable_grub_emu_usb" = xyes ; then
589 grub_emu_pci_excuse="conflicts with USB support"
592 [if [ x"$grub_emu_pci_excuse" = x ]; then
593 # Check for libpci libraries.]
594 AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"],
595 [grub_emu_pci_excuse=["need libpciaccess library"]])
596 AC_SUBST([LIBPCIACCESS])
598 [if [ x"$grub_emu_pci_excuse" = x ]; then
599 # Check for headers.]
600 AC_CHECK_HEADERS([pci/pci.h], [],
601 [grub_emu_pci_excuse=["need libpciaccess headers"]])
604 if test x"$grub_emu_pci_excuse" = x ; then
605 enable_grub_emu_pci=yes
607 enable_grub_emu_pci=no
610 AC_SUBST([enable_grub_emu_usb])
611 AC_SUBST([enable_grub_emu_pci])
614 AC_ARG_ENABLE([grub-fstest],
615 [AS_HELP_STRING([--enable-grub-fstest],
616 [build and install the `grub-fstest' debugging utility (default=guessed)])])
617 if test x"$enable_grub_fstest" = xno ; then
618 grub_fstest_excuse="explicitly disabled"
620 if test x"$grub_fstest_excuse" = x ; then
621 enable_grub_fstest=yes
623 enable_grub_fstest=no
625 AC_SUBST([enable_grub_fstest])
627 AC_ARG_ENABLE([grub-mkfont],
628 [AS_HELP_STRING([--enable-grub-mkfont],
629 [build and install the `grub-mkfont' utility (default=guessed)])])
630 if test x"$enable_grub_mkfont" = xno ; then
631 grub_mkfont_excuse="explicitly disabled"
634 if test x"$grub_mkfont_excuse" = x ; then
635 # Check for freetype libraries.
636 AC_CHECK_PROGS([FREETYPE], [freetype-config])
637 if test "x$FREETYPE" = x ; then
638 grub_mkfont_excuse=["need freetype2 library"]
640 freetype_cflags=`freetype-config --cflags`
641 freetype_libs=`freetype-config --libs`
643 if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
644 AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
646 if test x"$grub_mkfont_excuse" = x ; then
647 enable_grub_mkfont=yes
649 enable_grub_mkfont=no
651 AC_SUBST([enable_grub_mkfont])
652 AC_SUBST([freetype_cflags])
653 AC_SUBST([freetype_libs])
659 if test x"$link_dir" = xyes ; then
660 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu])
661 if test "$platform" != emu ; then
662 AC_CONFIG_LINKS([include/grub/machine:include/grub/$target_cpu/$platform])
665 mkdir -p include/grub 2>/dev/null
666 rm -rf include/grub/cpu
667 cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
668 if test "$platform" != emu ; then
669 rm -rf include/grub/machine
670 cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
673 AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
674 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
677 echo "*******************************************************"
678 echo GRUB2 will be compiled with following components:
679 echo Platform: "$target_cpu"-"$platform"
680 if [ x"$platform" = xemu ]; then
681 if [ x"$grub_emu_usb_excuse" = x ]; then
682 echo USB support for grub-emu: Yes
684 echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
686 if [ x"$grub_emu_pci_excuse" = x ]; then
687 echo PCI support for grub-emu: Yes
689 echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
692 if [ x"$enable_mm_debug" = xyes ]; then
693 echo With memory debugging: Yes
695 echo With memory debugging: No
697 if [ x"$efiemu_excuse" = x ]; then
698 echo efiemu runtime: Yes
700 echo efiemu runtime: No "($efiemu_excuse)"
702 if [ x"$grub_fstest_excuse" = x ]; then
703 echo grub-fstest: Yes
705 echo grub-fstest: No "($grub_fstest_excuse)"
707 if [ x"$grub_mkfont_excuse" = x ]; then
708 echo grub-mkfont: Yes
710 echo grub-mkfont: No "($grub_mkfont_excuse)"
712 echo "*******************************************************"