2009-10-03 Robert Millan <rmh.grub@aybabtu.com>
[grub2/phcoder/solaris.git] / configure.ac
blob4d221b4d67cde13e635af239c6cdc13419cfe409
1 # Process this file with autoconf to produce a configure script.
3 # Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009  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
12 # PARTICULAR PURPOSE.
14 dnl This configure script is complicated, because GRUB needs to deal
15 dnl with three potentially different types:
16 dnl
17 dnl   build  -- the environment for building GRUB
18 dnl   host   -- the environment for running utilities
19 dnl   target -- the environment for running GRUB
20 dnl
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.
25 dnl
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
31 dnl type.
34 AC_INIT([GRUB],[1.97~beta3],[bug-grub@gnu.org])
35 AC_PREREQ(2.59)
36 AC_CONFIG_SRCDIR([include/grub/dl.h])
37 AC_CONFIG_HEADER([config.h])
39 # Checks for host and target systems.
40 AC_CANONICAL_HOST
41 AC_CANONICAL_TARGET
43 # Program name transformations
44 AC_ARG_PROGRAM
46 case "$target_cpu" in
47   i[[3456]]86)  target_cpu=i386 ;;
48   sparc)        target_cpu=sparc64 ;;
49 esac
51 # Specify the platform (such as firmware).
52 AC_ARG_WITH([platform],
53             AS_HELP_STRING([--with-platform=PLATFORM],
54                            [select the host platform [[guessed]]]))
56 # Guess the platform if not specified.
57 if test "x$with_platform" = x; then
58   case "$target_cpu"-"$target_vendor" in
59     i386-apple) platform=efi ;;
60     i386-*) platform=pc ;;
61     x86_64-apple) platform=efi ;;
62     x86_64-*) platform=pc ;;
63     powerpc-*) platform=ieee1275 ;;
64     powerpc64-*) platform=ieee1275 ;;
65     sparc64-*) platform=ieee1275 ;;
66     *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
67   esac
68 else
69   platform="$with_platform"
72 # Adjust CPU unless target was explicitly specified.
73 if test -z "$target_alias"; then
74   case "$target_cpu"-"$platform" in
75     x86_64-efi) ;;
76     x86_64-*) target_cpu=i386 ;;
77     powerpc64-ieee1275) target_cpu=powerpc ;;
78   esac
81 # Check if the platform is supported, make final adjustments.
82 case "$target_cpu"-"$platform" in
83   i386-efi) ;;
84   x86_64-efi) ;;
85   i386-pc) ;;
86   i386-coreboot) ;;
87   i386-linuxbios) platform=coreboot ;;
88   i386-ieee1275) ;;
89   i386-qemu) ;;
90   powerpc-ieee1275) ;;
91   sparc64-ieee1275) ;;
92   *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
93 esac
95 case "$target_cpu" in
96   i386 | powerpc) target_m32=1 ;;
97   x86_64 | sparc64) target_m64=1 ;;
98 esac
100 case "$host_os" in
101   mingw32) host_os=cygwin ;;
102 esac
104 # This normalizes the names, and creates a new variable ("host_kernel")
105 # while at it, since the mapping is not always 1:1 (e.g. different OSes
106 # using the same kernel type).
107 case "$host_os" in
108   gnu*)                         host_kernel=hurd ;;
109   linux*)                       host_kernel=linux ;;
110   freebsd* | kfreebsd*-gnu)     host_kernel=freebsd ;;
111   cygwin)                       host_kernel=windows ;;
112 esac
114 AC_SUBST(host_cpu)
115 AC_SUBST(host_os)
116 AC_SUBST(host_kernel)
118 AC_SUBST(target_cpu)
119 AC_SUBST(platform)
122 # Checks for build programs.
125 # Although cmp is listed in the GNU Coding Standards as a command which
126 # can used directly, OpenBSD lacks cmp in the default installation.
127 AC_CHECK_PROGS([CMP], [cmp])
128 if test "x$CMP" = x; then
129   AC_MSG_ERROR([cmp is not found])
132 AC_CHECK_PROGS([YACC], [bison])
133 if test "x$YACC" = x; then
134   AC_MSG_ERROR([bison is not found])
137 for file in /usr/src/unifont.bdf ; do
138   if test -e $file ; then
139     AC_SUBST([UNIFONT_BDF], [$file])
140     break
141   fi
142 done
144 AC_PROG_INSTALL
145 AC_PROG_AWK
146 AC_PROG_MAKE_SET
147 AC_PROG_MKDIR_P
149 # These are not a "must".
150 AC_PATH_PROG(RUBY, ruby)
151 AC_PATH_PROG(MAKEINFO, makeinfo)
154 # Checks for host programs.
157 AC_PROG_CC
158 # Must be GCC.
159 test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
161 AC_GNU_SOURCE
162 AC_SYS_LARGEFILE
164 # Identify characteristics of the host architecture.
165 AC_C_BIGENDIAN
166 AC_CHECK_SIZEOF(void *)
167 AC_CHECK_SIZEOF(long)
169 grub_apple_cc
170 if test x$grub_cv_apple_cc = xyes ; then
171   CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
172   ASFLAGS="$ASFLAGS -DAPPLE_CC=1"
175 if test "x$cross_compiling" = xyes; then
176   AC_MSG_WARN([cannot generate manual pages while cross compiling])
177 else
178   AC_PATH_PROG(HELP2MAN, help2man)
181 # Check for functions.
182 AC_CHECK_FUNCS(posix_memalign memalign asprintf)
185 # Check for target programs.
188 # Find tools for the target.
189 if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
190   tmp_ac_tool_prefix="$ac_tool_prefix"
191   ac_tool_prefix=$target_alias-
193   AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
194                  [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
195   AC_CHECK_TOOL(OBJCOPY, objcopy)
196   AC_CHECK_TOOL(STRIP, strip)
197   AC_CHECK_TOOL(NM, nm)
199   ac_tool_prefix="$tmp_ac_tool_prefix"
200 else
201   if test "x$TARGET_CC" = x; then
202     TARGET_CC=$CC
203   fi
204   AC_CHECK_TOOL(OBJCOPY, objcopy)
205   AC_CHECK_TOOL(STRIP, strip)
206   AC_CHECK_TOOL(NM, nm)
208 AC_SUBST(TARGET_CC)
211 # Test the C compiler for the target environment.
212 tmp_CC="$CC"
213 tmp_CFLAGS="$CFLAGS"
214 tmp_LDFLAGS="$LDFLAGS"
215 tmp_CPPFLAGS="$CPPFLAGS"
216 tmp_LIBS="$LIBS"
217 CC="$TARGET_CC"
218 CFLAGS="$TARGET_CFLAGS"
219 CPPFLAGS="$TARGET_CPPFLAGS"
220 LDFLAGS="$TARGET_LDFLAGS"
221 LIBS=""
223 if test "x$TARGET_CFLAGS" = x; then
224   # debug flags.
225   TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
226                  -Wundef -Wstrict-prototypes -g"
228   # optimization flags.
229   AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [
230     CFLAGS=-Os
231     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
232                       [grub_cv_cc_Os=yes],
233                       [grub_cv_cc_Os=no])
234   ])
235   if test "x$grub_cv_cc_Os" = xyes; then
236     TARGET_CFLAGS="$TARGET_CFLAGS -Os"
237   else
238     TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
239   fi
241   # Force no alignment to save space on i386.
242   if test "x$target_cpu" = xi386; then
243     AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
244       CFLAGS="$CFLAGS -falign-loops=1"
245       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
246                         [grub_cv_cc_falign_loop=yes],
247                         [grub_cv_cc_falign_loop=no])
248     ])
250     if test "x$grub_cv_cc_falign_loop" = xyes; then
251       TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
252     else
253       TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
254     fi
255   fi
257   # By default, GCC 4.4 generates .eh_frame sections containing unwind
258   # information in some cases where it previously did not. GRUB doesn't need
259   # these and they just use up vital space. Restore the old compiler
260   # behaviour.
261   AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
262     SAVE_CFLAGS="$CFLAGS"
263     CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
264     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
265                       [grub_cv_cc_fno_dwarf2_cfi_asm=yes],
266                       [grub_cv_cc_fno_dwarf2_cfi_asm=no])
267     CFLAGS="$SAVE_CFLAGS"
268   ])
270   if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
271     TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
272   fi
275 grub_apple_target_cc
276 if test x$grub_cv_apple_target_cc = xyes ; then
277   TARGET_CFLAGS="$TARGET_CFLAGS -DAPPLE_CC=1 -fnested-functions"
278   CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
279   TARGET_ASFLAGS="$TARGET_ASFLAGS -DAPPLE_CC=1"
280   TARGET_APPLE_CC=1
281   AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
282   if test "x$OBJCONV" = x ; then
283      AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.])
284   fi
285   if test "x$OBJCONV" = x ; then
286     AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
287   fi
288   TARGET_IMG_LDSCRIPT=
289   TARGET_IMG_CFLAGS="-static"
290   TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
291   TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
292 else
293   TARGET_APPLE_CC=0
294 # Use linker script if present, otherwise use builtin -N script.
295 if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
296   TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
297   TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}  -Wl,-Ttext,"
298   TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
299 else
300   TARGET_IMG_LDSCRIPT=
301   TARGET_IMG_LDFLAGS='-Wl,-N  -Wl,-Ttext,'
302   TARGET_IMG_LDFLAGS_AC='-Wl,-N  -Wl,-Ttext,'
304 TARGET_IMG_CFLAGS=
307 AC_SUBST(TARGET_IMG_LDSCRIPT)
308 AC_SUBST(TARGET_IMG_LDFLAGS)
309 AC_SUBST(TARGET_IMG_CFLAGS)
311 # For platforms where ELF is not the default link format.
312 AC_MSG_CHECKING([for command to convert module to ELF format])
313 case "${host_os}" in
314   cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;;
315   *) ;;
316 esac
317 AC_SUBST(TARGET_OBJ2ELF)
318 AC_MSG_RESULT([$TARGET_OBJ2ELF])
321 if test "x$target_m32" = x1; then
322   # Force 32-bit mode.
323   TARGET_CFLAGS="$TARGET_CFLAGS -m32"
324   TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
325   TARGET_MODULE_FORMAT="elf32"
328 if test "x$target_m64" = x1; then
329   # Force 64-bit mode.
330   TARGET_CFLAGS="$TARGET_CFLAGS -m64"
331   TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
332   TARGET_MODULE_FORMAT="elf64"
335 if test "$target_cpu"-"$platform" = x86_64-efi; then
336   # Use large model to support 4G memory
337   AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
338     SAVED_CFLAGS=$CFLAGS
339     CFLAGS="$CFLAGS -m64 -mcmodel=large"
340     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
341                       [grub_cv_cc_mcmodel=yes],
342                       [grub_cv_cc_mcmodel=no])
343   ])
344   if test "x$grub_cv_cc_mcmodel" = xno; then
345     CFLAGS="$SAVED_CFLAGS -m64 -DMCMODEL_SMALL=1"
346     TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1"
347     AC_MSG_WARN([-mcmodel=large not supported. You won't be able to use the memory over 4GiB. Upgrade your gcc])
348   else
349     TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
350   fi
352   # EFI writes to stack below %rsp, we must not use the red zone
353   AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
354     CFLAGS="$CFLAGS -m64 -mno-red-zone"
355     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
356                       [grub_cv_cc_no_red_zone=yes],
357                       [grub_cv_cc_no_red_zone=no])
358   ])
359   if test "x$grub_cv_cc_no_red_zone" = xno; then
360     AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
361   fi
363   TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
367 # Compiler features.
370 # Need __enable_execute_stack() for nested function trampolines?
371 grub_CHECK_ENABLE_EXECUTE_STACK
373 # Position independent executable.
374 grub_CHECK_PIE
375 [# Need that, because some distributions ship compilers that include
376 # `-fPIE' in the default specs.
377 if [ x"$pie_possible" = xyes ]; then
378   TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
381 # Smashing stack protector.
382 grub_CHECK_STACK_PROTECTOR
383 # Need that, because some distributions ship compilers that include
384 # `-fstack-protector' in the default specs.
385 if test "x$ssp_possible" = xyes; then
386   TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
388 grub_CHECK_STACK_ARG_PROBE
389 # Cygwin's GCC uses alloca() to probe the stackframe on static
390 # stack allocations above some threshold.
391 if test x"$sap_possible" = xyes; then
392   TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
395 AC_ARG_ENABLE([werror],
396               [AS_HELP_STRING([--disable-werror],
397                              [do not use -Werror when building GRUB])])
398 if test x"$enable_werror" != xno ; then
399   TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
402 AC_SUBST(TARGET_CFLAGS)
403 AC_SUBST(TARGET_MODULE_FORMAT)
404 AC_SUBST(OBJCONV)
405 AC_SUBST(TARGET_APPLE_CC)
406 AC_SUBST(TARGET_ASFLAGS)
407 AC_SUBST(TARGET_CPPFLAGS)
408 AC_SUBST(TARGET_LDFLAGS)
410 # Set them to their new values for the tests below.
411 CC="$TARGET_CC"
412 if test "x$TARGET_APPLE_CC" = x1 ; then
413 CFLAGS="$TARGET_CFLAGS -nostdlib"
414 else
415 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
417 CPPFLAGS="$TARGET_CPPFLAGS"
418 LDFLAGS="$TARGET_LDFLAGS"
420 # Defined in aclocal.m4.
421 grub_PROG_TARGET_CC
422 if test "x$TARGET_APPLE_CC" != x1 ; then
423 grub_PROG_OBJCOPY_ABSOLUTE
425 grub_PROG_LD_BUILD_ID_NONE
426 grub_ASM_USCORE
427 if test "x$target_cpu" = xi386; then
428   if test ! -z "$TARGET_IMG_LDSCRIPT"; then
429     # Check symbols provided by linker script.
430     CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100"
431   fi
432   if test "x$TARGET_APPLE_CC" != x1 ; then
433     grub_CHECK_BSS_START_SYMBOL
434     grub_CHECK_END_SYMBOL
435   fi
436   CFLAGS="$TARGET_CFLAGS"
437   grub_I386_ASM_PREFIX_REQUIREMENT
438   grub_I386_ASM_ADDR32
439   grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
440 else
441   AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
444 AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL)
445 #define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
446 #else
447 #define NESTED_FUNC_ATTR
448 #endif])
450 AC_ARG_ENABLE([efiemu],
451               [AS_HELP_STRING([--enable-efiemu],
452                              [build and install the efiemu runtimes (default=guessed)])])
453 if test x"$enable_efiemu" = xno ; then
454   efiemu_excuse="explicitly disabled"
456 if test x"$efiemu_excuse" = x ; then
457   AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
458     CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
459     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
460                       [grub_cv_cc_efiemu=yes],
461                       [grub_cv_cc_efiemu=no])
462   ])
463   if test x$grub_cv_cc_efiemu = xno; then
464      efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
465   fi
467 if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
468   AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
470 if test x"$efiemu_excuse" = x ; then
471 enable_efiemu=yes
472 else
473 enable_efiemu=no
475 AC_SUBST([enable_efiemu])
478 # Restore the flags.
479 CC="$tmp_CC"
480 CFLAGS="$tmp_CFLAGS"
481 CPPFLAGS="$tmp_CPPFLAGS"
482 LDFLAGS="$tmp_LDFLAGS"
483 LIBS="$tmp_LIBS"
486 # Check for options.
489 # Memory manager debugging.
490 AC_ARG_ENABLE([mm-debug],
491               AS_HELP_STRING([--enable-mm-debug],
492                              [include memory manager debugging]),
493               [AC_DEFINE([MM_DEBUG], [1],
494                          [Define to 1 if you enable memory manager debugging.])])
496 AC_ARG_ENABLE([grub-emu],
497               [AS_HELP_STRING([--enable-grub-emu],
498                              [build and install the `grub-emu' debugging utility (default=guessed)])])
499 AC_ARG_ENABLE([grub-emu-usb],
500               [AS_HELP_STRING([--enable-grub-emu-usb],
501                              [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
502 if test x"$enable_grub_emu" = xno ; then
503   grub_emu_excuse="explicitly disabled"
506   [# Check for curses libraries.]
507 [if [ x"$grub_emu_excuse" = x ]; then ]
508   AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
509     [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
510       [grub_emu_excuse=["need (n)curses libraries"]])])
511   AC_SUBST([LIBCURSES])
512 [fi]
513 [if [ x"$grub_emu_excuse" = x ]; then ]
514   [# Check for headers.]
515   AC_CHECK_HEADERS([ncurses/curses.h], [],
516     [AC_CHECK_HEADERS([ncurses.h], [],
517       [AC_CHECK_HEADERS([curses.h], [],
518         [grub_emu_excuse=["need (n)curses headers"]])])])
519 [fi]
521 if test x"$enable_grub_emu" = xyes && test x"$grub_emu_excuse" != x ; then
522   AC_MSG_ERROR([grub-emu was explicitly requested but can't be compiled])
524 if test x"$grub_emu_excuse" = x ; then
525 enable_grub_emu=yes
526 else
527 enable_grub_emu=no
528 grub_emu_usb_excuse="grub-emu isn't built"
530 if test x"$enable_grub_emu_usb" = xno ; then
531   grub_emu_usb_excuse="explicitly disabled"
533 [if [ x"$grub_emu_usb_excuse" = x ]; then
534     # Check for libusb libraries.]
535 AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
536     [grub_emu_usb_excuse=["need libusb library"]])
537     AC_SUBST([LIBUSB])
538 [fi]
539 [if [ x"$grub_emu_usb_excuse" = x ]; then
540     # Check for headers.]
541     AC_CHECK_HEADERS([usb.h], [],
542       [grub_emu_usb_excuse=["need libusb headers"]])
543 [fi]
544 if test x"enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
545   AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
547 if test x"$grub_emu_usb_excuse" = x ; then
548 enable_grub_emu_usb=yes
549 else
550 enable_grub_emu_usb=no
553 AC_SUBST([enable_grub_emu])
554 AC_SUBST([enable_grub_emu_usb])
556 AC_ARG_ENABLE([grub-fstest],
557               [AS_HELP_STRING([--enable-grub-fstest],
558                              [build and install the `grub-fstest' debugging utility (default=guessed)])])
559 if test x"$enable_grub_fstest" = xno ; then
560   grub_fstest_excuse="explicitly disabled"
562 if test x"$grub_fstest_excuse" = x ; then
563 enable_grub_fstest=yes
564 else
565 enable_grub_fstest=no
567 AC_SUBST([enable_grub_fstest])
569 AC_ARG_ENABLE([grub-mkfont],
570               [AS_HELP_STRING([--enable-grub-mkfont],
571                              [build and install the `grub-mkfont' utility (default=guessed)])])
572 if test x"$enable_grub_mkfont" = xno ; then
573   grub_mkfont_excuse="explicitly disabled"
576 if test x"$grub_mkfont_excuse" = x ; then
577   # Check for freetype libraries.
578   AC_CHECK_PROGS([FREETYPE], [freetype-config])
579   if test "x$FREETYPE" = x ; then
580     grub_mkfont_excuse=["need freetype2 library"]
581   fi
582   freetype_cflags=`freetype-config --cflags`
583   freetype_libs=`freetype-config --libs`
585 if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
586   AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
588 if test x"$grub_mkfont_excuse" = x ; then
589 enable_grub_mkfont=yes
590 else
591 enable_grub_mkfont=no
593 AC_SUBST([enable_grub_mkfont])
594 AC_SUBST([freetype_cflags])
595 AC_SUBST([freetype_libs])
597 AC_SUBST(ASFLAGS)
599 # Output files.
600 grub_CHECK_LINK_DIR
601 if test x"$link_dir" = xyes ; then
602   AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
603         include/grub/machine:include/grub/$target_cpu/$platform])
604 else
605   mkdir -p include/grub 2>/dev/null
606   rm -rf include/grub/cpu
607   cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
608   rm -rf include/grub/machine
609   cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
611 AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
612 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
613 AC_OUTPUT
615 echo "*******************************************************"
616 echo GRUB2 will be compiled with following components:
617 echo Platform: "$target_cpu"-"$platform"
618 if [ x"$grub_emu_excuse" = x ]; then
619 echo grub-emu: Yes
620 else
621 echo grub-emu: No "($grub_emu_excuse)"
623 if [ x"$grub_emu_usb_excuse" = x ]; then
624 echo USB support for grub-emu: Yes
625 else
626 echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
628 if [ x"$enable_mm_debug" = xyes ]; then
629 echo With memory debugging: Yes
630 else
631 echo With memory debugging: No
633 if [ x"$efiemu_excuse" = x ]; then
634 echo efiemu runtime: Yes
635 else
636 echo efiemu runtime: No "($efiemu_excuse)"
638 if [ x"$grub_fstest_excuse" = x ]; then
639 echo grub-fstest: Yes
640 else
641 echo grub-fstest: No "($grub_fstest_excuse)"
643 if [ x"$grub_mkfont_excuse" = x ]; then
644 echo grub-mkfont: Yes
645 else
646 echo grub-mkfont: No "($grub_mkfont_excuse)"
648 echo "*******************************************************"