]> git.proxmox.com Git - grub2.git/blame - configure.ac
* configure.ac: Remove -Wempty-body. It's not essential and needs
[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
5f91f701 35AC_INIT([GRUB],[2.00],[bug-grub@gnu.org])
6a161fa9 36
15c69261
YB
37AC_CONFIG_AUX_DIR([build-aux])
38
76ed06b9
BC
39# We don't want -g -O2 by default in CFLAGS
40: ${CFLAGS=""}
6a161fa9 41
b977bf01 42# Checks for host and target systems.
6a161fa9 43AC_CANONICAL_HOST
b977bf01 44AC_CANONICAL_TARGET
6a161fa9 45
8c411768
BC
46AM_INIT_AUTOMAKE()
47AC_PREREQ(2.60)
6304d292 48AC_CONFIG_SRCDIR([include/grub/dl.h])
742f9232 49AC_CONFIG_HEADER([config-util.h])
e52db1f7 50
1d543c3e 51# Program name transformations
52AC_ARG_PROGRAM
fd49ceb3
CW
53grub_TRANSFORM([grub-bios-setup])
54grub_TRANSFORM([grub-editenv])
55grub_TRANSFORM([grub-install])
56grub_TRANSFORM([grub-mkconfig])
57grub_TRANSFORM([grub-mkfont])
58grub_TRANSFORM([grub-mkimage])
67ab8353 59grub_TRANSFORM([grub-glue-efi])
fd49ceb3
CW
60grub_TRANSFORM([grub-mklayout])
61grub_TRANSFORM([grub-mkpasswd-pbkdf2])
62grub_TRANSFORM([grub-mkrelpath])
63grub_TRANSFORM([grub-mkrescue])
64grub_TRANSFORM([grub-probe])
65grub_TRANSFORM([grub-reboot])
66grub_TRANSFORM([grub-script-check])
67grub_TRANSFORM([grub-set-default])
fd49ceb3 68grub_TRANSFORM([grub-sparc64-setup])
a79b8a15 69grub_TRANSFORM([grub-render-label])
1d543c3e 70
90d1e879
RM
71# Optimization flag. Allow user to override.
72if test "x$TARGET_CFLAGS" = x; then
73 TARGET_CFLAGS="$TARGET_CFLAGS -Os"
74fi
75
7c9d0c39
VS
76BUILD_CPPFLAGS="$BUILD_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\""
77
76ed06b9
BC
78# Default HOST_CPPFLAGS
79HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
76ed06b9 80HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
76ed06b9
BC
81HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1"
82HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_LIBDIR=\\\"\$(pkglibdir)\\\""
83HOST_CPPFLAGS="$HOST_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\""
84
85TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W"
86TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include"
87TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include"
88
b977bf01 89case "$target_cpu" in
02164e1b 90 i[[3456]]86) target_cpu=i386 ;;
c7ef54aa 91 amd64) target_cpu=x86_64 ;;
02164e1b 92 sparc) target_cpu=sparc64 ;;
ade85305 93 mipsel|mips64el)
4959e111 94 target_cpu=mipsel;
c721825b 95 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1";
4a1eefb6 96 ;;
ade85305 97 mips|mips64)
76ed06b9 98 target_cpu=mips;
c721825b 99 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1";
4a1eefb6 100 ;;
389b31cd
LL
101 arm*)
102 target_cpu=arm;
103 ;;
6a161fa9 104esac
105
05568c2e 106# Specify the platform (such as firmware).
107AC_ARG_WITH([platform],
108 AS_HELP_STRING([--with-platform=PLATFORM],
83b984de 109 [select the host platform [[guessed]]]))
05568c2e 110
111# Guess the platform if not specified.
112if test "x$with_platform" = x; then
b977bf01 113 case "$target_cpu"-"$target_vendor" in
05568c2e 114 i386-apple) platform=efi ;;
115 i386-*) platform=pc ;;
58393a2d 116 x86_64-apple) platform=efi ;;
737feb35 117 x86_64-*) platform=pc ;;
05568c2e 118 powerpc-*) platform=ieee1275 ;;
58393a2d 119 powerpc64-*) platform=ieee1275 ;;
05568c2e 120 sparc64-*) platform=ieee1275 ;;
4959e111
VS
121 mipsel-*) platform=loongson ;;
122 mips-*) platform=arc ;;
e68d3b24 123 ia64-*) platform=efi ;;
389b31cd 124 arm-*) platform=uboot ;;
58393a2d 125 *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
05568c2e 126 esac
127else
128 platform="$with_platform"
129fi
130
ec1dfd63
VS
131case "$target_cpu"-"$platform" in
132 x86_64-efi) ;;
133 x86_64-emu) ;;
134 x86_64-*) target_cpu=i386 ;;
135 powerpc64-ieee1275) target_cpu=powerpc ;;
136esac
20011694 137
58393a2d 138# Check if the platform is supported, make final adjustments.
b977bf01 139case "$target_cpu"-"$platform" in
05568c2e 140 i386-efi) ;;
3f4ce737 141 x86_64-efi) ;;
05568c2e 142 i386-pc) ;;
7210dca9 143 i386-multiboot) ;;
546f966a 144 i386-coreboot) ;;
58393a2d 145 i386-linuxbios) platform=coreboot ;;
3d04eab8 146 i386-ieee1275) ;;
8231fb77 147 i386-qemu) ;;
05568c2e 148 powerpc-ieee1275) ;;
149 sparc64-ieee1275) ;;
2c40cc78 150 ia64-efi) ;;
f440c33f 151 mips-qemu_mips) ;;
3666d5f6 152 mips-qemu-mips) platform=qemu_mips;;
8906c3dd 153 mips-arc) ;;
7f63a64f 154 mipsel-arc) ;;
4959e111
VS
155 mipsel-qemu_mips) ;;
156 mipsel-qemu-mips) platform=qemu_mips;;
157 mipsel-yeeloong) platform=loongson ;;
158 mipsel-fuloong) platform=loongson ;;
159 mipsel-loongson) ;;
389b31cd
LL
160 arm-uboot) ;;
161 arm-efi) ;;
f84b481b 162 *-emu) ;;
58393a2d 163 *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
6a161fa9 164esac
165
3f4ce737 166case "$target_cpu" in
167 i386 | powerpc) target_m32=1 ;;
168 x86_64 | sparc64) target_m64=1 ;;
169esac
170
6e5a42fe 171case "$host_os" in
4825d790 172 mingw32*) host_os=cygwin ;;
6e5a42fe 173esac
174
9304eef1 175# This normalizes the names, and creates a new variable ("host_kernel")
176# while at it, since the mapping is not always 1:1 (e.g. different OSes
177# using the same kernel type).
178case "$host_os" in
179 gnu*) host_kernel=hurd ;;
180 linux*) host_kernel=linux ;;
67937d4d 181 freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;;
2c7031b1 182 netbsd*) host_kernel=netbsd ;;
958ee221 183 solaris*) host_kernel=illumos ;;
b105df76 184 darwin*) host_kernel=xnu ;;
9304eef1 185 cygwin) host_kernel=windows ;;
186esac
187
f84b481b 188case "$platform" in
c721825b
BC
189 coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;;
190 multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;;
191 efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;;
192 ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;;
389b31cd 193 uboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_UBOOT=1" ;;
c721825b
BC
194 qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
195 pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
196 emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
54da1feb 197 loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
3666d5f6
VS
198 qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
199 arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
f84b481b 200esac
6bea3f89 201case "$target_cpu" in
389b31cd 202 arm) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARM=1" ;;
4959e111 203 mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
c721825b 204 sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
6bea3f89 205esac
4959e111
VS
206if test x${target_cpu} = xmipsel ; then
207 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
208else
3ec0fc1c 209 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,` -DGRUB_TARGET_CPU_`echo ${target_cpu} | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`=1"
4959e111 210fi
6bea3f89 211
7f63a64f
VS
212case "${target_cpu}-$platform" in
213 mips-arc)
214 TARGET_LINK_ADDR=0x88200000
215 TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000
216 ;;
217 mipsel-arc)
218 TARGET_LINK_ADDR=0x80700000
219 TARGET_DECOMPRESSOR_LINK_ADDR=0x80600000
220 ;;
5fe67f39 221 mips*-qemu_mips | mips*-loongson)
7f63a64f
VS
222 TARGET_DECOMPRESSOR_LINK_ADDR=0x80100000
223 ;;
224esac
225
226AC_SUBST(TARGET_LINK_ADDR)
227AC_SUBST(TARGET_DECOMPRESSOR_LINK_ADDR)
228
c721825b 229TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
f84b481b 230
56978920 231AC_SUBST(host_cpu)
232AC_SUBST(host_os)
9304eef1 233AC_SUBST(host_kernel)
6e5a42fe 234
071114bb
VS
235AC_SUBST(target_cpu)
236AC_SUBST(platform)
237
d87aedff 238# Define default variables
7134247c
VS
239
240have_with_bootdir=n
241AC_ARG_WITH([bootdir],
242 AS_HELP_STRING([--with-bootdir=DIR],
243 [set the name of /boot directory [[guessed]]]),
244 [have_with_bootdir=y],
245 [have_with_bootdir=n])
246if test x$have_with_bootdir = xy; then
247 bootdirname="$with_bootdir"
248else
249 case "$host_os" in
250 netbsd* | openbsd*)
d87aedff 251 # Because /boot is used for the boot block in NetBSD and OpenBSD,
7134247c
VS
252 bootdirname='' ;;
253 *) bootdirname='boot' ;;
254 esac
255fi
256
d87aedff 257AC_SUBST(bootdirname)
a4c1d277
YB
258AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname",
259 [Default boot directory name]")
d87aedff 260
7134247c
VS
261AC_ARG_WITH([grubdir],
262 AS_HELP_STRING([--with-grubdir=DIR],
263 [set the name of grub directory [[guessed]]]),
264 [grubdirname="$with_grubdir"],
265 [grubdirname="$PACKAGE"])
266
d87aedff 267AC_SUBST(grubdirname)
a4c1d277
YB
268AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
269 [Default grub directory name])
d87aedff 270
b977bf01 271#
272# Checks for build programs.
273#
144f1f98 274
6c826348 275# Although cmp is listed in the GNU Coding Standards as a command which
276# can used directly, OpenBSD lacks cmp in the default installation.
277AC_CHECK_PROGS([CMP], [cmp])
278if test "x$CMP" = x; then
279 AC_MSG_ERROR([cmp is not found])
280fi
281
144f1f98 282AC_CHECK_PROGS([YACC], [bison])
1569ec51 283if test "x$YACC" = x; then
6c826348 284 AC_MSG_ERROR([bison is not found])
1569ec51 285fi
286
76ed06b9 287AC_PROG_RANLIB
b977bf01 288AC_PROG_INSTALL
289AC_PROG_AWK
09220190 290AC_PROG_LEX
76ed06b9 291AC_PROG_YACC
b977bf01 292AC_PROG_MAKE_SET
ff420223 293AC_PROG_MKDIR_P
e1fd1939 294AC_PROG_LN_S
b977bf01 295
c7c75cf4 296if test "x$LEX" = "x:"; then
09220190
BC
297 AC_MSG_ERROR([flex is not found])
298else
2663fb5f 299 version=`$LEX --version | $AWK '{ split($NF,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'`
b777c18e 300 if test -n "$version" -a "$version" -ge 20535; then
09220190
BC
301 :
302 else
303 AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above])
304 fi
305fi
306
68807e5f 307# These are not a "must".
51fa856c 308AC_PATH_PROGS(MAKEINFO, makeinfo true)
6a161fa9 309
b977bf01 310#
311# Checks for host programs.
312#
313
314AC_PROG_CC
15c69261 315gl_EARLY
1eed0e6e 316AC_PROG_CXX
76ed06b9
BC
317AM_PROG_CC_C_O
318AM_PROG_AS
319
6a161fa9 320# Must be GCC.
321test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
322
1eed0e6e
VS
323AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
324
4889bdec 325AC_GNU_SOURCE
2f1a3acf 326AM_GNU_GETTEXT([external])
b977bf01 327AC_SYS_LARGEFILE
328
329# Identify characteristics of the host architecture.
330AC_C_BIGENDIAN
331AC_CHECK_SIZEOF(void *)
332AC_CHECK_SIZEOF(long)
333
2b167a72 334grub_apple_cc
c9da87d0 335if test x$grub_cv_apple_cc = xyes ; then
6fd0b143
VS
336 HOST_CPPFLAGS="$HOST_CPPFLAGS -fnested-functions"
337 HOST_LDFLAGS="$HOST_LDFLAGS -Wl,-allow_stack_execute"
2b167a72 338fi
b977bf01 339
aad32b14
VS
340if test x$USE_NLS = xno; then
341 HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext"
342fi
343
86695375 344if test "x$cross_compiling" = xyes; then
345 AC_MSG_WARN([cannot generate manual pages while cross compiling])
346else
347 AC_PATH_PROG(HELP2MAN, help2man)
348fi
349
3169f4c7 350# Check for functions and headers.
0f7e980b 351AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
e4c498a1 352AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
7c4e16ff 353
fb90b546
RM
354AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
355#include <sys/param.h>
356#include <sys/mount.h>])
357
358AC_CHECK_MEMBERS([struct statfs.f_mntfromname],,,[$ac_includes_default
359#include <sys/param.h>
360#include <sys/mount.h>])
361
2c7031b1
GS
362# For opendisk() and getrawpartition() on NetBSD.
363# Used in util/deviceiter.c and in util/hostdisk.c.
364AC_CHECK_HEADER([util.h], [
365 AC_CHECK_LIB([util], [opendisk], [
366 LIBUTIL="-lutil"
367 AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used])
368 ])
369 AC_CHECK_LIB([util], [getrawpartition], [
370 LIBUTIL="-lutil"
371 AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition() in -lutil can be used])
372 ])
373])
374AC_SUBST([LIBUTIL])
375
19ce697d 376AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
00c05e22 377 SAVED_CFLAGS="$CFLAGS"
00c05e22
VS
378 CFLAGS="$HOST_CFLAGS -Wtrampolines"
379 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
380int va_arg_func (int fixed, va_list args);]], [[]])],
19ce697d
VS
381 [grub_cv_host_cc_wtrampolines=yes],
382 [grub_cv_host_cc_wtrampolines=no])
00c05e22
VS
383 CFLAGS="$SAVED_CFLAGS"
384])
385
19ce697d
VS
386if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then
387 HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines"
00c05e22
VS
388fi
389
76ed06b9
BC
390#
391# Check for host and build compilers.
392#
393HOST_CC=$CC
816719c8
VS
394AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc])
395test -z "$BUILD_CC" && AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])
76ed06b9 396
15c69261
YB
397# For gnulib.
398gl_INIT
399
b977bf01 400#
401# Check for target programs.
402#
403
5b5d4aa5 404# Find tools for the target.
405if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
b977bf01 406 tmp_ac_tool_prefix="$ac_tool_prefix"
407 ac_tool_prefix=$target_alias-
408
409 AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
410 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
411 AC_CHECK_TOOL(OBJCOPY, objcopy)
412 AC_CHECK_TOOL(STRIP, strip)
413 AC_CHECK_TOOL(NM, nm)
414
415 ac_tool_prefix="$tmp_ac_tool_prefix"
416else
417 if test "x$TARGET_CC" = x; then
418 TARGET_CC=$CC
419 fi
420 AC_CHECK_TOOL(OBJCOPY, objcopy)
421 AC_CHECK_TOOL(STRIP, strip)
422 AC_CHECK_TOOL(NM, nm)
423fi
76ed06b9
BC
424AC_SUBST(HOST_CC)
425AC_SUBST(BUILD_CC)
7c9d0c39
VS
426AC_SUBST(BUILD_CFLAGS)
427AC_SUBST(BUILD_CPPFLAGS)
b977bf01 428AC_SUBST(TARGET_CC)
429
b977bf01 430# Test the C compiler for the target environment.
431tmp_CC="$CC"
432tmp_CFLAGS="$CFLAGS"
433tmp_LDFLAGS="$LDFLAGS"
434tmp_CPPFLAGS="$CPPFLAGS"
aa6d7826 435tmp_LIBS="$LIBS"
b977bf01 436CC="$TARGET_CC"
437CFLAGS="$TARGET_CFLAGS"
438CPPFLAGS="$TARGET_CPPFLAGS"
439LDFLAGS="$TARGET_LDFLAGS"
aa6d7826 440LIBS=""
b977bf01 441
90d1e879 442# debug flags.
ca1fb563 443WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
ebcecdf1 444HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
4e27343f 445TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
76ed06b9 446TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
6a161fa9 447
90d1e879
RM
448# Force no alignment to save space on i386.
449if test "x$target_cpu" = xi386; then
450 AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
451 CFLAGS="$CFLAGS -falign-loops=1"
eb73121d 452 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
90d1e879
RM
453 [grub_cv_cc_falign_loop=yes],
454 [grub_cv_cc_falign_loop=no])
6a161fa9 455 ])
6a161fa9 456
90d1e879
RM
457 if test "x$grub_cv_cc_falign_loop" = xyes; then
458 TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
6a161fa9 459 else
90d1e879 460 TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
6a161fa9 461 fi
89e0240c 462fi
6a161fa9 463
ee0220bc 464if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then
90d1e879
RM
465 # Some toolchains enable these features by default, but they need
466 # registers that aren't set up properly in GRUB.
467 TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
468fi
77c55a87 469
90d1e879
RM
470# By default, GCC 4.4 generates .eh_frame sections containing unwind
471# information in some cases where it previously did not. GRUB doesn't need
472# these and they just use up vital space. Restore the old compiler
473# behaviour.
474AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
475 SAVE_CFLAGS="$CFLAGS"
476 CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
477 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
478 [grub_cv_cc_fno_dwarf2_cfi_asm=yes],
479 [grub_cv_cc_fno_dwarf2_cfi_asm=no])
480 CFLAGS="$SAVE_CFLAGS"
481])
77c55a87 482
90d1e879
RM
483if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
484 TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
b977bf01 485fi
6a161fa9 486
e9d3421c
VS
487# By default, GCC 4.6 generates .eh_frame sections containing unwind
488# information in some cases where it previously did not. GRUB doesn't need
489# these and they just use up vital space. Restore the old compiler
490# behaviour.
491AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [
492 SAVE_CFLAGS="$CFLAGS"
493 CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
494 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
495 [grub_cv_cc_fno_asynchronous_unwind_tables=yes],
496 [grub_cv_cc_fno_asynchronous_unwind_tables=no])
497 CFLAGS="$SAVE_CFLAGS"
498])
499
500if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then
501 TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables"
502fi
503
2b167a72 504grub_apple_target_cc
c9da87d0 505if test x$grub_cv_apple_target_cc = xyes ; then
403e25a5 506 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -fnested-functions"
76ed06b9 507
6fd0b143 508 CFLAGS="$CFLAGS -fnested-functions"
2b167a72 509 TARGET_APPLE_CC=1
cf00df31 510 AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
511 if test "x$OBJCONV" = x ; then
512 AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.])
513 fi
514 if test "x$OBJCONV" = x ; then
515 AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
516 fi
2b167a72 517 TARGET_IMG_LDSCRIPT=
518 TARGET_IMG_CFLAGS="-static"
76ed06b9
BC
519 TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
520 TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
521 TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
46cf439c 522 TARGET_LDFLAGS_OLDMAGIC=""
2b167a72 523else
524 TARGET_APPLE_CC=0
f04a9a21 525 TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
2b167a72 526# Use linker script if present, otherwise use builtin -N script.
76ed06b9
BC
527if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
528 TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
529 TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
530 TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
531 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
2b167a72 532else
533 TARGET_IMG_LDSCRIPT=
76ed06b9
BC
534 TARGET_IMG_LDFLAGS='-Wl,-N'
535 TARGET_IMG_LDFLAGS_AC='-Wl,-N'
536 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
2b167a72 537fi
538TARGET_IMG_CFLAGS=
539fi
540
46cf439c
VS
541AC_SUBST(TARGET_LDFLAGS_OLDMAGIC)
542
2b167a72 543# For platforms where ELF is not the default link format.
544AC_MSG_CHECKING([for command to convert module to ELF format])
545case "${host_os}" in
f1632d4d 546 cygwin) TARGET_OBJ2ELF='$(top_builddir)/grub-pe2elf';
4b0cd8f8 547# FIXME: put proper test here
742f9232 548 NEED_REGISTER_FRAME_INFO=1
4b0cd8f8 549 ;;
742f9232 550 *) NEED_REGISTER_FRAME_INFO=0 ;;
2b167a72 551esac
2b167a72 552AC_MSG_RESULT([$TARGET_OBJ2ELF])
553
30c7d3ce
VS
554
555AC_ARG_ENABLE([efiemu],
556 [AS_HELP_STRING([--enable-efiemu],
557 [build and install the efiemu runtimes (default=guessed)])])
558if test x"$enable_efiemu" = xno ; then
559 efiemu_excuse="explicitly disabled"
560fi
561if test x"$target_cpu" != xi386 ; then
562 efiemu_excuse="only available on i386"
563fi
564if test x"$platform" = xefi ; then
565 efiemu_excuse="not available on efi"
566fi
567if test x"$efiemu_excuse" = x ; then
568 AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
dfc8aeb0 569 SAVED_CFLAGS="$CFLAGS"
30c7d3ce
VS
570 CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
571 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
572 [grub_cv_cc_efiemu=yes],
573 [grub_cv_cc_efiemu=no])
dfc8aeb0 574 CFLAGS="$SAVED_CFLAGS"
30c7d3ce
VS
575 ])
576 if test x$grub_cv_cc_efiemu = xno; then
577 efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
578 fi
579fi
580if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
581 AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
582fi
583if test x"$efiemu_excuse" = x ; then
584enable_efiemu=yes
585else
586enable_efiemu=no
587fi
588AC_SUBST([enable_efiemu])
589
b977bf01 590if test "x$target_m32" = x1; then
591 # Force 32-bit mode.
592 TARGET_CFLAGS="$TARGET_CFLAGS -m32"
76ed06b9 593 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
19e81ba7 594 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
b977bf01 595 TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
2b167a72 596 TARGET_MODULE_FORMAT="elf32"
6a161fa9 597fi
b977bf01 598
20011694 599if test "x$target_m64" = x1; then
600 # Force 64-bit mode.
7e9ca17a 601 TARGET_CFLAGS="$TARGET_CFLAGS -m64"
76ed06b9 602 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
19e81ba7 603 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64"
7e9ca17a 604 TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
2b167a72 605 TARGET_MODULE_FORMAT="elf64"
7e9ca17a 606fi
607
46546fc5 608if test "$target_cpu" = x86_64; then
7e9ca17a 609 # Use large model to support 4G memory
6e09b8b7 610 AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
c8600122 611 SAVED_CFLAGS=$CFLAGS
612 CFLAGS="$CFLAGS -m64 -mcmodel=large"
6e09b8b7 613 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
614 [grub_cv_cc_mcmodel=yes],
615 [grub_cv_cc_mcmodel=no])
616 ])
c8600122 617 if test "x$grub_cv_cc_mcmodel" = xno; then
4ba8d354 618 AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.])
c8600122 619 else
620 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
6e09b8b7 621 fi
46546fc5 622fi
7e9ca17a 623
46546fc5 624if test "$target_cpu"-"$platform" = x86_64-efi; then
7e9ca17a 625 # EFI writes to stack below %rsp, we must not use the red zone
626 AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
c8600122 627 CFLAGS="$CFLAGS -m64 -mno-red-zone"
7e9ca17a 628 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
629 [grub_cv_cc_no_red_zone=yes],
630 [grub_cv_cc_no_red_zone=no])
631 ])
632 if test "x$grub_cv_cc_no_red_zone" = xno; then
633 AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
634 fi
635
c8600122 636 TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
20011694 637fi
638
baa2a121 639#
640# Compiler features.
641#
642
93a81088 643# Position independent executable.
644grub_CHECK_PIE
645[# Need that, because some distributions ship compilers that include
646# `-fPIE' in the default specs.
647if [ x"$pie_possible" = xyes ]; then
648 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
649fi]
650
7bd8b0c7
VS
651# Position independent executable.
652grub_CHECK_PIC
653[# Need that, because some distributions ship compilers that include
654# `-fPIC' in the default specs.
655if [ x"$pic_possible" = xyes ]; then
656 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC"
657fi]
658
baa2a121 659# Smashing stack protector.
660grub_CHECK_STACK_PROTECTOR
c3db8364 661# Need that, because some distributions ship compilers that include
baa2a121 662# `-fstack-protector' in the default specs.
c3db8364 663if test "x$ssp_possible" = xyes; then
664 TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
665fi
2a8a80e4 666grub_CHECK_STACK_ARG_PROBE
667# Cygwin's GCC uses alloca() to probe the stackframe on static
668# stack allocations above some threshold.
669if test x"$sap_possible" = xyes; then
670 TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
671fi
baa2a121 672
bb9f92b9
LL
673# -mno-unaligned-access
674if test "$target_cpu" = arm; then
675 grub_CHECK_NO_UNALIGNED_ACCESS
676 if test x"$nua_possible" = xyes; then
677 TARGET_CFLAGS="$TARGET_CFLAGS -mno-unaligned-access"
678 fi
679fi
680
63f745e8 681AC_ARG_ENABLE([werror],
682 [AS_HELP_STRING([--disable-werror],
683 [do not use -Werror when building GRUB])])
684if test x"$enable_werror" != xno ; then
685 TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
ebcecdf1 686 HOST_CFLAGS="$HOST_CFLAGS -Werror"
63f745e8 687fi
688
76ed06b9
BC
689TARGET_CPP="$TARGET_CC -E"
690TARGET_CCAS=$TARGET_CC
691
92cd0f6e
VS
692GRUB_TARGET_CPU="${target_cpu}"
693GRUB_PLATFORM="${platform}"
694
695AC_SUBST(GRUB_TARGET_CPU)
696AC_SUBST(GRUB_PLATFORM)
697
cf00df31 698AC_SUBST(OBJCONV)
76ed06b9
BC
699AC_SUBST(TARGET_CPP)
700AC_SUBST(TARGET_CCAS)
701AC_SUBST(TARGET_OBJ2ELF)
2b167a72 702AC_SUBST(TARGET_APPLE_CC)
76ed06b9
BC
703AC_SUBST(TARGET_MODULE_FORMAT)
704
705AC_SUBST(TARGET_CFLAGS)
b977bf01 706AC_SUBST(TARGET_LDFLAGS)
76ed06b9
BC
707AC_SUBST(TARGET_CPPFLAGS)
708AC_SUBST(TARGET_CCASFLAGS)
709
710AC_SUBST(TARGET_IMG_LDSCRIPT)
711AC_SUBST(TARGET_IMG_LDFLAGS)
712AC_SUBST(TARGET_IMG_CFLAGS)
713AC_SUBST(TARGET_IMG_BASE_LDOPT)
714
715AC_SUBST(HOST_CFLAGS)
716AC_SUBST(HOST_LDFLAGS)
717AC_SUBST(HOST_CPPFLAGS)
718AC_SUBST(HOST_CCASFLAGS)
6a161fa9 719
aa6d7826 720# Set them to their new values for the tests below.
721CC="$TARGET_CC"
26de2bcd 722if test "x$TARGET_APPLE_CC" = x1 ; then
69be5b74 723CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
26de2bcd 724else
01fcf061 725CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
26de2bcd 726fi
aa6d7826 727CPPFLAGS="$TARGET_CPPFLAGS"
03f80960
VS
728if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 ; then
729LIBS=
730else
69be5b74 731LIBS=-lgcc
03f80960 732fi
69be5b74 733
01fcf061
VS
734grub_ASM_USCORE
735if test x$grub_cv_asm_uscore = xyes; then
736CFLAGS="$CFLAGS -Wl,--defsym,_abort=_main"
737else
738CFLAGS="$CFLAGS -Wl,--defsym,abort=main"
739fi
740
69be5b74 741# Check for libgcc symbols
19ce697d 742AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2)
69be5b74
VS
743
744if test "x$TARGET_APPLE_CC" = x1 ; then
745CFLAGS="$TARGET_CFLAGS -nostdlib"
746else
747CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
748fi
42e0cba3 749LIBS=""
aa6d7826 750
6a161fa9 751# Defined in aclocal.m4.
f6130a12 752grub_PROG_TARGET_CC
2b167a72 753if test "x$TARGET_APPLE_CC" != x1 ; then
b977bf01 754grub_PROG_OBJCOPY_ABSOLUTE
2b167a72 755fi
cb71ba20 756grub_PROG_LD_BUILD_ID_NONE
b977bf01 757if test "x$target_cpu" = xi386; then
2aec1692
CF
758 if test "$platform" != emu && test "x$TARGET_APPLE_CC" != x1 ; then
759 if test ! -z "$TARGET_IMG_LDSCRIPT"; then
760 # Check symbols provided by linker script.
76ed06b9 761 CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},8000 -Wl,--defsym,___main=0x8100"
2aec1692 762 fi
2a8a80e4 763 grub_CHECK_BSS_START_SYMBOL
764 grub_CHECK_END_SYMBOL
765 fi
766 CFLAGS="$TARGET_CFLAGS"
4b13b216 767 grub_I386_ASM_PREFIX_REQUIREMENT
768 grub_I386_ASM_ADDR32
6a161fa9 769fi
770
016a671b 771if test "$platform" != emu; then
8f9a632b
VS
772AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
773 SAVED_CPPFLAGS="$CPPFLAGS"
774 CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
775 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
ce938140 776#include <stddef.h>
8f9a632b
VS
777int va_arg_func (int fixed, va_list args);]], [[]])],
778 [grub_cv_cc_isystem=yes],
779 [grub_cv_cc_isystem=no])
780 CPPFLAGS="$SAVED_CPPFLAGS"
781])
782
783if test x"$grub_cv_cc_isystem" = xyes ; then
784 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
785fi
dae79b6b 786fi
5ce5507f 787
19ce697d 788AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [
779dc15b 789 SAVED_CFLAGS="$CFLAGS"
72b7c7aa 790 CFLAGS="$TARGET_CFLAGS -Wtrampolines"
779dc15b
VS
791 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
792int va_arg_func (int fixed, va_list args);]], [[]])],
19ce697d
VS
793 [grub_cv_cc_wtrampolines=yes],
794 [grub_cv_cc_wtrampolines=no])
779dc15b
VS
795 CFLAGS="$SAVED_CFLAGS"
796])
797
19ce697d
VS
798if test x"$grub_cv_cc_wtrampolines" = xyes ; then
799 TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines"
779dc15b
VS
800fi
801
c9a86192 802# Restore the flags.
9962ed99 803CC="$tmp_CC"
804CFLAGS="$tmp_CFLAGS"
805CPPFLAGS="$tmp_CPPFLAGS"
c9a86192 806LDFLAGS="$tmp_LDFLAGS"
aa6d7826 807LIBS="$tmp_LIBS"
6a161fa9 808
4fe9862e 809#
2965c7cc 810# Check for options.
4fe9862e 811#
812
813# Memory manager debugging.
b39f9d20 814AC_ARG_ENABLE([mm-debug],
2965c7cc 815 AS_HELP_STRING([--enable-mm-debug],
90ce5d56 816 [include memory manager debugging]),
2965c7cc 817 [AC_DEFINE([MM_DEBUG], [1],
818 [Define to 1 if you enable memory manager debugging.])])
819
c5dc1690
SJ
820AC_ARG_ENABLE([cache-stats],
821 AS_HELP_STRING([--enable-cache-stats],
055e2b8b 822 [enable disk cache statistics collection]))
c5dc1690
SJ
823
824if test x$enable_cache_stats = xyes; then
825 DISK_CACHE_STATS=1
826else
827 DISK_CACHE_STATS=0
828fi
829AC_SUBST([DISK_CACHE_STATS])
830
e744219b
VS
831AC_ARG_ENABLE([boot-time],
832 AS_HELP_STRING([--enable-boot-time],
833 [enable boot time statistics collection]))
834
835if test x$enable_boot_time = xyes; then
836 BOOT_TIME_STATS=1
837else
838 BOOT_TIME_STATS=0
839fi
840AC_SUBST([BOOT_TIME_STATS])
841
d64399b5 842AC_ARG_ENABLE([grub-emu-usb],
843 [AS_HELP_STRING([--enable-grub-emu-usb],
5ce5507f 844 [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
5ce5507f 845
927d0134
VS
846AC_ARG_ENABLE([grub-emu-sdl],
847 [AS_HELP_STRING([--enable-grub-emu-sdl],
848 [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])])
849
3affd0ec 850AC_ARG_ENABLE([grub-emu-pci],
851 [AS_HELP_STRING([--enable-grub-emu-pci],
852 [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
853
f84b481b 854if test "$platform" = emu; then
f84b481b 855
62a747cb
VS
856if test x"$enable_grub_emu_usb" != xyes ; then
857 grub_emu_usb_excuse="not enabled"
5ce5507f 858fi
325c8258 859
0e848909
VS
860if test x"$enable_grub_emu_pci" = xyes ; then
861 grub_emu_usb_excuse="conflicts with PCI support"
862fi
863
5ce5507f 864[if [ x"$grub_emu_usb_excuse" = x ]; then
d64399b5 865 # Check for libusb libraries.]
5ce5507f 866AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
e98cd0c2 867 [grub_emu_usb_excuse=["need libusb library"]])
d64399b5 868 AC_SUBST([LIBUSB])
5ce5507f 869[fi]
870[if [ x"$grub_emu_usb_excuse" = x ]; then
871 # Check for headers.]
d64399b5 872 AC_CHECK_HEADERS([usb.h], [],
e98cd0c2 873 [grub_emu_usb_excuse=["need libusb headers"]])
4fe9862e 874[fi]
c6f3b249 875if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
ce7a733d 876 AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
5ce5507f 877fi
878if test x"$grub_emu_usb_excuse" = x ; then
879enable_grub_emu_usb=yes
880else
881enable_grub_emu_usb=no
882fi
883
927d0134
VS
884if test x"$enable_grub_emu_sdl" = xno ; then
885 grub_emu_sdl_excuse="explicitely disabled"
886fi
887[if [ x"$grub_emu_sdl_excuse" = x ]; then
888 # Check for libSDL libraries.]
889AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
890 [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]])
891 AC_SUBST([LIBSDL])
892[fi]
9f293ab0 893
927d0134
VS
894[if [ x"$grub_emu_sdl_excuse" = x ]; then
895 # Check for headers.]
896 AC_CHECK_HEADERS([SDL/SDL.h], [],
897 [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]])
898[fi]
9f293ab0 899
927d0134
VS
900if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
901 AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled])
902fi
903if test x"$grub_emu_sdl_excuse" = x ; then
904enable_grub_emu_sdl=yes
905else
906enable_grub_emu_sdl=no
907fi
908
3affd0ec 909if test x"$enable_grub_emu_pci" != xyes ; then
325c8258 910 grub_emu_pci_excuse="not enabled"
911fi
912
913if test x"$enable_grub_emu_usb" = xyes ; then
914 grub_emu_pci_excuse="conflicts with USB support"
915fi
916
917[if [ x"$grub_emu_pci_excuse" = x ]; then
918 # Check for libpci libraries.]
459fed4b 919 AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"],
920 [grub_emu_pci_excuse=["need libpciaccess library"]])
921 AC_SUBST([LIBPCIACCESS])
325c8258 922[fi]
923[if [ x"$grub_emu_pci_excuse" = x ]; then
924 # Check for headers.]
925 AC_CHECK_HEADERS([pci/pci.h], [],
459fed4b 926 [grub_emu_pci_excuse=["need libpciaccess headers"]])
325c8258 927[fi]
928
929if test x"$grub_emu_pci_excuse" = x ; then
930enable_grub_emu_pci=yes
931else
9f293ab0 932
325c8258 933enable_grub_emu_pci=no
3affd0ec 934fi
935
927d0134 936AC_SUBST([enable_grub_emu_sdl])
d64399b5 937AC_SUBST([enable_grub_emu_usb])
3affd0ec 938AC_SUBST([enable_grub_emu_pci])
f84b481b 939fi
4fe9862e 940
e52db1f7 941AC_ARG_ENABLE([grub-mkfont],
942 [AS_HELP_STRING([--enable-grub-mkfont],
5ce5507f 943 [build and install the `grub-mkfont' utility (default=guessed)])])
944if test x"$enable_grub_mkfont" = xno ; then
ce7a733d 945 grub_mkfont_excuse="explicitly disabled"
5ce5507f 946fi
947
948if test x"$grub_mkfont_excuse" = x ; then
e52db1f7 949 # Check for freetype libraries.
a5b55c4b 950 AC_CHECK_TOOLS([FREETYPE], [freetype-config])
e52db1f7 951 if test "x$FREETYPE" = x ; then
e98cd0c2 952 grub_mkfont_excuse=["need freetype2 library"]
e52db1f7 953 fi
e52db1f7 954fi
660960d6
VS
955
956if test x"$grub_mkfont_excuse" = x ; then
957 # Check for freetype libraries.
a5b55c4b
DM
958 freetype_cflags=`$FREETYPE --cflags`
959 freetype_libs=`$FREETYPE --libs`
d1e8a02f
VS
960 SAVED_CPPFLAGS="$CPPFLAGS"
961 CPPFLAGS="$CPPFLAGS $freetype_cflags"
660960d6
VS
962 AC_CHECK_HEADERS([ft2build.h], [],
963 [grub_mkfont_excuse=["need freetype2 headers"]])
d1e8a02f 964 CPPFLAGS="$SAVED_CPPFLAGS"
660960d6
VS
965fi
966
5ce5507f 967if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
ce7a733d 968 AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
5ce5507f 969fi
970if test x"$grub_mkfont_excuse" = x ; then
971enable_grub_mkfont=yes
972else
973enable_grub_mkfont=no
974fi
e52db1f7 975AC_SUBST([enable_grub_mkfont])
976AC_SUBST([freetype_cflags])
977AC_SUBST([freetype_libs])
978
7c9d0c39
VS
979SAVED_CC="$CC"
980SAVED_CFLAGS="$CFLAGS"
981SAVED_CPPFLAGS="$CPPFLAGS"
982CC="$BUILD_CC"
983CFLAGS="$BUILD_CFLAGS"
984CPPFLAGS="$SAVED_CPPFLAGS"
c5884973 985
7c9d0c39
VS
986if test x"$grub_build_mkfont_excuse" = x ; then
987 # Check for freetype libraries.
988 AC_CHECK_TOOLS([BUILD_FREETYPE], [freetype-config])
989 if test "x$BUILD_FREETYPE" = x ; then
990 grub_build_mkfont_excuse=["need freetype2 library"]
991 fi
992fi
c5884973 993
7c9d0c39
VS
994if test x"$grub_build_mkfont_excuse" = x ; then
995 # Check for freetype libraries.
996 build_freetype_cflags=`$BUILD_FREETYPE --cflags`
997 build_freetype_libs=`$BUILD_FREETYPE --libs`
998 SAVED_CPPFLAGS_2="$CPPFLAGS"
999 CPPFLAGS="$CPPFLAGS $build_freetype_cflags"
1000 AC_CHECK_HEADERS([ft2build.h], [],
1001 [grub_build_mkfont_excuse=["need freetype2 headers"]])
1002 CPPFLAGS="$SAVED_CPPFLAGS_2"
1003fi
1004
1005if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then
1006 AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled])
1007fi
1008if test x"$grub_build_mkfont_excuse" = x ; then
1009 enable_build_grub_mkfont=yes
1010else
1011 enable_build_grub_mkfont=no
c5884973 1012fi
b2e9d276
VS
1013if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 ); then
1014 AC_MSG_ERROR([qemu, powerpc-ieee1275 and loongson ports needs build-time grub-mkfont])
7c9d0c39
VS
1015fi
1016
1017AC_SUBST([build_freetype_cflags])
1018AC_SUBST([build_freetype_libs])
1019
1020CC="$SAVED_CC"
1021CFLAGS="$SAVED_CFLAGS"
1022CPPFLAGS="$SAVED_CPPFLAGS"
1023
1024
1025DJVU_FONT_SOURCE=
1026
1027starfield_excuse=
c5884973 1028
7b966834
VS
1029if test x"$enable_build_grub_mkfont" = xno ; then
1030 starfield_excuse="No build-time grub-mkfont"
1031fi
1032
501b9e4b 1033if test x"$starfield_excuse" = x; then
c5884973 1034 for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
32745f51 1035 for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do
c5884973
DO
1036 if test -f "$dir/DejaVuSans.$ext"; then
1037 DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext"
1038 break 2
1039 fi
1040 done
1041 done
1042
1043 if test "x$DJVU_FONT_SOURCE" = x; then
1044 starfield_excuse="No DejaVu found"
1045 fi
1046fi
1047
1048AC_SUBST([DJVU_FONT_SOURCE])
1049
7c9d0c39
VS
1050FONT_SOURCE=
1051
1052for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
1053 for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni /usr/share/fonts/truetype/unifont /usr/share/fonts/misc; do
1054 if test -f "$dir/unifont.$ext"; then
1055 FONT_SOURCE="$dir/unifont.$ext"
1056 break 2
1057 fi
1058 done
1059done
1060
7b966834
VS
1061if test x"$enable_build_grub_mkfont" = xno ; then
1062 FONT_SOURCE=
1063fi
1064
b2e9d276
VS
1065if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 ); then
1066 AC_MSG_ERROR([qemu, powerpc-ieee1275 and loongson ports need unifont])
7c9d0c39
VS
1067fi
1068
1069AC_SUBST([FONT_SOURCE])
1070
1071if test x"$FONT_SOURCE" = x && test x"$DJVU_FONT_SOURCE" = x; then
1072 grub_build_mkfont_excuse="no fonts"
1073fi
1074
1075
897e6207
CW
1076AC_ARG_ENABLE([grub-mount],
1077 [AS_HELP_STRING([--enable-grub-mount],
1078 [build and install the `grub-mount' utility (default=guessed)])])
1079if test x"$enable_grub_mount" = xno ; then
1080 grub_mount_excuse="explicitly disabled"
92bb0786
VS
1081fi
1082
897e6207 1083if test x"$grub_mount_excuse" = x ; then
92bb0786 1084 AC_CHECK_LIB([fuse], [fuse_main_real], [],
897e6207 1085 [grub_mount_excuse="need FUSE library"])
92bb0786
VS
1086fi
1087
897e6207 1088if test x"$grub_mount_excuse" = x ; then
92bb0786
VS
1089 # Check for fuse headers.
1090 SAVED_CPPFLAGS="$CPPFLAGS"
338c7fab 1091 CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26"
92bb0786 1092 AC_CHECK_HEADERS([fuse/fuse.h], [],
897e6207 1093 [grub_mount_excuse=["need FUSE headers"]])
92bb0786
VS
1094 CPPFLAGS="$SAVED_CPPFLAGS"
1095fi
1096
897e6207 1097if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then
89644ef1 1098 AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled])
92bb0786 1099fi
897e6207
CW
1100if test x"$grub_mount_excuse" = x ; then
1101enable_grub_mount=yes
92bb0786 1102else
897e6207 1103enable_grub_mount=no
92bb0786 1104fi
897e6207 1105AC_SUBST([enable_grub_mount])
92bb0786 1106
7181e228
CW
1107AC_ARG_ENABLE([device-mapper],
1108 [AS_HELP_STRING([--enable-device-mapper],
1109 [enable Linux device-mapper support (default=guessed)])])
1110if test x"$enable_device_mapper" = xno ; then
1111 device_mapper_excuse="explicitly disabled"
1112fi
1113
53798c4b
GS
1114if test x"$device_mapper_excuse" = x ; then
1115 # Check for device-mapper header.
1116 AC_CHECK_HEADER([libdevmapper.h], [],
1117 [device_mapper_excuse="need libdevmapper header"])
1118fi
1119
7181e228
CW
1120if test x"$device_mapper_excuse" = x ; then
1121 # Check for device-mapper library.
61d720e5 1122 AC_CHECK_LIB([devmapper], [dm_task_create], [],
7181e228 1123 [device_mapper_excuse="need devmapper library"])
7181e228 1124fi
61d720e5
VS
1125
1126if test x"$device_mapper_excuse" = x ; then
1127 # Check for device-mapper library.
1128 AC_CHECK_LIB([devmapper], [dm_log_with_errno_init],
1129 [],
1130 [device_mapper_excuse="need devmapper library"])
1131fi
1132
1133if test x"$device_mapper_excuse" = x ; then
1134 LIBDEVMAPPER="-ldevmapper";
1135 AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
1136 [Define to 1 if you have the devmapper library.])
1137fi
1138
62f7d208 1139AC_SUBST([LIBDEVMAPPER])
76ed06b9 1140
f4727da9
VS
1141LIBGEOM=
1142if test x$host_kernel = xkfreebsd; then
1143 AC_CHECK_LIB([geom], [geom_gettree], [],
1144 [AC_MSG_ERROR([Your platform requires libgeom])])
1145 LIBGEOM="-lgeom"
1146fi
1147
1148AC_SUBST([LIBGEOM])
1149
2c44e493
VS
1150AC_CHECK_LIB([lzma], [lzma_code],
1151 [LIBLZMA="-llzma"
1152 AC_DEFINE([HAVE_LIBLZMA], [1],
1153 [Define to 1 if you have the LZMA library.])],)
1154AC_SUBST([LIBLZMA])
1155
e4c498a1
MG
1156AC_ARG_ENABLE([libzfs],
1157 [AS_HELP_STRING([--enable-libzfs],
1158 [enable libzfs integration (default=guessed)])])
1159if test x"$enable_libzfs" = xno ; then
1160 libzfs_excuse="explicitly disabled"
1161fi
16c7cb32 1162
e4c498a1
MG
1163if test x"$libzfs_excuse" = x ; then
1164 # Only check for system headers if libzfs support has not been disabled.
1165 AC_CHECK_HEADERS(libzfs.h libnvpair.h)
1166fi
1167
1168if test x"$libzfs_excuse" = x ; then
1169 AC_CHECK_LIB([zfs], [libzfs_init],
1170 [],
1171 [libzfs_excuse="need zfs library"])
1172fi
1173
1174if test x"$libzfs_excuse" = x ; then
1175 AC_CHECK_LIB([nvpair], [nvlist_print],
1176 [],
1177 [libzfs_excuse="need nvpair library"])
1178fi
1179
1180if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then
1181 AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied])
1182fi
1183
1184if test x"$libzfs_excuse" = x ; then
1185 # We need both libzfs and libnvpair for a successful build.
1186 LIBZFS="-lzfs"
1187 AC_DEFINE([HAVE_LIBZFS], [1],
1188 [Define to 1 if you have the ZFS library.])
1189 LIBNVPAIR="-lnvpair"
1190 AC_DEFINE([HAVE_LIBNVPAIR], [1],
1191 [Define to 1 if you have the NVPAIR library.])
1192fi
1193
1194AC_SUBST([LIBZFS])
16c7cb32
BC
1195AC_SUBST([LIBNVPAIR])
1196
9f915872
VS
1197LIBS=""
1198
76ed06b9 1199AC_SUBST([FONT_SOURCE])
76ed06b9
BC
1200AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
1201 [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
76ed06b9
BC
1202AS_IF([test x$TARGET_APPLE_CC = x1],
1203 [AC_SUBST([USE_APPLE_CC_FIXES], yes)])
7181e228 1204
742f9232
VS
1205AC_SUBST(HAVE_ASM_USCORE)
1206AC_SUBST(ADDR32)
1207AC_SUBST(DATA32)
1208AC_SUBST(BSS_START_SYMBOL)
1209AC_SUBST(END_SYMBOL)
1210AC_SUBST(PACKAGE)
1211AC_SUBST(VERSION)
742f9232
VS
1212AC_SUBST(NEED_REGISTER_FRAME_INFO)
1213
76ed06b9
BC
1214#
1215# Automake conditionals
1216#
8c411768 1217
76ed06b9
BC
1218AM_CONDITIONAL([COND_emu], [test x$platform = xemu])
1219AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc])
1220AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi])
6585de4c 1221AM_CONDITIONAL([COND_ia64_efi], [test x$target_cpu = xia64 -a x$platform = xefi])
76ed06b9
BC
1222AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu])
1223AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275])
1224AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
1225AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
1226AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
4959e111
VS
1227AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
1228AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
7f63a64f 1229AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc])
76ed06b9
BC
1230AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
1231AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
4959e111 1232AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
37ba07eb
VS
1233AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
1234AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
389b31cd
LL
1235AM_CONDITIONAL([COND_arm], [test x$target_cpu = xarm ])
1236AM_CONDITIONAL([COND_arm_uboot], [test x$target_cpu = xarm -a x$platform = xuboot])
1237AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi])
f7711f5e
BC
1238
1239AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
1240AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
1241AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
1242AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
1243AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
b105df76 1244AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu])
958ee221 1245AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos])
2d465fb0 1246
76ed06b9
BC
1247AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
1248AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
1249AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
1250AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
1251AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
7c9d0c39 1252AM_CONDITIONAL([COND_BUILD_GRUB_MKFONT], [test x$enable_build_grub_mkfont = xyes])
897e6207 1253AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes])
76ed06b9 1254AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
76ed06b9 1255AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x])
771111e5 1256AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1])
76ed06b9 1257AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
c5dc1690 1258AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1])
e744219b 1259AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1])
fc45fb58 1260
1eed0e6e
VS
1261AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes])
1262
742f9232 1263AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
f1632d4d 1264AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin])
c5884973 1265AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x])
742f9232 1266
6a161fa9 1267# Output files.
4959e111
VS
1268cpudir="${target_cpu}"
1269if test x${cpudir} = xmipsel; then
1270 cpudir=mips;
1271fi
1f4147aa 1272grub_CHECK_LINK_DIR
1273if test x"$link_dir" = xyes ; then
4959e111 1274 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir])
f84b481b 1275 if test "$platform" != emu ; then
4959e111 1276 AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform])
f84b481b 1277 fi
1f4147aa 1278else
1279 mkdir -p include/grub 2>/dev/null
1280 rm -rf include/grub/cpu
4959e111 1281 cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null
f84b481b
RM
1282 if test "$platform" != emu ; then
1283 rm -rf include/grub/machine
4959e111 1284 cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null
f84b481b 1285 fi
1f4147aa 1286fi
6304d292 1287
8c411768 1288AC_CONFIG_FILES([Makefile])
6304d292 1289AC_CONFIG_FILES([grub-core/Makefile])
15c69261 1290AC_CONFIG_FILES([grub-core/gnulib/Makefile])
269004c1 1291AC_CONFIG_FILES([po/Makefile.in])
8c411768 1292AC_CONFIG_FILES([docs/Makefile])
b23ffd70 1293AC_CONFIG_FILES([util/bash-completion.d/Makefile])
6a161fa9 1294AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
742f9232 1295AC_CONFIG_FILES([config.h])
8c411768 1296
6a161fa9 1297AC_OUTPUT
5ce5507f 1298[
1299echo "*******************************************************"
1300echo GRUB2 will be compiled with following components:
1301echo Platform: "$target_cpu"-"$platform"
f84b481b 1302if [ x"$platform" = xemu ]; then
5ce5507f 1303if [ x"$grub_emu_usb_excuse" = x ]; then
1304echo USB support for grub-emu: Yes
1305else
1306echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
1307fi
927d0134
VS
1308if [ x"$grub_emu_sdl_excuse" = x ]; then
1309echo SDL support for grub-emu: Yes
1310else
1311echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)"
1312fi
325c8258 1313if [ x"$grub_emu_pci_excuse" = x ]; then
1314echo PCI support for grub-emu: Yes
1315else
1316echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
1317fi
f84b481b 1318fi
61d720e5
VS
1319if test x"$device_mapper_excuse" = x ; then
1320echo With devmapper support: Yes
1321else
1322echo With devmapper support: No "($device_mapper_excuse)"
1323fi
5ce5507f 1324if [ x"$enable_mm_debug" = xyes ]; then
1325echo With memory debugging: Yes
1326else
1327echo With memory debugging: No
1328fi
c5dc1690
SJ
1329if [ x"$enable_cache_stats" = xyes ]; then
1330echo With disk cache statistics: Yes
1331else
1332echo With disk cache statistics: No
1333fi
e744219b
VS
1334
1335if [ x"$enable_boot_time" = xyes ]; then
1336echo With boot time statistics: Yes
1337else
1338echo With boot time statistics: No
1339fi
1340
5ce5507f 1341if [ x"$efiemu_excuse" = x ]; then
1342echo efiemu runtime: Yes
1343else
1344echo efiemu runtime: No "($efiemu_excuse)"
1345fi
5ce5507f 1346if [ x"$grub_mkfont_excuse" = x ]; then
1347echo grub-mkfont: Yes
1348else
1349echo grub-mkfont: No "($grub_mkfont_excuse)"
1350fi
897e6207 1351if [ x"$grub_mount_excuse" = x ]; then
89644ef1 1352echo grub-mount: Yes
92bb0786 1353else
897e6207 1354echo grub-mount: No "($grub_mount_excuse)"
92bb0786 1355fi
c5884973
DO
1356if [ x"$starfield_excuse" = x ]; then
1357echo starfield theme: Yes
1358else
1359echo starfield theme: No "($starfield_excuse)"
1360fi
e4c498a1
MG
1361if [ x"$libzfs_excuse" = x ]; then
1362echo With libzfs support: Yes
1363else
1364echo With libzfs support: No "($libzfs_excuse)"
1365fi
7c9d0c39
VS
1366if [ x"$build_grub_mkfont_excuse" = x ]; then
1367 echo Build-time grub-mkfont: Yes
1368 if test "x$FONT_SOURCE" = x ; then
1369 echo "Without unifont"
1370 else
1371 echo "With unifont from $FONT_SOURCE"
1372 fi
4b80e43c 1373else
7c9d0c39
VS
1374 echo Build-time grub-mkfont: No "($build_grub_mkfont_excuse)"
1375 echo "Without unifont (no build-time grub-mkfont)"
4b80e43c 1376fi
64fce2d8
VS
1377if test "x$LIBLZMA" = x ; then
1378echo "Without liblzma (no support for XZ-compressed mips images)"
1379else
1380echo "With liblzma from $LIBLZMA (support for XZ-compressed mips images)"
1381fi
5ce5507f 1382echo "*******************************************************"
1383]