]> git.proxmox.com Git - grub2.git/blame - configure.ac
Change to v1 xen grants.
[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
ee7fb780 44save_program_prefix="${program_prefix}"
b977bf01 45AC_CANONICAL_TARGET
ee7fb780 46program_prefix="${save_program_prefix}"
6a161fa9 47
6fe506b0 48AM_INIT_AUTOMAKE([1.10.1])
8c411768 49AC_PREREQ(2.60)
6304d292 50AC_CONFIG_SRCDIR([include/grub/dl.h])
742f9232 51AC_CONFIG_HEADER([config-util.h])
e52db1f7 52
1d543c3e 53# Program name transformations
54AC_ARG_PROGRAM
fd49ceb3
CW
55grub_TRANSFORM([grub-bios-setup])
56grub_TRANSFORM([grub-editenv])
57grub_TRANSFORM([grub-install])
58grub_TRANSFORM([grub-mkconfig])
59grub_TRANSFORM([grub-mkfont])
60grub_TRANSFORM([grub-mkimage])
67ab8353 61grub_TRANSFORM([grub-glue-efi])
fd49ceb3
CW
62grub_TRANSFORM([grub-mklayout])
63grub_TRANSFORM([grub-mkpasswd-pbkdf2])
64grub_TRANSFORM([grub-mkrelpath])
65grub_TRANSFORM([grub-mkrescue])
66grub_TRANSFORM([grub-probe])
67grub_TRANSFORM([grub-reboot])
68grub_TRANSFORM([grub-script-check])
69grub_TRANSFORM([grub-set-default])
fd49ceb3 70grub_TRANSFORM([grub-sparc64-setup])
a79b8a15 71grub_TRANSFORM([grub-render-label])
1d543c3e 72
90d1e879
RM
73# Optimization flag. Allow user to override.
74if test "x$TARGET_CFLAGS" = x; then
75 TARGET_CFLAGS="$TARGET_CFLAGS -Os"
76fi
77
76ed06b9
BC
78# Default HOST_CPPFLAGS
79HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
76ed06b9 80HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
76ed06b9 81HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1"
76ed06b9
BC
82
83TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W"
84TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include"
85TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include"
86
b977bf01 87case "$target_cpu" in
02164e1b 88 i[[3456]]86) target_cpu=i386 ;;
c7ef54aa 89 amd64) target_cpu=x86_64 ;;
02164e1b 90 sparc) target_cpu=sparc64 ;;
ade85305 91 mipsel|mips64el)
4959e111 92 target_cpu=mipsel;
c721825b 93 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1";
4a1eefb6 94 ;;
ade85305 95 mips|mips64)
76ed06b9 96 target_cpu=mips;
c721825b 97 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1";
4a1eefb6 98 ;;
389b31cd
LL
99 arm*)
100 target_cpu=arm;
101 ;;
15a463d7
LL
102 aarch64*)
103 target_cpu=arm64;
104 ;;
6a161fa9 105esac
106
05568c2e 107# Specify the platform (such as firmware).
108AC_ARG_WITH([platform],
109 AS_HELP_STRING([--with-platform=PLATFORM],
83b984de 110 [select the host platform [[guessed]]]))
05568c2e 111
112# Guess the platform if not specified.
113if test "x$with_platform" = x; then
b977bf01 114 case "$target_cpu"-"$target_vendor" in
05568c2e 115 i386-apple) platform=efi ;;
116 i386-*) platform=pc ;;
58393a2d 117 x86_64-apple) platform=efi ;;
737feb35 118 x86_64-*) platform=pc ;;
05568c2e 119 powerpc-*) platform=ieee1275 ;;
58393a2d 120 powerpc64-*) platform=ieee1275 ;;
05568c2e 121 sparc64-*) platform=ieee1275 ;;
4959e111
VS
122 mipsel-*) platform=loongson ;;
123 mips-*) platform=arc ;;
e68d3b24 124 ia64-*) platform=efi ;;
389b31cd 125 arm-*) platform=uboot ;;
15a463d7 126 arm64-*) platform=efi ;;
58393a2d 127 *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
05568c2e 128 esac
129else
130 platform="$with_platform"
131fi
132
ec1dfd63
VS
133case "$target_cpu"-"$platform" in
134 x86_64-efi) ;;
135 x86_64-emu) ;;
9612ebc0 136 x86_64-xen) ;;
ec1dfd63
VS
137 x86_64-*) target_cpu=i386 ;;
138 powerpc64-ieee1275) target_cpu=powerpc ;;
139esac
20011694 140
58393a2d 141# Check if the platform is supported, make final adjustments.
b977bf01 142case "$target_cpu"-"$platform" in
05568c2e 143 i386-efi) ;;
3f4ce737 144 x86_64-efi) ;;
9612ebc0
VS
145 i386-xen) ;;
146 x86_64-xen) ;;
05568c2e 147 i386-pc) ;;
7210dca9 148 i386-multiboot) ;;
546f966a 149 i386-coreboot) ;;
58393a2d 150 i386-linuxbios) platform=coreboot ;;
3d04eab8 151 i386-ieee1275) ;;
8231fb77 152 i386-qemu) ;;
05568c2e 153 powerpc-ieee1275) ;;
154 sparc64-ieee1275) ;;
2c40cc78 155 ia64-efi) ;;
f440c33f 156 mips-qemu_mips) ;;
3666d5f6 157 mips-qemu-mips) platform=qemu_mips;;
8906c3dd 158 mips-arc) ;;
7f63a64f 159 mipsel-arc) ;;
4959e111
VS
160 mipsel-qemu_mips) ;;
161 mipsel-qemu-mips) platform=qemu_mips;;
162 mipsel-yeeloong) platform=loongson ;;
163 mipsel-fuloong) platform=loongson ;;
164 mipsel-loongson) ;;
389b31cd
LL
165 arm-uboot) ;;
166 arm-efi) ;;
15a463d7 167 arm64-efi) ;;
f84b481b 168 *-emu) ;;
58393a2d 169 *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
6a161fa9 170esac
171
48145ea3 172if test x$platform != xemu ; then
dd614590
VS
173 case "$target_cpu" in
174 i386 | powerpc) target_m32=1 ;;
175 x86_64 | sparc64) target_m64=1 ;;
176 esac
177fi
3f4ce737 178
eaf01c25
VS
179if test x"$target_cpu-$platform" = xsparc64-emu ; then
180 target_m64=1 ;
181fi
182
fc97214f 183case "$target_os" in
c3302aa5 184 windows* | mingw32*) target_os=cygwin ;;
fc97214f
VS
185esac
186
9304eef1 187# This normalizes the names, and creates a new variable ("host_kernel")
188# while at it, since the mapping is not always 1:1 (e.g. different OSes
189# using the same kernel type).
190case "$host_os" in
191 gnu*) host_kernel=hurd ;;
192 linux*) host_kernel=linux ;;
67937d4d 193 freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;;
2c7031b1 194 netbsd*) host_kernel=netbsd ;;
958ee221 195 solaris*) host_kernel=illumos ;;
b105df76 196 darwin*) host_kernel=xnu ;;
7e518ca8 197 cygwin | windows* | mingw32*) host_kernel=windows ;;
9304eef1 198esac
199
cd46aa6c
VS
200case "$host_os" in
201 cygwin | windows* | mingw32*) have_exec=n ;;
202 aros*) have_exec=n ;;
203 *) have_exec=y;;
204esac
205
f84b481b 206case "$platform" in
c721825b
BC
207 coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;;
208 multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;;
209 efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;;
9612ebc0 210 xen) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_XEN=1" ;;
c721825b 211 ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;;
389b31cd 212 uboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_UBOOT=1" ;;
c721825b
BC
213 qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
214 pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
215 emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
54da1feb 216 loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
3666d5f6
VS
217 qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
218 arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
f84b481b 219esac
6bea3f89 220case "$target_cpu" in
389b31cd 221 arm) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARM=1" ;;
15a463d7 222 arm64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARM64=1" ;;
4959e111 223 mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
c721825b 224 sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
6bea3f89 225esac
4959e111
VS
226if test x${target_cpu} = xmipsel ; then
227 machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
228else
3ec0fc1c 229 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 230fi
6bea3f89 231
7f63a64f
VS
232case "${target_cpu}-$platform" in
233 mips-arc)
234 TARGET_LINK_ADDR=0x88200000
235 TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000
236 ;;
237 mipsel-arc)
238 TARGET_LINK_ADDR=0x80700000
239 TARGET_DECOMPRESSOR_LINK_ADDR=0x80600000
240 ;;
5fe67f39 241 mips*-qemu_mips | mips*-loongson)
7f63a64f
VS
242 TARGET_DECOMPRESSOR_LINK_ADDR=0x80100000
243 ;;
244esac
245
246AC_SUBST(TARGET_LINK_ADDR)
247AC_SUBST(TARGET_DECOMPRESSOR_LINK_ADDR)
248
c721825b 249TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
f84b481b 250
56978920 251AC_SUBST(host_cpu)
252AC_SUBST(host_os)
9304eef1 253AC_SUBST(host_kernel)
6e5a42fe 254
071114bb
VS
255AC_SUBST(target_cpu)
256AC_SUBST(platform)
257
d87aedff 258# Define default variables
7134247c
VS
259
260have_with_bootdir=n
261AC_ARG_WITH([bootdir],
262 AS_HELP_STRING([--with-bootdir=DIR],
263 [set the name of /boot directory [[guessed]]]),
264 [have_with_bootdir=y],
265 [have_with_bootdir=n])
266if test x$have_with_bootdir = xy; then
267 bootdirname="$with_bootdir"
268else
269 case "$host_os" in
270 netbsd* | openbsd*)
d87aedff 271 # Because /boot is used for the boot block in NetBSD and OpenBSD,
7134247c
VS
272 bootdirname='' ;;
273 *) bootdirname='boot' ;;
274 esac
275fi
276
d87aedff 277AC_SUBST(bootdirname)
a4c1d277
YB
278AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname",
279 [Default boot directory name]")
d87aedff 280
7134247c
VS
281AC_ARG_WITH([grubdir],
282 AS_HELP_STRING([--with-grubdir=DIR],
283 [set the name of grub directory [[guessed]]]),
284 [grubdirname="$with_grubdir"],
285 [grubdirname="$PACKAGE"])
286
d87aedff 287AC_SUBST(grubdirname)
a4c1d277
YB
288AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
289 [Default grub directory name])
d87aedff 290
b977bf01 291#
292# Checks for build programs.
293#
144f1f98 294
6c826348 295# Although cmp is listed in the GNU Coding Standards as a command which
296# can used directly, OpenBSD lacks cmp in the default installation.
297AC_CHECK_PROGS([CMP], [cmp])
298if test "x$CMP" = x; then
299 AC_MSG_ERROR([cmp is not found])
300fi
301
144f1f98 302AC_CHECK_PROGS([YACC], [bison])
1569ec51 303if test "x$YACC" = x; then
6c826348 304 AC_MSG_ERROR([bison is not found])
1569ec51 305fi
306
76ed06b9 307AC_PROG_RANLIB
b977bf01 308AC_PROG_INSTALL
309AC_PROG_AWK
09220190 310AC_PROG_LEX
76ed06b9 311AC_PROG_YACC
b977bf01 312AC_PROG_MAKE_SET
ff420223 313AC_PROG_MKDIR_P
e1fd1939 314AC_PROG_LN_S
b977bf01 315
c7c75cf4 316if test "x$LEX" = "x:"; then
09220190
BC
317 AC_MSG_ERROR([flex is not found])
318else
2663fb5f 319 version=`$LEX --version | $AWK '{ split($NF,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'`
b777c18e 320 if test -n "$version" -a "$version" -ge 20535; then
09220190
BC
321 :
322 else
323 AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above])
324 fi
325fi
326
68807e5f 327# These are not a "must".
51fa856c 328AC_PATH_PROGS(MAKEINFO, makeinfo true)
6a161fa9 329
b977bf01 330#
331# Checks for host programs.
332#
333
334AC_PROG_CC
15c69261 335gl_EARLY
1eed0e6e 336AC_PROG_CXX
76ed06b9
BC
337AM_PROG_CC_C_O
338AM_PROG_AS
339
6a161fa9 340# Must be GCC.
341test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
342
1eed0e6e
VS
343AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
344
4889bdec 345AC_GNU_SOURCE
2f1a3acf 346AM_GNU_GETTEXT([external])
b977bf01 347AC_SYS_LARGEFILE
348
349# Identify characteristics of the host architecture.
7b780018
VS
350unset ac_cv_c_bigendian
351
eaf01c25
VS
352if test x"$target_cpu-$platform" = xsparc64-emu ; then
353 CFLAGS="$CFLAGS -m64"
354 HOST_CFLAGS="$HOST_CFLAGS -m64"
355fi
356
b977bf01 357AC_C_BIGENDIAN
358AC_CHECK_SIZEOF(void *)
359AC_CHECK_SIZEOF(long)
360
7e518ca8
VS
361case "$host_os" in
362 cygwin | windows* | mingw32*)
363 HOST_CPPFLAGS="$HOST_CPPFLAGS -DUNICODE=1 -D_WIN32_WINNT=0x0500"
364 CPPFLAGS="$CPPFLAGS -DUNICODE=1 -D_WIN32_WINNT=0x0500"
365 AC_CHECK_SIZEOF(TCHAR,,[#include <windows.h>])
366 ;;
367esac
368
aad32b14
VS
369if test x$USE_NLS = xno; then
370 HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext"
371fi
372
86695375 373if test "x$cross_compiling" = xyes; then
374 AC_MSG_WARN([cannot generate manual pages while cross compiling])
375else
376 AC_PATH_PROG(HELP2MAN, help2man)
377fi
378
3169f4c7 379# Check for functions and headers.
0f7e980b 380AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
e4c498a1 381AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
7c4e16ff 382
fb90b546
RM
383AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
384#include <sys/param.h>
385#include <sys/mount.h>])
386
387AC_CHECK_MEMBERS([struct statfs.f_mntfromname],,,[$ac_includes_default
388#include <sys/param.h>
389#include <sys/mount.h>])
390
2c7031b1
GS
391# For opendisk() and getrawpartition() on NetBSD.
392# Used in util/deviceiter.c and in util/hostdisk.c.
393AC_CHECK_HEADER([util.h], [
394 AC_CHECK_LIB([util], [opendisk], [
395 LIBUTIL="-lutil"
396 AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used])
397 ])
398 AC_CHECK_LIB([util], [getrawpartition], [
399 LIBUTIL="-lutil"
400 AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition() in -lutil can be used])
401 ])
402])
403AC_SUBST([LIBUTIL])
404
19ce697d 405AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
00c05e22 406 SAVED_CFLAGS="$CFLAGS"
b35ec299 407 CFLAGS="$HOST_CFLAGS -Wtrampolines -Werror"
00c05e22
VS
408 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
409int va_arg_func (int fixed, va_list args);]], [[]])],
19ce697d
VS
410 [grub_cv_host_cc_wtrampolines=yes],
411 [grub_cv_host_cc_wtrampolines=no])
00c05e22
VS
412 CFLAGS="$SAVED_CFLAGS"
413])
414
19ce697d
VS
415if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then
416 HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines"
00c05e22
VS
417fi
418
76ed06b9
BC
419#
420# Check for host and build compilers.
421#
422HOST_CC=$CC
816719c8
VS
423AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc])
424test -z "$BUILD_CC" && AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])
b224c266 425BUILD_CPP="$BUILD_CC -E"
76ed06b9 426
29013cba
VS
427case "$build_os" in
428 haiku*) BUILD_LIBM= ;;
429 *) BUILD_LIBM=-lm ;;
430esac
15c69261
YB
431# For gnulib.
432gl_INIT
433
382b500e
VS
434WARN_FLAGS="-Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes"
435EXTRA_WARN_FLAGS="-Wold-style-definition -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign"
60d5e9cb
VS
436
437HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS -Wcast-align"
438
439AC_CACHE_CHECK([which extra warnings work], [grub_cv_cc_w_extra_flags], [
440 SAVED_CFLAGS="$CFLAGS"
441 grub_cv_cc_w_extra_flags=
442 for x in $EXTRA_WARN_FLAGS; do
443 CFLAGS="$HOST_CFLAGS $x -Werror"
444 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0])
445 if test x$flag = x1 ; then
446 grub_cv_cc_w_extra_flags="$grub_cv_cc_w_extra_flags $x"
447 fi
448 done
449 CFLAGS="$SAVED_CFLAGS"
450])
451
452HOST_CFLAGS="$HOST_CFLAGS $grub_cv_cc_w_extra_flags"
453
b977bf01 454#
455# Check for target programs.
456#
457
5b5d4aa5 458# Find tools for the target.
459if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
b977bf01 460 tmp_ac_tool_prefix="$ac_tool_prefix"
461 ac_tool_prefix=$target_alias-
462
463 AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
464 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
fc97214f
VS
465 AC_CHECK_TOOL(TARGET_OBJCOPY, objcopy)
466 AC_CHECK_TOOL(TARGET_STRIP, strip)
467 AC_CHECK_TOOL(TARGET_NM, nm)
0e8daad0 468 AC_CHECK_TOOL(TARGET_RANLIB, ranlib)
b977bf01 469
470 ac_tool_prefix="$tmp_ac_tool_prefix"
471else
472 if test "x$TARGET_CC" = x; then
473 TARGET_CC=$CC
474 fi
fc97214f
VS
475 AC_CHECK_TOOL(TARGET_OBJCOPY, objcopy)
476 AC_CHECK_TOOL(TARGET_STRIP, strip)
477 AC_CHECK_TOOL(TARGET_NM, nm)
0e8daad0 478 AC_CHECK_TOOL(TARGET_RANLIB, ranlib)
b977bf01 479fi
fc97214f 480
76ed06b9
BC
481AC_SUBST(HOST_CC)
482AC_SUBST(BUILD_CC)
7c9d0c39
VS
483AC_SUBST(BUILD_CFLAGS)
484AC_SUBST(BUILD_CPPFLAGS)
b977bf01 485AC_SUBST(TARGET_CC)
fc97214f 486AC_SUBST(TARGET_NM)
1bd73025 487AC_SUBST(TARGET_RANLIB)
fc97214f
VS
488AC_SUBST(TARGET_STRIP)
489AC_SUBST(TARGET_OBJCOPY)
b977bf01 490
b977bf01 491# Test the C compiler for the target environment.
492tmp_CC="$CC"
493tmp_CFLAGS="$CFLAGS"
494tmp_LDFLAGS="$LDFLAGS"
495tmp_CPPFLAGS="$CPPFLAGS"
aa6d7826 496tmp_LIBS="$LIBS"
b977bf01 497CC="$TARGET_CC"
498CFLAGS="$TARGET_CFLAGS"
499CPPFLAGS="$TARGET_CPPFLAGS"
500LDFLAGS="$TARGET_LDFLAGS"
aa6d7826 501LIBS=""
b977bf01 502
90d1e879 503# debug flags.
4e27343f 504TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
76ed06b9 505TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
6a161fa9 506
c12936c5
VS
507if test "x$target_cpu" != xi386 && test "x$target_cpu" != xx86_64; then
508TARGET_CFLAGS="$TARGET_CFLAGS -Wcast-align"
509fi
510
60d5e9cb
VS
511AC_CACHE_CHECK([which extra warnings work], [grub_cv_target_cc_w_extra_flags], [
512 LDFLAGS="$TARGET_LDFLAGS -nostdlib -static"
513
514 grub_cv_target_cc_w_extra_flags=
515 for x in $EXTRA_WARN_FLAGS; do
516 CFLAGS="$TARGET_CFLAGS $x -Werror"
37378f74
VS
517 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
518asm (".globl start; start:");
519void __main (void);
520void __main (void) {}
521int main (void);
522]], [[]])], [flag=1], [flag=0])
60d5e9cb
VS
523 if test x$flag = x1 ; then
524 grub_cv_target_cc_w_extra_flags="$grub_cv_target_cc_w_extra_flags $x"
525 fi
526 done
527])
528
529TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_w_extra_flags"
530
60375a88 531AC_CACHE_CHECK([if compiling with clang], [grub_cv_cc_target_clang]
b73b70eb
VS
532[
533CFLAGS="$TARGET_CFLAGS"
534AC_COMPILE_IFELSE(
60375a88
VS
535[AC_LANG_PROGRAM([], [[
536#ifdef __clang__
537#error "is clang"
538#endif
539]])],
540[grub_cv_cc_target_clang=no], [grub_cv_cc_target_clang=yes])])
541
2312f06c
VS
542# on x86 clang doesn't support .code16
543# on arm clang doesn't support .arch directive
63a45330
VS
544# on mips clang doesn't support privilegied instructions, doubleword store/load
545# and crashes with hand-written assembly
546if test "x$grub_cv_cc_target_clang" = xyes && ( test "x$target_cpu" = xi386 \
547 || test "x$target_cpu" = xx86_64 || test "x$target_cpu" = xarm \
548 || test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ); then
60375a88
VS
549 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
550fi
551
b73b70eb
VS
552if test "x$grub_cv_cc_target_clang" = xyes && test "x$target_cpu" = xpowerpc; then
553AC_CACHE_CHECK([if clang can handle ame instruction], [grub_cv_cc_target_clang_ame]
554[
555CFLAGS="$TARGET_CFLAGS"
556AC_COMPILE_IFELSE(
557[AC_LANG_PROGRAM([], [[
558 unsigned int a = 0, b = 0;
559 asm volatile ("{ame|addme} %0,%1" : "=r" (a) : "r" (b));
560 if (a)
561 return 1;
562]])],
563[grub_cv_cc_target_clang_ame=yes], [grub_cv_cc_target_clang_ame=no])])
564 # clang <= 3.3 doesn't handle most of ppc assembly, not even inline assembly
565 # used by gcrypt
566 if test x$grub_cv_cc_target_clang_ame = xno ; then
567 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
896f483d 568 TARGET_CFLAGS="$TARGET_CFLAGS -no-integrated-as"
b73b70eb
VS
569 fi
570fi
571
60375a88
VS
572if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then
573 TARGET_CFLAGS="$TARGET_CFLAGS -march=i386"
574fi
575
576if test "x$target_m32" = x1; then
577 # Force 32-bit mode.
578 TARGET_CFLAGS="$TARGET_CFLAGS -m32"
579 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
580 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
581 TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
582 TARGET_MODULE_FORMAT="elf32"
583fi
584
585if test "x$target_m64" = x1; then
586 # Force 64-bit mode.
587 TARGET_CFLAGS="$TARGET_CFLAGS -m64"
588 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
589 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64"
590 TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
591 TARGET_MODULE_FORMAT="elf64"
592fi
593
594if test "x$grub_cv_cc_target_clang" = xno && test "x$target_cpu" = xi386 && test "x$platform" != xemu && test "x$platform" != xefi; then
595 TARGET_CFLAGS="$TARGET_CFLAGS -mrtd -mregparm=3"
596fi
597
f93ddcfd
VS
598# on mips redirect cache flushing function to non-existant one.
599if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
600 AC_CACHE_CHECK([whether -mflush-func=grub_red_herring works], [grub_cv_cc_mflush_func], [
601 CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring -Werror"
602 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
603 [grub_cv_cc_mflush_func=yes],
604 [grub_cv_cc_mflush_func=no])
605 ])
606
607 if test "x$grub_cv_cc_mflush_func" = xyes; then
608 TARGET_CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring"
609 fi
610fi
611
612
90d1e879
RM
613# Force no alignment to save space on i386.
614if test "x$target_cpu" = xi386; then
615 AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
b35ec299 616 CFLAGS="$TARGET_CFLAGS -falign-loops=1 -Werror"
eb73121d 617 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
90d1e879
RM
618 [grub_cv_cc_falign_loop=yes],
619 [grub_cv_cc_falign_loop=no])
6a161fa9 620 ])
6a161fa9 621
c966a489 622 AC_CACHE_CHECK([whether -malign-loops works], [grub_cv_cc_malign_loop], [
b35ec299 623 CFLAGS="$TARGET_CFLAGS -malign-loops=1 -Werror"
c966a489
VS
624 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
625 [grub_cv_cc_malign_loop=yes],
626 [grub_cv_cc_malign_loop=no])
627 ])
628
90d1e879
RM
629 if test "x$grub_cv_cc_falign_loop" = xyes; then
630 TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
c966a489 631 elif test "x$grub_cv_cc_malign_loop" = xyes; then
90d1e879 632 TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
6a161fa9 633 fi
89e0240c 634fi
6a161fa9 635
cdc17f60
VS
636AC_CACHE_CHECK([whether -freg-struct-return works], [grub_cv_cc_freg_struct_return], [
637 CFLAGS="$TARGET_CFLAGS -freg-struct-return -Werror"
638 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
639 [grub_cv_cc_freg_struct_return=yes],
640 [grub_cv_cc_freg_struct_return=no])
641])
642
643if test "x$grub_cv_cc_freg_struct_return" = xyes; then
644 TARGET_CFLAGS="$TARGET_CFLAGS -freg-struct-return"
645fi
646
ee0220bc 647if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then
90d1e879
RM
648 # Some toolchains enable these features by default, but they need
649 # registers that aren't set up properly in GRUB.
650 TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
651fi
77c55a87 652
90d1e879
RM
653# By default, GCC 4.4 generates .eh_frame sections containing unwind
654# information in some cases where it previously did not. GRUB doesn't need
655# these and they just use up vital space. Restore the old compiler
656# behaviour.
657AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
24f4e57c 658 CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
90d1e879
RM
659 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
660 [grub_cv_cc_fno_dwarf2_cfi_asm=yes],
661 [grub_cv_cc_fno_dwarf2_cfi_asm=no])
90d1e879 662])
77c55a87 663
90d1e879
RM
664if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
665 TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
b977bf01 666fi
6a161fa9 667
1c1f31e5
VS
668if test x"$target_os" = xcygwin; then
669 AC_CACHE_CHECK([whether option -fno-reorder-functions works], grub_cv_cc_no_reorder_functions, [
24f4e57c 670 CFLAGS="$TARGET_CFLAGS -fno-reorder-functions"
1c1f31e5
VS
671 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
672 [grub_cv_cc_no_reorder_functions=yes],
673 [grub_cv_cc_no_reorder_functions=no])
674 ])
675fi
676
677if test x"$target_os" = xcygwin && test "x$grub_cv_cc_no_reorder_functions" = xyes; then
678 TARGET_CFLAGS="$TARGET_CFLAGS -fno-reorder-functions"
679fi
680
e9d3421c
VS
681# By default, GCC 4.6 generates .eh_frame sections containing unwind
682# information in some cases where it previously did not. GRUB doesn't need
683# these and they just use up vital space. Restore the old compiler
684# behaviour.
685AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [
24f4e57c 686 CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
e9d3421c
VS
687 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
688 [grub_cv_cc_fno_asynchronous_unwind_tables=yes],
689 [grub_cv_cc_fno_asynchronous_unwind_tables=no])
e9d3421c
VS
690])
691
692if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then
693 TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables"
694fi
695
30c7d3ce
VS
696AC_ARG_ENABLE([efiemu],
697 [AS_HELP_STRING([--enable-efiemu],
698 [build and install the efiemu runtimes (default=guessed)])])
699if test x"$enable_efiemu" = xno ; then
700 efiemu_excuse="explicitly disabled"
701fi
6f1f6a0c 702if test x"$grub_cv_target_cc_link_format" = x-mi386pe || test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then
1c1f31e5
VS
703 efiemu_excuse="not available on cygwin"
704fi
30c7d3ce
VS
705if test x"$target_cpu" != xi386 ; then
706 efiemu_excuse="only available on i386"
707fi
708if test x"$platform" = xefi ; then
709 efiemu_excuse="not available on efi"
710fi
711if test x"$efiemu_excuse" = x ; then
712 AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
3c2304d5 713 CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone"
30c7d3ce
VS
714 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
715 [grub_cv_cc_efiemu=yes],
716 [grub_cv_cc_efiemu=no])
717 ])
718 if test x$grub_cv_cc_efiemu = xno; then
719 efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
720 fi
721fi
c2b70d09
AB
722if test x"$efiemu_excuse" = x ; then
723 AC_CACHE_CHECK([for efiemu64 linking format], [grub_cv_target_cc_efiemu64_link_format], [
724 grub_cv_target_cc_efiemu64_link_format=unknown
725 for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd -melf_x86_64_haiku -arch,x86_64; do
726 CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone"
727 LDFLAGS="-m64 -Wl,$format -nostdlib -static"
728 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
729 asm (".globl start; start:");
730 asm (".globl _start; _start:");
731 asm (".globl __start; __start:");
732 void __main (void);
733 void __main (void) {}
734 ]], [[]])], [flag=1], [flag=0])
735 if test x"$flag" = x1; then
736 grub_cv_target_cc_efiemu64_link_format="$format"
737 break;
738 fi
739 done])
740 if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then
741 efiemu_excuse="no suitable link format for efiemu64 found"
742 else
743 EFIEMU64_LINK_FORMAT="-Wl,$grub_cv_target_cc_efiemu64_link_format"
744 fi
745fi
30c7d3ce
VS
746if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
747 AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
748fi
749if test x"$efiemu_excuse" = x ; then
750enable_efiemu=yes
751else
752enable_efiemu=no
753fi
754AC_SUBST([enable_efiemu])
c2b70d09 755AC_SUBST([EFIEMU64_LINK_FORMAT])
30c7d3ce 756
a9f25a08
VS
757CFLAGS="$TARGET_CFLAGS"
758
759if test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then
c2b70d09 760 AC_CACHE_CHECK([for target linking format], [grub_cv_target_cc_link_format], [
a9f25a08 761 grub_cv_target_cc_link_format=unknown
6f1f6a0c
VS
762 for format in -melf_${target_cpu} -melf_${target_cpu}_fbsd -melf_${target_cpu}_obsd -melf_${target_cpu}_haiku -mi386pe -mi386pep -arch,${target_cpu}; do
763 if test x${target_cpu} != xi386 && test x$format = xi386pe; then
764 continue
765 fi
766 if test x${target_cpu} != xx86_64 && test x$format = xi386pep; then
a9f25a08
VS
767 continue
768 fi
246a434f
VS
769 CFLAGS="$TARGET_CFLAGS"
770 LDFLAGS="$TARGET_LDFLAGS -Wl,$format -nostdlib -static"
a9f25a08
VS
771 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
772 asm (".globl start; start:");
773 asm (".globl _start; _start:");
774 asm (".globl __start; __start:");
775 void __main (void);
776 void __main (void) {}
c2b70d09 777 ]], [[]])], [flag=1], [flag=0])
a9f25a08
VS
778 if test x"$flag" = x1; then
779 grub_cv_target_cc_link_format="$format"
780 break;
781 fi
782 done])
783 if test x"$grub_cv_target_cc_link_format" = xunknown; then
784 AC_MSG_ERROR([no suitable link format found])
785 fi
786 TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format"
6f1f6a0c 787 if test x"$grub_cv_target_cc_link_format" = x-mi386pe ; then
a9f25a08
VS
788 TARGET_OBJ2ELF='./build-grub-pe2elf';
789 fi
6f1f6a0c
VS
790 if test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then
791 TARGET_OBJ2ELF='./build-grub-pep2elf';
792 fi
a9f25a08
VS
793fi
794
795if test x$grub_cv_target_cc_link_format = x-arch,i386 || test x$grub_cv_target_cc_link_format = x-arch,x86_64; then
796 TARGET_APPLE_LINKER=1
797 AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [objconv], [])
798 if test "x$TARGET_OBJCONV" = x ; then
799 AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [./objconv], [], [.])
800 fi
801 if test "x$TARGET_OBJCONV" = x ; then
802 AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
803 fi
804 TARGET_IMG_LDSCRIPT=
805 TARGET_IMG_CFLAGS="-static"
806 TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
807 TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
808 TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
809 TARGET_LDFLAGS_OLDMAGIC=""
6f1f6a0c 810elif test x$grub_cv_target_cc_link_format = x-mi386pe || test x$grub_cv_target_cc_link_format = x-mi386pep ; then
a9f25a08
VS
811 TARGET_APPLE_LINKER=0
812 TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
60b967be 813 TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/i386-cygwin-img-ld.sc"
a9f25a08 814 TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
60b967be 815 TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/i386-cygwin-img-ld.sc"
a9f25a08
VS
816 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
817 TARGET_IMG_CFLAGS=
818else
819 TARGET_APPLE_LINKER=0
820 TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
821 TARGET_IMG_LDSCRIPT=
822 TARGET_IMG_LDFLAGS='-Wl,-N'
823 TARGET_IMG_LDFLAGS_AC='-Wl,-N'
824 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
825 TARGET_IMG_CFLAGS=
826fi
827
828AC_SUBST(TARGET_LDFLAGS_OLDMAGIC)
829
830
831LDFLAGS="$TARGET_LDFLAGS"
8f0baaac 832
eaf01c25 833if test "$target_cpu" = x86_64 || test "$target_cpu-$platform" = sparc64-emu ; then
7e9ca17a 834 # Use large model to support 4G memory
6e09b8b7 835 AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
24f4e57c 836 CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large"
6e09b8b7 837 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
838 [grub_cv_cc_mcmodel=yes],
839 [grub_cv_cc_mcmodel=no])
840 ])
a3ba7410 841 if test "x$grub_cv_cc_mcmodel" = xyes; then
c8600122 842 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
eaf01c25
VS
843 elif test "$target_cpu-$platform" = sparc64-emu; then
844 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=medany"
6e09b8b7 845 fi
46546fc5 846fi
7e9ca17a 847
46546fc5 848if test "$target_cpu"-"$platform" = x86_64-efi; then
7e9ca17a 849 # EFI writes to stack below %rsp, we must not use the red zone
850 AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
24f4e57c 851 CFLAGS="$TARGET_CFLAGS -m64 -mno-red-zone"
7e9ca17a 852 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
853 [grub_cv_cc_no_red_zone=yes],
854 [grub_cv_cc_no_red_zone=no])
855 ])
856 if test "x$grub_cv_cc_no_red_zone" = xno; then
857 AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
858 fi
859
c8600122 860 TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
20011694 861fi
862
41822625
VS
863if test "x$target_cpu" = xarm; then
864 AC_CACHE_CHECK([whether option -mlong-calls works], grub_cv_cc_mlong_calls, [
865 CFLAGS="$TARGET_CFLAGS -mlong-calls -Werror"
866 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
867 [grub_cv_cc_mlong_calls=yes],
868 [grub_cv_cc_mlong_calls=no])
869 ])
870 if test "x$grub_cv_cc_mlong_calls" = xyes; then
871 TARGET_CFLAGS="$TARGET_CFLAGS -mlong-calls"
872 fi
873fi
874
baa2a121 875#
876# Compiler features.
877#
878
28668d80
VS
879CFLAGS="$TARGET_CFLAGS"
880
93a81088 881# Position independent executable.
882grub_CHECK_PIE
883[# Need that, because some distributions ship compilers that include
884# `-fPIE' in the default specs.
885if [ x"$pie_possible" = xyes ]; then
886 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
887fi]
888
28668d80
VS
889CFLAGS="$TARGET_CFLAGS"
890
7bd8b0c7
VS
891# Position independent executable.
892grub_CHECK_PIC
9cf12b20
VS
893[# On most platforms we don't want PIC as it only makes relocations harder
894# and code less efficient. On mips we want to have one got table per module
895# and reload $gp in every function.
896# GCC implements it using symbol __gnu_local_gp in non-PIC as well.
897# However with clang we need PIC for this reloading to happen.
898# Since default varies across dictributions use either -fPIC or -fno-PIC
899# explicitly.
900if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel ) && test "x$grub_cv_cc_target_clang" = xyes ; then
901 TARGET_CFLAGS="$TARGET_CFLAGS -fPIC"
902elif [ x"$pic_possible" = xyes ]; then
903 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC"
7bd8b0c7
VS
904fi]
905
28668d80
VS
906CFLAGS="$TARGET_CFLAGS"
907
baa2a121 908# Smashing stack protector.
909grub_CHECK_STACK_PROTECTOR
c3db8364 910# Need that, because some distributions ship compilers that include
baa2a121 911# `-fstack-protector' in the default specs.
c3db8364 912if test "x$ssp_possible" = xyes; then
913 TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
914fi
28668d80
VS
915
916CFLAGS="$TARGET_CFLAGS"
917
2a8a80e4 918grub_CHECK_STACK_ARG_PROBE
919# Cygwin's GCC uses alloca() to probe the stackframe on static
920# stack allocations above some threshold.
921if test x"$sap_possible" = xyes; then
922 TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
923fi
baa2a121 924
28668d80
VS
925CFLAGS="$TARGET_CFLAGS"
926
d74b9a1d 927# -mno-unaligned-access -mstrict-align
bb9f92b9 928if test "$target_cpu" = arm; then
d74b9a1d 929 AC_CACHE_CHECK([for compile options to get strict alignment], [grub_cv_target_cc_strict_align], [
bdb6090d 930 grub_cv_target_cc_strict_align=
d74b9a1d
VS
931 for arg in -mno-unaligned-access "-Xclang -mstrict-align" -mstrict-align; do
932 CFLAGS="$TARGET_CFLAGS $arg -Werror"
933 LDFLAGS="$TARGET_LDFLAGS"
934 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0])
935 if test x"$flag" = x1; then
936 grub_cv_target_cc_strict_align="$arg"
937 break;
938 fi
939 done])
940
d74b9a1d
VS
941 TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_strict_align"
942 if test x"$grub_cv_target_cc_strict_align" = x"-Xclang -mstrict-align"; then
943 TARGET_LDFLAGS="$TARGET_LDFLAGS -Qunused-arguments"
bb9f92b9 944 fi
bdb6090d
VS
945 AC_CACHE_CHECK([if compiler generates unaligned accesses], [grub_cv_cc_target_emits_unaligned],
946 [CFLAGS="$TARGET_CFLAGS"
947 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
948#ifdef __ARM_FEATURE_UNALIGNED
949#error "unaligned"
950#endif
951 ]])],
952 [grub_cv_cc_target_emits_unaligned=no], [grub_cv_cc_target_emits_unaligned=yes])])
953 if test x$grub_cv_cc_target_emits_unaligned = xyes; then
954 AC_MSG_ERROR([compiler generates unaligned accesses])
955 fi
bb9f92b9
LL
956fi
957
aa6d7826 958# Set them to their new values for the tests below.
959CC="$TARGET_CC"
a9f25a08 960if test "x$TARGET_APPLE_LINKER" = x1 ; then
246a434f 961CFLAGS="$TARGET_CFLAGS -nostdlib -static -Wno-error"
26de2bcd 962else
37378f74 963CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
26de2bcd 964fi
aa6d7826 965CPPFLAGS="$TARGET_CPPFLAGS"
d5524ca8
VS
966if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test "x$grub_cv_cc_target_clang" = xyes ; then
967TARGET_LIBGCC=
03f80960 968else
d5524ca8 969TARGET_LIBGCC=-lgcc
03f80960 970fi
69be5b74 971
d5524ca8
VS
972LIBS="$TARGET_LIBGCC"
973
01fcf061 974grub_ASM_USCORE
a9f25a08 975if test "x$TARGET_APPLE_LINKER" = x0 ; then
01fcf061 976if test x$grub_cv_asm_uscore = xyes; then
37378f74 977DEFSYM="-Wl,--defsym,_abort=_main -Wl,--defsym,__main=_main"
01fcf061 978else
37378f74 979DEFSYM="-Wl,--defsym,abort=main -Wl,--defsym,_main=main -Wl,--defsym,__main=main"
01fcf061 980fi
37378f74 981CFLAGS="$TARGET_CFLAGS -nostdlib $DEFSYM"
a9f25a08 982fi
01fcf061 983
69be5b74 984# Check for libgcc symbols
6fcec439 985AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x)
69be5b74 986
a9f25a08 987if test "x$TARGET_APPLE_LINKER" = x1 ; then
246a434f 988CFLAGS="$TARGET_CFLAGS -nostdlib -static"
69be5b74 989else
37378f74 990CFLAGS="$TARGET_CFLAGS -nostdlib"
69be5b74 991fi
42e0cba3 992LIBS=""
aa6d7826 993
6a161fa9 994# Defined in aclocal.m4.
f6130a12 995grub_PROG_TARGET_CC
a9f25a08 996if test "x$TARGET_APPLE_LINKER" != x1 ; then
b977bf01 997grub_PROG_OBJCOPY_ABSOLUTE
2b167a72 998fi
cb71ba20 999grub_PROG_LD_BUILD_ID_NONE
b977bf01 1000if test "x$target_cpu" = xi386; then
a9f25a08 1001 if test "$platform" != emu && test "x$TARGET_APPLE_LINKER" != x1 ; then
2aec1692
CF
1002 if test ! -z "$TARGET_IMG_LDSCRIPT"; then
1003 # Check symbols provided by linker script.
37378f74 1004 CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},0x8000"
2aec1692 1005 fi
2a8a80e4 1006 grub_CHECK_BSS_START_SYMBOL
1007 grub_CHECK_END_SYMBOL
1008 fi
1009 CFLAGS="$TARGET_CFLAGS"
4b13b216 1010 grub_I386_ASM_PREFIX_REQUIREMENT
1011 grub_I386_ASM_ADDR32
6a161fa9 1012fi
1013
20aea949
VS
1014grub_PROG_NM_WORKS
1015grub_PROG_NM_MINUS_P
1016grub_PROG_NM_DEFINED_ONLY
1017AC_SUBST(TARGET_NMFLAGS_MINUS_P)
1018AC_SUBST(TARGET_NMFLAGS_DEFINED_ONLY)
1019
016a671b 1020if test "$platform" != emu; then
8f9a632b
VS
1021AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
1022 SAVED_CPPFLAGS="$CPPFLAGS"
1023 CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
1024 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
ce938140 1025#include <stddef.h>
8f9a632b
VS
1026int va_arg_func (int fixed, va_list args);]], [[]])],
1027 [grub_cv_cc_isystem=yes],
1028 [grub_cv_cc_isystem=no])
1029 CPPFLAGS="$SAVED_CPPFLAGS"
1030])
1031
1032if test x"$grub_cv_cc_isystem" = xyes ; then
1033 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
1034fi
dae79b6b 1035fi
5ce5507f 1036
19ce697d 1037AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [
24f4e57c 1038 CFLAGS="$TARGET_CFLAGS -Wtrampolines -Werror"
779dc15b
VS
1039 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
1040int va_arg_func (int fixed, va_list args);]], [[]])],
19ce697d
VS
1041 [grub_cv_cc_wtrampolines=yes],
1042 [grub_cv_cc_wtrampolines=no])
779dc15b
VS
1043])
1044
19ce697d
VS
1045if test x"$grub_cv_cc_wtrampolines" = xyes ; then
1046 TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines"
779dc15b
VS
1047fi
1048
c9a86192 1049# Restore the flags.
9962ed99 1050CC="$tmp_CC"
1051CFLAGS="$tmp_CFLAGS"
1052CPPFLAGS="$tmp_CPPFLAGS"
c9a86192 1053LDFLAGS="$tmp_LDFLAGS"
aa6d7826 1054LIBS="$tmp_LIBS"
6a161fa9 1055
4fe9862e 1056#
2965c7cc 1057# Check for options.
4fe9862e 1058#
1059
1060# Memory manager debugging.
b39f9d20 1061AC_ARG_ENABLE([mm-debug],
2965c7cc 1062 AS_HELP_STRING([--enable-mm-debug],
90ce5d56 1063 [include memory manager debugging]),
2965c7cc 1064 [AC_DEFINE([MM_DEBUG], [1],
1065 [Define to 1 if you enable memory manager debugging.])])
1066
c5dc1690
SJ
1067AC_ARG_ENABLE([cache-stats],
1068 AS_HELP_STRING([--enable-cache-stats],
055e2b8b 1069 [enable disk cache statistics collection]))
c5dc1690
SJ
1070
1071if test x$enable_cache_stats = xyes; then
1072 DISK_CACHE_STATS=1
1073else
1074 DISK_CACHE_STATS=0
1075fi
1076AC_SUBST([DISK_CACHE_STATS])
1077
e744219b
VS
1078AC_ARG_ENABLE([boot-time],
1079 AS_HELP_STRING([--enable-boot-time],
1080 [enable boot time statistics collection]))
1081
1082if test x$enable_boot_time = xyes; then
1083 BOOT_TIME_STATS=1
1084else
1085 BOOT_TIME_STATS=0
1086fi
1087AC_SUBST([BOOT_TIME_STATS])
1088
d64399b5 1089AC_ARG_ENABLE([grub-emu-usb],
1090 [AS_HELP_STRING([--enable-grub-emu-usb],
5ce5507f 1091 [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
5ce5507f 1092
927d0134
VS
1093AC_ARG_ENABLE([grub-emu-sdl],
1094 [AS_HELP_STRING([--enable-grub-emu-sdl],
1095 [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])])
1096
3affd0ec 1097AC_ARG_ENABLE([grub-emu-pci],
1098 [AS_HELP_STRING([--enable-grub-emu-pci],
1099 [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
1100
f84b481b 1101if test "$platform" = emu; then
f84b481b 1102
62a747cb
VS
1103if test x"$enable_grub_emu_usb" != xyes ; then
1104 grub_emu_usb_excuse="not enabled"
5ce5507f 1105fi
325c8258 1106
0e848909
VS
1107if test x"$enable_grub_emu_pci" = xyes ; then
1108 grub_emu_usb_excuse="conflicts with PCI support"
1109fi
1110
5ce5507f 1111[if [ x"$grub_emu_usb_excuse" = x ]; then
d64399b5 1112 # Check for libusb libraries.]
5ce5507f 1113AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
e98cd0c2 1114 [grub_emu_usb_excuse=["need libusb library"]])
d64399b5 1115 AC_SUBST([LIBUSB])
5ce5507f 1116[fi]
1117[if [ x"$grub_emu_usb_excuse" = x ]; then
1118 # Check for headers.]
d64399b5 1119 AC_CHECK_HEADERS([usb.h], [],
e98cd0c2 1120 [grub_emu_usb_excuse=["need libusb headers"]])
4fe9862e 1121[fi]
c6f3b249 1122if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
ce7a733d 1123 AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
5ce5507f 1124fi
1125if test x"$grub_emu_usb_excuse" = x ; then
1126enable_grub_emu_usb=yes
1127else
1128enable_grub_emu_usb=no
1129fi
1130
927d0134
VS
1131if test x"$enable_grub_emu_sdl" = xno ; then
1132 grub_emu_sdl_excuse="explicitely disabled"
1133fi
1134[if [ x"$grub_emu_sdl_excuse" = x ]; then
1135 # Check for libSDL libraries.]
1136AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
1137 [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]])
1138 AC_SUBST([LIBSDL])
1139[fi]
9f293ab0 1140
927d0134
VS
1141[if [ x"$grub_emu_sdl_excuse" = x ]; then
1142 # Check for headers.]
1143 AC_CHECK_HEADERS([SDL/SDL.h], [],
1144 [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]])
1145[fi]
9f293ab0 1146
927d0134
VS
1147if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
1148 AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled])
1149fi
1150if test x"$grub_emu_sdl_excuse" = x ; then
1151enable_grub_emu_sdl=yes
1152else
1153enable_grub_emu_sdl=no
1154fi
1155
3affd0ec 1156if test x"$enable_grub_emu_pci" != xyes ; then
325c8258 1157 grub_emu_pci_excuse="not enabled"
1158fi
1159
1160if test x"$enable_grub_emu_usb" = xyes ; then
1161 grub_emu_pci_excuse="conflicts with USB support"
1162fi
1163
1164[if [ x"$grub_emu_pci_excuse" = x ]; then
1165 # Check for libpci libraries.]
459fed4b 1166 AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"],
1167 [grub_emu_pci_excuse=["need libpciaccess library"]])
1168 AC_SUBST([LIBPCIACCESS])
325c8258 1169[fi]
1170[if [ x"$grub_emu_pci_excuse" = x ]; then
1171 # Check for headers.]
1172 AC_CHECK_HEADERS([pci/pci.h], [],
459fed4b 1173 [grub_emu_pci_excuse=["need libpciaccess headers"]])
325c8258 1174[fi]
1175
1176if test x"$grub_emu_pci_excuse" = x ; then
1177enable_grub_emu_pci=yes
1178else
9f293ab0 1179
325c8258 1180enable_grub_emu_pci=no
3affd0ec 1181fi
1182
927d0134 1183AC_SUBST([enable_grub_emu_sdl])
d64399b5 1184AC_SUBST([enable_grub_emu_usb])
3affd0ec 1185AC_SUBST([enable_grub_emu_pci])
e7d09ac4
AB
1186
1187else
1188
1189# Ignore --enable-emu-* if platform is not emu
1190enable_grub_emu_sdl=no
1191enable_grub_emu_usb=no
1192enable_grub_emu_pci=no
f84b481b 1193fi
4fe9862e 1194
e52db1f7 1195AC_ARG_ENABLE([grub-mkfont],
1196 [AS_HELP_STRING([--enable-grub-mkfont],
5ce5507f 1197 [build and install the `grub-mkfont' utility (default=guessed)])])
1198if test x"$enable_grub_mkfont" = xno ; then
ce7a733d 1199 grub_mkfont_excuse="explicitly disabled"
5ce5507f 1200fi
1201
1202if test x"$grub_mkfont_excuse" = x ; then
e52db1f7 1203 # Check for freetype libraries.
a5b55c4b 1204 AC_CHECK_TOOLS([FREETYPE], [freetype-config])
e52db1f7 1205 if test "x$FREETYPE" = x ; then
e98cd0c2 1206 grub_mkfont_excuse=["need freetype2 library"]
e52db1f7 1207 fi
e52db1f7 1208fi
660960d6 1209
7b780018
VS
1210unset ac_cv_header_ft2build_h
1211
660960d6
VS
1212if test x"$grub_mkfont_excuse" = x ; then
1213 # Check for freetype libraries.
a5b55c4b
DM
1214 freetype_cflags=`$FREETYPE --cflags`
1215 freetype_libs=`$FREETYPE --libs`
d1e8a02f 1216 SAVED_CPPFLAGS="$CPPFLAGS"
b75db69a 1217 SAVED_LIBS="$LIBS"
d1e8a02f 1218 CPPFLAGS="$CPPFLAGS $freetype_cflags"
b75db69a 1219 LIBS="$LIBS $freetype_libs"
660960d6
VS
1220 AC_CHECK_HEADERS([ft2build.h], [],
1221 [grub_mkfont_excuse=["need freetype2 headers"]])
b75db69a 1222 AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_mkfont_excuse=["freetype2 library unusable"]])
d1e8a02f 1223 CPPFLAGS="$SAVED_CPPFLAGS"
b75db69a 1224 LIBS="$SAVED_LIBS"
660960d6
VS
1225fi
1226
5ce5507f 1227if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
ce7a733d 1228 AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
5ce5507f 1229fi
1230if test x"$grub_mkfont_excuse" = x ; then
1231enable_grub_mkfont=yes
1232else
1233enable_grub_mkfont=no
1234fi
e52db1f7 1235AC_SUBST([enable_grub_mkfont])
1236AC_SUBST([freetype_cflags])
1237AC_SUBST([freetype_libs])
1238
7c9d0c39 1239SAVED_CC="$CC"
b224c266 1240SAVED_CPP="$CPP"
7c9d0c39
VS
1241SAVED_CFLAGS="$CFLAGS"
1242SAVED_CPPFLAGS="$CPPFLAGS"
1243CC="$BUILD_CC"
b224c266 1244CPP="$BUILD_CPP"
7c9d0c39 1245CFLAGS="$BUILD_CFLAGS"
7b780018
VS
1246CPPFLAGS="$BUILD_CPPFLAGS"
1247
1248unset ac_cv_c_bigendian
1249unset ac_cv_header_ft2build_h
1250
1251AC_COMPUTE_INT([BUILD_SIZEOF_VOID_P], [sizeof (void *)])
1252AC_COMPUTE_INT([BUILD_SIZEOF_LONG], [sizeof (long)])
1253AC_C_BIGENDIAN([BUILD_WORDS_BIGENDIAN=1], [BUILD_WORDS_BIGENDIAN=0], [BUILD_WORDS_BIGENDIAN=err], [BUILD_WORDS_BIGENDIAN=err])
1254
1255if test x$BUILD_WORDS_BIGENDIAN = xerr ; then
1256 AC_MSG_ERROR([couldnt determine build endianness])
1257fi
1258
1259AC_SUBST([BUILD_SIZEOF_LONG])
1260AC_SUBST([BUILD_SIZEOF_VOID_P])
1261AC_SUBST([BUILD_WORDS_BIGENDIAN])
c5884973 1262
7c9d0c39
VS
1263if test x"$grub_build_mkfont_excuse" = x ; then
1264 # Check for freetype libraries.
7b780018 1265 AC_CHECK_PROGS([BUILD_FREETYPE], [freetype-config])
7c9d0c39
VS
1266 if test "x$BUILD_FREETYPE" = x ; then
1267 grub_build_mkfont_excuse=["need freetype2 library"]
1268 fi
1269fi
c5884973 1270
7c9d0c39
VS
1271if test x"$grub_build_mkfont_excuse" = x ; then
1272 # Check for freetype libraries.
1273 build_freetype_cflags=`$BUILD_FREETYPE --cflags`
1274 build_freetype_libs=`$BUILD_FREETYPE --libs`
1275 SAVED_CPPFLAGS_2="$CPPFLAGS"
b75db69a 1276 SAVED_LIBS="$LIBS"
7c9d0c39 1277 CPPFLAGS="$CPPFLAGS $build_freetype_cflags"
b75db69a 1278 LIBS="$LIBS $build_freetype_libs"
7c9d0c39
VS
1279 AC_CHECK_HEADERS([ft2build.h], [],
1280 [grub_build_mkfont_excuse=["need freetype2 headers"]])
b75db69a
VS
1281 AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_build_mkfont_excuse=["freetype2 library unusable"]])
1282 LIBS="$SAVED_LIBS"
7c9d0c39
VS
1283 CPPFLAGS="$SAVED_CPPFLAGS_2"
1284fi
1285
1286if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then
1287 AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled])
1288fi
1289if test x"$grub_build_mkfont_excuse" = x ; then
1290 enable_build_grub_mkfont=yes
1291else
1292 enable_build_grub_mkfont=no
c5884973 1293fi
71669c3b
VS
1294if 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 || test "x$platform" = xxen || test "x$platform" = xcoreboot ); then
1295 AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot, xen and loongson ports needs build-time grub-mkfont])
7c9d0c39
VS
1296fi
1297
1298AC_SUBST([build_freetype_cflags])
1299AC_SUBST([build_freetype_libs])
1300
1301CC="$SAVED_CC"
b224c266 1302CPP="$SAVED_CPP"
7c9d0c39
VS
1303CFLAGS="$SAVED_CFLAGS"
1304CPPFLAGS="$SAVED_CPPFLAGS"
1305
1306
1307DJVU_FONT_SOURCE=
1308
1309starfield_excuse=
c5884973 1310
300f48c5
VS
1311AC_ARG_ENABLE([grub-themes],
1312 [AS_HELP_STRING([--enable-grub-themes],
1313 [build and install GRUB themes (default=guessed)])])
1314if test x"$enable_grub_themes" = xno ; then
1315 starfield_excuse="explicitly disabled"
1316fi
1317
1318if test x"$starfield_excuse" = x && test x"$enable_build_grub_mkfont" = xno ; then
7b966834
VS
1319 starfield_excuse="No build-time grub-mkfont"
1320fi
1321
501b9e4b 1322if test x"$starfield_excuse" = x; then
c5884973 1323 for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
32745f51 1324 for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do
c5884973
DO
1325 if test -f "$dir/DejaVuSans.$ext"; then
1326 DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext"
1327 break 2
1328 fi
1329 done
1330 done
1331
1332 if test "x$DJVU_FONT_SOURCE" = x; then
1333 starfield_excuse="No DejaVu found"
1334 fi
1335fi
1336
300f48c5
VS
1337if test x"$enable_grub_themes" = xyes && test x"$starfield_excuse" != x; then
1338 AC_MSG_ERROR([themes were explicitly requested but requirements are not satisfied])
1339fi
1340
c5884973
DO
1341AC_SUBST([DJVU_FONT_SOURCE])
1342
7c9d0c39
VS
1343FONT_SOURCE=
1344
1345for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
1346 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
1347 if test -f "$dir/unifont.$ext"; then
0277eab7
VS
1348 md5="$(md5sum "$dir/unifont.$ext"|awk '{ print $1; }')"
1349 # PCF and BDF from version 6.3 isn't hanled properly by libfreetype.
1350 if test "$md5" = 0a54834d2788c83886a3e1785a6a1e61 || test "$md5" = 28f2565c7a41d8d407e2551159385edb || test "$md5" = dae5e588461b3b92b87b6ffee734f936 || test "$md5" = 4a3d687aa5bb329ed05f4263a1016791 ; then
1351 continue;
1352 fi
7c9d0c39
VS
1353 FONT_SOURCE="$dir/unifont.$ext"
1354 break 2
1355 fi
1356 done
1357done
1358
7b966834
VS
1359if test x"$enable_build_grub_mkfont" = xno ; then
1360 FONT_SOURCE=
1361fi
1362
71669c3b
VS
1363if 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 || test "x$platform" = xxen || test "x$platform" = xcoreboot ); then
1364 AC_MSG_ERROR([qemu, powerpc-ieee1275, xen, coreboot and loongson ports need unifont])
7c9d0c39
VS
1365fi
1366
1367AC_SUBST([FONT_SOURCE])
1368
7b780018 1369if test x"$FONT_SOURCE" = x && test x"$DJVU_FONT_SOURCE" = x && test x"$grub_build_mkfont_excuse" = x; then
7c9d0c39
VS
1370 grub_build_mkfont_excuse="no fonts"
1371fi
1372
1373
897e6207
CW
1374AC_ARG_ENABLE([grub-mount],
1375 [AS_HELP_STRING([--enable-grub-mount],
1376 [build and install the `grub-mount' utility (default=guessed)])])
1377if test x"$enable_grub_mount" = xno ; then
1378 grub_mount_excuse="explicitly disabled"
92bb0786
VS
1379fi
1380
897e6207 1381if test x"$grub_mount_excuse" = x ; then
92bb0786 1382 AC_CHECK_LIB([fuse], [fuse_main_real], [],
897e6207 1383 [grub_mount_excuse="need FUSE library"])
92bb0786
VS
1384fi
1385
897e6207 1386if test x"$grub_mount_excuse" = x ; then
92bb0786
VS
1387 # Check for fuse headers.
1388 SAVED_CPPFLAGS="$CPPFLAGS"
338c7fab 1389 CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26"
92bb0786 1390 AC_CHECK_HEADERS([fuse/fuse.h], [],
897e6207 1391 [grub_mount_excuse=["need FUSE headers"]])
92bb0786
VS
1392 CPPFLAGS="$SAVED_CPPFLAGS"
1393fi
1394
897e6207 1395if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then
89644ef1 1396 AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled])
92bb0786 1397fi
897e6207
CW
1398if test x"$grub_mount_excuse" = x ; then
1399enable_grub_mount=yes
92bb0786 1400else
897e6207 1401enable_grub_mount=no
92bb0786 1402fi
897e6207 1403AC_SUBST([enable_grub_mount])
92bb0786 1404
7181e228
CW
1405AC_ARG_ENABLE([device-mapper],
1406 [AS_HELP_STRING([--enable-device-mapper],
1407 [enable Linux device-mapper support (default=guessed)])])
1408if test x"$enable_device_mapper" = xno ; then
1409 device_mapper_excuse="explicitly disabled"
1410fi
1411
53798c4b
GS
1412if test x"$device_mapper_excuse" = x ; then
1413 # Check for device-mapper header.
1414 AC_CHECK_HEADER([libdevmapper.h], [],
1415 [device_mapper_excuse="need libdevmapper header"])
1416fi
1417
7181e228
CW
1418if test x"$device_mapper_excuse" = x ; then
1419 # Check for device-mapper library.
61d720e5 1420 AC_CHECK_LIB([devmapper], [dm_task_create], [],
7181e228 1421 [device_mapper_excuse="need devmapper library"])
7181e228 1422fi
61d720e5
VS
1423
1424if test x"$device_mapper_excuse" = x ; then
1425 # Check for device-mapper library.
1426 AC_CHECK_LIB([devmapper], [dm_log_with_errno_init],
1427 [],
1428 [device_mapper_excuse="need devmapper library"])
1429fi
1430
1431if test x"$device_mapper_excuse" = x ; then
1432 LIBDEVMAPPER="-ldevmapper";
1433 AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
1434 [Define to 1 if you have the devmapper library.])
1435fi
1436
62f7d208 1437AC_SUBST([LIBDEVMAPPER])
76ed06b9 1438
f4727da9
VS
1439LIBGEOM=
1440if test x$host_kernel = xkfreebsd; then
1441 AC_CHECK_LIB([geom], [geom_gettree], [],
1442 [AC_MSG_ERROR([Your platform requires libgeom])])
1443 LIBGEOM="-lgeom"
1444fi
1445
1446AC_SUBST([LIBGEOM])
1447
0d2d30bb
VS
1448AC_ARG_ENABLE([liblzma],
1449 [AS_HELP_STRING([--enable-liblzma],
1450 [enable liblzma integration (default=guessed)])])
1451if test x"$enable_liblzma" = xno ; then
1452 liblzma_excuse="explicitly disabled"
1453fi
1454
1455if test x"$liblzma_excuse" = x ; then
2c44e493 1456AC_CHECK_LIB([lzma], [lzma_code],
0d2d30bb
VS
1457 [],[liblzma_excuse="need lzma library"])
1458fi
1459if test x"$liblzma_excuse" = x ; then
1460AC_CHECK_HEADER([lzma.h], [], [liblzma_excuse="need lzma header"])
1461fi
1462
1463if test x"$enable_liblzma" = xyes && test x"$liblzma_excuse" != x ; then
1464 AC_MSG_ERROR([liblzma support was explicitly requested but requirements are not satisfied])
1465fi
1466
1467
1468if test x"$liblzma_excuse" = x ; then
1469 LIBLZMA="-llzma"
1470 AC_DEFINE([USE_LIBLZMA], [1],
1471 [Define to 1 if you have the LZMA library.])
1472fi
1473
2c44e493
VS
1474AC_SUBST([LIBLZMA])
1475
e4c498a1
MG
1476AC_ARG_ENABLE([libzfs],
1477 [AS_HELP_STRING([--enable-libzfs],
1478 [enable libzfs integration (default=guessed)])])
1479if test x"$enable_libzfs" = xno ; then
1480 libzfs_excuse="explicitly disabled"
1481fi
16c7cb32 1482
e4c498a1
MG
1483if test x"$libzfs_excuse" = x ; then
1484 # Only check for system headers if libzfs support has not been disabled.
1485 AC_CHECK_HEADERS(libzfs.h libnvpair.h)
1486fi
1487
1488if test x"$libzfs_excuse" = x ; then
1489 AC_CHECK_LIB([zfs], [libzfs_init],
1490 [],
1491 [libzfs_excuse="need zfs library"])
1492fi
1493
1494if test x"$libzfs_excuse" = x ; then
27f9d02e 1495 AC_CHECK_LIB([nvpair], [nvlist_lookup_string],
e4c498a1
MG
1496 [],
1497 [libzfs_excuse="need nvpair library"])
1498fi
1499
1500if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then
1501 AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied])
1502fi
1503
1504if test x"$libzfs_excuse" = x ; then
1505 # We need both libzfs and libnvpair for a successful build.
1506 LIBZFS="-lzfs"
1507 AC_DEFINE([HAVE_LIBZFS], [1],
1508 [Define to 1 if you have the ZFS library.])
1509 LIBNVPAIR="-lnvpair"
1510 AC_DEFINE([HAVE_LIBNVPAIR], [1],
1511 [Define to 1 if you have the NVPAIR library.])
1512fi
1513
1514AC_SUBST([LIBZFS])
16c7cb32
BC
1515AC_SUBST([LIBNVPAIR])
1516
9f915872
VS
1517LIBS=""
1518
76ed06b9 1519AC_SUBST([FONT_SOURCE])
76ed06b9
BC
1520AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
1521 [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
7181e228 1522
742f9232
VS
1523AC_SUBST(HAVE_ASM_USCORE)
1524AC_SUBST(ADDR32)
1525AC_SUBST(DATA32)
1526AC_SUBST(BSS_START_SYMBOL)
1527AC_SUBST(END_SYMBOL)
1528AC_SUBST(PACKAGE)
1529AC_SUBST(VERSION)
742f9232
VS
1530AC_SUBST(NEED_REGISTER_FRAME_INFO)
1531
d5524ca8
VS
1532AC_ARG_ENABLE([werror],
1533 [AS_HELP_STRING([--disable-werror],
1534 [do not use -Werror when building GRUB])])
1535if test x"$enable_werror" != xno ; then
1536 TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
1537 HOST_CFLAGS="$HOST_CFLAGS -Werror"
1538fi
1539
1540if test "x$grub_cv_cc_target_clang" = xno; then
1541 TARGET_LDFLAGS_STATIC_LIBGCC="-static-libgcc"
1542else
1543 TARGET_LDFLAGS_STATIC_LIBGCC=
1544fi
1545
1546TARGET_CPP="$TARGET_CC -E"
1547TARGET_CCAS=$TARGET_CC
1548
1549GRUB_TARGET_CPU="${target_cpu}"
1550GRUB_PLATFORM="${platform}"
1551
1552AC_SUBST(GRUB_TARGET_CPU)
1553AC_SUBST(GRUB_PLATFORM)
1554
1555AC_SUBST(TARGET_OBJCONV)
1556AC_SUBST(TARGET_LIBGCC)
1557AC_SUBST(TARGET_LDFLAGS_STATIC_LIBGCC)
1558AC_SUBST(TARGET_CPP)
1559AC_SUBST(TARGET_CCAS)
1560AC_SUBST(TARGET_OBJ2ELF)
d5524ca8
VS
1561AC_SUBST(TARGET_MODULE_FORMAT)
1562
1563AC_SUBST(TARGET_CFLAGS)
1564AC_SUBST(TARGET_LDFLAGS)
1565AC_SUBST(TARGET_CPPFLAGS)
1566AC_SUBST(TARGET_CCASFLAGS)
1567
d5524ca8
VS
1568AC_SUBST(TARGET_IMG_LDFLAGS)
1569AC_SUBST(TARGET_IMG_CFLAGS)
1570AC_SUBST(TARGET_IMG_BASE_LDOPT)
a9f25a08 1571AC_SUBST(TARGET_APPLE_LINKER)
d5524ca8
VS
1572
1573AC_SUBST(HOST_CFLAGS)
1574AC_SUBST(HOST_LDFLAGS)
1575AC_SUBST(HOST_CPPFLAGS)
1576AC_SUBST(HOST_CCASFLAGS)
1577
1578AC_SUBST(BUILD_LIBM)
1579
76ed06b9
BC
1580#
1581# Automake conditionals
1582#
8c411768 1583
76ed06b9 1584AM_CONDITIONAL([COND_emu], [test x$platform = xemu])
d59849b2 1585AM_CONDITIONAL([COND_clang], [test x$grub_cv_cc_target_clang = xyes])
76ed06b9
BC
1586AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc])
1587AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi])
6585de4c 1588AM_CONDITIONAL([COND_ia64_efi], [test x$target_cpu = xia64 -a x$platform = xefi])
76ed06b9
BC
1589AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu])
1590AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275])
1591AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
1592AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
1593AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
9612ebc0
VS
1594AM_CONDITIONAL([COND_i386_xen], [test x$target_cpu = xi386 -a x$platform = xxen])
1595AM_CONDITIONAL([COND_x86_64_xen], [test x$target_cpu = xx86_64 -a x$platform = xxen])
4959e111
VS
1596AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
1597AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
7f63a64f 1598AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc])
76ed06b9 1599AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
eaf01c25 1600AM_CONDITIONAL([COND_sparc64_emu], [test x$target_cpu = xsparc64 -a x$platform = xemu])
76ed06b9 1601AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
4959e111 1602AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
37ba07eb
VS
1603AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
1604AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
389b31cd
LL
1605AM_CONDITIONAL([COND_arm], [test x$target_cpu = xarm ])
1606AM_CONDITIONAL([COND_arm_uboot], [test x$target_cpu = xarm -a x$platform = xuboot])
1607AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi])
15a463d7
LL
1608AM_CONDITIONAL([COND_arm64], [test x$target_cpu = xarm64 ])
1609AM_CONDITIONAL([COND_arm64_efi], [test x$target_cpu = xarm64 -a x$platform = xefi])
f7711f5e
BC
1610
1611AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
1612AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
1613AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
1614AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
1615AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
b105df76 1616AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu])
958ee221 1617AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos])
2d465fb0 1618
76ed06b9
BC
1619AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
1620AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
1621AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
1622AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
1623AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
897e6207 1624AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes])
76ed06b9 1625AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
6f07c4e4
VS
1626if test x$FONT_SOURCE != x ; then
1627 HAVE_FONT_SOURCE=1
1628else
1629 HAVE_FONT_SOURCE=0
1630fi
1631AC_SUBST(HAVE_FONT_SOURCE)
a9f25a08 1632AM_CONDITIONAL([COND_APPLE_LINKER], [test x$TARGET_APPLE_LINKER = x1])
76ed06b9 1633AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
c5dc1690 1634AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1])
e744219b 1635AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1])
fc45fb58 1636
1eed0e6e
VS
1637AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes])
1638
742f9232 1639AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
c5884973 1640AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x])
cd46aa6c
VS
1641AM_CONDITIONAL([COND_HAVE_EXEC], [test "x$have_exec" = xy])
1642
1643test "x$prefix" = xNONE && prefix="$ac_default_prefix"
1644test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
1645datarootdir="$(eval echo "$datarootdir")"
1646grub_libdir="$(eval echo "$libdir")"
1647grub_localedir="$(eval echo "$localedir")"
1648grub_datadir="$(eval echo "$datadir")"
1649grub_sysconfdir="$(eval echo "$sysconfdir")"
1650AC_DEFINE_UNQUOTED(LOCALEDIR, "$grub_localedir", [Locale dir])
1651AC_DEFINE_UNQUOTED(GRUB_LIBDIR, "$grub_libdir", [Library dir])
1652AC_DEFINE_UNQUOTED(GRUB_DATADIR, "$grub_datadir", [Data dir])
1653AC_DEFINE_UNQUOTED(GRUB_SYSCONFDIR, "$grub_sysconfdir", [Configuration dir])
1654
742f9232 1655
6a161fa9 1656# Output files.
4959e111
VS
1657cpudir="${target_cpu}"
1658if test x${cpudir} = xmipsel; then
1659 cpudir=mips;
1660fi
1f4147aa 1661grub_CHECK_LINK_DIR
1662if test x"$link_dir" = xyes ; then
4959e111 1663 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir])
f84b481b 1664 if test "$platform" != emu ; then
4959e111 1665 AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform])
f84b481b 1666 fi
1f4147aa 1667else
1668 mkdir -p include/grub 2>/dev/null
1669 rm -rf include/grub/cpu
4959e111 1670 cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null
f84b481b
RM
1671 if test "$platform" != emu ; then
1672 rm -rf include/grub/machine
4959e111 1673 cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null
f84b481b 1674 fi
1f4147aa 1675fi
6304d292 1676
8c411768 1677AC_CONFIG_FILES([Makefile])
6304d292 1678AC_CONFIG_FILES([grub-core/Makefile])
15c69261 1679AC_CONFIG_FILES([grub-core/gnulib/Makefile])
269004c1 1680AC_CONFIG_FILES([po/Makefile.in])
8c411768 1681AC_CONFIG_FILES([docs/Makefile])
b23ffd70 1682AC_CONFIG_FILES([util/bash-completion.d/Makefile])
6a161fa9 1683AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
742f9232 1684AC_CONFIG_FILES([config.h])
8c411768 1685
6a161fa9 1686AC_OUTPUT
5ce5507f 1687[
1688echo "*******************************************************"
1689echo GRUB2 will be compiled with following components:
1690echo Platform: "$target_cpu"-"$platform"
f84b481b 1691if [ x"$platform" = xemu ]; then
5ce5507f 1692if [ x"$grub_emu_usb_excuse" = x ]; then
1693echo USB support for grub-emu: Yes
1694else
1695echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
1696fi
927d0134
VS
1697if [ x"$grub_emu_sdl_excuse" = x ]; then
1698echo SDL support for grub-emu: Yes
1699else
1700echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)"
1701fi
325c8258 1702if [ x"$grub_emu_pci_excuse" = x ]; then
1703echo PCI support for grub-emu: Yes
1704else
1705echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
1706fi
f84b481b 1707fi
61d720e5
VS
1708if test x"$device_mapper_excuse" = x ; then
1709echo With devmapper support: Yes
1710else
1711echo With devmapper support: No "($device_mapper_excuse)"
1712fi
5ce5507f 1713if [ x"$enable_mm_debug" = xyes ]; then
1714echo With memory debugging: Yes
1715else
1716echo With memory debugging: No
1717fi
c5dc1690
SJ
1718if [ x"$enable_cache_stats" = xyes ]; then
1719echo With disk cache statistics: Yes
1720else
1721echo With disk cache statistics: No
1722fi
e744219b
VS
1723
1724if [ x"$enable_boot_time" = xyes ]; then
1725echo With boot time statistics: Yes
1726else
1727echo With boot time statistics: No
1728fi
1729
5ce5507f 1730if [ x"$efiemu_excuse" = x ]; then
1731echo efiemu runtime: Yes
1732else
1733echo efiemu runtime: No "($efiemu_excuse)"
1734fi
5ce5507f 1735if [ x"$grub_mkfont_excuse" = x ]; then
1736echo grub-mkfont: Yes
1737else
1738echo grub-mkfont: No "($grub_mkfont_excuse)"
1739fi
897e6207 1740if [ x"$grub_mount_excuse" = x ]; then
89644ef1 1741echo grub-mount: Yes
92bb0786 1742else
897e6207 1743echo grub-mount: No "($grub_mount_excuse)"
92bb0786 1744fi
c5884973
DO
1745if [ x"$starfield_excuse" = x ]; then
1746echo starfield theme: Yes
1747else
1748echo starfield theme: No "($starfield_excuse)"
1749fi
e4c498a1
MG
1750if [ x"$libzfs_excuse" = x ]; then
1751echo With libzfs support: Yes
1752else
1753echo With libzfs support: No "($libzfs_excuse)"
1754fi
7b780018 1755if [ x"$grub_build_mkfont_excuse" = x ]; then
7c9d0c39
VS
1756 echo Build-time grub-mkfont: Yes
1757 if test "x$FONT_SOURCE" = x ; then
1758 echo "Without unifont"
1759 else
1760 echo "With unifont from $FONT_SOURCE"
1761 fi
4b80e43c 1762else
7b780018 1763 echo Build-time grub-mkfont: No "($grub_build_mkfont_excuse)"
7c9d0c39 1764 echo "Without unifont (no build-time grub-mkfont)"
4b80e43c 1765fi
0d2d30bb
VS
1766if test x"$liblzma_excuse" != x ; then
1767echo "Without liblzma (no support for XZ-compressed mips images) ($liblzma_excuse)"
64fce2d8
VS
1768else
1769echo "With liblzma from $LIBLZMA (support for XZ-compressed mips images)"
1770fi
5ce5507f 1771echo "*******************************************************"
1772]