]> git.proxmox.com Git - grub2.git/blame - configure.ac
Add lost part of GRUB_TERM_KEY_* commit
[grub2.git] / configure.ac
CommitLineData
76ed06b9
BC
1# -*- autoconf -*-
2
6a161fa9 3# Process this file with autoconf to produce a configure script.
4
2f1a3acf 5# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
6a161fa9 6#
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.
10#
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
14# PARTICULAR PURPOSE.
15
b977bf01 16dnl This configure script is complicated, because GRUB needs to deal
17dnl with three potentially different types:
18dnl
19dnl build -- the environment for building GRUB
20dnl host -- the environment for running utilities
21dnl target -- the environment for running GRUB
22dnl
23dnl In addition, GRUB needs to deal with a platform specification
24dnl which specifies the system running GRUB, such as firmware.
25dnl This is necessary because the target type in autoconf does not
26dnl describe such a system very well.
27dnl
28dnl The current strategy is to use variables with no prefix (such as
29dnl CC, CFLAGS, etc.) for the host type as well as the build type,
30dnl because GRUB does not need to use those variables for the build
31dnl type, so there is no conflict. Variables with the prefix "TARGET_"
32dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
33dnl type.
34
5519963b 35AC_INIT([GRUB],[1.98],[bug-grub@gnu.org])
6a161fa9 36
76ed06b9
BC
37# We don't want -g -O2 by default in CFLAGS
38: ${CFLAGS=""}
6a161fa9 39
b977bf01 40# Checks for host and target systems.
6a161fa9 41AC_CANONICAL_HOST
b977bf01 42AC_CANONICAL_TARGET
6a161fa9 43
8c411768
BC
44AM_INIT_AUTOMAKE()
45AC_PREREQ(2.60)
6304d292 46AC_CONFIG_SRCDIR([include/grub/dl.h])
8c411768 47AC_CONFIG_HEADER([config.h])
e52db1f7 48
1d543c3e 49# Program name transformations
50AC_ARG_PROGRAM
51
90d1e879
RM
52# Optimization flag. Allow user to override.
53if test "x$TARGET_CFLAGS" = x; then
54 TARGET_CFLAGS="$TARGET_CFLAGS -Os"
55fi
56
76ed06b9
BC
57# Default HOST_CPPFLAGS
58HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
76ed06b9 59HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
76ed06b9
BC
60HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1"
61HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_LIBDIR=\\\"\$(pkglibdir)\\\""
62HOST_CPPFLAGS="$HOST_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\""
63
64TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W"
65TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include"
66TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include"
67
b977bf01 68case "$target_cpu" in
02164e1b 69 i[[3456]]86) target_cpu=i386 ;;
c7ef54aa 70 amd64) target_cpu=x86_64 ;;
02164e1b 71 sparc) target_cpu=sparc64 ;;
ade85305 72 mipsel|mips64el)
76ed06b9 73 target_cpu=mips;
c721825b 74 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1";
4a1eefb6 75 ;;
ade85305 76 mips|mips64)
76ed06b9 77 target_cpu=mips;
c721825b 78 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1";
4a1eefb6 79 ;;
6a161fa9 80esac
81
05568c2e 82# Specify the platform (such as firmware).
83AC_ARG_WITH([platform],
84 AS_HELP_STRING([--with-platform=PLATFORM],
83b984de 85 [select the host platform [[guessed]]]))
05568c2e 86
87# Guess the platform if not specified.
88if test "x$with_platform" = x; then
b977bf01 89 case "$target_cpu"-"$target_vendor" in
05568c2e 90 i386-apple) platform=efi ;;
91 i386-*) platform=pc ;;
58393a2d 92 x86_64-apple) platform=efi ;;
737feb35 93 x86_64-*) platform=pc ;;
05568c2e 94 powerpc-*) platform=ieee1275 ;;
58393a2d 95 powerpc64-*) platform=ieee1275 ;;
05568c2e 96 sparc64-*) platform=ieee1275 ;;
ad17a401 97 mips-*) platform=yeeloong ;;
58393a2d 98 *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
05568c2e 99 esac
100else
101 platform="$with_platform"
102fi
103
58393a2d 104# Adjust CPU unless target was explicitly specified.
105if test -z "$target_alias"; then
106 case "$target_cpu"-"$platform" in
107 x86_64-efi) ;;
909301af 108 x86_64-emu) ;;
3f4ce737 109 x86_64-*) target_cpu=i386 ;;
110 powerpc64-ieee1275) target_cpu=powerpc ;;
20011694 111 esac
112fi
113
58393a2d 114# Check if the platform is supported, make final adjustments.
b977bf01 115case "$target_cpu"-"$platform" in
05568c2e 116 i386-efi) ;;
3f4ce737 117 x86_64-efi) ;;
05568c2e 118 i386-pc) ;;
7210dca9 119 i386-multiboot) ;;
546f966a 120 i386-coreboot) ;;
58393a2d 121 i386-linuxbios) platform=coreboot ;;
3d04eab8 122 i386-ieee1275) ;;
8231fb77 123 i386-qemu) ;;
05568c2e 124 powerpc-ieee1275) ;;
125 sparc64-ieee1275) ;;
7b5f334b 126 mips-qemu-mips) ;;
ad17a401 127 mips-yeeloong) ;;
f84b481b 128 *-emu) ;;
58393a2d 129 *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
6a161fa9 130esac
131
3f4ce737 132case "$target_cpu" in
133 i386 | powerpc) target_m32=1 ;;
134 x86_64 | sparc64) target_m64=1 ;;
135esac
136
6e5a42fe 137case "$host_os" in
4825d790 138 mingw32*) host_os=cygwin ;;
6e5a42fe 139esac
140
9304eef1 141# This normalizes the names, and creates a new variable ("host_kernel")
142# while at it, since the mapping is not always 1:1 (e.g. different OSes
143# using the same kernel type).
144case "$host_os" in
145 gnu*) host_kernel=hurd ;;
146 linux*) host_kernel=linux ;;
67937d4d 147 freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;;
2c7031b1 148 netbsd*) host_kernel=netbsd ;;
9304eef1 149 cygwin) host_kernel=windows ;;
150esac
151
f84b481b 152case "$platform" in
c721825b
BC
153 coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;;
154 multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;;
155 efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;;
156 ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;;
157 qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
158 pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
159 emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
160 yeeloong) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
161 qemu-mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
f84b481b 162esac
6bea3f89 163case "$target_cpu" in
c721825b
BC
164 mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
165 sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
6bea3f89 166esac
c721825b 167machine_CPPFLAGS="$machine_CPPFLAGS -DMACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
6bea3f89 168
c721825b
BC
169HOST_CPPFLAGS="$HOST_CPPFLAGS $machine_CPPFLAGS"
170TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
f84b481b 171
56978920 172AC_SUBST(host_cpu)
173AC_SUBST(host_os)
9304eef1 174AC_SUBST(host_kernel)
6e5a42fe 175
b977bf01 176AC_SUBST(target_cpu)
05568c2e 177AC_SUBST(platform)
6a161fa9 178
d87aedff
YB
179# Define default variables
180case "$host_os" in
181 netbsd* | openbsd*)
182 # Because /boot is used for the boot block in NetBSD and OpenBSD,
183 bootdirname='' ;;
184 *) bootdirname='boot' ;;
185esac
186bootdirname=`echo "$bootdirname" | sed "$program_transform_name"`
187AC_SUBST(bootdirname)
188
189grubdirname=`echo "$PACKAGE" | sed "$program_transform_name"`
190AC_SUBST(grubdirname)
191
b977bf01 192#
193# Checks for build programs.
194#
144f1f98 195
6c826348 196# Although cmp is listed in the GNU Coding Standards as a command which
197# can used directly, OpenBSD lacks cmp in the default installation.
198AC_CHECK_PROGS([CMP], [cmp])
199if test "x$CMP" = x; then
200 AC_MSG_ERROR([cmp is not found])
201fi
202
144f1f98 203AC_CHECK_PROGS([YACC], [bison])
1569ec51 204if test "x$YACC" = x; then
6c826348 205 AC_MSG_ERROR([bison is not found])
1569ec51 206fi
207
4d88b9ae
VS
208FONT_SOURCE=
209
f4d095d7
GS
210for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
211 for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont; do
212 if test -f "$dir/unifont.$ext"; then
8e50ec9f 213 FONT_SOURCE="$dir/unifont.$ext"
f4d095d7
GS
214 break 2
215 fi
216 done
4931827f 217done
218
76ed06b9 219if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xyeeloong ); then
4d88b9ae
VS
220 AC_MSG_ERROR([qemu and yeeloong ports need unifont])
221fi
222
76ed06b9 223AC_SUBST([FONT_SOURCE])
8e50ec9f 224
76ed06b9 225AC_PROG_RANLIB
b977bf01 226AC_PROG_INSTALL
227AC_PROG_AWK
09220190 228AC_PROG_LEX
76ed06b9 229AC_PROG_YACC
b977bf01 230AC_PROG_MAKE_SET
ff420223 231AC_PROG_MKDIR_P
b977bf01 232
c7c75cf4 233if test "x$LEX" = "x:"; then
09220190
BC
234 AC_MSG_ERROR([flex is not found])
235else
2663fb5f 236 version=`$LEX --version | $AWK '{ split($NF,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'`
b777c18e 237 if test -n "$version" -a "$version" -ge 20535; then
09220190
BC
238 :
239 else
240 AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above])
241 fi
242fi
243
68807e5f 244# These are not a "must".
c44c90db 245AC_PATH_PROG(MAKEINFO, makeinfo)
6a161fa9 246
b977bf01 247#
248# Checks for host programs.
249#
250
251AC_PROG_CC
76ed06b9
BC
252AM_PROG_CC_C_O
253AM_PROG_AS
254
6a161fa9 255# Must be GCC.
256test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
257
4889bdec 258AC_GNU_SOURCE
2f1a3acf 259AM_GNU_GETTEXT([external])
b977bf01 260AC_SYS_LARGEFILE
261
262# Identify characteristics of the host architecture.
263AC_C_BIGENDIAN
264AC_CHECK_SIZEOF(void *)
265AC_CHECK_SIZEOF(long)
266
2b167a72 267grub_apple_cc
c9da87d0 268if test x$grub_cv_apple_cc = xyes ; then
76ed06b9
BC
269 HOST_CPPFLAGS="$HOST_CPPFLAGS -DAPPLE_CC=1"
270 HOST_CFLAGS="$HOST_CFLAGS -fnested-functions"
2b167a72 271fi
b977bf01 272
86695375 273if test "x$cross_compiling" = xyes; then
274 AC_MSG_WARN([cannot generate manual pages while cross compiling])
275else
276 AC_PATH_PROG(HELP2MAN, help2man)
277fi
278
3169f4c7 279# Check for functions and headers.
c38fe9f4
RM
280AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
281AC_CHECK_HEADERS(libzfs.h libnvpair.h sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h)
7c4e16ff 282
fb90b546
RM
283AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
284#include <sys/param.h>
285#include <sys/mount.h>])
286
287AC_CHECK_MEMBERS([struct statfs.f_mntfromname],,,[$ac_includes_default
288#include <sys/param.h>
289#include <sys/mount.h>])
290
2c7031b1
GS
291# For opendisk() and getrawpartition() on NetBSD.
292# Used in util/deviceiter.c and in util/hostdisk.c.
293AC_CHECK_HEADER([util.h], [
294 AC_CHECK_LIB([util], [opendisk], [
295 LIBUTIL="-lutil"
296 AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used])
297 ])
298 AC_CHECK_LIB([util], [getrawpartition], [
299 LIBUTIL="-lutil"
300 AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition() in -lutil can be used])
301 ])
302])
303AC_SUBST([LIBUTIL])
304
76ed06b9
BC
305#
306# Check for host and build compilers.
307#
308HOST_CC=$CC
309AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
310 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
311
b977bf01 312#
313# Check for target programs.
314#
315
5b5d4aa5 316# Find tools for the target.
317if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
b977bf01 318 tmp_ac_tool_prefix="$ac_tool_prefix"
319 ac_tool_prefix=$target_alias-
320
321 AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
322 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
323 AC_CHECK_TOOL(OBJCOPY, objcopy)
324 AC_CHECK_TOOL(STRIP, strip)
325 AC_CHECK_TOOL(NM, nm)
326
327 ac_tool_prefix="$tmp_ac_tool_prefix"
328else
329 if test "x$TARGET_CC" = x; then
330 TARGET_CC=$CC
331 fi
332 AC_CHECK_TOOL(OBJCOPY, objcopy)
333 AC_CHECK_TOOL(STRIP, strip)
334 AC_CHECK_TOOL(NM, nm)
335fi
76ed06b9
BC
336AC_SUBST(HOST_CC)
337AC_SUBST(BUILD_CC)
b977bf01 338AC_SUBST(TARGET_CC)
339
b977bf01 340# Test the C compiler for the target environment.
341tmp_CC="$CC"
342tmp_CFLAGS="$CFLAGS"
343tmp_LDFLAGS="$LDFLAGS"
344tmp_CPPFLAGS="$CPPFLAGS"
aa6d7826 345tmp_LIBS="$LIBS"
b977bf01 346CC="$TARGET_CC"
347CFLAGS="$TARGET_CFLAGS"
348CPPFLAGS="$TARGET_CPPFLAGS"
349LDFLAGS="$TARGET_LDFLAGS"
aa6d7826 350LIBS=""
b977bf01 351
90d1e879 352# debug flags.
76ed06b9
BC
353TARGET_CFLAGS="$TARGET_CFLAGS -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g"
354TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
6a161fa9 355
90d1e879
RM
356# Force no alignment to save space on i386.
357if test "x$target_cpu" = xi386; then
358 AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
359 CFLAGS="$CFLAGS -falign-loops=1"
eb73121d 360 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
90d1e879
RM
361 [grub_cv_cc_falign_loop=yes],
362 [grub_cv_cc_falign_loop=no])
6a161fa9 363 ])
6a161fa9 364
90d1e879
RM
365 if test "x$grub_cv_cc_falign_loop" = xyes; then
366 TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
6a161fa9 367 else
90d1e879 368 TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
6a161fa9 369 fi
370
90d1e879
RM
371 # Some toolchains enable these features by default, but they need
372 # registers that aren't set up properly in GRUB.
373 TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
374fi
77c55a87 375
90d1e879
RM
376# By default, GCC 4.4 generates .eh_frame sections containing unwind
377# information in some cases where it previously did not. GRUB doesn't need
378# these and they just use up vital space. Restore the old compiler
379# behaviour.
380AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
381 SAVE_CFLAGS="$CFLAGS"
382 CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
383 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
384 [grub_cv_cc_fno_dwarf2_cfi_asm=yes],
385 [grub_cv_cc_fno_dwarf2_cfi_asm=no])
386 CFLAGS="$SAVE_CFLAGS"
387])
77c55a87 388
90d1e879
RM
389if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
390 TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
b977bf01 391fi
6a161fa9 392
2b167a72 393grub_apple_target_cc
c9da87d0 394if test x$grub_cv_apple_target_cc = xyes ; then
76ed06b9
BC
395 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -DAPPLE_CC=1"
396 TARGET_CFLAGS="$TARGET_CFLAGS -fnested-functions"
397
2b167a72 398 CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
2b167a72 399 TARGET_APPLE_CC=1
cf00df31 400 AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
401 if test "x$OBJCONV" = x ; then
402 AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.])
403 fi
404 if test "x$OBJCONV" = x ; then
405 AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
406 fi
2b167a72 407 TARGET_IMG_LDSCRIPT=
408 TARGET_IMG_CFLAGS="-static"
76ed06b9
BC
409 TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
410 TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
411 TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
2b167a72 412else
413 TARGET_APPLE_CC=0
414# Use linker script if present, otherwise use builtin -N script.
76ed06b9
BC
415if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
416 TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
417 TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
418 TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
419 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
2b167a72 420else
421 TARGET_IMG_LDSCRIPT=
76ed06b9
BC
422 TARGET_IMG_LDFLAGS='-Wl,-N'
423 TARGET_IMG_LDFLAGS_AC='-Wl,-N'
424 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
2b167a72 425fi
426TARGET_IMG_CFLAGS=
427fi
428
2b167a72 429# For platforms where ELF is not the default link format.
430AC_MSG_CHECKING([for command to convert module to ELF format])
431case "${host_os}" in
76ed06b9 432 cygwin) TARGET_OBJ2ELF='$(grub_utildir)/grub-pe2elf';
4b0cd8f8
VS
433# FIXME: put proper test here
434 AC_DEFINE([NEED_REGISTER_FRAME_INFO], 1,
435 [Define to 1 if GCC generates calls to __register_frame_info()])
436 ;;
2b167a72 437 *) ;;
438esac
2b167a72 439AC_MSG_RESULT([$TARGET_OBJ2ELF])
440
b977bf01 441if test "x$target_m32" = x1; then
442 # Force 32-bit mode.
443 TARGET_CFLAGS="$TARGET_CFLAGS -m32"
76ed06b9 444 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
b977bf01 445 TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
2b167a72 446 TARGET_MODULE_FORMAT="elf32"
6a161fa9 447fi
b977bf01 448
20011694 449if test "x$target_m64" = x1; then
450 # Force 64-bit mode.
7e9ca17a 451 TARGET_CFLAGS="$TARGET_CFLAGS -m64"
76ed06b9 452 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
7e9ca17a 453 TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
2b167a72 454 TARGET_MODULE_FORMAT="elf64"
7e9ca17a 455fi
456
457if test "$target_cpu"-"$platform" = x86_64-efi; then
458 # Use large model to support 4G memory
6e09b8b7 459 AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
c8600122 460 SAVED_CFLAGS=$CFLAGS
461 CFLAGS="$CFLAGS -m64 -mcmodel=large"
6e09b8b7 462 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
463 [grub_cv_cc_mcmodel=yes],
464 [grub_cv_cc_mcmodel=no])
465 ])
c8600122 466 if test "x$grub_cv_cc_mcmodel" = xno; then
4ba8d354 467 AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.])
c8600122 468 else
469 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
6e09b8b7 470 fi
7e9ca17a 471
472 # EFI writes to stack below %rsp, we must not use the red zone
473 AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
c8600122 474 CFLAGS="$CFLAGS -m64 -mno-red-zone"
7e9ca17a 475 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
476 [grub_cv_cc_no_red_zone=yes],
477 [grub_cv_cc_no_red_zone=no])
478 ])
479 if test "x$grub_cv_cc_no_red_zone" = xno; then
480 AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
481 fi
482
c8600122 483 TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
20011694 484fi
485
baa2a121 486#
487# Compiler features.
488#
489
9035dce4 490# Need __enable_execute_stack() for nested function trampolines?
491grub_CHECK_ENABLE_EXECUTE_STACK
492
93a81088 493# Position independent executable.
494grub_CHECK_PIE
495[# Need that, because some distributions ship compilers that include
496# `-fPIE' in the default specs.
497if [ x"$pie_possible" = xyes ]; then
498 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
499fi]
500
baa2a121 501# Smashing stack protector.
502grub_CHECK_STACK_PROTECTOR
c3db8364 503# Need that, because some distributions ship compilers that include
baa2a121 504# `-fstack-protector' in the default specs.
c3db8364 505if test "x$ssp_possible" = xyes; then
506 TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
507fi
2a8a80e4 508grub_CHECK_STACK_ARG_PROBE
509# Cygwin's GCC uses alloca() to probe the stackframe on static
510# stack allocations above some threshold.
511if test x"$sap_possible" = xyes; then
512 TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
513fi
baa2a121 514
63f745e8 515AC_ARG_ENABLE([werror],
516 [AS_HELP_STRING([--disable-werror],
517 [do not use -Werror when building GRUB])])
518if test x"$enable_werror" != xno ; then
519 TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
520fi
521
76ed06b9
BC
522TARGET_CPP="$TARGET_CC -E"
523TARGET_CCAS=$TARGET_CC
524
cf00df31 525AC_SUBST(OBJCONV)
76ed06b9
BC
526AC_SUBST(TARGET_CPP)
527AC_SUBST(TARGET_CCAS)
528AC_SUBST(TARGET_OBJ2ELF)
2b167a72 529AC_SUBST(TARGET_APPLE_CC)
76ed06b9
BC
530AC_SUBST(TARGET_MODULE_FORMAT)
531
532AC_SUBST(TARGET_CFLAGS)
b977bf01 533AC_SUBST(TARGET_LDFLAGS)
76ed06b9
BC
534AC_SUBST(TARGET_CPPFLAGS)
535AC_SUBST(TARGET_CCASFLAGS)
536
537AC_SUBST(TARGET_IMG_LDSCRIPT)
538AC_SUBST(TARGET_IMG_LDFLAGS)
539AC_SUBST(TARGET_IMG_CFLAGS)
540AC_SUBST(TARGET_IMG_BASE_LDOPT)
541
542AC_SUBST(HOST_CFLAGS)
543AC_SUBST(HOST_LDFLAGS)
544AC_SUBST(HOST_CPPFLAGS)
545AC_SUBST(HOST_CCASFLAGS)
6a161fa9 546
aa6d7826 547# Set them to their new values for the tests below.
548CC="$TARGET_CC"
26de2bcd 549if test "x$TARGET_APPLE_CC" = x1 ; then
69be5b74 550CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
26de2bcd 551else
01fcf061 552CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
26de2bcd 553fi
aa6d7826 554CPPFLAGS="$TARGET_CPPFLAGS"
555LDFLAGS="$TARGET_LDFLAGS"
69be5b74
VS
556LIBS=-lgcc
557
01fcf061
VS
558grub_ASM_USCORE
559if test x$grub_cv_asm_uscore = xyes; then
560CFLAGS="$CFLAGS -Wl,--defsym,_abort=_main"
561else
562CFLAGS="$CFLAGS -Wl,--defsym,abort=main"
563fi
564
69be5b74
VS
565# Check for libgcc symbols
566AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x)
567
568if test "x$TARGET_APPLE_CC" = x1 ; then
569CFLAGS="$TARGET_CFLAGS -nostdlib"
570else
571CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
572fi
42e0cba3 573LIBS=""
aa6d7826 574
6a161fa9 575# Defined in aclocal.m4.
f6130a12 576grub_PROG_TARGET_CC
2b167a72 577if test "x$TARGET_APPLE_CC" != x1 ; then
b977bf01 578grub_PROG_OBJCOPY_ABSOLUTE
2b167a72 579fi
cb71ba20 580grub_PROG_LD_BUILD_ID_NONE
b977bf01 581if test "x$target_cpu" = xi386; then
2aec1692
CF
582 if test "$platform" != emu && test "x$TARGET_APPLE_CC" != x1 ; then
583 if test ! -z "$TARGET_IMG_LDSCRIPT"; then
584 # Check symbols provided by linker script.
76ed06b9 585 CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},8000 -Wl,--defsym,___main=0x8100"
2aec1692 586 fi
2a8a80e4 587 grub_CHECK_BSS_START_SYMBOL
588 grub_CHECK_END_SYMBOL
589 fi
590 CFLAGS="$TARGET_CFLAGS"
4b13b216 591 grub_I386_ASM_PREFIX_REQUIREMENT
592 grub_I386_ASM_ADDR32
593 grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
5aded270 594else
f4917dfd 595 AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
6a161fa9 596fi
597
bf6a5fb2 598AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL)
599#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
600#else
601#define NESTED_FUNC_ATTR
602#endif])
603
5ce5507f 604AC_ARG_ENABLE([efiemu],
605 [AS_HELP_STRING([--enable-efiemu],
606 [build and install the efiemu runtimes (default=guessed)])])
607if test x"$enable_efiemu" = xno ; then
ce7a733d 608 efiemu_excuse="explicitly disabled"
5ce5507f 609fi
05f602fc
VS
610if test x"$target_cpu" != xi386 ; then
611 efiemu_excuse="only available on i386"
612fi
cfdcef12 613if test x"$platform" = xefi ; then
05f602fc
VS
614 efiemu_excuse="not available on efi"
615fi
5ce5507f 616if test x"$efiemu_excuse" = x ; then
43e6200c 617 AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
d2838156 618 CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
5ce5507f 619 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
620 [grub_cv_cc_efiemu=yes],
621 [grub_cv_cc_efiemu=no])
622 ])
55c70904 623 if test x$grub_cv_cc_efiemu = xno; then
e98cd0c2 624 efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
5ce5507f 625 fi
626fi
627if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
ce7a733d 628 AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
5ce5507f 629fi
630if test x"$efiemu_excuse" = x ; then
631enable_efiemu=yes
632else
633enable_efiemu=no
634fi
635AC_SUBST([enable_efiemu])
636
016a671b 637if test "$platform" != emu; then
8f9a632b
VS
638AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
639 SAVED_CPPFLAGS="$CPPFLAGS"
640 CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
641 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
642int va_arg_func (int fixed, va_list args);]], [[]])],
643 [grub_cv_cc_isystem=yes],
644 [grub_cv_cc_isystem=no])
645 CPPFLAGS="$SAVED_CPPFLAGS"
646])
647
648if test x"$grub_cv_cc_isystem" = xyes ; then
649 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
650fi
dae79b6b 651fi
5ce5507f 652
c9a86192 653# Restore the flags.
9962ed99 654CC="$tmp_CC"
655CFLAGS="$tmp_CFLAGS"
656CPPFLAGS="$tmp_CPPFLAGS"
c9a86192 657LDFLAGS="$tmp_LDFLAGS"
aa6d7826 658LIBS="$tmp_LIBS"
6a161fa9 659
4fe9862e 660#
2965c7cc 661# Check for options.
4fe9862e 662#
663
664# Memory manager debugging.
b39f9d20 665AC_ARG_ENABLE([mm-debug],
2965c7cc 666 AS_HELP_STRING([--enable-mm-debug],
90ce5d56 667 [include memory manager debugging]),
2965c7cc 668 [AC_DEFINE([MM_DEBUG], [1],
669 [Define to 1 if you enable memory manager debugging.])])
670
d64399b5 671AC_ARG_ENABLE([grub-emu-usb],
672 [AS_HELP_STRING([--enable-grub-emu-usb],
5ce5507f 673 [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
5ce5507f 674
927d0134
VS
675AC_ARG_ENABLE([grub-emu-sdl],
676 [AS_HELP_STRING([--enable-grub-emu-sdl],
677 [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])])
678
3affd0ec 679AC_ARG_ENABLE([grub-emu-pci],
680 [AS_HELP_STRING([--enable-grub-emu-pci],
681 [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
682
f84b481b
RM
683if test "$platform" = emu; then
684 missing_ncurses=
685[# Check for curses libraries.]
4fe9862e 686 AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
687 [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
f84b481b 688 [missing_ncurses=[true]])])
4fe9862e 689 AC_SUBST([LIBCURSES])
f84b481b 690[if [ x"$missing_ncurses" = x ]; then ]
4fe9862e 691 [# Check for headers.]
692 AC_CHECK_HEADERS([ncurses/curses.h], [],
693 [AC_CHECK_HEADERS([ncurses.h], [],
694 [AC_CHECK_HEADERS([curses.h], [],
f84b481b 695 [missing_ncurses=[true]])])])
5ce5507f 696[fi]
f84b481b
RM
697if test x"$missing_ncurses" = xtrue ; then
698 AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
5ce5507f 699fi
f84b481b 700
62a747cb
VS
701if test x"$enable_grub_emu_usb" != xyes ; then
702 grub_emu_usb_excuse="not enabled"
5ce5507f 703fi
325c8258 704
0e848909
VS
705if test x"$enable_grub_emu_pci" = xyes ; then
706 grub_emu_usb_excuse="conflicts with PCI support"
707fi
708
5ce5507f 709[if [ x"$grub_emu_usb_excuse" = x ]; then
d64399b5 710 # Check for libusb libraries.]
5ce5507f 711AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
e98cd0c2 712 [grub_emu_usb_excuse=["need libusb library"]])
d64399b5 713 AC_SUBST([LIBUSB])
5ce5507f 714[fi]
715[if [ x"$grub_emu_usb_excuse" = x ]; then
716 # Check for headers.]
d64399b5 717 AC_CHECK_HEADERS([usb.h], [],
e98cd0c2 718 [grub_emu_usb_excuse=["need libusb headers"]])
4fe9862e 719[fi]
c6f3b249 720if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
ce7a733d 721 AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
5ce5507f 722fi
723if test x"$grub_emu_usb_excuse" = x ; then
724enable_grub_emu_usb=yes
725else
726enable_grub_emu_usb=no
727fi
728
927d0134
VS
729if test x"$enable_grub_emu_sdl" = xno ; then
730 grub_emu_sdl_excuse="explicitely disabled"
731fi
732[if [ x"$grub_emu_sdl_excuse" = x ]; then
733 # Check for libSDL libraries.]
734AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
735 [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]])
736 AC_SUBST([LIBSDL])
737[fi]
9f293ab0 738
927d0134
VS
739[if [ x"$grub_emu_sdl_excuse" = x ]; then
740 # Check for headers.]
741 AC_CHECK_HEADERS([SDL/SDL.h], [],
742 [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]])
743[fi]
9f293ab0 744
927d0134
VS
745if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
746 AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled])
747fi
748if test x"$grub_emu_sdl_excuse" = x ; then
749enable_grub_emu_sdl=yes
750else
751enable_grub_emu_sdl=no
752fi
753
3affd0ec 754if test x"$enable_grub_emu_pci" != xyes ; then
325c8258 755 grub_emu_pci_excuse="not enabled"
756fi
757
758if test x"$enable_grub_emu_usb" = xyes ; then
759 grub_emu_pci_excuse="conflicts with USB support"
760fi
761
762[if [ x"$grub_emu_pci_excuse" = x ]; then
763 # Check for libpci libraries.]
459fed4b 764 AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"],
765 [grub_emu_pci_excuse=["need libpciaccess library"]])
766 AC_SUBST([LIBPCIACCESS])
325c8258 767[fi]
768[if [ x"$grub_emu_pci_excuse" = x ]; then
769 # Check for headers.]
770 AC_CHECK_HEADERS([pci/pci.h], [],
459fed4b 771 [grub_emu_pci_excuse=["need libpciaccess headers"]])
325c8258 772[fi]
773
774if test x"$grub_emu_pci_excuse" = x ; then
775enable_grub_emu_pci=yes
776else
9f293ab0 777
325c8258 778enable_grub_emu_pci=no
3affd0ec 779fi
780
927d0134 781AC_SUBST([enable_grub_emu_sdl])
d64399b5 782AC_SUBST([enable_grub_emu_usb])
3affd0ec 783AC_SUBST([enable_grub_emu_pci])
f84b481b 784fi
4fe9862e 785
e52db1f7 786AC_ARG_ENABLE([grub-mkfont],
787 [AS_HELP_STRING([--enable-grub-mkfont],
5ce5507f 788 [build and install the `grub-mkfont' utility (default=guessed)])])
789if test x"$enable_grub_mkfont" = xno ; then
ce7a733d 790 grub_mkfont_excuse="explicitly disabled"
5ce5507f 791fi
792
793if test x"$grub_mkfont_excuse" = x ; then
e52db1f7 794 # Check for freetype libraries.
795 AC_CHECK_PROGS([FREETYPE], [freetype-config])
796 if test "x$FREETYPE" = x ; then
e98cd0c2 797 grub_mkfont_excuse=["need freetype2 library"]
e52db1f7 798 fi
e52db1f7 799fi
660960d6
VS
800
801if test x"$grub_mkfont_excuse" = x ; then
802 # Check for freetype libraries.
10854d0d
YB
803 freetype_cflags=`freetype-config --cflags`
804 freetype_libs=`freetype-config --libs`
d1e8a02f
VS
805 SAVED_CPPFLAGS="$CPPFLAGS"
806 CPPFLAGS="$CPPFLAGS $freetype_cflags"
660960d6
VS
807 AC_CHECK_HEADERS([ft2build.h], [],
808 [grub_mkfont_excuse=["need freetype2 headers"]])
d1e8a02f 809 CPPFLAGS="$SAVED_CPPFLAGS"
660960d6
VS
810fi
811
5ce5507f 812if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
ce7a733d 813 AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
5ce5507f 814fi
815if test x"$grub_mkfont_excuse" = x ; then
816enable_grub_mkfont=yes
817else
818enable_grub_mkfont=no
819fi
e52db1f7 820AC_SUBST([enable_grub_mkfont])
821AC_SUBST([freetype_cflags])
822AC_SUBST([freetype_libs])
823
7181e228
CW
824AC_ARG_ENABLE([device-mapper],
825 [AS_HELP_STRING([--enable-device-mapper],
826 [enable Linux device-mapper support (default=guessed)])])
827if test x"$enable_device_mapper" = xno ; then
828 device_mapper_excuse="explicitly disabled"
829fi
830
831if test x"$device_mapper_excuse" = x ; then
832 # Check for device-mapper library.
61d720e5 833 AC_CHECK_LIB([devmapper], [dm_task_create], [],
7181e228 834 [device_mapper_excuse="need devmapper library"])
7181e228 835fi
61d720e5
VS
836
837if test x"$device_mapper_excuse" = x ; then
838 # Check for device-mapper library.
839 AC_CHECK_LIB([devmapper], [dm_log_with_errno_init],
840 [],
841 [device_mapper_excuse="need devmapper library"])
842fi
843
844if test x"$device_mapper_excuse" = x ; then
845 LIBDEVMAPPER="-ldevmapper";
846 AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
847 [Define to 1 if you have the devmapper library.])
848fi
849
62f7d208 850AC_SUBST([LIBDEVMAPPER])
76ed06b9 851
a184f9c8 852AC_CHECK_LIB([zfs], [libzfs_init],
16c7cb32 853 [LIBZFS="-lzfs"
a184f9c8
RM
854 AC_DEFINE([HAVE_LIBZFS], [1],
855 [Define to 1 if you have the ZFS library.])],)
16c7cb32
BC
856AC_SUBST([LIBZFS])
857
a184f9c8 858AC_CHECK_LIB([nvpair], [nvlist_print],
16c7cb32 859 [LIBNVPAIR="-lnvpair"
a184f9c8
RM
860 AC_DEFINE([HAVE_LIBNVPAIR], [1],
861 [Define to 1 if you have the NVPAIR library.])],)
16c7cb32
BC
862AC_SUBST([LIBNVPAIR])
863
9f915872
VS
864LIBS=""
865
76ed06b9
BC
866pkglibrootdir='$(libdir)'/`echo $PACKAGE | sed "$program_transform_name"`
867AC_SUBST(pkglibrootdir)
868
869AC_SUBST([FONT_SOURCE])
76ed06b9
BC
870AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
871 [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
76ed06b9
BC
872AS_IF([test x$TARGET_APPLE_CC = x1],
873 [AC_SUBST([USE_APPLE_CC_FIXES], yes)])
7181e228 874
76ed06b9
BC
875#
876# Automake conditionals
877#
8c411768 878
76ed06b9
BC
879AM_CONDITIONAL([COND_emu], [test x$platform = xemu])
880AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc])
881AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi])
882AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu])
883AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275])
884AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
885AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
886AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
887AM_CONDITIONAL([COND_mips_yeeloong], [test x$target_cpu = xmips -a x$platform = xyeeloong])
888AM_CONDITIONAL([COND_mips_qemu_mips], [test x$target_cpu = xmips -a x$platform = xqemu_mips])
889AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
890AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
050abaea 891AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips])
f7711f5e
BC
892
893AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
894AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
895AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
896AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
897AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
2d465fb0 898
76ed06b9
BC
899AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
900AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
901AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
902AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
903AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
904AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
76ed06b9 905AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x])
771111e5 906AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1])
76ed06b9 907AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
fc45fb58 908
6a161fa9 909# Output files.
1f4147aa 910grub_CHECK_LINK_DIR
911if test x"$link_dir" = xyes ; then
f84b481b
RM
912 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu])
913 if test "$platform" != emu ; then
914 AC_CONFIG_LINKS([include/grub/machine:include/grub/$target_cpu/$platform])
915 fi
1f4147aa 916else
917 mkdir -p include/grub 2>/dev/null
918 rm -rf include/grub/cpu
919 cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
f84b481b
RM
920 if test "$platform" != emu ; then
921 rm -rf include/grub/machine
922 cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
923 fi
1f4147aa 924fi
6304d292 925
8c411768 926AC_CONFIG_FILES([Makefile])
6304d292 927AC_CONFIG_FILES([grub-core/Makefile])
8c411768
BC
928AC_CONFIG_FILES([po/Makefile])
929AC_CONFIG_FILES([docs/Makefile])
b23ffd70 930AC_CONFIG_FILES([util/bash-completion.d/Makefile])
6a161fa9 931AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
8c411768 932
6a161fa9 933AC_OUTPUT
5ce5507f 934[
935echo "*******************************************************"
936echo GRUB2 will be compiled with following components:
937echo Platform: "$target_cpu"-"$platform"
f84b481b 938if [ x"$platform" = xemu ]; then
5ce5507f 939if [ x"$grub_emu_usb_excuse" = x ]; then
940echo USB support for grub-emu: Yes
941else
942echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
943fi
927d0134
VS
944if [ x"$grub_emu_sdl_excuse" = x ]; then
945echo SDL support for grub-emu: Yes
946else
947echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)"
948fi
325c8258 949if [ x"$grub_emu_pci_excuse" = x ]; then
950echo PCI support for grub-emu: Yes
951else
952echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
953fi
f84b481b 954fi
61d720e5
VS
955if test x"$device_mapper_excuse" = x ; then
956echo With devmapper support: Yes
957else
958echo With devmapper support: No "($device_mapper_excuse)"
959fi
5ce5507f 960if [ x"$enable_mm_debug" = xyes ]; then
961echo With memory debugging: Yes
962else
963echo With memory debugging: No
964fi
5ce5507f 965if [ x"$efiemu_excuse" = x ]; then
966echo efiemu runtime: Yes
967else
968echo efiemu runtime: No "($efiemu_excuse)"
969fi
5ce5507f 970if [ x"$grub_mkfont_excuse" = x ]; then
971echo grub-mkfont: Yes
972else
973echo grub-mkfont: No "($grub_mkfont_excuse)"
974fi
975echo "*******************************************************"
976]