]> git.proxmox.com Git - grub2.git/blame - configure.ac
* .bzrignore: Add grub-kbdcomp, grub-menulst2cfg, *.marker,
[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])
742f9232 47AC_CONFIG_HEADER([config-util.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
742f9232 167machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`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 433# FIXME: put proper test here
742f9232 434 NEED_REGISTER_FRAME_INFO=1
4b0cd8f8 435 ;;
742f9232 436 *) NEED_REGISTER_FRAME_INFO=0 ;;
2b167a72 437esac
2b167a72 438AC_MSG_RESULT([$TARGET_OBJ2ELF])
439
b977bf01 440if test "x$target_m32" = x1; then
441 # Force 32-bit mode.
442 TARGET_CFLAGS="$TARGET_CFLAGS -m32"
76ed06b9 443 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
b977bf01 444 TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
2b167a72 445 TARGET_MODULE_FORMAT="elf32"
6a161fa9 446fi
b977bf01 447
20011694 448if test "x$target_m64" = x1; then
449 # Force 64-bit mode.
7e9ca17a 450 TARGET_CFLAGS="$TARGET_CFLAGS -m64"
76ed06b9 451 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
7e9ca17a 452 TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
2b167a72 453 TARGET_MODULE_FORMAT="elf64"
7e9ca17a 454fi
455
456if test "$target_cpu"-"$platform" = x86_64-efi; then
457 # Use large model to support 4G memory
6e09b8b7 458 AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
c8600122 459 SAVED_CFLAGS=$CFLAGS
460 CFLAGS="$CFLAGS -m64 -mcmodel=large"
6e09b8b7 461 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
462 [grub_cv_cc_mcmodel=yes],
463 [grub_cv_cc_mcmodel=no])
464 ])
c8600122 465 if test "x$grub_cv_cc_mcmodel" = xno; then
4ba8d354 466 AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.])
c8600122 467 else
468 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
6e09b8b7 469 fi
7e9ca17a 470
471 # EFI writes to stack below %rsp, we must not use the red zone
472 AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
c8600122 473 CFLAGS="$CFLAGS -m64 -mno-red-zone"
7e9ca17a 474 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
475 [grub_cv_cc_no_red_zone=yes],
476 [grub_cv_cc_no_red_zone=no])
477 ])
478 if test "x$grub_cv_cc_no_red_zone" = xno; then
479 AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
480 fi
481
c8600122 482 TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
20011694 483fi
484
baa2a121 485#
486# Compiler features.
487#
488
9035dce4 489# Need __enable_execute_stack() for nested function trampolines?
490grub_CHECK_ENABLE_EXECUTE_STACK
491
93a81088 492# Position independent executable.
493grub_CHECK_PIE
494[# Need that, because some distributions ship compilers that include
495# `-fPIE' in the default specs.
496if [ x"$pie_possible" = xyes ]; then
497 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
498fi]
499
baa2a121 500# Smashing stack protector.
501grub_CHECK_STACK_PROTECTOR
c3db8364 502# Need that, because some distributions ship compilers that include
baa2a121 503# `-fstack-protector' in the default specs.
c3db8364 504if test "x$ssp_possible" = xyes; then
505 TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
506fi
2a8a80e4 507grub_CHECK_STACK_ARG_PROBE
508# Cygwin's GCC uses alloca() to probe the stackframe on static
509# stack allocations above some threshold.
510if test x"$sap_possible" = xyes; then
511 TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
512fi
baa2a121 513
63f745e8 514AC_ARG_ENABLE([werror],
515 [AS_HELP_STRING([--disable-werror],
516 [do not use -Werror when building GRUB])])
517if test x"$enable_werror" != xno ; then
518 TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
519fi
520
76ed06b9
BC
521TARGET_CPP="$TARGET_CC -E"
522TARGET_CCAS=$TARGET_CC
523
cf00df31 524AC_SUBST(OBJCONV)
76ed06b9
BC
525AC_SUBST(TARGET_CPP)
526AC_SUBST(TARGET_CCAS)
527AC_SUBST(TARGET_OBJ2ELF)
2b167a72 528AC_SUBST(TARGET_APPLE_CC)
76ed06b9
BC
529AC_SUBST(TARGET_MODULE_FORMAT)
530
531AC_SUBST(TARGET_CFLAGS)
b977bf01 532AC_SUBST(TARGET_LDFLAGS)
76ed06b9
BC
533AC_SUBST(TARGET_CPPFLAGS)
534AC_SUBST(TARGET_CCASFLAGS)
535
536AC_SUBST(TARGET_IMG_LDSCRIPT)
537AC_SUBST(TARGET_IMG_LDFLAGS)
538AC_SUBST(TARGET_IMG_CFLAGS)
539AC_SUBST(TARGET_IMG_BASE_LDOPT)
540
541AC_SUBST(HOST_CFLAGS)
542AC_SUBST(HOST_LDFLAGS)
543AC_SUBST(HOST_CPPFLAGS)
544AC_SUBST(HOST_CCASFLAGS)
6a161fa9 545
aa6d7826 546# Set them to their new values for the tests below.
547CC="$TARGET_CC"
26de2bcd 548if test "x$TARGET_APPLE_CC" = x1 ; then
69be5b74 549CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
26de2bcd 550else
01fcf061 551CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
26de2bcd 552fi
aa6d7826 553CPPFLAGS="$TARGET_CPPFLAGS"
554LDFLAGS="$TARGET_LDFLAGS"
69be5b74
VS
555LIBS=-lgcc
556
01fcf061
VS
557grub_ASM_USCORE
558if test x$grub_cv_asm_uscore = xyes; then
559CFLAGS="$CFLAGS -Wl,--defsym,_abort=_main"
560else
561CFLAGS="$CFLAGS -Wl,--defsym,abort=main"
562fi
563
69be5b74
VS
564# Check for libgcc symbols
565AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x)
566
567if test "x$TARGET_APPLE_CC" = x1 ; then
568CFLAGS="$TARGET_CFLAGS -nostdlib"
569else
570CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
571fi
42e0cba3 572LIBS=""
aa6d7826 573
6a161fa9 574# Defined in aclocal.m4.
f6130a12 575grub_PROG_TARGET_CC
2b167a72 576if test "x$TARGET_APPLE_CC" != x1 ; then
b977bf01 577grub_PROG_OBJCOPY_ABSOLUTE
2b167a72 578fi
cb71ba20 579grub_PROG_LD_BUILD_ID_NONE
b977bf01 580if test "x$target_cpu" = xi386; then
2aec1692
CF
581 if test "$platform" != emu && test "x$TARGET_APPLE_CC" != x1 ; then
582 if test ! -z "$TARGET_IMG_LDSCRIPT"; then
583 # Check symbols provided by linker script.
76ed06b9 584 CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},8000 -Wl,--defsym,___main=0x8100"
2aec1692 585 fi
2a8a80e4 586 grub_CHECK_BSS_START_SYMBOL
587 grub_CHECK_END_SYMBOL
588 fi
589 CFLAGS="$TARGET_CFLAGS"
4b13b216 590 grub_I386_ASM_PREFIX_REQUIREMENT
591 grub_I386_ASM_ADDR32
6a161fa9 592fi
593
5ce5507f 594AC_ARG_ENABLE([efiemu],
595 [AS_HELP_STRING([--enable-efiemu],
596 [build and install the efiemu runtimes (default=guessed)])])
597if test x"$enable_efiemu" = xno ; then
ce7a733d 598 efiemu_excuse="explicitly disabled"
5ce5507f 599fi
05f602fc
VS
600if test x"$target_cpu" != xi386 ; then
601 efiemu_excuse="only available on i386"
602fi
cfdcef12 603if test x"$platform" = xefi ; then
05f602fc
VS
604 efiemu_excuse="not available on efi"
605fi
5ce5507f 606if test x"$efiemu_excuse" = x ; then
43e6200c 607 AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
d2838156 608 CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
5ce5507f 609 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
610 [grub_cv_cc_efiemu=yes],
611 [grub_cv_cc_efiemu=no])
612 ])
55c70904 613 if test x$grub_cv_cc_efiemu = xno; then
e98cd0c2 614 efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
5ce5507f 615 fi
616fi
617if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
ce7a733d 618 AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
5ce5507f 619fi
620if test x"$efiemu_excuse" = x ; then
621enable_efiemu=yes
622else
623enable_efiemu=no
624fi
625AC_SUBST([enable_efiemu])
626
016a671b 627if test "$platform" != emu; then
8f9a632b
VS
628AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
629 SAVED_CPPFLAGS="$CPPFLAGS"
630 CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
631 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
632int va_arg_func (int fixed, va_list args);]], [[]])],
633 [grub_cv_cc_isystem=yes],
634 [grub_cv_cc_isystem=no])
635 CPPFLAGS="$SAVED_CPPFLAGS"
636])
637
638if test x"$grub_cv_cc_isystem" = xyes ; then
639 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
640fi
dae79b6b 641fi
5ce5507f 642
c9a86192 643# Restore the flags.
9962ed99 644CC="$tmp_CC"
645CFLAGS="$tmp_CFLAGS"
646CPPFLAGS="$tmp_CPPFLAGS"
c9a86192 647LDFLAGS="$tmp_LDFLAGS"
aa6d7826 648LIBS="$tmp_LIBS"
6a161fa9 649
4fe9862e 650#
2965c7cc 651# Check for options.
4fe9862e 652#
653
654# Memory manager debugging.
b39f9d20 655AC_ARG_ENABLE([mm-debug],
2965c7cc 656 AS_HELP_STRING([--enable-mm-debug],
90ce5d56 657 [include memory manager debugging]),
2965c7cc 658 [AC_DEFINE([MM_DEBUG], [1],
659 [Define to 1 if you enable memory manager debugging.])])
660
d64399b5 661AC_ARG_ENABLE([grub-emu-usb],
662 [AS_HELP_STRING([--enable-grub-emu-usb],
5ce5507f 663 [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
5ce5507f 664
927d0134
VS
665AC_ARG_ENABLE([grub-emu-sdl],
666 [AS_HELP_STRING([--enable-grub-emu-sdl],
667 [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])])
668
3affd0ec 669AC_ARG_ENABLE([grub-emu-pci],
670 [AS_HELP_STRING([--enable-grub-emu-pci],
671 [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
672
f84b481b
RM
673if test "$platform" = emu; then
674 missing_ncurses=
675[# Check for curses libraries.]
4fe9862e 676 AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
677 [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
f84b481b 678 [missing_ncurses=[true]])])
4fe9862e 679 AC_SUBST([LIBCURSES])
f84b481b 680[if [ x"$missing_ncurses" = x ]; then ]
4fe9862e 681 [# Check for headers.]
682 AC_CHECK_HEADERS([ncurses/curses.h], [],
683 [AC_CHECK_HEADERS([ncurses.h], [],
684 [AC_CHECK_HEADERS([curses.h], [],
f84b481b 685 [missing_ncurses=[true]])])])
5ce5507f 686[fi]
f84b481b
RM
687if test x"$missing_ncurses" = xtrue ; then
688 AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
5ce5507f 689fi
f84b481b 690
62a747cb
VS
691if test x"$enable_grub_emu_usb" != xyes ; then
692 grub_emu_usb_excuse="not enabled"
5ce5507f 693fi
325c8258 694
0e848909
VS
695if test x"$enable_grub_emu_pci" = xyes ; then
696 grub_emu_usb_excuse="conflicts with PCI support"
697fi
698
5ce5507f 699[if [ x"$grub_emu_usb_excuse" = x ]; then
d64399b5 700 # Check for libusb libraries.]
5ce5507f 701AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
e98cd0c2 702 [grub_emu_usb_excuse=["need libusb library"]])
d64399b5 703 AC_SUBST([LIBUSB])
5ce5507f 704[fi]
705[if [ x"$grub_emu_usb_excuse" = x ]; then
706 # Check for headers.]
d64399b5 707 AC_CHECK_HEADERS([usb.h], [],
e98cd0c2 708 [grub_emu_usb_excuse=["need libusb headers"]])
4fe9862e 709[fi]
c6f3b249 710if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
ce7a733d 711 AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
5ce5507f 712fi
713if test x"$grub_emu_usb_excuse" = x ; then
714enable_grub_emu_usb=yes
715else
716enable_grub_emu_usb=no
717fi
718
927d0134
VS
719if test x"$enable_grub_emu_sdl" = xno ; then
720 grub_emu_sdl_excuse="explicitely disabled"
721fi
722[if [ x"$grub_emu_sdl_excuse" = x ]; then
723 # Check for libSDL libraries.]
724AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
725 [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]])
726 AC_SUBST([LIBSDL])
727[fi]
9f293ab0 728
927d0134
VS
729[if [ x"$grub_emu_sdl_excuse" = x ]; then
730 # Check for headers.]
731 AC_CHECK_HEADERS([SDL/SDL.h], [],
732 [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]])
733[fi]
9f293ab0 734
927d0134
VS
735if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
736 AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled])
737fi
738if test x"$grub_emu_sdl_excuse" = x ; then
739enable_grub_emu_sdl=yes
740else
741enable_grub_emu_sdl=no
742fi
743
3affd0ec 744if test x"$enable_grub_emu_pci" != xyes ; then
325c8258 745 grub_emu_pci_excuse="not enabled"
746fi
747
748if test x"$enable_grub_emu_usb" = xyes ; then
749 grub_emu_pci_excuse="conflicts with USB support"
750fi
751
752[if [ x"$grub_emu_pci_excuse" = x ]; then
753 # Check for libpci libraries.]
459fed4b 754 AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"],
755 [grub_emu_pci_excuse=["need libpciaccess library"]])
756 AC_SUBST([LIBPCIACCESS])
325c8258 757[fi]
758[if [ x"$grub_emu_pci_excuse" = x ]; then
759 # Check for headers.]
760 AC_CHECK_HEADERS([pci/pci.h], [],
459fed4b 761 [grub_emu_pci_excuse=["need libpciaccess headers"]])
325c8258 762[fi]
763
764if test x"$grub_emu_pci_excuse" = x ; then
765enable_grub_emu_pci=yes
766else
9f293ab0 767
325c8258 768enable_grub_emu_pci=no
3affd0ec 769fi
770
927d0134 771AC_SUBST([enable_grub_emu_sdl])
d64399b5 772AC_SUBST([enable_grub_emu_usb])
3affd0ec 773AC_SUBST([enable_grub_emu_pci])
f84b481b 774fi
4fe9862e 775
e52db1f7 776AC_ARG_ENABLE([grub-mkfont],
777 [AS_HELP_STRING([--enable-grub-mkfont],
5ce5507f 778 [build and install the `grub-mkfont' utility (default=guessed)])])
779if test x"$enable_grub_mkfont" = xno ; then
ce7a733d 780 grub_mkfont_excuse="explicitly disabled"
5ce5507f 781fi
782
783if test x"$grub_mkfont_excuse" = x ; then
e52db1f7 784 # Check for freetype libraries.
785 AC_CHECK_PROGS([FREETYPE], [freetype-config])
786 if test "x$FREETYPE" = x ; then
e98cd0c2 787 grub_mkfont_excuse=["need freetype2 library"]
e52db1f7 788 fi
e52db1f7 789fi
660960d6
VS
790
791if test x"$grub_mkfont_excuse" = x ; then
792 # Check for freetype libraries.
10854d0d
YB
793 freetype_cflags=`freetype-config --cflags`
794 freetype_libs=`freetype-config --libs`
d1e8a02f
VS
795 SAVED_CPPFLAGS="$CPPFLAGS"
796 CPPFLAGS="$CPPFLAGS $freetype_cflags"
660960d6
VS
797 AC_CHECK_HEADERS([ft2build.h], [],
798 [grub_mkfont_excuse=["need freetype2 headers"]])
d1e8a02f 799 CPPFLAGS="$SAVED_CPPFLAGS"
660960d6
VS
800fi
801
5ce5507f 802if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
ce7a733d 803 AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
5ce5507f 804fi
805if test x"$grub_mkfont_excuse" = x ; then
806enable_grub_mkfont=yes
807else
808enable_grub_mkfont=no
809fi
e52db1f7 810AC_SUBST([enable_grub_mkfont])
811AC_SUBST([freetype_cflags])
812AC_SUBST([freetype_libs])
813
7181e228
CW
814AC_ARG_ENABLE([device-mapper],
815 [AS_HELP_STRING([--enable-device-mapper],
816 [enable Linux device-mapper support (default=guessed)])])
817if test x"$enable_device_mapper" = xno ; then
818 device_mapper_excuse="explicitly disabled"
819fi
820
821if test x"$device_mapper_excuse" = x ; then
822 # Check for device-mapper library.
61d720e5 823 AC_CHECK_LIB([devmapper], [dm_task_create], [],
7181e228 824 [device_mapper_excuse="need devmapper library"])
7181e228 825fi
61d720e5
VS
826
827if test x"$device_mapper_excuse" = x ; then
828 # Check for device-mapper library.
829 AC_CHECK_LIB([devmapper], [dm_log_with_errno_init],
830 [],
831 [device_mapper_excuse="need devmapper library"])
832fi
833
834if test x"$device_mapper_excuse" = x ; then
835 LIBDEVMAPPER="-ldevmapper";
836 AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
837 [Define to 1 if you have the devmapper library.])
838fi
839
62f7d208 840AC_SUBST([LIBDEVMAPPER])
76ed06b9 841
a184f9c8 842AC_CHECK_LIB([zfs], [libzfs_init],
16c7cb32 843 [LIBZFS="-lzfs"
a184f9c8
RM
844 AC_DEFINE([HAVE_LIBZFS], [1],
845 [Define to 1 if you have the ZFS library.])],)
16c7cb32
BC
846AC_SUBST([LIBZFS])
847
a184f9c8 848AC_CHECK_LIB([nvpair], [nvlist_print],
16c7cb32 849 [LIBNVPAIR="-lnvpair"
a184f9c8
RM
850 AC_DEFINE([HAVE_LIBNVPAIR], [1],
851 [Define to 1 if you have the NVPAIR library.])],)
16c7cb32
BC
852AC_SUBST([LIBNVPAIR])
853
9f915872
VS
854LIBS=""
855
76ed06b9
BC
856pkglibrootdir='$(libdir)'/`echo $PACKAGE | sed "$program_transform_name"`
857AC_SUBST(pkglibrootdir)
858
859AC_SUBST([FONT_SOURCE])
76ed06b9
BC
860AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
861 [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
76ed06b9
BC
862AS_IF([test x$TARGET_APPLE_CC = x1],
863 [AC_SUBST([USE_APPLE_CC_FIXES], yes)])
7181e228 864
742f9232
VS
865AC_SUBST(HAVE_ASM_USCORE)
866AC_SUBST(ADDR32)
867AC_SUBST(DATA32)
868AC_SUBST(BSS_START_SYMBOL)
869AC_SUBST(END_SYMBOL)
870AC_SUBST(PACKAGE)
871AC_SUBST(VERSION)
872AC_SUBST(NEED_ENABLE_EXECUTE_STACK)
873AC_SUBST(NEED_REGISTER_FRAME_INFO)
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
742f9232
VS
909AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
910
6a161fa9 911# Output files.
1f4147aa 912grub_CHECK_LINK_DIR
913if test x"$link_dir" = xyes ; then
f84b481b
RM
914 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu])
915 if test "$platform" != emu ; then
916 AC_CONFIG_LINKS([include/grub/machine:include/grub/$target_cpu/$platform])
917 fi
1f4147aa 918else
919 mkdir -p include/grub 2>/dev/null
920 rm -rf include/grub/cpu
921 cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
f84b481b
RM
922 if test "$platform" != emu ; then
923 rm -rf include/grub/machine
924 cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
925 fi
1f4147aa 926fi
6304d292 927
8c411768 928AC_CONFIG_FILES([Makefile])
6304d292 929AC_CONFIG_FILES([grub-core/Makefile])
8c411768
BC
930AC_CONFIG_FILES([po/Makefile])
931AC_CONFIG_FILES([docs/Makefile])
b23ffd70 932AC_CONFIG_FILES([util/bash-completion.d/Makefile])
6a161fa9 933AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
742f9232 934AC_CONFIG_FILES([config.h])
8c411768 935
6a161fa9 936AC_OUTPUT
5ce5507f 937[
938echo "*******************************************************"
939echo GRUB2 will be compiled with following components:
940echo Platform: "$target_cpu"-"$platform"
f84b481b 941if [ x"$platform" = xemu ]; then
5ce5507f 942if [ x"$grub_emu_usb_excuse" = x ]; then
943echo USB support for grub-emu: Yes
944else
945echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
946fi
927d0134
VS
947if [ x"$grub_emu_sdl_excuse" = x ]; then
948echo SDL support for grub-emu: Yes
949else
950echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)"
951fi
325c8258 952if [ x"$grub_emu_pci_excuse" = x ]; then
953echo PCI support for grub-emu: Yes
954else
955echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
956fi
f84b481b 957fi
61d720e5
VS
958if test x"$device_mapper_excuse" = x ; then
959echo With devmapper support: Yes
960else
961echo With devmapper support: No "($device_mapper_excuse)"
962fi
5ce5507f 963if [ x"$enable_mm_debug" = xyes ]; then
964echo With memory debugging: Yes
965else
966echo With memory debugging: No
967fi
5ce5507f 968if [ x"$efiemu_excuse" = x ]; then
969echo efiemu runtime: Yes
970else
971echo efiemu runtime: No "($efiemu_excuse)"
972fi
5ce5507f 973if [ x"$grub_mkfont_excuse" = x ]; then
974echo grub-mkfont: Yes
975else
976echo grub-mkfont: No "($grub_mkfont_excuse)"
977fi
978echo "*******************************************************"
979]