]> git.proxmox.com Git - grub2.git/blame - configure.ac
* grub-core/commands/minicmd.c (grub_mini_cmd_dump): Handle LLP case.
[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
60b967be 702if test x"$grub_cv_target_cc_link_format" = x-mi386pe ; 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
VS
761 grub_cv_target_cc_link_format=unknown
762 for format in -melf_${target_cpu} -melf_${target_cpu}_fbsd -melf_${target_cpu}_obsd -melf_${target_cpu}_haiku -m${target_cpu}pe -arch,${target_cpu}; do
763 if test x${target_cpu} != xi386 && test x$format = x${target_cpu}pe; then
764 continue
765 fi
246a434f
VS
766 CFLAGS="$TARGET_CFLAGS"
767 LDFLAGS="$TARGET_LDFLAGS -Wl,$format -nostdlib -static"
a9f25a08
VS
768 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
769 asm (".globl start; start:");
770 asm (".globl _start; _start:");
771 asm (".globl __start; __start:");
772 void __main (void);
773 void __main (void) {}
c2b70d09 774 ]], [[]])], [flag=1], [flag=0])
a9f25a08
VS
775 if test x"$flag" = x1; then
776 grub_cv_target_cc_link_format="$format"
777 break;
778 fi
779 done])
780 if test x"$grub_cv_target_cc_link_format" = xunknown; then
781 AC_MSG_ERROR([no suitable link format found])
782 fi
783 TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format"
784 if test x"$grub_cv_target_cc_link_format" = x-mi386pe; then
785 TARGET_OBJ2ELF='./build-grub-pe2elf';
786 fi
787fi
788
789if test x$grub_cv_target_cc_link_format = x-arch,i386 || test x$grub_cv_target_cc_link_format = x-arch,x86_64; then
790 TARGET_APPLE_LINKER=1
791 AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [objconv], [])
792 if test "x$TARGET_OBJCONV" = x ; then
793 AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [./objconv], [], [.])
794 fi
795 if test "x$TARGET_OBJCONV" = x ; then
796 AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
797 fi
798 TARGET_IMG_LDSCRIPT=
799 TARGET_IMG_CFLAGS="-static"
800 TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
801 TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
802 TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
803 TARGET_LDFLAGS_OLDMAGIC=""
60b967be 804elif test x$grub_cv_target_cc_link_format = x-mi386pe; then
a9f25a08
VS
805 TARGET_APPLE_LINKER=0
806 TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
60b967be 807 TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/i386-cygwin-img-ld.sc"
a9f25a08 808 TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
60b967be 809 TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/i386-cygwin-img-ld.sc"
a9f25a08
VS
810 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
811 TARGET_IMG_CFLAGS=
812else
813 TARGET_APPLE_LINKER=0
814 TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
815 TARGET_IMG_LDSCRIPT=
816 TARGET_IMG_LDFLAGS='-Wl,-N'
817 TARGET_IMG_LDFLAGS_AC='-Wl,-N'
818 TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
819 TARGET_IMG_CFLAGS=
820fi
821
822AC_SUBST(TARGET_LDFLAGS_OLDMAGIC)
823
824
825LDFLAGS="$TARGET_LDFLAGS"
8f0baaac 826
eaf01c25 827if test "$target_cpu" = x86_64 || test "$target_cpu-$platform" = sparc64-emu ; then
7e9ca17a 828 # Use large model to support 4G memory
6e09b8b7 829 AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
24f4e57c 830 CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large"
6e09b8b7 831 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
832 [grub_cv_cc_mcmodel=yes],
833 [grub_cv_cc_mcmodel=no])
834 ])
a3ba7410 835 if test "x$grub_cv_cc_mcmodel" = xyes; then
c8600122 836 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
eaf01c25
VS
837 elif test "$target_cpu-$platform" = sparc64-emu; then
838 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=medany"
6e09b8b7 839 fi
46546fc5 840fi
7e9ca17a 841
46546fc5 842if test "$target_cpu"-"$platform" = x86_64-efi; then
7e9ca17a 843 # EFI writes to stack below %rsp, we must not use the red zone
844 AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
24f4e57c 845 CFLAGS="$TARGET_CFLAGS -m64 -mno-red-zone"
7e9ca17a 846 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
847 [grub_cv_cc_no_red_zone=yes],
848 [grub_cv_cc_no_red_zone=no])
849 ])
850 if test "x$grub_cv_cc_no_red_zone" = xno; then
851 AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
852 fi
853
c8600122 854 TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
20011694 855fi
856
41822625
VS
857if test "x$target_cpu" = xarm; then
858 AC_CACHE_CHECK([whether option -mlong-calls works], grub_cv_cc_mlong_calls, [
859 CFLAGS="$TARGET_CFLAGS -mlong-calls -Werror"
860 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
861 [grub_cv_cc_mlong_calls=yes],
862 [grub_cv_cc_mlong_calls=no])
863 ])
864 if test "x$grub_cv_cc_mlong_calls" = xyes; then
865 TARGET_CFLAGS="$TARGET_CFLAGS -mlong-calls"
866 fi
867fi
868
baa2a121 869#
870# Compiler features.
871#
872
28668d80
VS
873CFLAGS="$TARGET_CFLAGS"
874
93a81088 875# Position independent executable.
876grub_CHECK_PIE
877[# Need that, because some distributions ship compilers that include
878# `-fPIE' in the default specs.
879if [ x"$pie_possible" = xyes ]; then
880 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
881fi]
882
28668d80
VS
883CFLAGS="$TARGET_CFLAGS"
884
7bd8b0c7
VS
885# Position independent executable.
886grub_CHECK_PIC
9cf12b20
VS
887[# On most platforms we don't want PIC as it only makes relocations harder
888# and code less efficient. On mips we want to have one got table per module
889# and reload $gp in every function.
890# GCC implements it using symbol __gnu_local_gp in non-PIC as well.
891# However with clang we need PIC for this reloading to happen.
892# Since default varies across dictributions use either -fPIC or -fno-PIC
893# explicitly.
894if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel ) && test "x$grub_cv_cc_target_clang" = xyes ; then
895 TARGET_CFLAGS="$TARGET_CFLAGS -fPIC"
896elif [ x"$pic_possible" = xyes ]; then
897 TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC"
7bd8b0c7
VS
898fi]
899
28668d80
VS
900CFLAGS="$TARGET_CFLAGS"
901
baa2a121 902# Smashing stack protector.
903grub_CHECK_STACK_PROTECTOR
c3db8364 904# Need that, because some distributions ship compilers that include
baa2a121 905# `-fstack-protector' in the default specs.
c3db8364 906if test "x$ssp_possible" = xyes; then
907 TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
908fi
28668d80
VS
909
910CFLAGS="$TARGET_CFLAGS"
911
2a8a80e4 912grub_CHECK_STACK_ARG_PROBE
913# Cygwin's GCC uses alloca() to probe the stackframe on static
914# stack allocations above some threshold.
915if test x"$sap_possible" = xyes; then
916 TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
917fi
baa2a121 918
28668d80
VS
919CFLAGS="$TARGET_CFLAGS"
920
d74b9a1d 921# -mno-unaligned-access -mstrict-align
bb9f92b9 922if test "$target_cpu" = arm; then
d74b9a1d 923 AC_CACHE_CHECK([for compile options to get strict alignment], [grub_cv_target_cc_strict_align], [
bdb6090d 924 grub_cv_target_cc_strict_align=
d74b9a1d
VS
925 for arg in -mno-unaligned-access "-Xclang -mstrict-align" -mstrict-align; do
926 CFLAGS="$TARGET_CFLAGS $arg -Werror"
927 LDFLAGS="$TARGET_LDFLAGS"
928 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0])
929 if test x"$flag" = x1; then
930 grub_cv_target_cc_strict_align="$arg"
931 break;
932 fi
933 done])
934
d74b9a1d
VS
935 TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_strict_align"
936 if test x"$grub_cv_target_cc_strict_align" = x"-Xclang -mstrict-align"; then
937 TARGET_LDFLAGS="$TARGET_LDFLAGS -Qunused-arguments"
bb9f92b9 938 fi
bdb6090d
VS
939 AC_CACHE_CHECK([if compiler generates unaligned accesses], [grub_cv_cc_target_emits_unaligned],
940 [CFLAGS="$TARGET_CFLAGS"
941 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
942#ifdef __ARM_FEATURE_UNALIGNED
943#error "unaligned"
944#endif
945 ]])],
946 [grub_cv_cc_target_emits_unaligned=no], [grub_cv_cc_target_emits_unaligned=yes])])
947 if test x$grub_cv_cc_target_emits_unaligned = xyes; then
948 AC_MSG_ERROR([compiler generates unaligned accesses])
949 fi
bb9f92b9
LL
950fi
951
aa6d7826 952# Set them to their new values for the tests below.
953CC="$TARGET_CC"
a9f25a08 954if test "x$TARGET_APPLE_LINKER" = x1 ; then
246a434f 955CFLAGS="$TARGET_CFLAGS -nostdlib -static -Wno-error"
26de2bcd 956else
37378f74 957CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
26de2bcd 958fi
aa6d7826 959CPPFLAGS="$TARGET_CPPFLAGS"
d5524ca8
VS
960if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test "x$grub_cv_cc_target_clang" = xyes ; then
961TARGET_LIBGCC=
03f80960 962else
d5524ca8 963TARGET_LIBGCC=-lgcc
03f80960 964fi
69be5b74 965
d5524ca8
VS
966LIBS="$TARGET_LIBGCC"
967
01fcf061 968grub_ASM_USCORE
a9f25a08 969if test "x$TARGET_APPLE_LINKER" = x0 ; then
01fcf061 970if test x$grub_cv_asm_uscore = xyes; then
37378f74 971DEFSYM="-Wl,--defsym,_abort=_main -Wl,--defsym,__main=_main"
01fcf061 972else
37378f74 973DEFSYM="-Wl,--defsym,abort=main -Wl,--defsym,_main=main -Wl,--defsym,__main=main"
01fcf061 974fi
37378f74 975CFLAGS="$TARGET_CFLAGS -nostdlib $DEFSYM"
a9f25a08 976fi
01fcf061 977
69be5b74 978# Check for libgcc symbols
6fcec439 979AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x)
69be5b74 980
a9f25a08 981if test "x$TARGET_APPLE_LINKER" = x1 ; then
246a434f 982CFLAGS="$TARGET_CFLAGS -nostdlib -static"
69be5b74 983else
37378f74 984CFLAGS="$TARGET_CFLAGS -nostdlib"
69be5b74 985fi
42e0cba3 986LIBS=""
aa6d7826 987
6a161fa9 988# Defined in aclocal.m4.
f6130a12 989grub_PROG_TARGET_CC
a9f25a08 990if test "x$TARGET_APPLE_LINKER" != x1 ; then
b977bf01 991grub_PROG_OBJCOPY_ABSOLUTE
2b167a72 992fi
cb71ba20 993grub_PROG_LD_BUILD_ID_NONE
b977bf01 994if test "x$target_cpu" = xi386; then
a9f25a08 995 if test "$platform" != emu && test "x$TARGET_APPLE_LINKER" != x1 ; then
2aec1692
CF
996 if test ! -z "$TARGET_IMG_LDSCRIPT"; then
997 # Check symbols provided by linker script.
37378f74 998 CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},0x8000"
2aec1692 999 fi
2a8a80e4 1000 grub_CHECK_BSS_START_SYMBOL
1001 grub_CHECK_END_SYMBOL
1002 fi
1003 CFLAGS="$TARGET_CFLAGS"
4b13b216 1004 grub_I386_ASM_PREFIX_REQUIREMENT
1005 grub_I386_ASM_ADDR32
6a161fa9 1006fi
1007
20aea949
VS
1008grub_PROG_NM_WORKS
1009grub_PROG_NM_MINUS_P
1010grub_PROG_NM_DEFINED_ONLY
1011AC_SUBST(TARGET_NMFLAGS_MINUS_P)
1012AC_SUBST(TARGET_NMFLAGS_DEFINED_ONLY)
1013
016a671b 1014if test "$platform" != emu; then
8f9a632b
VS
1015AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
1016 SAVED_CPPFLAGS="$CPPFLAGS"
1017 CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
1018 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
ce938140 1019#include <stddef.h>
8f9a632b
VS
1020int va_arg_func (int fixed, va_list args);]], [[]])],
1021 [grub_cv_cc_isystem=yes],
1022 [grub_cv_cc_isystem=no])
1023 CPPFLAGS="$SAVED_CPPFLAGS"
1024])
1025
1026if test x"$grub_cv_cc_isystem" = xyes ; then
1027 TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
1028fi
dae79b6b 1029fi
5ce5507f 1030
19ce697d 1031AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [
24f4e57c 1032 CFLAGS="$TARGET_CFLAGS -Wtrampolines -Werror"
779dc15b
VS
1033 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
1034int va_arg_func (int fixed, va_list args);]], [[]])],
19ce697d
VS
1035 [grub_cv_cc_wtrampolines=yes],
1036 [grub_cv_cc_wtrampolines=no])
779dc15b
VS
1037])
1038
19ce697d
VS
1039if test x"$grub_cv_cc_wtrampolines" = xyes ; then
1040 TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines"
779dc15b
VS
1041fi
1042
c9a86192 1043# Restore the flags.
9962ed99 1044CC="$tmp_CC"
1045CFLAGS="$tmp_CFLAGS"
1046CPPFLAGS="$tmp_CPPFLAGS"
c9a86192 1047LDFLAGS="$tmp_LDFLAGS"
aa6d7826 1048LIBS="$tmp_LIBS"
6a161fa9 1049
4fe9862e 1050#
2965c7cc 1051# Check for options.
4fe9862e 1052#
1053
1054# Memory manager debugging.
b39f9d20 1055AC_ARG_ENABLE([mm-debug],
2965c7cc 1056 AS_HELP_STRING([--enable-mm-debug],
90ce5d56 1057 [include memory manager debugging]),
2965c7cc 1058 [AC_DEFINE([MM_DEBUG], [1],
1059 [Define to 1 if you enable memory manager debugging.])])
1060
c5dc1690
SJ
1061AC_ARG_ENABLE([cache-stats],
1062 AS_HELP_STRING([--enable-cache-stats],
055e2b8b 1063 [enable disk cache statistics collection]))
c5dc1690
SJ
1064
1065if test x$enable_cache_stats = xyes; then
1066 DISK_CACHE_STATS=1
1067else
1068 DISK_CACHE_STATS=0
1069fi
1070AC_SUBST([DISK_CACHE_STATS])
1071
e744219b
VS
1072AC_ARG_ENABLE([boot-time],
1073 AS_HELP_STRING([--enable-boot-time],
1074 [enable boot time statistics collection]))
1075
1076if test x$enable_boot_time = xyes; then
1077 BOOT_TIME_STATS=1
1078else
1079 BOOT_TIME_STATS=0
1080fi
1081AC_SUBST([BOOT_TIME_STATS])
1082
d64399b5 1083AC_ARG_ENABLE([grub-emu-usb],
1084 [AS_HELP_STRING([--enable-grub-emu-usb],
5ce5507f 1085 [build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
5ce5507f 1086
927d0134
VS
1087AC_ARG_ENABLE([grub-emu-sdl],
1088 [AS_HELP_STRING([--enable-grub-emu-sdl],
1089 [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])])
1090
3affd0ec 1091AC_ARG_ENABLE([grub-emu-pci],
1092 [AS_HELP_STRING([--enable-grub-emu-pci],
1093 [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
1094
f84b481b 1095if test "$platform" = emu; then
f84b481b 1096
62a747cb
VS
1097if test x"$enable_grub_emu_usb" != xyes ; then
1098 grub_emu_usb_excuse="not enabled"
5ce5507f 1099fi
325c8258 1100
0e848909
VS
1101if test x"$enable_grub_emu_pci" = xyes ; then
1102 grub_emu_usb_excuse="conflicts with PCI support"
1103fi
1104
5ce5507f 1105[if [ x"$grub_emu_usb_excuse" = x ]; then
d64399b5 1106 # Check for libusb libraries.]
5ce5507f 1107AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
e98cd0c2 1108 [grub_emu_usb_excuse=["need libusb library"]])
d64399b5 1109 AC_SUBST([LIBUSB])
5ce5507f 1110[fi]
1111[if [ x"$grub_emu_usb_excuse" = x ]; then
1112 # Check for headers.]
d64399b5 1113 AC_CHECK_HEADERS([usb.h], [],
e98cd0c2 1114 [grub_emu_usb_excuse=["need libusb headers"]])
4fe9862e 1115[fi]
c6f3b249 1116if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
ce7a733d 1117 AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
5ce5507f 1118fi
1119if test x"$grub_emu_usb_excuse" = x ; then
1120enable_grub_emu_usb=yes
1121else
1122enable_grub_emu_usb=no
1123fi
1124
927d0134
VS
1125if test x"$enable_grub_emu_sdl" = xno ; then
1126 grub_emu_sdl_excuse="explicitely disabled"
1127fi
1128[if [ x"$grub_emu_sdl_excuse" = x ]; then
1129 # Check for libSDL libraries.]
1130AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
1131 [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]])
1132 AC_SUBST([LIBSDL])
1133[fi]
9f293ab0 1134
927d0134
VS
1135[if [ x"$grub_emu_sdl_excuse" = x ]; then
1136 # Check for headers.]
1137 AC_CHECK_HEADERS([SDL/SDL.h], [],
1138 [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]])
1139[fi]
9f293ab0 1140
927d0134
VS
1141if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
1142 AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled])
1143fi
1144if test x"$grub_emu_sdl_excuse" = x ; then
1145enable_grub_emu_sdl=yes
1146else
1147enable_grub_emu_sdl=no
1148fi
1149
3affd0ec 1150if test x"$enable_grub_emu_pci" != xyes ; then
325c8258 1151 grub_emu_pci_excuse="not enabled"
1152fi
1153
1154if test x"$enable_grub_emu_usb" = xyes ; then
1155 grub_emu_pci_excuse="conflicts with USB support"
1156fi
1157
1158[if [ x"$grub_emu_pci_excuse" = x ]; then
1159 # Check for libpci libraries.]
459fed4b 1160 AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"],
1161 [grub_emu_pci_excuse=["need libpciaccess library"]])
1162 AC_SUBST([LIBPCIACCESS])
325c8258 1163[fi]
1164[if [ x"$grub_emu_pci_excuse" = x ]; then
1165 # Check for headers.]
1166 AC_CHECK_HEADERS([pci/pci.h], [],
459fed4b 1167 [grub_emu_pci_excuse=["need libpciaccess headers"]])
325c8258 1168[fi]
1169
1170if test x"$grub_emu_pci_excuse" = x ; then
1171enable_grub_emu_pci=yes
1172else
9f293ab0 1173
325c8258 1174enable_grub_emu_pci=no
3affd0ec 1175fi
1176
927d0134 1177AC_SUBST([enable_grub_emu_sdl])
d64399b5 1178AC_SUBST([enable_grub_emu_usb])
3affd0ec 1179AC_SUBST([enable_grub_emu_pci])
e7d09ac4
AB
1180
1181else
1182
1183# Ignore --enable-emu-* if platform is not emu
1184enable_grub_emu_sdl=no
1185enable_grub_emu_usb=no
1186enable_grub_emu_pci=no
f84b481b 1187fi
4fe9862e 1188
e52db1f7 1189AC_ARG_ENABLE([grub-mkfont],
1190 [AS_HELP_STRING([--enable-grub-mkfont],
5ce5507f 1191 [build and install the `grub-mkfont' utility (default=guessed)])])
1192if test x"$enable_grub_mkfont" = xno ; then
ce7a733d 1193 grub_mkfont_excuse="explicitly disabled"
5ce5507f 1194fi
1195
1196if test x"$grub_mkfont_excuse" = x ; then
e52db1f7 1197 # Check for freetype libraries.
a5b55c4b 1198 AC_CHECK_TOOLS([FREETYPE], [freetype-config])
e52db1f7 1199 if test "x$FREETYPE" = x ; then
e98cd0c2 1200 grub_mkfont_excuse=["need freetype2 library"]
e52db1f7 1201 fi
e52db1f7 1202fi
660960d6 1203
7b780018
VS
1204unset ac_cv_header_ft2build_h
1205
660960d6
VS
1206if test x"$grub_mkfont_excuse" = x ; then
1207 # Check for freetype libraries.
a5b55c4b
DM
1208 freetype_cflags=`$FREETYPE --cflags`
1209 freetype_libs=`$FREETYPE --libs`
d1e8a02f 1210 SAVED_CPPFLAGS="$CPPFLAGS"
b75db69a 1211 SAVED_LIBS="$LIBS"
d1e8a02f 1212 CPPFLAGS="$CPPFLAGS $freetype_cflags"
b75db69a 1213 LIBS="$LIBS $freetype_libs"
660960d6
VS
1214 AC_CHECK_HEADERS([ft2build.h], [],
1215 [grub_mkfont_excuse=["need freetype2 headers"]])
b75db69a 1216 AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_mkfont_excuse=["freetype2 library unusable"]])
d1e8a02f 1217 CPPFLAGS="$SAVED_CPPFLAGS"
b75db69a 1218 LIBS="$SAVED_LIBS"
660960d6
VS
1219fi
1220
5ce5507f 1221if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
ce7a733d 1222 AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
5ce5507f 1223fi
1224if test x"$grub_mkfont_excuse" = x ; then
1225enable_grub_mkfont=yes
1226else
1227enable_grub_mkfont=no
1228fi
e52db1f7 1229AC_SUBST([enable_grub_mkfont])
1230AC_SUBST([freetype_cflags])
1231AC_SUBST([freetype_libs])
1232
7c9d0c39 1233SAVED_CC="$CC"
b224c266 1234SAVED_CPP="$CPP"
7c9d0c39
VS
1235SAVED_CFLAGS="$CFLAGS"
1236SAVED_CPPFLAGS="$CPPFLAGS"
1237CC="$BUILD_CC"
b224c266 1238CPP="$BUILD_CPP"
7c9d0c39 1239CFLAGS="$BUILD_CFLAGS"
7b780018
VS
1240CPPFLAGS="$BUILD_CPPFLAGS"
1241
1242unset ac_cv_c_bigendian
1243unset ac_cv_header_ft2build_h
1244
1245AC_COMPUTE_INT([BUILD_SIZEOF_VOID_P], [sizeof (void *)])
1246AC_COMPUTE_INT([BUILD_SIZEOF_LONG], [sizeof (long)])
1247AC_C_BIGENDIAN([BUILD_WORDS_BIGENDIAN=1], [BUILD_WORDS_BIGENDIAN=0], [BUILD_WORDS_BIGENDIAN=err], [BUILD_WORDS_BIGENDIAN=err])
1248
1249if test x$BUILD_WORDS_BIGENDIAN = xerr ; then
1250 AC_MSG_ERROR([couldnt determine build endianness])
1251fi
1252
1253AC_SUBST([BUILD_SIZEOF_LONG])
1254AC_SUBST([BUILD_SIZEOF_VOID_P])
1255AC_SUBST([BUILD_WORDS_BIGENDIAN])
c5884973 1256
7c9d0c39
VS
1257if test x"$grub_build_mkfont_excuse" = x ; then
1258 # Check for freetype libraries.
7b780018 1259 AC_CHECK_PROGS([BUILD_FREETYPE], [freetype-config])
7c9d0c39
VS
1260 if test "x$BUILD_FREETYPE" = x ; then
1261 grub_build_mkfont_excuse=["need freetype2 library"]
1262 fi
1263fi
c5884973 1264
7c9d0c39
VS
1265if test x"$grub_build_mkfont_excuse" = x ; then
1266 # Check for freetype libraries.
1267 build_freetype_cflags=`$BUILD_FREETYPE --cflags`
1268 build_freetype_libs=`$BUILD_FREETYPE --libs`
1269 SAVED_CPPFLAGS_2="$CPPFLAGS"
b75db69a 1270 SAVED_LIBS="$LIBS"
7c9d0c39 1271 CPPFLAGS="$CPPFLAGS $build_freetype_cflags"
b75db69a 1272 LIBS="$LIBS $build_freetype_libs"
7c9d0c39
VS
1273 AC_CHECK_HEADERS([ft2build.h], [],
1274 [grub_build_mkfont_excuse=["need freetype2 headers"]])
b75db69a
VS
1275 AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_build_mkfont_excuse=["freetype2 library unusable"]])
1276 LIBS="$SAVED_LIBS"
7c9d0c39
VS
1277 CPPFLAGS="$SAVED_CPPFLAGS_2"
1278fi
1279
1280if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then
1281 AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled])
1282fi
1283if test x"$grub_build_mkfont_excuse" = x ; then
1284 enable_build_grub_mkfont=yes
1285else
1286 enable_build_grub_mkfont=no
c5884973 1287fi
5ff24907
VS
1288if 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" = xcoreboot ); then
1289 AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont])
7c9d0c39
VS
1290fi
1291
1292AC_SUBST([build_freetype_cflags])
1293AC_SUBST([build_freetype_libs])
1294
1295CC="$SAVED_CC"
b224c266 1296CPP="$SAVED_CPP"
7c9d0c39
VS
1297CFLAGS="$SAVED_CFLAGS"
1298CPPFLAGS="$SAVED_CPPFLAGS"
1299
1300
1301DJVU_FONT_SOURCE=
1302
1303starfield_excuse=
c5884973 1304
300f48c5
VS
1305AC_ARG_ENABLE([grub-themes],
1306 [AS_HELP_STRING([--enable-grub-themes],
1307 [build and install GRUB themes (default=guessed)])])
1308if test x"$enable_grub_themes" = xno ; then
1309 starfield_excuse="explicitly disabled"
1310fi
1311
1312if test x"$starfield_excuse" = x && test x"$enable_build_grub_mkfont" = xno ; then
7b966834
VS
1313 starfield_excuse="No build-time grub-mkfont"
1314fi
1315
501b9e4b 1316if test x"$starfield_excuse" = x; then
c5884973 1317 for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
32745f51 1318 for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do
c5884973
DO
1319 if test -f "$dir/DejaVuSans.$ext"; then
1320 DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext"
1321 break 2
1322 fi
1323 done
1324 done
1325
1326 if test "x$DJVU_FONT_SOURCE" = x; then
1327 starfield_excuse="No DejaVu found"
1328 fi
1329fi
1330
300f48c5
VS
1331if test x"$enable_grub_themes" = xyes && test x"$starfield_excuse" != x; then
1332 AC_MSG_ERROR([themes were explicitly requested but requirements are not satisfied])
1333fi
1334
c5884973
DO
1335AC_SUBST([DJVU_FONT_SOURCE])
1336
7c9d0c39
VS
1337FONT_SOURCE=
1338
1339for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
1340 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
1341 if test -f "$dir/unifont.$ext"; then
0277eab7
VS
1342 md5="$(md5sum "$dir/unifont.$ext"|awk '{ print $1; }')"
1343 # PCF and BDF from version 6.3 isn't hanled properly by libfreetype.
1344 if test "$md5" = 0a54834d2788c83886a3e1785a6a1e61 || test "$md5" = 28f2565c7a41d8d407e2551159385edb || test "$md5" = dae5e588461b3b92b87b6ffee734f936 || test "$md5" = 4a3d687aa5bb329ed05f4263a1016791 ; then
1345 continue;
1346 fi
7c9d0c39
VS
1347 FONT_SOURCE="$dir/unifont.$ext"
1348 break 2
1349 fi
1350 done
1351done
1352
7b966834
VS
1353if test x"$enable_build_grub_mkfont" = xno ; then
1354 FONT_SOURCE=
1355fi
1356
5ff24907
VS
1357if 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" = xcoreboot ); then
1358 AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont])
7c9d0c39
VS
1359fi
1360
1361AC_SUBST([FONT_SOURCE])
1362
7b780018 1363if test x"$FONT_SOURCE" = x && test x"$DJVU_FONT_SOURCE" = x && test x"$grub_build_mkfont_excuse" = x; then
7c9d0c39
VS
1364 grub_build_mkfont_excuse="no fonts"
1365fi
1366
1367
897e6207
CW
1368AC_ARG_ENABLE([grub-mount],
1369 [AS_HELP_STRING([--enable-grub-mount],
1370 [build and install the `grub-mount' utility (default=guessed)])])
1371if test x"$enable_grub_mount" = xno ; then
1372 grub_mount_excuse="explicitly disabled"
92bb0786
VS
1373fi
1374
897e6207 1375if test x"$grub_mount_excuse" = x ; then
92bb0786 1376 AC_CHECK_LIB([fuse], [fuse_main_real], [],
897e6207 1377 [grub_mount_excuse="need FUSE library"])
92bb0786
VS
1378fi
1379
897e6207 1380if test x"$grub_mount_excuse" = x ; then
92bb0786
VS
1381 # Check for fuse headers.
1382 SAVED_CPPFLAGS="$CPPFLAGS"
338c7fab 1383 CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26"
92bb0786 1384 AC_CHECK_HEADERS([fuse/fuse.h], [],
897e6207 1385 [grub_mount_excuse=["need FUSE headers"]])
92bb0786
VS
1386 CPPFLAGS="$SAVED_CPPFLAGS"
1387fi
1388
897e6207 1389if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then
89644ef1 1390 AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled])
92bb0786 1391fi
897e6207
CW
1392if test x"$grub_mount_excuse" = x ; then
1393enable_grub_mount=yes
92bb0786 1394else
897e6207 1395enable_grub_mount=no
92bb0786 1396fi
897e6207 1397AC_SUBST([enable_grub_mount])
92bb0786 1398
7181e228
CW
1399AC_ARG_ENABLE([device-mapper],
1400 [AS_HELP_STRING([--enable-device-mapper],
1401 [enable Linux device-mapper support (default=guessed)])])
1402if test x"$enable_device_mapper" = xno ; then
1403 device_mapper_excuse="explicitly disabled"
1404fi
1405
53798c4b
GS
1406if test x"$device_mapper_excuse" = x ; then
1407 # Check for device-mapper header.
1408 AC_CHECK_HEADER([libdevmapper.h], [],
1409 [device_mapper_excuse="need libdevmapper header"])
1410fi
1411
7181e228
CW
1412if test x"$device_mapper_excuse" = x ; then
1413 # Check for device-mapper library.
61d720e5 1414 AC_CHECK_LIB([devmapper], [dm_task_create], [],
7181e228 1415 [device_mapper_excuse="need devmapper library"])
7181e228 1416fi
61d720e5
VS
1417
1418if test x"$device_mapper_excuse" = x ; then
1419 # Check for device-mapper library.
1420 AC_CHECK_LIB([devmapper], [dm_log_with_errno_init],
1421 [],
1422 [device_mapper_excuse="need devmapper library"])
1423fi
1424
1425if test x"$device_mapper_excuse" = x ; then
1426 LIBDEVMAPPER="-ldevmapper";
1427 AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
1428 [Define to 1 if you have the devmapper library.])
1429fi
1430
62f7d208 1431AC_SUBST([LIBDEVMAPPER])
76ed06b9 1432
f4727da9
VS
1433LIBGEOM=
1434if test x$host_kernel = xkfreebsd; then
1435 AC_CHECK_LIB([geom], [geom_gettree], [],
1436 [AC_MSG_ERROR([Your platform requires libgeom])])
1437 LIBGEOM="-lgeom"
1438fi
1439
1440AC_SUBST([LIBGEOM])
1441
0d2d30bb
VS
1442AC_ARG_ENABLE([liblzma],
1443 [AS_HELP_STRING([--enable-liblzma],
1444 [enable liblzma integration (default=guessed)])])
1445if test x"$enable_liblzma" = xno ; then
1446 liblzma_excuse="explicitly disabled"
1447fi
1448
1449if test x"$liblzma_excuse" = x ; then
2c44e493 1450AC_CHECK_LIB([lzma], [lzma_code],
0d2d30bb
VS
1451 [],[liblzma_excuse="need lzma library"])
1452fi
1453if test x"$liblzma_excuse" = x ; then
1454AC_CHECK_HEADER([lzma.h], [], [liblzma_excuse="need lzma header"])
1455fi
1456
1457if test x"$enable_liblzma" = xyes && test x"$liblzma_excuse" != x ; then
1458 AC_MSG_ERROR([liblzma support was explicitly requested but requirements are not satisfied])
1459fi
1460
1461
1462if test x"$liblzma_excuse" = x ; then
1463 LIBLZMA="-llzma"
1464 AC_DEFINE([USE_LIBLZMA], [1],
1465 [Define to 1 if you have the LZMA library.])
1466fi
1467
2c44e493
VS
1468AC_SUBST([LIBLZMA])
1469
e4c498a1
MG
1470AC_ARG_ENABLE([libzfs],
1471 [AS_HELP_STRING([--enable-libzfs],
1472 [enable libzfs integration (default=guessed)])])
1473if test x"$enable_libzfs" = xno ; then
1474 libzfs_excuse="explicitly disabled"
1475fi
16c7cb32 1476
e4c498a1
MG
1477if test x"$libzfs_excuse" = x ; then
1478 # Only check for system headers if libzfs support has not been disabled.
1479 AC_CHECK_HEADERS(libzfs.h libnvpair.h)
1480fi
1481
1482if test x"$libzfs_excuse" = x ; then
1483 AC_CHECK_LIB([zfs], [libzfs_init],
1484 [],
1485 [libzfs_excuse="need zfs library"])
1486fi
1487
1488if test x"$libzfs_excuse" = x ; then
27f9d02e 1489 AC_CHECK_LIB([nvpair], [nvlist_lookup_string],
e4c498a1
MG
1490 [],
1491 [libzfs_excuse="need nvpair library"])
1492fi
1493
1494if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then
1495 AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied])
1496fi
1497
1498if test x"$libzfs_excuse" = x ; then
1499 # We need both libzfs and libnvpair for a successful build.
1500 LIBZFS="-lzfs"
1501 AC_DEFINE([HAVE_LIBZFS], [1],
1502 [Define to 1 if you have the ZFS library.])
1503 LIBNVPAIR="-lnvpair"
1504 AC_DEFINE([HAVE_LIBNVPAIR], [1],
1505 [Define to 1 if you have the NVPAIR library.])
1506fi
1507
1508AC_SUBST([LIBZFS])
16c7cb32
BC
1509AC_SUBST([LIBNVPAIR])
1510
9f915872
VS
1511LIBS=""
1512
76ed06b9 1513AC_SUBST([FONT_SOURCE])
76ed06b9
BC
1514AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
1515 [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
7181e228 1516
742f9232
VS
1517AC_SUBST(HAVE_ASM_USCORE)
1518AC_SUBST(ADDR32)
1519AC_SUBST(DATA32)
1520AC_SUBST(BSS_START_SYMBOL)
1521AC_SUBST(END_SYMBOL)
1522AC_SUBST(PACKAGE)
1523AC_SUBST(VERSION)
742f9232
VS
1524AC_SUBST(NEED_REGISTER_FRAME_INFO)
1525
d5524ca8
VS
1526AC_ARG_ENABLE([werror],
1527 [AS_HELP_STRING([--disable-werror],
1528 [do not use -Werror when building GRUB])])
1529if test x"$enable_werror" != xno ; then
1530 TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
1531 HOST_CFLAGS="$HOST_CFLAGS -Werror"
1532fi
1533
1534if test "x$grub_cv_cc_target_clang" = xno; then
1535 TARGET_LDFLAGS_STATIC_LIBGCC="-static-libgcc"
1536else
1537 TARGET_LDFLAGS_STATIC_LIBGCC=
1538fi
1539
1540TARGET_CPP="$TARGET_CC -E"
1541TARGET_CCAS=$TARGET_CC
1542
1543GRUB_TARGET_CPU="${target_cpu}"
1544GRUB_PLATFORM="${platform}"
1545
1546AC_SUBST(GRUB_TARGET_CPU)
1547AC_SUBST(GRUB_PLATFORM)
1548
1549AC_SUBST(TARGET_OBJCONV)
1550AC_SUBST(TARGET_LIBGCC)
1551AC_SUBST(TARGET_LDFLAGS_STATIC_LIBGCC)
1552AC_SUBST(TARGET_CPP)
1553AC_SUBST(TARGET_CCAS)
1554AC_SUBST(TARGET_OBJ2ELF)
d5524ca8
VS
1555AC_SUBST(TARGET_MODULE_FORMAT)
1556
1557AC_SUBST(TARGET_CFLAGS)
1558AC_SUBST(TARGET_LDFLAGS)
1559AC_SUBST(TARGET_CPPFLAGS)
1560AC_SUBST(TARGET_CCASFLAGS)
1561
d5524ca8
VS
1562AC_SUBST(TARGET_IMG_LDFLAGS)
1563AC_SUBST(TARGET_IMG_CFLAGS)
1564AC_SUBST(TARGET_IMG_BASE_LDOPT)
a9f25a08 1565AC_SUBST(TARGET_APPLE_LINKER)
d5524ca8
VS
1566
1567AC_SUBST(HOST_CFLAGS)
1568AC_SUBST(HOST_LDFLAGS)
1569AC_SUBST(HOST_CPPFLAGS)
1570AC_SUBST(HOST_CCASFLAGS)
1571
1572AC_SUBST(BUILD_LIBM)
1573
76ed06b9
BC
1574#
1575# Automake conditionals
1576#
8c411768 1577
76ed06b9 1578AM_CONDITIONAL([COND_emu], [test x$platform = xemu])
d59849b2 1579AM_CONDITIONAL([COND_clang], [test x$grub_cv_cc_target_clang = xyes])
76ed06b9
BC
1580AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc])
1581AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi])
6585de4c 1582AM_CONDITIONAL([COND_ia64_efi], [test x$target_cpu = xia64 -a x$platform = xefi])
76ed06b9
BC
1583AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu])
1584AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275])
1585AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
1586AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
1587AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
9612ebc0
VS
1588AM_CONDITIONAL([COND_i386_xen], [test x$target_cpu = xi386 -a x$platform = xxen])
1589AM_CONDITIONAL([COND_x86_64_xen], [test x$target_cpu = xx86_64 -a x$platform = xxen])
4959e111
VS
1590AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
1591AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
7f63a64f 1592AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc])
76ed06b9 1593AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
eaf01c25 1594AM_CONDITIONAL([COND_sparc64_emu], [test x$target_cpu = xsparc64 -a x$platform = xemu])
76ed06b9 1595AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
4959e111 1596AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
37ba07eb
VS
1597AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
1598AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
389b31cd
LL
1599AM_CONDITIONAL([COND_arm], [test x$target_cpu = xarm ])
1600AM_CONDITIONAL([COND_arm_uboot], [test x$target_cpu = xarm -a x$platform = xuboot])
1601AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi])
15a463d7
LL
1602AM_CONDITIONAL([COND_arm64], [test x$target_cpu = xarm64 ])
1603AM_CONDITIONAL([COND_arm64_efi], [test x$target_cpu = xarm64 -a x$platform = xefi])
f7711f5e
BC
1604
1605AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
1606AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
1607AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
1608AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
1609AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
b105df76 1610AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu])
958ee221 1611AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos])
2d465fb0 1612
76ed06b9
BC
1613AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
1614AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
1615AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
1616AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
1617AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
897e6207 1618AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes])
76ed06b9 1619AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
6f07c4e4
VS
1620if test x$FONT_SOURCE != x ; then
1621 HAVE_FONT_SOURCE=1
1622else
1623 HAVE_FONT_SOURCE=0
1624fi
1625AC_SUBST(HAVE_FONT_SOURCE)
a9f25a08 1626AM_CONDITIONAL([COND_APPLE_LINKER], [test x$TARGET_APPLE_LINKER = x1])
76ed06b9 1627AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
c5dc1690 1628AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1])
e744219b 1629AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1])
fc45fb58 1630
1eed0e6e
VS
1631AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes])
1632
742f9232 1633AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
c5884973 1634AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x])
cd46aa6c
VS
1635AM_CONDITIONAL([COND_HAVE_EXEC], [test "x$have_exec" = xy])
1636
1637test "x$prefix" = xNONE && prefix="$ac_default_prefix"
1638test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
1639datarootdir="$(eval echo "$datarootdir")"
1640grub_libdir="$(eval echo "$libdir")"
1641grub_localedir="$(eval echo "$localedir")"
1642grub_datadir="$(eval echo "$datadir")"
1643grub_sysconfdir="$(eval echo "$sysconfdir")"
1644AC_DEFINE_UNQUOTED(LOCALEDIR, "$grub_localedir", [Locale dir])
1645AC_DEFINE_UNQUOTED(GRUB_LIBDIR, "$grub_libdir", [Library dir])
1646AC_DEFINE_UNQUOTED(GRUB_DATADIR, "$grub_datadir", [Data dir])
1647AC_DEFINE_UNQUOTED(GRUB_SYSCONFDIR, "$grub_sysconfdir", [Configuration dir])
1648
742f9232 1649
6a161fa9 1650# Output files.
4959e111
VS
1651cpudir="${target_cpu}"
1652if test x${cpudir} = xmipsel; then
1653 cpudir=mips;
1654fi
1f4147aa 1655grub_CHECK_LINK_DIR
1656if test x"$link_dir" = xyes ; then
4959e111 1657 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir])
f84b481b 1658 if test "$platform" != emu ; then
4959e111 1659 AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform])
f84b481b 1660 fi
1f4147aa 1661else
1662 mkdir -p include/grub 2>/dev/null
1663 rm -rf include/grub/cpu
4959e111 1664 cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null
f84b481b
RM
1665 if test "$platform" != emu ; then
1666 rm -rf include/grub/machine
4959e111 1667 cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null
f84b481b 1668 fi
1f4147aa 1669fi
6304d292 1670
8c411768 1671AC_CONFIG_FILES([Makefile])
6304d292 1672AC_CONFIG_FILES([grub-core/Makefile])
15c69261 1673AC_CONFIG_FILES([grub-core/gnulib/Makefile])
269004c1 1674AC_CONFIG_FILES([po/Makefile.in])
8c411768 1675AC_CONFIG_FILES([docs/Makefile])
b23ffd70 1676AC_CONFIG_FILES([util/bash-completion.d/Makefile])
6a161fa9 1677AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
742f9232 1678AC_CONFIG_FILES([config.h])
8c411768 1679
6a161fa9 1680AC_OUTPUT
5ce5507f 1681[
1682echo "*******************************************************"
1683echo GRUB2 will be compiled with following components:
1684echo Platform: "$target_cpu"-"$platform"
f84b481b 1685if [ x"$platform" = xemu ]; then
5ce5507f 1686if [ x"$grub_emu_usb_excuse" = x ]; then
1687echo USB support for grub-emu: Yes
1688else
1689echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
1690fi
927d0134
VS
1691if [ x"$grub_emu_sdl_excuse" = x ]; then
1692echo SDL support for grub-emu: Yes
1693else
1694echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)"
1695fi
325c8258 1696if [ x"$grub_emu_pci_excuse" = x ]; then
1697echo PCI support for grub-emu: Yes
1698else
1699echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
1700fi
f84b481b 1701fi
61d720e5
VS
1702if test x"$device_mapper_excuse" = x ; then
1703echo With devmapper support: Yes
1704else
1705echo With devmapper support: No "($device_mapper_excuse)"
1706fi
5ce5507f 1707if [ x"$enable_mm_debug" = xyes ]; then
1708echo With memory debugging: Yes
1709else
1710echo With memory debugging: No
1711fi
c5dc1690
SJ
1712if [ x"$enable_cache_stats" = xyes ]; then
1713echo With disk cache statistics: Yes
1714else
1715echo With disk cache statistics: No
1716fi
e744219b
VS
1717
1718if [ x"$enable_boot_time" = xyes ]; then
1719echo With boot time statistics: Yes
1720else
1721echo With boot time statistics: No
1722fi
1723
5ce5507f 1724if [ x"$efiemu_excuse" = x ]; then
1725echo efiemu runtime: Yes
1726else
1727echo efiemu runtime: No "($efiemu_excuse)"
1728fi
5ce5507f 1729if [ x"$grub_mkfont_excuse" = x ]; then
1730echo grub-mkfont: Yes
1731else
1732echo grub-mkfont: No "($grub_mkfont_excuse)"
1733fi
897e6207 1734if [ x"$grub_mount_excuse" = x ]; then
89644ef1 1735echo grub-mount: Yes
92bb0786 1736else
897e6207 1737echo grub-mount: No "($grub_mount_excuse)"
92bb0786 1738fi
c5884973
DO
1739if [ x"$starfield_excuse" = x ]; then
1740echo starfield theme: Yes
1741else
1742echo starfield theme: No "($starfield_excuse)"
1743fi
e4c498a1
MG
1744if [ x"$libzfs_excuse" = x ]; then
1745echo With libzfs support: Yes
1746else
1747echo With libzfs support: No "($libzfs_excuse)"
1748fi
7b780018 1749if [ x"$grub_build_mkfont_excuse" = x ]; then
7c9d0c39
VS
1750 echo Build-time grub-mkfont: Yes
1751 if test "x$FONT_SOURCE" = x ; then
1752 echo "Without unifont"
1753 else
1754 echo "With unifont from $FONT_SOURCE"
1755 fi
4b80e43c 1756else
7b780018 1757 echo Build-time grub-mkfont: No "($grub_build_mkfont_excuse)"
7c9d0c39 1758 echo "Without unifont (no build-time grub-mkfont)"
4b80e43c 1759fi
0d2d30bb
VS
1760if test x"$liblzma_excuse" != x ; then
1761echo "Without liblzma (no support for XZ-compressed mips images) ($liblzma_excuse)"
64fce2d8
VS
1762else
1763echo "With liblzma from $LIBLZMA (support for XZ-compressed mips images)"
1764fi
5ce5507f 1765echo "*******************************************************"
1766]