]> git.proxmox.com Git - grub2.git/blame - configure.ac
2009-06-11 Giuseppe Caizzone <acaizzo@gmail.com>
[grub2.git] / configure.ac
CommitLineData
6a161fa9 1# Process this file with autoconf to produce a configure script.
2
1e901a75 3# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
6a161fa9 4#
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.
8#
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.
13
b977bf01 14dnl This configure script is complicated, because GRUB needs to deal
15dnl with three potentially different types:
16dnl
17dnl build -- the environment for building GRUB
18dnl host -- the environment for running utilities
19dnl target -- the environment for running GRUB
20dnl
21dnl In addition, GRUB needs to deal with a platform specification
22dnl which specifies the system running GRUB, such as firmware.
23dnl This is necessary because the target type in autoconf does not
24dnl describe such a system very well.
25dnl
26dnl The current strategy is to use variables with no prefix (such as
27dnl CC, CFLAGS, etc.) for the host type as well as the build type,
28dnl because GRUB does not need to use those variables for the build
29dnl type, so there is no conflict. Variables with the prefix "TARGET_"
30dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
31dnl type.
32
33
eb73121d 34AC_INIT([GRUB],[1.96],[bug-grub@gnu.org])
46e04eb9 35AC_PREREQ(2.59)
4b13b216 36AC_CONFIG_SRCDIR([include/grub/dl.h])
6a161fa9 37AC_CONFIG_HEADER([config.h])
38
b977bf01 39# Checks for host and target systems.
6a161fa9 40AC_CANONICAL_HOST
b977bf01 41AC_CANONICAL_TARGET
6a161fa9 42
1d543c3e 43# Program name transformations
44AC_ARG_PROGRAM
45
b977bf01 46case "$target_cpu" in
47 i[[3456]]86) target_cpu=i386 ;;
6a161fa9 48esac
49
05568c2e 50# Specify the platform (such as firmware).
51AC_ARG_WITH([platform],
52 AS_HELP_STRING([--with-platform=PLATFORM],
83b984de 53 [select the host platform [[guessed]]]))
05568c2e 54
55# Guess the platform if not specified.
56if test "x$with_platform" = x; then
b977bf01 57 case "$target_cpu"-"$target_vendor" in
05568c2e 58 i386-apple) platform=efi ;;
59 i386-*) platform=pc ;;
58393a2d 60 x86_64-apple) platform=efi ;;
737feb35 61 x86_64-*) platform=pc ;;
05568c2e 62 powerpc-*) platform=ieee1275 ;;
58393a2d 63 powerpc64-*) platform=ieee1275 ;;
05568c2e 64 sparc64-*) platform=ieee1275 ;;
58393a2d 65 *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
05568c2e 66 esac
67else
68 platform="$with_platform"
69fi
70
58393a2d 71# Adjust CPU unless target was explicitly specified.
72if test -z "$target_alias"; then
73 case "$target_cpu"-"$platform" in
74 x86_64-efi) ;;
3f4ce737 75 x86_64-*) target_cpu=i386 ;;
76 powerpc64-ieee1275) target_cpu=powerpc ;;
20011694 77 esac
78fi
79
58393a2d 80# Check if the platform is supported, make final adjustments.
b977bf01 81case "$target_cpu"-"$platform" in
05568c2e 82 i386-efi) ;;
3f4ce737 83 x86_64-efi) ;;
05568c2e 84 i386-pc) ;;
546f966a 85 i386-coreboot) ;;
58393a2d 86 i386-linuxbios) platform=coreboot ;;
3d04eab8 87 i386-ieee1275) ;;
05568c2e 88 powerpc-ieee1275) ;;
89 sparc64-ieee1275) ;;
58393a2d 90 *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
6a161fa9 91esac
92
3f4ce737 93case "$target_cpu" in
94 i386 | powerpc) target_m32=1 ;;
95 x86_64 | sparc64) target_m64=1 ;;
96esac
97
6e5a42fe 98case "$host_os" in
99 mingw32) host_os=cygwin ;;
100esac
101
9304eef1 102# This normalizes the names, and creates a new variable ("host_kernel")
103# while at it, since the mapping is not always 1:1 (e.g. different OSes
104# using the same kernel type).
105case "$host_os" in
106 gnu*) host_kernel=hurd ;;
107 linux*) host_kernel=linux ;;
108 freebsd* | kfreebsd*-gnu) host_kernel=freebsd ;;
109 cygwin) host_kernel=windows ;;
110esac
111
56978920 112AC_SUBST(host_cpu)
113AC_SUBST(host_os)
9304eef1 114AC_SUBST(host_kernel)
6e5a42fe 115
b977bf01 116AC_SUBST(target_cpu)
05568c2e 117AC_SUBST(platform)
6a161fa9 118
b977bf01 119#
120# Checks for build programs.
121#
144f1f98 122
6c826348 123# Although cmp is listed in the GNU Coding Standards as a command which
124# can used directly, OpenBSD lacks cmp in the default installation.
125AC_CHECK_PROGS([CMP], [cmp])
126if test "x$CMP" = x; then
127 AC_MSG_ERROR([cmp is not found])
128fi
129
144f1f98 130AC_CHECK_PROGS([YACC], [bison])
1569ec51 131if test "x$YACC" = x; then
6c826348 132 AC_MSG_ERROR([bison is not found])
1569ec51 133fi
134
1e901a75 135for file in /usr/src/unifont.bdf ; do
4931827f 136 if test -e $file ; then
1e901a75 137 AC_SUBST([UNIFONT_BDF], [$file])
4931827f 138 break
139 fi
140done
141
b977bf01 142AC_PROG_INSTALL
143AC_PROG_AWK
144AC_PROG_MAKE_SET
145
68807e5f 146# These are not a "must".
b977bf01 147AC_PATH_PROG(RUBY, ruby)
68807e5f 148AC_PATH_PROG(HELP2MAN, help2man)
6a161fa9 149
b977bf01 150#
151# Checks for host programs.
152#
153
154AC_PROG_CC
6a161fa9 155# Must be GCC.
156test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
157
4889bdec 158AC_GNU_SOURCE
b977bf01 159AC_SYS_LARGEFILE
160
161# Identify characteristics of the host architecture.
162AC_C_BIGENDIAN
163AC_CHECK_SIZEOF(void *)
164AC_CHECK_SIZEOF(long)
165
2b167a72 166grub_apple_cc
167if test x$grub_cv_apple_cc == xyes ; then
168 CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
169 ASFLAGS="$ASFLAGS -DAPPLE_CC=1"
170fi
b977bf01 171
172# Check LZO when compiling for the i386-pc.
173if test "$target_cpu"-"$platform" = i386-pc; then
aa24b516 174 AC_ARG_ENABLE([lzo],
175 [AS_HELP_STRING([--enable-lzo],
176 [use lzo to compress kernel (default is lzma)])])
177 [if [ x"$enable_lzo" = xyes ]; then
178 # There are three possibilities. LZO version 2 installed with the name
179 # liblzo2, with the name liblzo, and LZO version 1.]
180 AC_DEFINE([ENABLE_LZO], [1], [Use lzo compression])
181 AC_CHECK_LIB([lzo2], [__lzo_init_v2], [LIBLZO="-llzo2"],
182 [AC_CHECK_LIB([lzo], [__lzo_init_v2], [LIBLZO="-llzo"],
183 [AC_CHECK_LIB([lzo], [__lzo_init2], [LIBLZO="-llzo"],
184 [AC_MSG_ERROR([LZO library version 1.02 or later is required])])])])
185 AC_SUBST([LIBLZO])
186 [LIBS="$LIBS $LIBLZO"]
187 AC_CHECK_FUNC([lzo1x_999_compress], ,
b977bf01 188 [AC_MSG_ERROR([LZO1X-999 must be enabled])])
189
aa24b516 190 [# LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.]
191 AC_CHECK_HEADERS([lzo/lzo1x.h lzo1x.h])
192 [else]
193 AC_DEFINE([ENABLE_LZMA], [1], [Use lzma compression])
194 [fi]
195 AC_SUBST([enable_lzo])
b977bf01 196fi
197
4889bdec 198# Check for functions.
df38d0bb 199AC_CHECK_FUNCS(posix_memalign memalign asprintf)
4889bdec 200
b977bf01 201#
202# Check for target programs.
203#
204
5b5d4aa5 205# Find tools for the target.
206if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
b977bf01 207 tmp_ac_tool_prefix="$ac_tool_prefix"
208 ac_tool_prefix=$target_alias-
209
210 AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
211 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
212 AC_CHECK_TOOL(OBJCOPY, objcopy)
213 AC_CHECK_TOOL(STRIP, strip)
214 AC_CHECK_TOOL(NM, nm)
215
216 ac_tool_prefix="$tmp_ac_tool_prefix"
217else
218 if test "x$TARGET_CC" = x; then
219 TARGET_CC=$CC
220 fi
221 AC_CHECK_TOOL(OBJCOPY, objcopy)
222 AC_CHECK_TOOL(STRIP, strip)
223 AC_CHECK_TOOL(NM, nm)
224fi
225AC_SUBST(TARGET_CC)
226
227
228# Test the C compiler for the target environment.
229tmp_CC="$CC"
230tmp_CFLAGS="$CFLAGS"
231tmp_LDFLAGS="$LDFLAGS"
232tmp_CPPFLAGS="$CPPFLAGS"
aa6d7826 233tmp_LIBS="$LIBS"
b977bf01 234CC="$TARGET_CC"
235CFLAGS="$TARGET_CFLAGS"
236CPPFLAGS="$TARGET_CPPFLAGS"
237LDFLAGS="$TARGET_LDFLAGS"
aa6d7826 238LIBS=""
b977bf01 239
240if test "x$TARGET_CFLAGS" = x; then
6a161fa9 241 # debug flags.
b977bf01 242 TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
243 -Wundef -Wstrict-prototypes -g"
6a161fa9 244
245 # optimization flags.
322562ea 246 AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [
6a161fa9 247 CFLAGS=-Os
eb73121d 248 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
249 [grub_cv_cc_Os=yes],
250 [grub_cv_cc_Os=no])
6a161fa9 251 ])
322562ea 252 if test "x$grub_cv_cc_Os" = xyes; then
b977bf01 253 TARGET_CFLAGS="$TARGET_CFLAGS -Os"
6a161fa9 254 else
b977bf01 255 TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
6a161fa9 256 fi
257
258 # Force no alignment to save space on i386.
b977bf01 259 if test "x$target_cpu" = xi386; then
322562ea 260 AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
2b167a72 261 CFLAGS="$CFLAGS -falign-loops=1"
eb73121d 262 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
263 [grub_cv_cc_falign_loop=yes],
264 [grub_cv_cc_falign_loop=no])
6a161fa9 265 ])
266
322562ea 267 if test "x$grub_cv_cc_falign_loop" = xyes; then
b977bf01 268 TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
6a161fa9 269 else
b977bf01 270 TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
6a161fa9 271 fi
272 fi
b977bf01 273fi
6a161fa9 274
2b167a72 275grub_apple_target_cc
276if 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
cf00df31 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
2b167a72 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,'
292else
293 TARGET_APPLE_CC=0
294# Use linker script if present, otherwise use builtin -N script.
295AC_MSG_CHECKING([for option to link raw image])
296if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
297 TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
298 TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT} -Wl,-Ttext,"
299 TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
300else
301 TARGET_IMG_LDSCRIPT=
302 TARGET_IMG_LDFLAGS='-Wl,-N -Wl,-Ttext,'
303 TARGET_IMG_LDFLAGS_AC='-Wl,-N -Wl,-Ttext,'
304fi
305TARGET_IMG_CFLAGS=
306fi
307
308AC_SUBST(TARGET_IMG_LDSCRIPT)
309AC_SUBST(TARGET_IMG_LDFLAGS)
310AC_SUBST(TARGET_IMG_CFLAGS)
311AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC])
312
313# For platforms where ELF is not the default link format.
314AC_MSG_CHECKING([for command to convert module to ELF format])
315case "${host_os}" in
316 cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;;
317 *) ;;
318esac
319AC_SUBST(TARGET_OBJ2ELF)
320AC_MSG_RESULT([$TARGET_OBJ2ELF])
321
322
b977bf01 323if test "x$target_m32" = x1; then
324 # Force 32-bit mode.
325 TARGET_CFLAGS="$TARGET_CFLAGS -m32"
326 TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
2b167a72 327 TARGET_MODULE_FORMAT="elf32"
6a161fa9 328fi
b977bf01 329
20011694 330if test "x$target_m64" = x1; then
331 # Force 64-bit mode.
7e9ca17a 332 TARGET_CFLAGS="$TARGET_CFLAGS -m64"
333 TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
2b167a72 334 TARGET_MODULE_FORMAT="elf64"
7e9ca17a 335fi
336
337if test "$target_cpu"-"$platform" = x86_64-efi; then
338 # Use large model to support 4G memory
6e09b8b7 339 AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
c8600122 340 SAVED_CFLAGS=$CFLAGS
341 CFLAGS="$CFLAGS -m64 -mcmodel=large"
6e09b8b7 342 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
343 [grub_cv_cc_mcmodel=yes],
344 [grub_cv_cc_mcmodel=no])
345 ])
c8600122 346 if test "x$grub_cv_cc_mcmodel" = xno; then
347 CFLAGS="$SAVED_CFLAGS -m64 -DMCMODEL_SMALL=1"
b39f9d20 348 TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1"
c8600122 349 AC_MSG_WARN([-mcmodel=large not supported. You wan't be able to use the memory over 4GiB. Upgrade your gcc])
350 else
351 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
6e09b8b7 352 fi
7e9ca17a 353
354 # EFI writes to stack below %rsp, we must not use the red zone
355 AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
c8600122 356 CFLAGS="$CFLAGS -m64 -mno-red-zone"
7e9ca17a 357 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
358 [grub_cv_cc_no_red_zone=yes],
359 [grub_cv_cc_no_red_zone=no])
360 ])
361 if test "x$grub_cv_cc_no_red_zone" = xno; then
362 AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
363 fi
364
c8600122 365 TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
20011694 366fi
367
baa2a121 368#
369# Compiler features.
370#
371
9035dce4 372# Need __enable_execute_stack() for nested function trampolines?
373grub_CHECK_ENABLE_EXECUTE_STACK
374
baa2a121 375# Smashing stack protector.
376grub_CHECK_STACK_PROTECTOR
c3db8364 377# Need that, because some distributions ship compilers that include
baa2a121 378# `-fstack-protector' in the default specs.
c3db8364 379if test "x$ssp_possible" = xyes; then
380 TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
381fi
2a8a80e4 382grub_CHECK_STACK_ARG_PROBE
383# Cygwin's GCC uses alloca() to probe the stackframe on static
384# stack allocations above some threshold.
385if test x"$sap_possible" = xyes; then
386 TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
387fi
baa2a121 388
b977bf01 389AC_SUBST(TARGET_CFLAGS)
2b167a72 390AC_SUBST(TARGET_MODULE_FORMAT)
cf00df31 391AC_SUBST(OBJCONV)
2b167a72 392AC_SUBST(TARGET_APPLE_CC)
393AC_SUBST(TARGET_ASFLAGS)
b977bf01 394AC_SUBST(TARGET_CPPFLAGS)
395AC_SUBST(TARGET_LDFLAGS)
6a161fa9 396
aa6d7826 397# Set them to their new values for the tests below.
398CC="$TARGET_CC"
437e6adc 399CFLAGS="$TARGET_CFLAGS -nostdlib"
aa6d7826 400CPPFLAGS="$TARGET_CPPFLAGS"
401LDFLAGS="$TARGET_LDFLAGS"
402
6a161fa9 403# Defined in aclocal.m4.
f6130a12 404grub_PROG_TARGET_CC
2b167a72 405if test "x$TARGET_APPLE_CC" != x1 ; then
b977bf01 406grub_PROG_OBJCOPY_ABSOLUTE
2b167a72 407fi
cb71ba20 408grub_PROG_LD_BUILD_ID_NONE
4b13b216 409grub_ASM_USCORE
b977bf01 410if test "x$target_cpu" = xi386; then
2a8a80e4 411 if test ! -z "$TARGET_IMG_LDSCRIPT"; then
412 # Check symbols provided by linker script.
413 CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100"
414 fi
2b167a72 415 if test "x$platform" = xpc && test "x$TARGET_APPLE_CC" != x1 ; then
2a8a80e4 416 grub_CHECK_BSS_START_SYMBOL
417 grub_CHECK_END_SYMBOL
418 fi
419 CFLAGS="$TARGET_CFLAGS"
4b13b216 420 grub_I386_ASM_PREFIX_REQUIREMENT
421 grub_I386_ASM_ADDR32
422 grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
5aded270 423else
f4917dfd 424 AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
6a161fa9 425fi
426
bf6a5fb2 427AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL)
428#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
429#else
430#define NESTED_FUNC_ATTR
431#endif])
432
c9a86192 433# Restore the flags.
9962ed99 434CC="$tmp_CC"
435CFLAGS="$tmp_CFLAGS"
436CPPFLAGS="$tmp_CPPFLAGS"
c9a86192 437LDFLAGS="$tmp_LDFLAGS"
aa6d7826 438LIBS="$tmp_LIBS"
6a161fa9 439
4fe9862e 440#
2965c7cc 441# Check for options.
4fe9862e 442#
443
444# Memory manager debugging.
b39f9d20 445AC_ARG_ENABLE([mm-debug],
2965c7cc 446 AS_HELP_STRING([--enable-mm-debug],
90ce5d56 447 [include memory manager debugging]),
2965c7cc 448 [AC_DEFINE([MM_DEBUG], [1],
449 [Define to 1 if you enable memory manager debugging.])])
450
4fe9862e 451AC_ARG_ENABLE([grub-emu],
452 [AS_HELP_STRING([--enable-grub-emu],
453 [build and install the `grub-emu' debugging utility])])
d64399b5 454AC_ARG_ENABLE([grub-emu-usb],
455 [AS_HELP_STRING([--enable-grub-emu-usb],
456 [build and install the `grub-emu' debugging utility with USB support])])
4fe9862e 457[if [ x"$enable_grub_emu" = xyes ]; then
458 # Check for curses libraries.]
459 AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
460 [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
461 [AC_MSG_ERROR([(n)curses libraries are required to build `grub-emu'])])])
462 AC_SUBST([LIBCURSES])
463
464 [# Check for headers.]
465 AC_CHECK_HEADERS([ncurses/curses.h], [],
466 [AC_CHECK_HEADERS([ncurses.h], [],
467 [AC_CHECK_HEADERS([curses.h], [],
468 [AC_MSG_ERROR([(n)curses header files are required to build `grub-emu'])])])])
d64399b5 469
470 [if [ x"$enable_grub_emu_usb" = xyes ]; then
471 # Check for libusb libraries.]
472 AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
473 [AC_MSG_ERROR([libusb libraries are required to build `grub-emu' with USB support])])
474 AC_SUBST([LIBUSB])
475
476 [# Check for headers.]
477 AC_CHECK_HEADERS([usb.h], [],
478 [AC_MSG_ERROR([libusb header file is required to build `grub-emu' with USB support])])
479 [fi]
4fe9862e 480[fi]
481AC_SUBST([enable_grub_emu])
d64399b5 482AC_SUBST([enable_grub_emu_usb])
4fe9862e 483
99fadbaa 484AC_ARG_ENABLE([grub-fstest],
485 [AS_HELP_STRING([--enable-grub-fstest],
486 [build and install the `grub-fstest' debugging utility])])
487AC_SUBST([enable_grub_fstest])
488
2d05bc6a 489AC_ARG_ENABLE([grub-pe2elf],
490 [AS_HELP_STRING([--enable-grub-pe2elf],
491 [build and install the `grub-pe2elf' conversion utility])])
492AC_SUBST([enable_grub_pe2elf])
493
e52db1f7 494AC_ARG_ENABLE([grub-mkfont],
495 [AS_HELP_STRING([--enable-grub-mkfont],
496 [build and install the `grub-mkfont' utility])])
497if test x"$enable_grub_mkfont" = xyes ; then
498 # Check for freetype libraries.
499 AC_CHECK_PROGS([FREETYPE], [freetype-config])
500 if test "x$FREETYPE" = x ; then
501 AC_MSG_ERROR([freetype2 libraries are required to build `grub-mkfont'])
502 fi
503 freetype_cflags=`freetype-config --cflags`
504 freetype_libs=`freetype-config --libs`
505fi
506AC_SUBST([enable_grub_mkfont])
507AC_SUBST([freetype_cflags])
508AC_SUBST([freetype_libs])
509
fc45fb58 510AC_ARG_ENABLE([efiemu],
511 [AS_HELP_STRING([--enable-efiemu],
512 [build and install the efiemu runtimes])])
513AC_SUBST([enable_efiemu])
2b167a72 514AC_SUBST(ASFLAGS)
fc45fb58 515
6a161fa9 516# Output files.
1f4147aa 517grub_CHECK_LINK_DIR
518if test x"$link_dir" = xyes ; then
519 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
b977bf01 520 include/grub/machine:include/grub/$target_cpu/$platform])
1f4147aa 521else
522 mkdir -p include/grub 2>/dev/null
523 rm -rf include/grub/cpu
524 cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
525 rm -rf include/grub/machine
526 cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
527fi
7b455f4d 528AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
6a161fa9 529AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
530AC_OUTPUT