2009-09-10 Felix Zielcke <fzielcke@z-51.de>
[grub2/phcoder/solaris.git] / configure.ac
blob5516058121e6a0634471d3d0a9fcadb5bf0b4432
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~beta2],[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
148 # These are not a "must".
149 AC_PATH_PROG(RUBY, ruby)
150 AC_PATH_PROG(HELP2MAN, help2man)
153 # Checks for host programs.
156 AC_PROG_CC
157 # Must be GCC.
158 test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
160 AC_GNU_SOURCE
161 AC_SYS_LARGEFILE
163 # Identify characteristics of the host architecture.
164 AC_C_BIGENDIAN
165 AC_CHECK_SIZEOF(void *)
166 AC_CHECK_SIZEOF(long)
168 grub_apple_cc
169 if test x$grub_cv_apple_cc = xyes ; then
170   CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
171   ASFLAGS="$ASFLAGS -DAPPLE_CC=1"
174 # Check for functions.
175 AC_CHECK_FUNCS(posix_memalign memalign asprintf)
178 # Check for target programs.
181 # Find tools for the target.
182 if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
183   tmp_ac_tool_prefix="$ac_tool_prefix"
184   ac_tool_prefix=$target_alias-
186   AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
187                  [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
188   AC_CHECK_TOOL(OBJCOPY, objcopy)
189   AC_CHECK_TOOL(STRIP, strip)
190   AC_CHECK_TOOL(NM, nm)
192   ac_tool_prefix="$tmp_ac_tool_prefix"
193 else
194   if test "x$TARGET_CC" = x; then
195     TARGET_CC=$CC
196   fi
197   AC_CHECK_TOOL(OBJCOPY, objcopy)
198   AC_CHECK_TOOL(STRIP, strip)
199   AC_CHECK_TOOL(NM, nm)
201 AC_SUBST(TARGET_CC)
204 # Test the C compiler for the target environment.
205 tmp_CC="$CC"
206 tmp_CFLAGS="$CFLAGS"
207 tmp_LDFLAGS="$LDFLAGS"
208 tmp_CPPFLAGS="$CPPFLAGS"
209 tmp_LIBS="$LIBS"
210 CC="$TARGET_CC"
211 CFLAGS="$TARGET_CFLAGS"
212 CPPFLAGS="$TARGET_CPPFLAGS"
213 LDFLAGS="$TARGET_LDFLAGS"
214 LIBS=""
216 if test "x$TARGET_CFLAGS" = x; then
217   # debug flags.
218   TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
219                  -Wundef -Wstrict-prototypes -g"
221   # optimization flags.
222   AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [
223     CFLAGS=-Os
224     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
225                       [grub_cv_cc_Os=yes],
226                       [grub_cv_cc_Os=no])
227   ])
228   if test "x$grub_cv_cc_Os" = xyes; then
229     TARGET_CFLAGS="$TARGET_CFLAGS -Os"
230   else
231     TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
232   fi
234   # Force no alignment to save space on i386.
235   if test "x$target_cpu" = xi386; then
236     AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
237       CFLAGS="$CFLAGS -falign-loops=1"
238       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
239                         [grub_cv_cc_falign_loop=yes],
240                         [grub_cv_cc_falign_loop=no])
241     ])
243     if test "x$grub_cv_cc_falign_loop" = xyes; then
244       TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
245     else
246       TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
247     fi
248   fi
250   # By default, GCC 4.4 generates .eh_frame sections containing unwind
251   # information in some cases where it previously did not. GRUB doesn't need
252   # these and they just use up vital space. Restore the old compiler
253   # behaviour.
254   AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
255     SAVE_CFLAGS="$CFLAGS"
256     CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
257     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
258                       [grub_cv_cc_fno_dwarf2_cfi_asm=yes],
259                       [grub_cv_cc_fno_dwarf2_cfi_asm=no])
260     CFLAGS="$SAVE_CFLAGS"
261   ])
263   if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
264     TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
265   fi
268 grub_apple_target_cc
269 if test x$grub_cv_apple_target_cc = xyes ; then
270   TARGET_CFLAGS="$TARGET_CFLAGS -DAPPLE_CC=1 -fnested-functions"
271   CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
272   TARGET_ASFLAGS="$TARGET_ASFLAGS -DAPPLE_CC=1"
273   TARGET_APPLE_CC=1
274   AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
275   if test "x$OBJCONV" = x ; then
276      AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.])
277   fi
278   if test "x$OBJCONV" = x ; then
279     AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
280   fi
281   TARGET_IMG_LDSCRIPT=
282   TARGET_IMG_CFLAGS="-static"
283   TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
284   TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
285 else
286   TARGET_APPLE_CC=0
287 # Use linker script if present, otherwise use builtin -N script.
288 if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
289   TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
290   TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}  -Wl,-Ttext,"
291   TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
292 else
293   TARGET_IMG_LDSCRIPT=
294   TARGET_IMG_LDFLAGS='-Wl,-N  -Wl,-Ttext,'
295   TARGET_IMG_LDFLAGS_AC='-Wl,-N  -Wl,-Ttext,'
297 TARGET_IMG_CFLAGS=
300 AC_SUBST(TARGET_IMG_LDSCRIPT)
301 AC_SUBST(TARGET_IMG_LDFLAGS)
302 AC_SUBST(TARGET_IMG_CFLAGS)
304 # For platforms where ELF is not the default link format.
305 AC_MSG_CHECKING([for command to convert module to ELF format])
306 case "${host_os}" in
307   cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;;
308   *) ;;
309 esac
310 AC_SUBST(TARGET_OBJ2ELF)
311 AC_MSG_RESULT([$TARGET_OBJ2ELF])
314 if test "x$target_m32" = x1; then
315   # Force 32-bit mode.
316   TARGET_CFLAGS="$TARGET_CFLAGS -m32"
317   TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
318   TARGET_MODULE_FORMAT="elf32"
321 if test "x$target_m64" = x1; then
322   # Force 64-bit mode.
323   TARGET_CFLAGS="$TARGET_CFLAGS -m64"
324   TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
325   TARGET_MODULE_FORMAT="elf64"
328 if test "$target_cpu"-"$platform" = x86_64-efi; then
329   # Use large model to support 4G memory
330   AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
331     SAVED_CFLAGS=$CFLAGS
332     CFLAGS="$CFLAGS -m64 -mcmodel=large"
333     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
334                       [grub_cv_cc_mcmodel=yes],
335                       [grub_cv_cc_mcmodel=no])
336   ])
337   if test "x$grub_cv_cc_mcmodel" = xno; then
338     CFLAGS="$SAVED_CFLAGS -m64 -DMCMODEL_SMALL=1"
339     TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1"
340     AC_MSG_WARN([-mcmodel=large not supported. You won't be able to use the memory over 4GiB. Upgrade your gcc])
341   else
342     TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
343   fi
345   # EFI writes to stack below %rsp, we must not use the red zone
346   AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
347     CFLAGS="$CFLAGS -m64 -mno-red-zone"
348     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
349                       [grub_cv_cc_no_red_zone=yes],
350                       [grub_cv_cc_no_red_zone=no])
351   ])
352   if test "x$grub_cv_cc_no_red_zone" = xno; then
353     AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
354   fi
356   TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
360 # Compiler features.
363 # Need __enable_execute_stack() for nested function trampolines?
364 grub_CHECK_ENABLE_EXECUTE_STACK
366 # Position independent executable.
367 grub_CHECK_PIE
368 [# Need that, because some distributions ship compilers that include
369 # `-fPIE' in the default specs.
370 if [ x"$pie_possible" = xyes ]; then
371   TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
374 # Smashing stack protector.
375 grub_CHECK_STACK_PROTECTOR
376 # Need that, because some distributions ship compilers that include
377 # `-fstack-protector' in the default specs.
378 if test "x$ssp_possible" = xyes; then
379   TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
381 grub_CHECK_STACK_ARG_PROBE
382 # Cygwin's GCC uses alloca() to probe the stackframe on static
383 # stack allocations above some threshold.
384 if test x"$sap_possible" = xyes; then
385   TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
388 AC_SUBST(TARGET_CFLAGS)
389 AC_SUBST(TARGET_MODULE_FORMAT)
390 AC_SUBST(OBJCONV)
391 AC_SUBST(TARGET_APPLE_CC)
392 AC_SUBST(TARGET_ASFLAGS)
393 AC_SUBST(TARGET_CPPFLAGS)
394 AC_SUBST(TARGET_LDFLAGS)
396 # Set them to their new values for the tests below.
397 CC="$TARGET_CC"
398 if test "x$TARGET_APPLE_CC" = x1 ; then
399 CFLAGS="$TARGET_CFLAGS -nostdlib"
400 else
401 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
403 CPPFLAGS="$TARGET_CPPFLAGS"
404 LDFLAGS="$TARGET_LDFLAGS"
406 # Defined in aclocal.m4.
407 grub_PROG_TARGET_CC
408 if test "x$TARGET_APPLE_CC" != x1 ; then
409 grub_PROG_OBJCOPY_ABSOLUTE
411 grub_PROG_LD_BUILD_ID_NONE
412 grub_ASM_USCORE
413 if test "x$target_cpu" = xi386; then
414   if test ! -z "$TARGET_IMG_LDSCRIPT"; then
415     # Check symbols provided by linker script.
416     CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100"
417   fi
418   if test "x$TARGET_APPLE_CC" != x1 ; then
419     grub_CHECK_BSS_START_SYMBOL
420     grub_CHECK_END_SYMBOL
421   fi
422   CFLAGS="$TARGET_CFLAGS"
423   grub_I386_ASM_PREFIX_REQUIREMENT
424   grub_I386_ASM_ADDR32
425   grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
426 else
427   AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
430 AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL)
431 #define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
432 #else
433 #define NESTED_FUNC_ATTR
434 #endif])
436 AC_ARG_ENABLE([efiemu],
437               [AS_HELP_STRING([--enable-efiemu],
438                              [build and install the efiemu runtimes (default=guessed)])])
439 if test x"$enable_efiemu" = xno ; then
440   efiemu_excuse="explicitly disabled"
442 if test x"$efiemu_excuse" = x ; then
443   AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
444     CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
445     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
446                       [grub_cv_cc_efiemu=yes],
447                       [grub_cv_cc_efiemu=no])
448   ])
449   if test x$grub_cv_cc_efiemu = xno; then
450      efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
451   fi
453 if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
454   AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
456 if test x"$efiemu_excuse" = x ; then
457 enable_efiemu=yes
458 else
459 enable_efiemu=no
461 AC_SUBST([enable_efiemu])
464 # Restore the flags.
465 CC="$tmp_CC"
466 CFLAGS="$tmp_CFLAGS"
467 CPPFLAGS="$tmp_CPPFLAGS"
468 LDFLAGS="$tmp_LDFLAGS"
469 LIBS="$tmp_LIBS"
472 # Check for options.
475 # Memory manager debugging.
476 AC_ARG_ENABLE([mm-debug],
477               AS_HELP_STRING([--enable-mm-debug],
478                              [include memory manager debugging]),
479               [AC_DEFINE([MM_DEBUG], [1],
480                          [Define to 1 if you enable memory manager debugging.])])
482 AC_ARG_ENABLE([grub-emu],
483               [AS_HELP_STRING([--enable-grub-emu],
484                              [build and install the `grub-emu' debugging utility (default=guessed)])])
485 AC_ARG_ENABLE([grub-emu-usb],
486               [AS_HELP_STRING([--enable-grub-emu-usb],
487                              [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
488 if test x"$enable_grub_emu" = xno ; then
489   grub_emu_excuse="explicitly disabled"
492   [# Check for curses libraries.]
493 [if [ x"$grub_emu_excuse" = x ]; then ]
494   AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
495     [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
496       [grub_emu_excuse=["need (n)curses libraries"]])])
497   AC_SUBST([LIBCURSES])
498 [fi]
499 [if [ x"$grub_emu_excuse" = x ]; then ]
500   [# Check for headers.]
501   AC_CHECK_HEADERS([ncurses/curses.h], [],
502     [AC_CHECK_HEADERS([ncurses.h], [],
503       [AC_CHECK_HEADERS([curses.h], [],
504         [grub_emu_excuse=["need (n)curses headers"]])])])
505 [fi]
507 if test x"$enable_grub_emu" = xyes && test x"$grub_emu_excuse" != x ; then
508   AC_MSG_ERROR([grub-emu was explicitly requested but can't be compiled])
510 if test x"$grub_emu_excuse" = x ; then
511 enable_grub_emu=yes
512 else
513 enable_grub_emu=no
514 grub_emu_usb_excuse="grub-emu isn't built"
516 if test x"$enable_grub_emu_usb" = xno ; then
517   grub_emu_usb_excuse="explicitly disabled"
519 [if [ x"$grub_emu_usb_excuse" = x ]; then
520     # Check for libusb libraries.]
521 AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
522     [grub_emu_usb_excuse=["need libusb library"]])
523     AC_SUBST([LIBUSB])
524 [fi]
525 [if [ x"$grub_emu_usb_excuse" = x ]; then
526     # Check for headers.]
527     AC_CHECK_HEADERS([usb.h], [],
528       [grub_emu_usb_excuse=["need libusb headers"]])
529 [fi]
530 if test x"enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
531   AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
533 if test x"$grub_emu_usb_excuse" = x ; then
534 enable_grub_emu_usb=yes
535 else
536 enable_grub_emu_usb=no
539 AC_SUBST([enable_grub_emu])
540 AC_SUBST([enable_grub_emu_usb])
542 AC_ARG_ENABLE([grub-fstest],
543               [AS_HELP_STRING([--enable-grub-fstest],
544                              [build and install the `grub-fstest' debugging utility (default=guessed)])])
545 if test x"$enable_grub_fstest" = xno ; then
546   grub_fstest_excuse="explicitly disabled"
548 if test x"$grub_fstest_excuse" = x ; then
549 enable_grub_fstest=yes
550 else
551 enable_grub_fstest=no
553 AC_SUBST([enable_grub_fstest])
555 AC_ARG_ENABLE([grub-pe2elf],
556               [AS_HELP_STRING([--enable-grub-pe2elf],
557                              [build and install the `grub-pe2elf' conversion utility])])
558 AC_SUBST([enable_grub_pe2elf])
560 AC_ARG_ENABLE([grub-mkfont],
561               [AS_HELP_STRING([--enable-grub-mkfont],
562                              [build and install the `grub-mkfont' utility (default=guessed)])])
563 if test x"$enable_grub_mkfont" = xno ; then
564   grub_mkfont_excuse="explicitly disabled"
567 if test x"$grub_mkfont_excuse" = x ; then
568   # Check for freetype libraries.
569   AC_CHECK_PROGS([FREETYPE], [freetype-config])
570   if test "x$FREETYPE" = x ; then
571     grub_mkfont_excuse=["need freetype2 library"]
572   fi
573   freetype_cflags=`freetype-config --cflags`
574   freetype_libs=`freetype-config --libs`
576 if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
577   AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
579 if test x"$grub_mkfont_excuse" = x ; then
580 enable_grub_mkfont=yes
581 else
582 enable_grub_mkfont=no
584 AC_SUBST([enable_grub_mkfont])
585 AC_SUBST([freetype_cflags])
586 AC_SUBST([freetype_libs])
588 AC_SUBST(ASFLAGS)
590 # Output files.
591 grub_CHECK_LINK_DIR
592 if test x"$link_dir" = xyes ; then
593   AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
594         include/grub/machine:include/grub/$target_cpu/$platform])
595 else
596   mkdir -p include/grub 2>/dev/null
597   rm -rf include/grub/cpu
598   cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
599   rm -rf include/grub/machine
600   cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
602 AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
603 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
604 AC_OUTPUT
606 echo "*******************************************************"
607 echo GRUB2 will be compiled with following components:
608 echo Platform: "$target_cpu"-"$platform"
609 if [ x"$grub_emu_excuse" = x ]; then
610 echo grub-emu: Yes
611 else
612 echo grub-emu: No "($grub_emu_excuse)"
614 if [ x"$grub_emu_usb_excuse" = x ]; then
615 echo USB support for grub-emu: Yes
616 else
617 echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
619 if [ x"$enable_mm_debug" = xyes ]; then
620 echo With memory debugging: Yes
621 else
622 echo With memory debugging: No
624 if [ x"$enable_grub_pe2elf" = xyes ]; then
625 echo grub-pe2elf will be built and installed
626 elif [ x$TARGET_OBJ2ELF = xgrub-pe2elf ]; then
627 echo grub-pe2elf will be built but not installed
628 else
629 echo grub-pe2elf will not be built
631 if [ x"$efiemu_excuse" = x ]; then
632 echo efiemu runtime: Yes
633 else
634 echo efiemu runtime: No "($efiemu_excuse)"
636 if [ x"$grub_fstest_excuse" = x ]; then
637 echo grub-fstest: Yes
638 else
639 echo grub-fstest: No "($grub_fstest_excuse)"
641 if [ x"$grub_mkfont_excuse" = x ]; then
642 echo grub-mkfont: Yes
643 else
644 echo grub-mkfont: No "($grub_mkfont_excuse)"
646 echo "*******************************************************"