]>
Commit | Line | Data |
---|---|---|
1 | # -*- autoconf -*- | |
2 | ||
3 | # Process this file with autoconf to produce a configure script. | |
4 | ||
5 | # Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. | |
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 | ||
16 | dnl This configure script is complicated, because GRUB needs to deal | |
17 | dnl with three potentially different types: | |
18 | dnl | |
19 | dnl build -- the environment for building GRUB | |
20 | dnl host -- the environment for running utilities | |
21 | dnl target -- the environment for running GRUB | |
22 | dnl | |
23 | dnl In addition, GRUB needs to deal with a platform specification | |
24 | dnl which specifies the system running GRUB, such as firmware. | |
25 | dnl This is necessary because the target type in autoconf does not | |
26 | dnl describe such a system very well. | |
27 | dnl | |
28 | dnl The current strategy is to use variables with no prefix (such as | |
29 | dnl CC, CFLAGS, etc.) for the host type, variables with prefix "BUILD_" | |
30 | dnl (such as BUILD_CC, BUILD_CFLAGS, etc.) for the build type and variables | |
31 | dnl with the prefix "TARGET_" (such as TARGET_CC, TARGET_CFLAGS, etc.) are | |
32 | dnl used for the target type. See INSTALL for full list of variables. | |
33 | ||
34 | AC_INIT([GRUB],[2.02],[bug-grub@gnu.org]) | |
35 | ||
36 | AC_CONFIG_AUX_DIR([build-aux]) | |
37 | ||
38 | # We don't want -g -O2 by default in CFLAGS | |
39 | : ${CFLAGS=""} | |
40 | ||
41 | # Checks for build, host and target systems. | |
42 | AC_CANONICAL_BUILD | |
43 | AC_CANONICAL_HOST | |
44 | save_program_prefix="${program_prefix}" | |
45 | AC_CANONICAL_TARGET | |
46 | program_prefix="${save_program_prefix}" | |
47 | ||
48 | AM_INIT_AUTOMAKE([1.10.1]) | |
49 | AC_PREREQ(2.60) | |
50 | AC_CONFIG_SRCDIR([include/grub/dl.h]) | |
51 | AC_CONFIG_HEADER([config-util.h]) | |
52 | ||
53 | # Explicitly check for pkg-config early on, since otherwise conditional | |
54 | # calls are problematic. | |
55 | PKG_PROG_PKG_CONFIG | |
56 | ||
57 | # Program name transformations | |
58 | AC_ARG_PROGRAM | |
59 | grub_TRANSFORM([grub-bios-setup]) | |
60 | grub_TRANSFORM([grub-editenv]) | |
61 | grub_TRANSFORM([grub-install]) | |
62 | grub_TRANSFORM([grub-mkconfig]) | |
63 | grub_TRANSFORM([grub-mkfont]) | |
64 | grub_TRANSFORM([grub-mkimage]) | |
65 | grub_TRANSFORM([grub-glue-efi]) | |
66 | grub_TRANSFORM([grub-mklayout]) | |
67 | grub_TRANSFORM([grub-mkpasswd-pbkdf2]) | |
68 | grub_TRANSFORM([grub-mkrelpath]) | |
69 | grub_TRANSFORM([grub-mkrescue]) | |
70 | grub_TRANSFORM([grub-probe]) | |
71 | grub_TRANSFORM([grub-reboot]) | |
72 | grub_TRANSFORM([grub-script-check]) | |
73 | grub_TRANSFORM([grub-set-default]) | |
74 | grub_TRANSFORM([grub-sparc64-setup]) | |
75 | grub_TRANSFORM([grub-render-label]) | |
76 | grub_TRANSFORM([grub-file]) | |
77 | ||
78 | # Optimization flag. Allow user to override. | |
79 | if test "x$TARGET_CFLAGS" = x; then | |
80 | TARGET_CFLAGS="$TARGET_CFLAGS -Os" | |
81 | fi | |
82 | ||
83 | # Default HOST_CPPFLAGS | |
84 | HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W" | |
85 | HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1" | |
86 | ||
87 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W" | |
88 | ||
89 | case "$target_cpu" in | |
90 | i[[3456]]86) target_cpu=i386 ;; | |
91 | amd64) target_cpu=x86_64 ;; | |
92 | sparc) target_cpu=sparc64 ;; | |
93 | mipsel|mips64el) | |
94 | target_cpu=mipsel | |
95 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1" | |
96 | ;; | |
97 | mips|mips64) | |
98 | target_cpu=mips | |
99 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1" | |
100 | ;; | |
101 | arm*) | |
102 | target_cpu=arm | |
103 | ;; | |
104 | aarch64*) | |
105 | target_cpu=arm64 | |
106 | ;; | |
107 | esac | |
108 | ||
109 | # Specify the platform (such as firmware). | |
110 | AC_ARG_WITH([platform], | |
111 | AS_HELP_STRING([--with-platform=PLATFORM], | |
112 | [select the host platform [[guessed]]])) | |
113 | ||
114 | # Guess the platform if not specified. | |
115 | if test "x$with_platform" = x; then | |
116 | case "$target_cpu"-"$target_vendor" in | |
117 | i386-apple) platform=efi ;; | |
118 | i386-*) platform=pc ;; | |
119 | x86_64-apple) platform=efi ;; | |
120 | x86_64-*) platform=pc ;; | |
121 | powerpc-*) platform=ieee1275 ;; | |
122 | powerpc64-*) platform=ieee1275 ;; | |
123 | powerpc64le-*) platform=ieee1275 ;; | |
124 | sparc64-*) platform=ieee1275 ;; | |
125 | mipsel-*) platform=loongson ;; | |
126 | mips-*) platform=arc ;; | |
127 | ia64-*) platform=efi ;; | |
128 | arm-*) platform=uboot ;; | |
129 | arm64-*) platform=efi ;; | |
130 | *) | |
131 | AC_MSG_WARN([unsupported CPU: "$target_cpu" - only building utilities]) | |
132 | platform=none | |
133 | ;; | |
134 | esac | |
135 | else | |
136 | platform="$with_platform" | |
137 | fi | |
138 | ||
139 | case "$target_cpu"-"$platform" in | |
140 | x86_64-efi) ;; | |
141 | x86_64-emu) ;; | |
142 | x86_64-xen) ;; | |
143 | x86_64-none) ;; | |
144 | x86_64-*) target_cpu=i386 ;; | |
145 | powerpc64-ieee1275) target_cpu=powerpc ;; | |
146 | powerpc64le-ieee1275) target_cpu=powerpc ;; | |
147 | esac | |
148 | ||
149 | # Check if the platform is supported, make final adjustments. | |
150 | case "$target_cpu"-"$platform" in | |
151 | i386-efi) ;; | |
152 | x86_64-efi) ;; | |
153 | i386-xen) ;; | |
154 | x86_64-xen) ;; | |
155 | i386-pc) ;; | |
156 | i386-multiboot) ;; | |
157 | i386-coreboot) ;; | |
158 | i386-linuxbios) platform=coreboot ;; | |
159 | i386-ieee1275) ;; | |
160 | i386-qemu) ;; | |
161 | powerpc-ieee1275) ;; | |
162 | sparc64-ieee1275) ;; | |
163 | ia64-efi) ;; | |
164 | mips-qemu_mips) ;; | |
165 | mips-qemu-mips) platform=qemu_mips;; | |
166 | mips-arc) ;; | |
167 | mipsel-arc) ;; | |
168 | mipsel-qemu_mips) ;; | |
169 | mipsel-qemu-mips) platform=qemu_mips;; | |
170 | mipsel-yeeloong) platform=loongson ;; | |
171 | mipsel-fuloong) platform=loongson ;; | |
172 | mipsel-loongson) ;; | |
173 | arm-uboot) ;; | |
174 | arm-efi) ;; | |
175 | arm64-efi) ;; | |
176 | *-emu) ;; | |
177 | *-none) ;; | |
178 | *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; | |
179 | esac | |
180 | ||
181 | if test x$platform != xemu ; then | |
182 | case "$target_cpu" in | |
183 | i386 | powerpc) target_m32=1 ;; | |
184 | x86_64 | sparc64) target_m64=1 ;; | |
185 | esac | |
186 | fi | |
187 | ||
188 | if test x"$target_cpu-$platform" = xsparc64-emu ; then | |
189 | target_m64=1 | |
190 | fi | |
191 | ||
192 | case "$target_os" in | |
193 | windows* | mingw32*) target_os=cygwin ;; | |
194 | esac | |
195 | ||
196 | # This normalizes the names, and creates a new variable ("host_kernel") | |
197 | # while at it, since the mapping is not always 1:1 (e.g. different OSes | |
198 | # using the same kernel type). | |
199 | case "$host_os" in | |
200 | gnu*) host_kernel=hurd ;; | |
201 | linux*) host_kernel=linux ;; | |
202 | freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;; | |
203 | netbsd*) host_kernel=netbsd ;; | |
204 | solaris*) host_kernel=illumos ;; | |
205 | darwin*) host_kernel=xnu ;; | |
206 | cygwin | windows* | mingw32*) host_kernel=windows ;; | |
207 | esac | |
208 | ||
209 | case "$host_os" in | |
210 | cygwin | windows* | mingw32*) have_exec=n ;; | |
211 | aros*) have_exec=n ;; | |
212 | *) have_exec=y;; | |
213 | esac | |
214 | ||
215 | case "$platform" in | |
216 | coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;; | |
217 | multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;; | |
218 | efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;; | |
219 | xen) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_XEN=1" ;; | |
220 | ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;; | |
221 | uboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_UBOOT=1" ;; | |
222 | qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;; | |
223 | pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;; | |
224 | emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;; | |
225 | loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1" ;; | |
226 | qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1" ;; | |
227 | arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;; | |
228 | esac | |
229 | if test x${target_cpu} = xmipsel ; then | |
230 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`" | |
231 | else | |
232 | machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`" | |
233 | fi | |
234 | ||
235 | case "${target_cpu}-$platform" in | |
236 | mips-arc) | |
237 | TARGET_LINK_ADDR=0x88200000 | |
238 | TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000 | |
239 | ;; | |
240 | mipsel-arc) | |
241 | TARGET_LINK_ADDR=0x80700000 | |
242 | TARGET_DECOMPRESSOR_LINK_ADDR=0x80600000 | |
243 | ;; | |
244 | mips*-qemu_mips | mips*-loongson) | |
245 | TARGET_DECOMPRESSOR_LINK_ADDR=0x80100000 | |
246 | ;; | |
247 | esac | |
248 | ||
249 | AC_SUBST(TARGET_LINK_ADDR) | |
250 | AC_SUBST(TARGET_DECOMPRESSOR_LINK_ADDR) | |
251 | ||
252 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS" | |
253 | ||
254 | AC_SUBST(host_cpu) | |
255 | AC_SUBST(host_os) | |
256 | AC_SUBST(host_kernel) | |
257 | ||
258 | AC_SUBST(target_cpu) | |
259 | AC_SUBST(platform) | |
260 | ||
261 | # Define default variables | |
262 | ||
263 | have_with_bootdir=n | |
264 | AC_ARG_WITH([bootdir], | |
265 | AS_HELP_STRING([--with-bootdir=DIR], | |
266 | [set the name of /boot directory [[guessed]]]), | |
267 | [have_with_bootdir=y], | |
268 | [have_with_bootdir=n]) | |
269 | if test x$have_with_bootdir = xy; then | |
270 | bootdirname="$with_bootdir" | |
271 | else | |
272 | case "$host_os" in | |
273 | netbsd* | openbsd*) | |
274 | # Because /boot is used for the boot block in NetBSD and OpenBSD, | |
275 | bootdirname='' ;; | |
276 | *) bootdirname='boot' ;; | |
277 | esac | |
278 | fi | |
279 | ||
280 | AC_SUBST(bootdirname) | |
281 | AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname", | |
282 | [Default boot directory name]") | |
283 | ||
284 | AC_ARG_WITH([grubdir], | |
285 | AS_HELP_STRING([--with-grubdir=DIR], | |
286 | [set the name of grub directory [[guessed]]]), | |
287 | [grubdirname="$with_grubdir"], | |
288 | [grubdirname="$PACKAGE"]) | |
289 | ||
290 | AC_SUBST(grubdirname) | |
291 | AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname", | |
292 | [Default grub directory name]) | |
293 | ||
294 | # | |
295 | # Checks for build programs. | |
296 | # | |
297 | ||
298 | # Although cmp is listed in the GNU Coding Standards as a command which | |
299 | # can used directly, OpenBSD lacks cmp in the default installation. | |
300 | AC_CHECK_PROGS([CMP], [cmp]) | |
301 | if test "x$CMP" = x; then | |
302 | AC_MSG_ERROR([cmp is not found]) | |
303 | fi | |
304 | ||
305 | AC_CHECK_PROGS([YACC], [bison]) | |
306 | if test "x$YACC" = x; then | |
307 | AC_MSG_ERROR([bison is not found]) | |
308 | fi | |
309 | ||
310 | AC_PROG_RANLIB | |
311 | AC_PROG_INSTALL | |
312 | AC_PROG_AWK | |
313 | AC_PROG_LEX | |
314 | AC_PROG_YACC | |
315 | AC_PROG_MAKE_SET | |
316 | AC_PROG_MKDIR_P | |
317 | AC_PROG_LN_S | |
318 | ||
319 | if test "x$LEX" = "x:"; then | |
320 | AC_MSG_ERROR([flex is not found]) | |
321 | else | |
322 | version=`$LEX --version | $AWK '{ split($2,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'` | |
323 | if test -n "$version" -a "$version" -ge 20535; then | |
324 | : | |
325 | else | |
326 | AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above]) | |
327 | fi | |
328 | fi | |
329 | ||
330 | # These are not a "must". | |
331 | AC_PATH_PROGS(MAKEINFO, makeinfo true) | |
332 | ||
333 | # | |
334 | # Checks for host programs. | |
335 | # | |
336 | ||
337 | AC_PROG_CC | |
338 | gl_EARLY | |
339 | AC_PROG_CXX | |
340 | AM_PROG_CC_C_O | |
341 | AM_PROG_AS | |
342 | ||
343 | # Must be GCC. | |
344 | test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required]) | |
345 | ||
346 | AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no) | |
347 | ||
348 | AC_GNU_SOURCE | |
349 | AM_GNU_GETTEXT([external]) | |
350 | AC_SYS_LARGEFILE | |
351 | ||
352 | # Identify characteristics of the host architecture. | |
353 | unset ac_cv_c_bigendian | |
354 | ||
355 | if test x"$target_cpu-$platform" = xsparc64-emu ; then | |
356 | CFLAGS="$CFLAGS -m64" | |
357 | HOST_CFLAGS="$HOST_CFLAGS -m64" | |
358 | fi | |
359 | ||
360 | CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" | |
361 | HOST_CPPFLAGS="$HOST_CPPFLAGS -D_FILE_OFFSET_BITS=64" | |
362 | ||
363 | AC_C_BIGENDIAN | |
364 | AC_CHECK_SIZEOF(void *) | |
365 | AC_CHECK_SIZEOF(long) | |
366 | ||
367 | case "$host_os" in | |
368 | cygwin | windows* | mingw32*) | |
369 | HOST_CPPFLAGS="$HOST_CPPFLAGS -DUNICODE=1 -D_WIN32_WINNT=0x0500" | |
370 | CPPFLAGS="$CPPFLAGS -DUNICODE=1 -D_WIN32_WINNT=0x0500" | |
371 | AC_CHECK_SIZEOF(TCHAR,,[#include <windows.h>]) | |
372 | ;; | |
373 | esac | |
374 | ||
375 | case "$host_os" in | |
376 | cygwin | windows* | mingw32* | aros*) | |
377 | ;; | |
378 | *) | |
379 | AC_CHECK_SIZEOF(off_t) | |
380 | test x"$ac_cv_sizeof_off_t" = x8 || AC_MSG_ERROR([Large file support is required]);; | |
381 | esac | |
382 | ||
383 | if test x$USE_NLS = xno; then | |
384 | HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext" | |
385 | fi | |
386 | ||
387 | if test "x$cross_compiling" = xyes; then | |
388 | AC_MSG_WARN([cannot generate manual pages while cross compiling]) | |
389 | else | |
390 | AC_PATH_PROG(HELP2MAN, help2man) | |
391 | fi | |
392 | ||
393 | # Check for functions and headers. | |
394 | AC_CHECK_FUNCS(posix_memalign memalign getextmntent) | |
395 | AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h) | |
396 | ||
397 | # glibc 2.25 still includes sys/sysmacros.h in sys/types.h but emits deprecation | |
398 | # warning which causes compilation failure later with -Werror. So use -Werror here | |
399 | # as well to force proper sys/sysmacros.h detection. | |
400 | SAVED_CFLAGS="$CFLAGS" | |
401 | CFLAGS="$HOST_CFLAGS -Werror" | |
402 | AC_HEADER_MAJOR | |
403 | CFLAGS="$SAVED_CFLAGS" | |
404 | ||
405 | AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default | |
406 | #include <sys/param.h> | |
407 | #include <sys/mount.h>]) | |
408 | ||
409 | AC_CHECK_MEMBERS([struct statfs.f_mntfromname],,,[$ac_includes_default | |
410 | #include <sys/param.h> | |
411 | #include <sys/mount.h>]) | |
412 | ||
413 | # For opendisk() and getrawpartition() on NetBSD. | |
414 | # Used in util/deviceiter.c and in util/hostdisk.c. | |
415 | AC_CHECK_HEADER([util.h], [ | |
416 | AC_CHECK_LIB([util], [opendisk], [ | |
417 | LIBUTIL="-lutil" | |
418 | AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used]) | |
419 | ]) | |
420 | AC_CHECK_LIB([util], [getrawpartition], [ | |
421 | LIBUTIL="-lutil" | |
422 | AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition() in -lutil can be used]) | |
423 | ]) | |
424 | ]) | |
425 | AC_SUBST([LIBUTIL]) | |
426 | ||
427 | AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [ | |
428 | SAVED_CFLAGS="$CFLAGS" | |
429 | CFLAGS="$HOST_CFLAGS -Wtrampolines -Werror" | |
430 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> | |
431 | int va_arg_func (int fixed, va_list args);]], [[]])], | |
432 | [grub_cv_host_cc_wtrampolines=yes], | |
433 | [grub_cv_host_cc_wtrampolines=no]) | |
434 | CFLAGS="$SAVED_CFLAGS" | |
435 | ]) | |
436 | ||
437 | if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then | |
438 | HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines" | |
439 | fi | |
440 | ||
441 | # | |
442 | # Check for host and build compilers. | |
443 | # | |
444 | HOST_CC=$CC | |
445 | AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc]) | |
446 | test -z "$BUILD_CC" && AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.]) | |
447 | BUILD_CPP="$BUILD_CC -E" | |
448 | ||
449 | case "$build_os" in | |
450 | haiku*) BUILD_LIBM= ;; | |
451 | *) BUILD_LIBM=-lm ;; | |
452 | esac | |
453 | ||
454 | dnl FIXME proper test seems to require too deep dive into Autoconf internals. | |
455 | dnl For now just list known platforms that we support. | |
456 | ||
457 | case "$build_os" in | |
458 | cygwin*|mingw32*|mingw64*) BUILD_EXEEXT=.exe ;; | |
459 | *) BUILD_EXEEXT= ;; | |
460 | esac | |
461 | AC_SUBST(BUILD_EXEEXT) | |
462 | ||
463 | # For gnulib. | |
464 | gl_INIT | |
465 | ||
466 | WARN_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 -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes" | |
467 | EXTRA_WARN_FLAGS="-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 -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2" | |
468 | ||
469 | HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS -Wcast-align" | |
470 | ||
471 | AC_CACHE_CHECK([which extra warnings work], [grub_cv_cc_w_extra_flags], [ | |
472 | SAVED_CFLAGS="$CFLAGS" | |
473 | grub_cv_cc_w_extra_flags= | |
474 | for x in $EXTRA_WARN_FLAGS; do | |
475 | CFLAGS="$HOST_CFLAGS $x -Werror" | |
476 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0]) | |
477 | if test x$flag = x1 ; then | |
478 | grub_cv_cc_w_extra_flags="$grub_cv_cc_w_extra_flags $x" | |
479 | fi | |
480 | done | |
481 | CFLAGS="$SAVED_CFLAGS" | |
482 | ]) | |
483 | ||
484 | HOST_CFLAGS="$HOST_CFLAGS $grub_cv_cc_w_extra_flags" | |
485 | ||
486 | # | |
487 | # Check for target programs. | |
488 | # | |
489 | ||
490 | # Find tools for the target. | |
491 | if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then | |
492 | tmp_ac_tool_prefix="$ac_tool_prefix" | |
493 | ac_tool_prefix=$target_alias- | |
494 | ||
495 | AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc], | |
496 | [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])]) | |
497 | AC_CHECK_TOOL(TARGET_OBJCOPY, objcopy) | |
498 | AC_CHECK_TOOL(TARGET_STRIP, strip) | |
499 | AC_CHECK_TOOL(TARGET_NM, nm) | |
500 | AC_CHECK_TOOL(TARGET_RANLIB, ranlib) | |
501 | ||
502 | ac_tool_prefix="$tmp_ac_tool_prefix" | |
503 | else | |
504 | if test "x$TARGET_CC" = x; then | |
505 | TARGET_CC=$CC | |
506 | fi | |
507 | AC_CHECK_TOOL(TARGET_OBJCOPY, objcopy) | |
508 | AC_CHECK_TOOL(TARGET_STRIP, strip) | |
509 | AC_CHECK_TOOL(TARGET_NM, nm) | |
510 | AC_CHECK_TOOL(TARGET_RANLIB, ranlib) | |
511 | fi | |
512 | ||
513 | AC_SUBST(HOST_CC) | |
514 | AC_SUBST(BUILD_CC) | |
515 | AC_SUBST(BUILD_CFLAGS) | |
516 | AC_SUBST(BUILD_CPPFLAGS) | |
517 | AC_SUBST(BUILD_LDFLAGS) | |
518 | AC_SUBST(TARGET_CC) | |
519 | AC_SUBST(TARGET_NM) | |
520 | AC_SUBST(TARGET_RANLIB) | |
521 | AC_SUBST(TARGET_STRIP) | |
522 | AC_SUBST(TARGET_OBJCOPY) | |
523 | ||
524 | # Test the C compiler for the target environment. | |
525 | tmp_CC="$CC" | |
526 | tmp_CFLAGS="$CFLAGS" | |
527 | tmp_LDFLAGS="$LDFLAGS" | |
528 | tmp_CPPFLAGS="$CPPFLAGS" | |
529 | tmp_LIBS="$LIBS" | |
530 | CC="$TARGET_CC" | |
531 | CFLAGS="$TARGET_CFLAGS" | |
532 | CPPFLAGS="$TARGET_CPPFLAGS" | |
533 | LDFLAGS="$TARGET_LDFLAGS" | |
534 | LIBS="" | |
535 | ||
536 | # debug flags. | |
537 | TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations" | |
538 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g" | |
539 | ||
540 | if test "x$target_cpu" != xi386 && test "x$target_cpu" != xx86_64; then | |
541 | TARGET_CFLAGS="$TARGET_CFLAGS -Wcast-align" | |
542 | fi | |
543 | ||
544 | TARGET_CC_VERSION="$(LC_ALL=C $TARGET_CC --version | head -n1)" | |
545 | ||
546 | AC_CACHE_CHECK([which extra warnings work], [grub_cv_target_cc_w_extra_flags], [ | |
547 | LDFLAGS="$TARGET_LDFLAGS -nostdlib -static" | |
548 | ||
549 | grub_cv_target_cc_w_extra_flags= | |
550 | for x in $EXTRA_WARN_FLAGS; do | |
551 | CFLAGS="$TARGET_CFLAGS $x -Werror" | |
552 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
553 | asm (".globl start; start:"); | |
554 | void __main (void); | |
555 | void __main (void) {} | |
556 | int main (void); | |
557 | ]], [[]])], [flag=1], [flag=0]) | |
558 | if test x$flag = x1 ; then | |
559 | grub_cv_target_cc_w_extra_flags="$grub_cv_target_cc_w_extra_flags $x" | |
560 | fi | |
561 | done | |
562 | ]) | |
563 | ||
564 | TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_w_extra_flags" | |
565 | ||
566 | AC_CACHE_CHECK([if compiling with clang], [grub_cv_cc_target_clang], | |
567 | [ | |
568 | CFLAGS="$TARGET_CFLAGS" | |
569 | AC_COMPILE_IFELSE( | |
570 | [AC_LANG_PROGRAM([], [[ | |
571 | #ifdef __clang__ | |
572 | #error "is clang" | |
573 | #endif | |
574 | ]])], | |
575 | [grub_cv_cc_target_clang=no], [grub_cv_cc_target_clang=yes])]) | |
576 | ||
577 | if test x$target_cpu = xpowerpc -o x$target_cpu = xmips; then | |
578 | AC_CACHE_CHECK([for options to get big-endian compilation], grub_cv_target_cc_big_endian, [ | |
579 | grub_cv_target_cc_big_endian=no | |
580 | for cand in "-target $target_cpu -Wl,-EB" "-target $target_cpu" \ | |
581 | "-target $target_cpu-linux-gnu -Wl,-EB" "-target $target_cpu-linux-gnu" \ | |
582 | "-EB" "-mbig-endian"; do | |
583 | if test x"$grub_cv_target_cc_big_endian" != xno ; then | |
584 | break | |
585 | fi | |
586 | CFLAGS="$TARGET_CFLAGS $cand -Werror" | |
587 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
588 | #if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__ORDER_BIG_ENDIAN__ != __BYTE_ORDER__) | |
589 | #error still little endian | |
590 | #endif | |
591 | asm (".globl start; start:"); | |
592 | asm (".globl _start; _start:"); | |
593 | asm (".globl __start; __start:"); | |
594 | void __main (void); | |
595 | void __main (void) {} | |
596 | int main (void); | |
597 | ]], [[]])], | |
598 | [grub_cv_target_cc_big_endian="$cand"], []) | |
599 | done | |
600 | ]) | |
601 | ||
602 | if test x"$grub_cv_target_cc_big_endian" = xno ; then | |
603 | AC_MSG_ERROR([could not force big-endian]) | |
604 | fi | |
605 | ||
606 | skip_linkflags="$(echo "$grub_cv_target_cc_big_endian"|sed 's@-Wl,-EB@@')" | |
607 | ||
608 | TARGET_CFLAGS="$TARGET_CFLAGS $skip_linkflags" | |
609 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS $skip_linkflags" | |
610 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS $skip_linkflags" | |
611 | TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_big_endian" | |
612 | elif test x$target_cpu = xmipsel; then | |
613 | AC_CACHE_CHECK([for options to get little-endian compilation], grub_cv_target_cc_little_endian, [ | |
614 | grub_cv_target_cc_little_endian=no | |
615 | for cand in "-target $target_cpu -Wl,-EL" "-target $target_cpu" \ | |
616 | "-target $target_cpu-linux-gnu -Wl,-EL" "-target $target_cpu-linux-gnu" \ | |
617 | "-EL"; do | |
618 | if test x"$grub_cv_target_cc_little_endian" != xno ; then | |
619 | break | |
620 | fi | |
621 | CFLAGS="$TARGET_CFLAGS $cand -Werror" | |
622 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
623 | #if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__ORDER_BIG_ENDIAN__ == __BYTE_ORDER__) | |
624 | #error still big endian | |
625 | #endif | |
626 | asm (".globl start; start:"); | |
627 | asm (".globl _start; _start:"); | |
628 | asm (".globl __start; __start:"); | |
629 | void __main (void); | |
630 | void __main (void) {} | |
631 | int main (void); | |
632 | ]], [[]])], | |
633 | [grub_cv_target_cc_little_endian="$cand"], []) | |
634 | done | |
635 | ]) | |
636 | ||
637 | if test x"$grub_cv_target_cc_little_endian" = xno ; then | |
638 | AC_MSG_ERROR([could not force little-endian]) | |
639 | fi | |
640 | ||
641 | skip_linkflags="$(echo "$grub_cv_target_cc_little_endian"|sed 's@-Wl,-EL@@')" | |
642 | ||
643 | TARGET_CFLAGS="$TARGET_CFLAGS $skip_linkflags" | |
644 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS $skip_linkflags" | |
645 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS $skip_linkflags" | |
646 | TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_little_endian" | |
647 | fi | |
648 | ||
649 | # GRUB code is N32-compliant but it's experimental and we would prefer to | |
650 | # avoid having too much variety when it doesn't result in any real improvement. | |
651 | # Moreover N64 isn't supported. | |
652 | if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then | |
653 | AC_CACHE_CHECK([for options to force MIPS o32 ABI], grub_cv_target_cc_mips_o32_abi, [ | |
654 | grub_cv_target_cc_mips_o32_abi=no | |
655 | for arg in "" "-mabi=32" "-target $target_cpu -mabi=32" ; do | |
656 | if test x"$grub_cv_target_cc_mips_o32_abi" != xno ; then | |
657 | break | |
658 | fi | |
659 | CFLAGS="$TARGET_CFLAGS $arg -Werror" | |
660 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
661 | #if !defined(_ABIO32) || !defined(_MIPS_SIM) || (_MIPS_SIM != _ABIO32) | |
662 | #error not o32 ABI | |
663 | #endif | |
664 | asm (".globl start; start:"); | |
665 | asm (".globl _start; _start:"); | |
666 | asm (".globl __start; __start:"); | |
667 | void __main (void); | |
668 | void __main (void) {} | |
669 | int main (void); | |
670 | ]], [[]])], | |
671 | [grub_cv_target_cc_mips_o32_abi="$arg"], []) | |
672 | done | |
673 | ]) | |
674 | ||
675 | if test x"$grub_cv_target_cc_mips_o32_abi" = xno ; then | |
676 | AC_MSG_ERROR([could not force MIPS o32 ABI]) | |
677 | fi | |
678 | ||
679 | TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mips_o32_abi" | |
680 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_mips_o32_abi" | |
681 | fi | |
682 | ||
683 | AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [ | |
684 | test_program= | |
685 | case "x$target_cpu-$platform" in | |
686 | xmips-* | xmipsel-*) | |
687 | test_program=mips | |
688 | ;; | |
689 | xi386-pc) | |
690 | test_program=i386-pc | |
691 | ;; | |
692 | xi386-* | xx86_64-*) | |
693 | test_program=i386 | |
694 | ;; | |
695 | xpowerpc-* | xsparc64-* | xarm-*) | |
696 | test_program=$target_cpu | |
697 | ;; | |
698 | esac | |
699 | if test x"$test_program" = x ; then | |
700 | grub_cv_cc_target_asm_compile= | |
701 | else | |
702 | found=no | |
703 | for arg in "" "-no-integrated-as"; do | |
704 | cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S" | |
705 | echo "Running $cmdline" >&AS_MESSAGE_LOG_FD | |
706 | if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then | |
707 | grub_cv_cc_target_asm_compile="$arg" | |
708 | found=yes | |
709 | break | |
710 | fi | |
711 | done | |
712 | if test x"$found" = xno ; then | |
713 | AC_MSG_ERROR([could not compile assembly]) | |
714 | fi | |
715 | fi | |
716 | ]) | |
717 | ||
718 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_cc_target_asm_compile" | |
719 | ||
720 | if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then | |
721 | TARGET_CFLAGS="$TARGET_CFLAGS -march=i386" | |
722 | fi | |
723 | ||
724 | if test "x$target_m32" = x1; then | |
725 | # Force 32-bit mode. | |
726 | TARGET_CFLAGS="$TARGET_CFLAGS -m32" | |
727 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32" | |
728 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32" | |
729 | TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" | |
730 | TARGET_MODULE_FORMAT="elf32" | |
731 | fi | |
732 | ||
733 | if test "x$target_m64" = x1; then | |
734 | # Force 64-bit mode. | |
735 | TARGET_CFLAGS="$TARGET_CFLAGS -m64" | |
736 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64" | |
737 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64" | |
738 | TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" | |
739 | TARGET_MODULE_FORMAT="elf64" | |
740 | fi | |
741 | ||
742 | if test "x$grub_cv_cc_target_clang" = xno && test "x$target_cpu" = xi386 && test "x$platform" != xemu && test "x$platform" != xefi; then | |
743 | TARGET_CFLAGS="$TARGET_CFLAGS -mrtd -mregparm=3" | |
744 | fi | |
745 | ||
746 | # on mips redirect cache flushing function to non-existant one. | |
747 | if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then | |
748 | AC_CACHE_CHECK([whether -mflush-func=grub_red_herring works], [grub_cv_cc_mflush_func], [ | |
749 | CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring -Werror" | |
750 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
751 | [grub_cv_cc_mflush_func=yes], | |
752 | [grub_cv_cc_mflush_func=no]) | |
753 | ]) | |
754 | ||
755 | if test "x$grub_cv_cc_mflush_func" = xyes; then | |
756 | TARGET_CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring" | |
757 | fi | |
758 | fi | |
759 | ||
760 | ||
761 | # Force no alignment to save space on i386. | |
762 | if test "x$target_cpu" = xi386; then | |
763 | AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ | |
764 | CFLAGS="$TARGET_CFLAGS -falign-loops=1 -Werror" | |
765 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
766 | [grub_cv_cc_falign_loop=yes], | |
767 | [grub_cv_cc_falign_loop=no]) | |
768 | ]) | |
769 | ||
770 | AC_CACHE_CHECK([whether -malign-loops works], [grub_cv_cc_malign_loop], [ | |
771 | CFLAGS="$TARGET_CFLAGS -malign-loops=1 -Werror" | |
772 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
773 | [grub_cv_cc_malign_loop=yes], | |
774 | [grub_cv_cc_malign_loop=no]) | |
775 | ]) | |
776 | ||
777 | if test "x$grub_cv_cc_falign_loop" = xyes; then | |
778 | TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" | |
779 | elif test "x$grub_cv_cc_malign_loop" = xyes; then | |
780 | TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" | |
781 | fi | |
782 | fi | |
783 | ||
784 | AC_CACHE_CHECK([whether -freg-struct-return works], [grub_cv_cc_freg_struct_return], [ | |
785 | CFLAGS="$TARGET_CFLAGS -freg-struct-return -Werror" | |
786 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
787 | [grub_cv_cc_freg_struct_return=yes], | |
788 | [grub_cv_cc_freg_struct_return=no]) | |
789 | ]) | |
790 | ||
791 | if test "x$grub_cv_cc_freg_struct_return" = xyes; then | |
792 | TARGET_CFLAGS="$TARGET_CFLAGS -freg-struct-return" | |
793 | fi | |
794 | ||
795 | if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then | |
796 | # Some toolchains enable these features by default, but they need | |
797 | # registers that aren't set up properly in GRUB. | |
798 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow" | |
799 | fi | |
800 | ||
801 | # GRUB doesn't use float or doubles at all. Yet some toolchains may decide | |
802 | # that floats are a good fit to run instead of what's written in the code. | |
803 | # Given that floating point unit is disabled (if present to begin with) | |
804 | # when GRUB is running which may result in various hard crashes. | |
805 | if test x"$platform" != xemu ; then | |
806 | AC_CACHE_CHECK([for options to get soft-float], grub_cv_target_cc_soft_float, [ | |
807 | grub_cv_target_cc_soft_float=no | |
808 | if test "x$target_cpu" = xarm64; then | |
809 | CFLAGS="$TARGET_CFLAGS -mgeneral-regs-only -Werror" | |
810 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
811 | [grub_cv_target_cc_soft_float="-mgeneral-regs-only"], []) | |
812 | fi | |
813 | if test "x$target_cpu" = xia64; then | |
814 | CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror" | |
815 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
816 | [grub_cv_target_cc_soft_float="-mno-inline-float-divide -mno-inline-sqrt"], []) | |
817 | fi | |
818 | for cand in "-msoft-float -Xclang -msoft-float -Xclang -no-implicit-float" \ | |
819 | "-Xclang -msoft-float -Xclang -no-implicit-float" \ | |
820 | "-Xclang -msoft-float" "-msoft-float"; do | |
821 | if test x"$grub_cv_target_cc_soft_float" != xno ; then | |
822 | break | |
823 | fi | |
824 | CFLAGS="$TARGET_CFLAGS $cand -Werror" | |
825 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
826 | [grub_cv_target_cc_soft_float="$cand"], []) | |
827 | done | |
828 | ]) | |
829 | ||
830 | if test x"$grub_cv_target_cc_soft_float" = xno ; then | |
831 | AC_MSG_ERROR([could not force soft-float]) | |
832 | fi | |
833 | ||
834 | case x"$grub_cv_target_cc_soft_float" in | |
835 | x*"-Xclang"*) | |
836 | # A trick so that clang doesn't see it on link stаge | |
837 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_soft_float" | |
838 | ;; | |
839 | *) | |
840 | TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_soft_float" | |
841 | ;; | |
842 | esac | |
843 | TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float" | |
844 | ||
845 | fi | |
846 | ||
847 | if test x"$target_cpu" = xsparc64 ; then | |
848 | AC_CACHE_CHECK([for options to reserve application registers], grub_cv_target_cc_mno_app_regs, [ | |
849 | grub_cv_target_cc_mno_app_regs=no | |
850 | for cand in "-mllvm -sparc-reserve-app-registers" \ | |
851 | "-mno-app-regs"; do | |
852 | if test x"$grub_cv_target_cc_mno_app_regs" != xno ; then | |
853 | break | |
854 | fi | |
855 | CFLAGS="$TARGET_CFLAGS $cand -Werror" | |
856 | CPPFLAGS="$TARGET_CPPFLAGS" | |
857 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
858 | [grub_cv_target_cc_mno_app_regs="$cand"], []) | |
859 | done | |
860 | ]) | |
861 | ||
862 | if test x"$grub_cv_target_cc_mno_app_regs" = xno ; then | |
863 | AC_MSG_ERROR([could not reserve application registers]) | |
864 | fi | |
865 | if test x"$grub_cv_target_cc_mno_app_regs" = x"-mllvm -sparc-reserve-app-registers" ; then | |
866 | # A trick so that clang doesn't see it on link stаge | |
867 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_mno_app_regs" | |
868 | else | |
869 | TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mno_app_regs" | |
870 | fi | |
871 | ||
872 | AC_CACHE_CHECK([for no-relax options], grub_cv_target_cc_mno_relax, [ | |
873 | grub_cv_target_cc_mno_relax=no | |
874 | for cand in "-mno-relax" "-Wl,--no-relax"; do | |
875 | if test x"$grub_cv_target_cc_mno_relax" != xno ; then | |
876 | break | |
877 | fi | |
878 | LDFLAGS="$TARGET_LDFLAGS $cand -nostdlib -static" | |
879 | CFLAGS="$TARGET_CFLAGS -Werror" | |
880 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
881 | asm (".globl start; start:"); | |
882 | void __main (void); | |
883 | void __main (void) {} | |
884 | int main (void); | |
885 | ]], [[]])], [grub_cv_target_cc_mno_relax="$cand"], []) | |
886 | done | |
887 | ]) | |
888 | LDFLAGS="$TARGET_LDFLAGS" | |
889 | CFLAGS="$TARGET_CFLAGS" | |
890 | ||
891 | if test x"$grub_cv_target_cc_mno_relax" = xno ; then | |
892 | AC_MSG_ERROR([could not find no-relax options]) | |
893 | fi | |
894 | TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_mno_relax" | |
895 | fi | |
896 | ||
897 | # By default, GCC 4.4 generates .eh_frame sections containing unwind | |
898 | # information in some cases where it previously did not. GRUB doesn't need | |
899 | # these and they just use up vital space. Restore the old compiler | |
900 | # behaviour. | |
901 | AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [ | |
902 | CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" | |
903 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
904 | [grub_cv_cc_fno_dwarf2_cfi_asm=yes], | |
905 | [grub_cv_cc_fno_dwarf2_cfi_asm=no]) | |
906 | ]) | |
907 | ||
908 | if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then | |
909 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" | |
910 | fi | |
911 | ||
912 | if test x"$target_os" = xcygwin; then | |
913 | AC_CACHE_CHECK([whether option -fno-reorder-functions works], grub_cv_cc_no_reorder_functions, [ | |
914 | CFLAGS="$TARGET_CFLAGS -fno-reorder-functions" | |
915 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
916 | [grub_cv_cc_no_reorder_functions=yes], | |
917 | [grub_cv_cc_no_reorder_functions=no]) | |
918 | ]) | |
919 | fi | |
920 | ||
921 | if test x"$target_os" = xcygwin && test "x$grub_cv_cc_no_reorder_functions" = xyes; then | |
922 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-reorder-functions" | |
923 | fi | |
924 | ||
925 | AC_CACHE_CHECK([whether -mno-stack-arg-probe works], [grub_cv_cc_mno_stack_arg_probe], [ | |
926 | CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" | |
927 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
928 | [grub_cv_cc_mno_stack_arg_probe=yes], | |
929 | [grub_cv_cc_mno_stack_arg_probe=no]) | |
930 | ]) | |
931 | ||
932 | if test "x$grub_cv_cc_mno_stack_arg_probe" = xyes; then | |
933 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" | |
934 | fi | |
935 | ||
936 | ||
937 | # By default, GCC 4.6 generates .eh_frame sections containing unwind | |
938 | # information in some cases where it previously did not. GRUB doesn't need | |
939 | # these and they just use up vital space. Restore the old compiler | |
940 | # behaviour. | |
941 | AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [ | |
942 | CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" | |
943 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
944 | [grub_cv_cc_fno_asynchronous_unwind_tables=yes], | |
945 | [grub_cv_cc_fno_asynchronous_unwind_tables=no]) | |
946 | ]) | |
947 | ||
948 | if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then | |
949 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" | |
950 | fi | |
951 | ||
952 | AC_CACHE_CHECK([whether -fno-unwind-tables works], [grub_cv_cc_fno_unwind_tables], [ | |
953 | CFLAGS="$TARGET_CFLAGS -fno-unwind-tables" | |
954 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
955 | [grub_cv_cc_fno_unwind_tables=yes], | |
956 | [grub_cv_cc_fno_unwind_tables=no]) | |
957 | ]) | |
958 | ||
959 | if test "x$grub_cv_cc_fno_unwind_tables" = xyes; then | |
960 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-unwind-tables" | |
961 | fi | |
962 | ||
963 | ||
964 | CFLAGS="$TARGET_CFLAGS" | |
965 | ||
966 | ||
967 | if test x"$platform" = xemu ; then | |
968 | TARGET_OBJ2ELF= | |
969 | grub_cv_target_cc_link_format= | |
970 | case "$host_os" in | |
971 | *darwin* | *mac*) | |
972 | grub_cv_target_cc_link_format="-arch,${target_cpu}" | |
973 | TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format" | |
974 | ;; | |
975 | *windows* | *cygwin* | *mingw*) | |
976 | if test x${target_cpu} = xi386 ; then | |
977 | grub_cv_target_cc_link_format=-mi386pe | |
978 | TARGET_OBJ2ELF='./build-grub-pe2elf$(BUILD_EXEEXT)' | |
979 | fi | |
980 | if test x${target_cpu} = xx86_64 ; then | |
981 | grub_cv_target_cc_link_format=-mi386pep | |
982 | TARGET_OBJ2ELF='./build-grub-pep2elf$(BUILD_EXEEXT)' | |
983 | fi | |
984 | TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format" | |
985 | ;; | |
986 | esac | |
987 | elif test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then | |
988 | AC_CACHE_CHECK([for target linking format], [grub_cv_target_cc_link_format], [ | |
989 | grub_cv_target_cc_link_format=unknown | |
990 | for format in -melf_${target_cpu} -melf_${target_cpu}_fbsd -melf_${target_cpu}_obsd -melf_${target_cpu}_haiku -mi386pe -mi386pep -arch,${target_cpu}; do | |
991 | if test x${target_cpu} != xi386 && test x$format = x-mi386pe; then | |
992 | continue | |
993 | fi | |
994 | if test x${target_cpu} != xx86_64 && test x$format = x-mi386pep; then | |
995 | continue | |
996 | fi | |
997 | CFLAGS="$TARGET_CFLAGS" | |
998 | LDFLAGS="$TARGET_LDFLAGS -Wl,$format -nostdlib -static" | |
999 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1000 | asm (".globl start; start:"); | |
1001 | asm (".globl _start; _start:"); | |
1002 | asm (".globl __start; __start:"); | |
1003 | void __main (void); | |
1004 | void __main (void) {} | |
1005 | ]], [[]])], [flag=1], [flag=0]) | |
1006 | if test x"$flag" = x1; then | |
1007 | grub_cv_target_cc_link_format="$format" | |
1008 | break | |
1009 | fi | |
1010 | done]) | |
1011 | if test x"$grub_cv_target_cc_link_format" = xunknown; then | |
1012 | AC_MSG_ERROR([no suitable link format found]) | |
1013 | fi | |
1014 | TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,$grub_cv_target_cc_link_format" | |
1015 | if test x"$grub_cv_target_cc_link_format" = x-mi386pe ; then | |
1016 | TARGET_OBJ2ELF='./build-grub-pe2elf$(BUILD_EXEEXT)' | |
1017 | fi | |
1018 | if test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then | |
1019 | TARGET_OBJ2ELF='./build-grub-pep2elf$(BUILD_EXEEXT)' | |
1020 | fi | |
1021 | fi | |
1022 | ||
1023 | if test x$grub_cv_target_cc_link_format = x-arch,i386 || test x$grub_cv_target_cc_link_format = x-arch,x86_64; then | |
1024 | TARGET_APPLE_LINKER=1 | |
1025 | AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [objconv], []) | |
1026 | if test "x$TARGET_OBJCONV" = x ; then | |
1027 | AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [./objconv], [], [.]) | |
1028 | fi | |
1029 | if test "x$TARGET_OBJCONV" = x ; then | |
1030 | AC_MSG_ERROR([objconv not found which is required when building with apple compiler]) | |
1031 | fi | |
1032 | TARGET_IMG_LDSCRIPT= | |
1033 | TARGET_IMG_CFLAGS="-static" | |
1034 | TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20' | |
1035 | TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20' | |
1036 | TARGET_IMG_BASE_LDOPT="-Wl,-image_base" | |
1037 | TARGET_LDFLAGS_OLDMAGIC="" | |
1038 | elif test x$grub_cv_target_cc_link_format = x-mi386pe || test x$grub_cv_target_cc_link_format = x-mi386pep ; then | |
1039 | TARGET_APPLE_LINKER=0 | |
1040 | TARGET_LDFLAGS_OLDMAGIC="-Wl,-N" | |
1041 | TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/i386-cygwin-img-ld.sc" | |
1042 | TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" | |
1043 | TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/i386-cygwin-img-ld.sc" | |
1044 | TARGET_IMG_BASE_LDOPT="-Wl,-Ttext" | |
1045 | TARGET_IMG_CFLAGS= | |
1046 | else | |
1047 | TARGET_APPLE_LINKER=0 | |
1048 | TARGET_LDFLAGS_OLDMAGIC="-Wl,-N" | |
1049 | TARGET_IMG_LDSCRIPT= | |
1050 | TARGET_IMG_LDFLAGS='-Wl,-N' | |
1051 | TARGET_IMG_LDFLAGS_AC='-Wl,-N' | |
1052 | TARGET_IMG_BASE_LDOPT="-Wl,-Ttext" | |
1053 | TARGET_IMG_CFLAGS= | |
1054 | fi | |
1055 | ||
1056 | CFLAGS="$TARGET_CFLAGS" | |
1057 | ||
1058 | AC_ARG_ENABLE([efiemu], | |
1059 | [AS_HELP_STRING([--enable-efiemu], | |
1060 | [build and install the efiemu runtimes (default=guessed)])]) | |
1061 | if test x"$enable_efiemu" = xno ; then | |
1062 | efiemu_excuse="explicitly disabled" | |
1063 | fi | |
1064 | ||
1065 | if test x"$grub_cv_target_cc_link_format" = x-mi386pe || test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then | |
1066 | efiemu_excuse="not available on cygwin" | |
1067 | fi | |
1068 | if test x"$target_cpu" != xi386 ; then | |
1069 | efiemu_excuse="only available on i386" | |
1070 | fi | |
1071 | if test x"$platform" = xefi ; then | |
1072 | efiemu_excuse="not available on efi" | |
1073 | fi | |
1074 | ||
1075 | if test x"$efiemu_excuse" = x ; then | |
1076 | AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ | |
1077 | CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" | |
1078 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
1079 | [grub_cv_cc_efiemu=yes], | |
1080 | [grub_cv_cc_efiemu=no]) | |
1081 | ]) | |
1082 | if test x$grub_cv_cc_efiemu = xno; then | |
1083 | efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib" | |
1084 | fi | |
1085 | fi | |
1086 | if test x"$efiemu_excuse" = x ; then | |
1087 | AC_CACHE_CHECK([for efiemu64 linking format], [grub_cv_target_cc_efiemu64_link_format], [ | |
1088 | grub_cv_target_cc_efiemu64_link_format=unknown | |
1089 | for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd -melf_x86_64_haiku -arch,x86_64; do | |
1090 | CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" | |
1091 | LDFLAGS="-m64 -Wl,$format -nostdlib -static" | |
1092 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |
1093 | asm (".globl start; start:"); | |
1094 | asm (".globl _start; _start:"); | |
1095 | asm (".globl __start; __start:"); | |
1096 | void __main (void); | |
1097 | void __main (void) {} | |
1098 | ]], [[]])], [flag=1], [flag=0]) | |
1099 | if test x"$flag" = x1; then | |
1100 | grub_cv_target_cc_efiemu64_link_format="$format" | |
1101 | break | |
1102 | fi | |
1103 | done]) | |
1104 | if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then | |
1105 | efiemu_excuse="no suitable link format for efiemu64 found" | |
1106 | else | |
1107 | EFIEMU64_LINK_FORMAT="-Wl,$grub_cv_target_cc_efiemu64_link_format" | |
1108 | fi | |
1109 | fi | |
1110 | if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then | |
1111 | AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled ($efiemu_excuse)]) | |
1112 | fi | |
1113 | if test x"$efiemu_excuse" = x ; then | |
1114 | enable_efiemu=yes | |
1115 | else | |
1116 | enable_efiemu=no | |
1117 | fi | |
1118 | AC_SUBST([enable_efiemu]) | |
1119 | AC_SUBST([EFIEMU64_LINK_FORMAT]) | |
1120 | ||
1121 | CFLAGS="$TARGET_CFLAGS" | |
1122 | ||
1123 | AC_SUBST(TARGET_LDFLAGS_OLDMAGIC) | |
1124 | ||
1125 | ||
1126 | LDFLAGS="$TARGET_LDFLAGS" | |
1127 | ||
1128 | if test "$target_cpu" = x86_64 || test "$target_cpu" = sparc64 ; then | |
1129 | # Use large model to support 4G memory | |
1130 | AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ | |
1131 | CFLAGS="$TARGET_CFLAGS -mcmodel=large" | |
1132 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
1133 | [grub_cv_cc_mcmodel=yes], | |
1134 | [grub_cv_cc_mcmodel=no]) | |
1135 | ]) | |
1136 | if test "x$grub_cv_cc_mcmodel" = xyes; then | |
1137 | TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large" | |
1138 | elif test "$target_cpu" = sparc64; then | |
1139 | TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=medany" | |
1140 | fi | |
1141 | fi | |
1142 | ||
1143 | if test "$target_cpu"-"$platform" = x86_64-efi; then | |
1144 | # EFI writes to stack below %rsp, we must not use the red zone | |
1145 | AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [ | |
1146 | CFLAGS="$TARGET_CFLAGS -mno-red-zone" | |
1147 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
1148 | [grub_cv_cc_no_red_zone=yes], | |
1149 | [grub_cv_cc_no_red_zone=no]) | |
1150 | ]) | |
1151 | if test "x$grub_cv_cc_no_red_zone" = xno; then | |
1152 | AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc]) | |
1153 | fi | |
1154 | ||
1155 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone" | |
1156 | fi | |
1157 | ||
1158 | if test "x$target_cpu" = xarm; then | |
1159 | AC_CACHE_CHECK([for options to disable movt and movw], grub_cv_target_cc_mno_movt, [ | |
1160 | grub_cv_target_cc_mno_movt=no | |
1161 | for cand in "-mno-movt" \ | |
1162 | "-mllvm -arm-use-movt=0"; do | |
1163 | if test x"$grub_cv_target_cc_mno_movt" != xno ; then | |
1164 | break | |
1165 | fi | |
1166 | CFLAGS="$TARGET_CFLAGS $cand -Werror" | |
1167 | CPPFLAGS="$TARGET_CPPFLAGS" | |
1168 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
1169 | [grub_cv_target_cc_mno_movt="$cand"], []) | |
1170 | done | |
1171 | ]) | |
1172 | ||
1173 | if test x"$grub_cv_target_cc_mno_movt" != xno ; then | |
1174 | # A trick so that clang doesn't see it on link stage | |
1175 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_mno_movt" | |
1176 | fi | |
1177 | AC_CACHE_CHECK([whether option -mthumb-interwork works], grub_cv_cc_mthumb_interwork, [ | |
1178 | CFLAGS="$TARGET_CFLAGS -mthumb-interwork -Werror" | |
1179 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
1180 | [grub_cv_cc_mthumb_interwork=yes], | |
1181 | [grub_cv_cc_mthumb_interwork=no]) | |
1182 | ]) | |
1183 | if test "x$grub_cv_cc_mthumb_interwork" = xyes; then | |
1184 | TARGET_CFLAGS="$TARGET_CFLAGS -mthumb-interwork" | |
1185 | # Clang defaults to thumb interworking | |
1186 | elif test "x$grub_cv_cc_target_clang" = xno ; then | |
1187 | AC_MSG_ERROR([your compiler doesn't support -mthumb-interwork]) | |
1188 | fi | |
1189 | fi | |
1190 | ||
1191 | AC_CACHE_CHECK([whether option -Qn works], grub_cv_target_cc_qn, [ | |
1192 | CFLAGS="$TARGET_CFLAGS -Qn -Werror" | |
1193 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | |
1194 | [grub_cv_target_cc_qn=yes], | |
1195 | [grub_cv_target_cc_qn=no])]) | |
1196 | if test "x$grub_cv_target_cc_qn" = xyes; then | |
1197 | TARGET_CFLAGS="$TARGET_CFLAGS -Qn" | |
1198 | fi | |
1199 | ||
1200 | # | |
1201 | # Compiler features. | |
1202 | # | |
1203 | ||
1204 | CFLAGS="$TARGET_CFLAGS" | |
1205 | ||
1206 | # Position independent executable. | |
1207 | grub_CHECK_PIE | |
1208 | grub_CHECK_NO_PIE | |
1209 | grub_CHECK_NO_PIE_ONEWORD | |
1210 | grub_CHECK_LINK_PIE | |
1211 | [# Need that, because some distributions ship compilers that include | |
1212 | # `-fPIE' or '-fpie' and '-pie' in the default specs. | |
1213 | if [ x"$pie_possible" = xyes ]; then | |
1214 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie" | |
1215 | fi | |
1216 | ||
1217 | if [ x"$link_nopie_needed" = xyes ] || [ x"$pie_possible" = xyes ]; then | |
1218 | if [ x"$nopie_possible" = xyes ]; then | |
1219 | TARGET_LDFLAGS="$TARGET_LDFLAGS -no-pie" | |
1220 | fi | |
1221 | if [ x"$nopie_oneword_possible" = xyes ]; then | |
1222 | TARGET_LDFLAGS="$TARGET_LDFLAGS -nopie" | |
1223 | fi | |
1224 | fi] | |
1225 | ||
1226 | CFLAGS="$TARGET_CFLAGS" | |
1227 | LDFLAGS="$TARGET_LDFLAGS" | |
1228 | ||
1229 | # Position independent executable. | |
1230 | grub_CHECK_PIC | |
1231 | [# On most platforms we don't want PIC as it only makes relocations harder | |
1232 | # and code less efficient. On mips we want to have one got table per module | |
1233 | # and reload $gp in every function. | |
1234 | # GCC implements it using symbol __gnu_local_gp in non-PIC as well. | |
1235 | # However with clang we need PIC for this reloading to happen. | |
1236 | # With arm64 we need relocations that are in some way representable in | |
1237 | # PE as we need to support arm64-efi. Without -fPIC clang generates | |
1238 | # movk's which aren't representable. | |
1239 | # Since default varies across dictributions use either -fPIC or -fno-PIC | |
1240 | # explicitly. | |
1241 | if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel || test x$target_cpu = xarm64 ) && test "x$grub_cv_cc_target_clang" = xyes ; then | |
1242 | TARGET_CFLAGS="$TARGET_CFLAGS -fPIC" | |
1243 | elif [ x"$pic_possible" = xyes ]; then | |
1244 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC" | |
1245 | fi] | |
1246 | ||
1247 | CFLAGS="$TARGET_CFLAGS" | |
1248 | ||
1249 | # Smashing stack protector. | |
1250 | grub_CHECK_STACK_PROTECTOR | |
1251 | # Need that, because some distributions ship compilers that include | |
1252 | # `-fstack-protector' in the default specs. | |
1253 | if test "x$ssp_possible" = xyes; then | |
1254 | TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector" | |
1255 | fi | |
1256 | ||
1257 | CFLAGS="$TARGET_CFLAGS" | |
1258 | ||
1259 | grub_CHECK_STACK_ARG_PROBE | |
1260 | # Cygwin's GCC uses alloca() to probe the stackframe on static | |
1261 | # stack allocations above some threshold. | |
1262 | if test x"$sap_possible" = xyes; then | |
1263 | TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" | |
1264 | fi | |
1265 | ||
1266 | CFLAGS="$TARGET_CFLAGS" | |
1267 | ||
1268 | # -mno-unaligned-access -mstrict-align | |
1269 | if test "$target_cpu" = arm; then | |
1270 | AC_CACHE_CHECK([for compile options to get strict alignment], [grub_cv_target_cc_strict_align], [ | |
1271 | grub_cv_target_cc_strict_align= | |
1272 | for arg in -mno-unaligned-access "-Xclang -mstrict-align" -mstrict-align; do | |
1273 | CFLAGS="$TARGET_CFLAGS $arg -Werror" | |
1274 | LDFLAGS="$TARGET_LDFLAGS" | |
1275 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [flag=1], [flag=0]) | |
1276 | if test x"$flag" = x1; then | |
1277 | grub_cv_target_cc_strict_align="$arg" | |
1278 | break | |
1279 | fi | |
1280 | done]) | |
1281 | ||
1282 | TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_strict_align" | |
1283 | if test x"$grub_cv_target_cc_strict_align" = x"-Xclang -mstrict-align"; then | |
1284 | TARGET_LDFLAGS="$TARGET_LDFLAGS -Qunused-arguments" | |
1285 | fi | |
1286 | AC_CACHE_CHECK([if compiler generates unaligned accesses], [grub_cv_cc_target_emits_unaligned], | |
1287 | [CFLAGS="$TARGET_CFLAGS" | |
1288 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ | |
1289 | #ifdef __ARM_FEATURE_UNALIGNED | |
1290 | #error "unaligned" | |
1291 | #endif | |
1292 | ]])], | |
1293 | [grub_cv_cc_target_emits_unaligned=no], [grub_cv_cc_target_emits_unaligned=yes])]) | |
1294 | if test x$grub_cv_cc_target_emits_unaligned = xyes; then | |
1295 | AC_MSG_ERROR([compiler generates unaligned accesses]) | |
1296 | fi | |
1297 | fi | |
1298 | ||
1299 | # Set them to their new values for the tests below. | |
1300 | CC="$TARGET_CC" | |
1301 | if test x"$platform" = xemu ; then | |
1302 | CFLAGS="$TARGET_CFLAGS -Wno-error" | |
1303 | elif test "x$TARGET_APPLE_LINKER" = x1 ; then | |
1304 | CFLAGS="$TARGET_CFLAGS -nostdlib -static -Wno-error" | |
1305 | else | |
1306 | CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error" | |
1307 | fi | |
1308 | CPPFLAGS="$TARGET_CPPFLAGS" | |
1309 | ||
1310 | grub_ASM_USCORE | |
1311 | if test "x$TARGET_APPLE_LINKER" = x0 && test x"$platform" != xemu; then | |
1312 | if test x$grub_cv_asm_uscore = xyes; then | |
1313 | DEFSYM="-Wl,--defsym,_abort=_main -Wl,--defsym,__main=_main" | |
1314 | else | |
1315 | DEFSYM="-Wl,--defsym,abort=main -Wl,--defsym,_main=main -Wl,--defsym,__main=main" | |
1316 | fi | |
1317 | CFLAGS="$TARGET_CFLAGS -nostdlib $DEFSYM" | |
1318 | fi | |
1319 | ||
1320 | # Check for libgcc symbols | |
1321 | if test x"$platform" = xemu; then | |
1322 | AC_CHECK_FUNCS(__udivsi3 __umodsi3 __divsi3 __modsi3 __divdi3 __moddi3 __udivdi3 __umoddi3 __ctzdi2 __ctzsi2 __aeabi_uidiv __aeabi_uidivmod __aeabi_idiv __aeabi_idivmod __aeabi_ulcmp __muldi3 __aeabi_lmul __aeabi_memcpy __aeabi_memcpy4 __aeabi_memcpy8 __aeabi_memclr __aeabi_memclr4 __aeabi_memclr8 __aeabi_memset __aeabi_lasr __aeabi_llsl __aeabi_llsr _restgpr_14_x __ucmpdi2 __ashldi3 __ashrdi3 __lshrdi3 __bswapsi2 __bswapdi2 __bzero __register_frame_info __deregister_frame_info ___chkstk_ms __chkstk_ms) | |
1323 | fi | |
1324 | ||
1325 | if test "x$TARGET_APPLE_LINKER" = x1 ; then | |
1326 | CFLAGS="$TARGET_CFLAGS -nostdlib -static" | |
1327 | else | |
1328 | CFLAGS="$TARGET_CFLAGS -nostdlib" | |
1329 | fi | |
1330 | LIBS="" | |
1331 | ||
1332 | # Defined in aclocal.m4. | |
1333 | grub_PROG_TARGET_CC | |
1334 | if test "x$TARGET_APPLE_LINKER" != x1 ; then | |
1335 | grub_PROG_OBJCOPY_ABSOLUTE | |
1336 | fi | |
1337 | grub_PROG_LD_BUILD_ID_NONE | |
1338 | if test "x$target_cpu" = xi386; then | |
1339 | if test "$platform" != emu && test "x$TARGET_APPLE_LINKER" != x1 ; then | |
1340 | if test ! -z "$TARGET_IMG_LDSCRIPT"; then | |
1341 | # Check symbols provided by linker script. | |
1342 | CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},0x8000" | |
1343 | fi | |
1344 | grub_CHECK_BSS_START_SYMBOL | |
1345 | grub_CHECK_END_SYMBOL | |
1346 | fi | |
1347 | CFLAGS="$TARGET_CFLAGS" | |
1348 | fi | |
1349 | ||
1350 | grub_PROG_NM_WORKS | |
1351 | grub_PROG_NM_MINUS_P | |
1352 | grub_PROG_NM_DEFINED_ONLY | |
1353 | AC_SUBST(TARGET_NMFLAGS_MINUS_P) | |
1354 | AC_SUBST(TARGET_NMFLAGS_DEFINED_ONLY) | |
1355 | ||
1356 | if test "$platform" != emu; then | |
1357 | AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [ | |
1358 | SAVED_CPPFLAGS="$CPPFLAGS" | |
1359 | CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" | |
1360 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> | |
1361 | #include <stddef.h> | |
1362 | int va_arg_func (int fixed, va_list args);]], [[]])], | |
1363 | [grub_cv_cc_isystem=yes], | |
1364 | [grub_cv_cc_isystem=no]) | |
1365 | CPPFLAGS="$SAVED_CPPFLAGS" | |
1366 | ]) | |
1367 | ||
1368 | if test x"$grub_cv_cc_isystem" = xyes ; then | |
1369 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" | |
1370 | fi | |
1371 | fi | |
1372 | ||
1373 | AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [ | |
1374 | CFLAGS="$TARGET_CFLAGS -Wtrampolines -Werror" | |
1375 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h> | |
1376 | int va_arg_func (int fixed, va_list args);]], [[]])], | |
1377 | [grub_cv_cc_wtrampolines=yes], | |
1378 | [grub_cv_cc_wtrampolines=no]) | |
1379 | ]) | |
1380 | ||
1381 | if test x"$grub_cv_cc_wtrampolines" = xyes ; then | |
1382 | TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines" | |
1383 | fi | |
1384 | ||
1385 | # Restore the flags. | |
1386 | CC="$tmp_CC" | |
1387 | CFLAGS="$tmp_CFLAGS" | |
1388 | CPPFLAGS="$tmp_CPPFLAGS" | |
1389 | LDFLAGS="$tmp_LDFLAGS" | |
1390 | LIBS="$tmp_LIBS" | |
1391 | ||
1392 | # | |
1393 | # Check for options. | |
1394 | # | |
1395 | ||
1396 | # Memory manager debugging. | |
1397 | AC_ARG_ENABLE([mm-debug], | |
1398 | AS_HELP_STRING([--enable-mm-debug], | |
1399 | [include memory manager debugging]), | |
1400 | [AC_DEFINE([MM_DEBUG], [1], | |
1401 | [Define to 1 if you enable memory manager debugging.])]) | |
1402 | ||
1403 | AC_ARG_ENABLE([cache-stats], | |
1404 | AS_HELP_STRING([--enable-cache-stats], | |
1405 | [enable disk cache statistics collection])) | |
1406 | ||
1407 | if test x$enable_cache_stats = xyes; then | |
1408 | DISK_CACHE_STATS=1 | |
1409 | else | |
1410 | DISK_CACHE_STATS=0 | |
1411 | fi | |
1412 | AC_SUBST([DISK_CACHE_STATS]) | |
1413 | ||
1414 | AC_ARG_ENABLE([boot-time], | |
1415 | AS_HELP_STRING([--enable-boot-time], | |
1416 | [enable boot time statistics collection])) | |
1417 | ||
1418 | if test x$enable_boot_time = xyes; then | |
1419 | BOOT_TIME_STATS=1 | |
1420 | else | |
1421 | BOOT_TIME_STATS=0 | |
1422 | fi | |
1423 | AC_SUBST([BOOT_TIME_STATS]) | |
1424 | ||
1425 | AC_ARG_ENABLE([grub-emu-sdl], | |
1426 | [AS_HELP_STRING([--enable-grub-emu-sdl], | |
1427 | [build and install the `grub-emu' debugging utility with SDL support (default=guessed)])]) | |
1428 | ||
1429 | AC_ARG_ENABLE([grub-emu-pci], | |
1430 | [AS_HELP_STRING([--enable-grub-emu-pci], | |
1431 | [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])]) | |
1432 | ||
1433 | if test "$platform" = emu; then | |
1434 | ||
1435 | if test x"$enable_grub_emu_sdl" = xno ; then | |
1436 | grub_emu_sdl_excuse="explicitly disabled" | |
1437 | fi | |
1438 | [if [ x"$grub_emu_sdl_excuse" = x ]; then | |
1439 | # Check for libSDL libraries.] | |
1440 | AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"], | |
1441 | [grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]]) | |
1442 | AC_SUBST([LIBSDL]) | |
1443 | [fi] | |
1444 | ||
1445 | [if [ x"$grub_emu_sdl_excuse" = x ]; then | |
1446 | # Check for headers.] | |
1447 | AC_CHECK_HEADERS([SDL/SDL.h], [], | |
1448 | [grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]]) | |
1449 | [fi] | |
1450 | ||
1451 | if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then | |
1452 | AC_MSG_ERROR([SDL support for grub-emu was explicitly requested but can't be compiled ($grub_emu_sdl_excuse)]) | |
1453 | fi | |
1454 | if test x"$grub_emu_sdl_excuse" = x ; then | |
1455 | enable_grub_emu_sdl=yes | |
1456 | else | |
1457 | enable_grub_emu_sdl=no | |
1458 | fi | |
1459 | ||
1460 | if test x"$enable_grub_emu_pci" != xyes ; then | |
1461 | grub_emu_pci_excuse="not enabled" | |
1462 | fi | |
1463 | ||
1464 | [if [ x"$grub_emu_pci_excuse" = x ]; then | |
1465 | # Check for libpci libraries.] | |
1466 | AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"], | |
1467 | [grub_emu_pci_excuse=["need libpciaccess library"]]) | |
1468 | AC_SUBST([LIBPCIACCESS]) | |
1469 | [fi] | |
1470 | [if [ x"$grub_emu_pci_excuse" = x ]; then | |
1471 | # Check for headers.] | |
1472 | AC_CHECK_HEADERS([pciaccess.h], [], | |
1473 | [grub_emu_pci_excuse=["need libpciaccess headers"]]) | |
1474 | [fi] | |
1475 | ||
1476 | if test x"$grub_emu_pci_excuse" = x ; then | |
1477 | enable_grub_emu_pci=yes | |
1478 | else | |
1479 | ||
1480 | enable_grub_emu_pci=no | |
1481 | fi | |
1482 | ||
1483 | AC_SUBST([enable_grub_emu_sdl]) | |
1484 | AC_SUBST([enable_grub_emu_pci]) | |
1485 | ||
1486 | else | |
1487 | ||
1488 | # Ignore --enable-emu-* if platform is not emu | |
1489 | enable_grub_emu_sdl=no | |
1490 | enable_grub_emu_pci=no | |
1491 | fi | |
1492 | ||
1493 | AC_ARG_ENABLE([grub-mkfont], | |
1494 | [AS_HELP_STRING([--enable-grub-mkfont], | |
1495 | [build and install the `grub-mkfont' utility (default=guessed)])]) | |
1496 | if test x"$enable_grub_mkfont" = xno ; then | |
1497 | grub_mkfont_excuse="explicitly disabled" | |
1498 | fi | |
1499 | ||
1500 | unset ac_cv_header_ft2build_h | |
1501 | ||
1502 | if test x"$grub_mkfont_excuse" = x ; then | |
1503 | # Check for freetype libraries. | |
1504 | PKG_CHECK_MODULES([FREETYPE], [freetype2], [ | |
1505 | SAVED_CPPFLAGS="$CPPFLAGS" | |
1506 | SAVED_LIBS="$LIBS" | |
1507 | CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" | |
1508 | LIBS="$LIBS $FREETYPE_LIBS" | |
1509 | AC_CHECK_HEADERS([ft2build.h], [], | |
1510 | [grub_mkfont_excuse=["need freetype2 headers"]]) | |
1511 | AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], | |
1512 | [grub_mkfont_excuse=["freetype2 library unusable"]]) | |
1513 | CPPFLAGS="$SAVED_CPPFLAGS" | |
1514 | LIBS="$SAVED_LIBS" | |
1515 | ], [grub_mkfont_excuse=["need freetype2 library"]]) | |
1516 | fi | |
1517 | ||
1518 | if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then | |
1519 | AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled ($grub_mkfont_excuse)]) | |
1520 | fi | |
1521 | if test x"$grub_mkfont_excuse" = x ; then | |
1522 | enable_grub_mkfont=yes | |
1523 | else | |
1524 | enable_grub_mkfont=no | |
1525 | fi | |
1526 | AC_SUBST([enable_grub_mkfont]) | |
1527 | ||
1528 | SAVED_CC="$CC" | |
1529 | SAVED_CPP="$CPP" | |
1530 | SAVED_CFLAGS="$CFLAGS" | |
1531 | SAVED_CPPFLAGS="$CPPFLAGS" | |
1532 | SAVED_LDFLAGS="$LDFLAGS" | |
1533 | CC="$BUILD_CC" | |
1534 | CPP="$BUILD_CPP" | |
1535 | CFLAGS="$BUILD_CFLAGS" | |
1536 | CPPFLAGS="$BUILD_CPPFLAGS" | |
1537 | LDFLAGS="$BUILD_LDFAGS" | |
1538 | ||
1539 | unset ac_cv_c_bigendian | |
1540 | unset ac_cv_header_ft2build_h | |
1541 | ||
1542 | AC_COMPUTE_INT([BUILD_SIZEOF_VOID_P], [sizeof (void *)]) | |
1543 | AC_COMPUTE_INT([BUILD_SIZEOF_LONG], [sizeof (long)]) | |
1544 | AC_C_BIGENDIAN([BUILD_WORDS_BIGENDIAN=1], [BUILD_WORDS_BIGENDIAN=0], [BUILD_WORDS_BIGENDIAN=err], [BUILD_WORDS_BIGENDIAN=err]) | |
1545 | ||
1546 | if test x$BUILD_WORDS_BIGENDIAN = xerr ; then | |
1547 | AC_MSG_ERROR([couldnt determine build endianness]) | |
1548 | fi | |
1549 | ||
1550 | AC_SUBST([BUILD_SIZEOF_LONG]) | |
1551 | AC_SUBST([BUILD_SIZEOF_VOID_P]) | |
1552 | AC_SUBST([BUILD_WORDS_BIGENDIAN]) | |
1553 | ||
1554 | if test x"$grub_build_mkfont_excuse" = x ; then | |
1555 | # Check for freetype libraries. | |
1556 | SAVED_PKG_CONFIG="$PKG_CONFIG" | |
1557 | test -z "$BUILD_PKG_CONFIG" || PKG_CONFIG="$BUILD_PKG_CONFIG" | |
1558 | PKG_CHECK_MODULES([BUILD_FREETYPE], [freetype2], [ | |
1559 | SAVED_CPPFLAGS_2="$CPPFLAGS" | |
1560 | SAVED_LIBS="$LIBS" | |
1561 | CPPFLAGS="$CPPFLAGS $BUILD_FREETYPE_CFLAGS" | |
1562 | LIBS="$LIBS $BUILD_FREETYPE_LIBS" | |
1563 | AC_CHECK_HEADERS([ft2build.h], [], | |
1564 | [grub_build_mkfont_excuse=["need freetype2 headers"]]) | |
1565 | AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], | |
1566 | [grub_build_mkfont_excuse=["freetype2 library unusable"]]) | |
1567 | LIBS="$SAVED_LIBS" | |
1568 | CPPFLAGS="$SAVED_CPPFLAGS_2" | |
1569 | ], [grub_build_mkfont_excuse=["need freetype2 library"]]) | |
1570 | PKG_CONFIG="$SAVED_PKG_CONFIG" | |
1571 | fi | |
1572 | ||
1573 | if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then | |
1574 | AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled ($grub_build_mkfont_excuse)]) | |
1575 | fi | |
1576 | if test x"$grub_build_mkfont_excuse" = x ; then | |
1577 | enable_build_grub_mkfont=yes | |
1578 | else | |
1579 | enable_build_grub_mkfont=no | |
1580 | fi | |
1581 | if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then | |
1582 | if test x"$grub_build_mkfont_excuse" = x ; then | |
1583 | AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont]) | |
1584 | else | |
1585 | AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont ($grub_build_mkfont_excuse)]) | |
1586 | fi | |
1587 | fi | |
1588 | ||
1589 | CC="$SAVED_CC" | |
1590 | CPP="$SAVED_CPP" | |
1591 | CFLAGS="$SAVED_CFLAGS" | |
1592 | CPPFLAGS="$SAVED_CPPFLAGS" | |
1593 | LDFLAGS="$SAVED_LDFLAGS" | |
1594 | ||
1595 | ||
1596 | DJVU_FONT_SOURCE= | |
1597 | ||
1598 | starfield_excuse= | |
1599 | ||
1600 | AC_ARG_ENABLE([grub-themes], | |
1601 | [AS_HELP_STRING([--enable-grub-themes], | |
1602 | [build and install GRUB themes (default=guessed)])]) | |
1603 | if test x"$enable_grub_themes" = xno ; then | |
1604 | starfield_excuse="explicitly disabled" | |
1605 | fi | |
1606 | ||
1607 | if test x"$starfield_excuse" = x && test x"$enable_build_grub_mkfont" = xno ; then | |
1608 | starfield_excuse="No build-time grub-mkfont" | |
1609 | fi | |
1610 | ||
1611 | if test x"$starfield_excuse" = x; then | |
1612 | for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do | |
1613 | for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu /usr/share/fonts/truetype; do | |
1614 | if test -f "$dir/DejaVuSans.$ext"; then | |
1615 | DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext" | |
1616 | break 2 | |
1617 | fi | |
1618 | done | |
1619 | done | |
1620 | ||
1621 | if test "x$DJVU_FONT_SOURCE" = x; then | |
1622 | starfield_excuse="No DejaVu found" | |
1623 | fi | |
1624 | fi | |
1625 | ||
1626 | if test x"$enable_grub_themes" = xyes && test x"$starfield_excuse" != x; then | |
1627 | AC_MSG_ERROR([themes were explicitly requested but requirements are not satisfied ($starfield_excuse)]) | |
1628 | fi | |
1629 | ||
1630 | AC_SUBST([DJVU_FONT_SOURCE]) | |
1631 | ||
1632 | FONT_SOURCE= | |
1633 | ||
1634 | for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do | |
1635 | 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 | |
1636 | if test -f "$dir/unifont.$ext"; then | |
1637 | md5="$(md5sum "$dir/unifont.$ext"|awk '{ print $1; }')" | |
1638 | # PCF and BDF from version 6.3 isn't hanled properly by libfreetype. | |
1639 | if test "$md5" = 0a54834d2788c83886a3e1785a6a1e61 || test "$md5" = 28f2565c7a41d8d407e2551159385edb || test "$md5" = dae5e588461b3b92b87b6ffee734f936 || test "$md5" = 4a3d687aa5bb329ed05f4263a1016791 ; then | |
1640 | continue | |
1641 | fi | |
1642 | FONT_SOURCE="$dir/unifont.$ext" | |
1643 | break 2 | |
1644 | fi | |
1645 | done | |
1646 | done | |
1647 | ||
1648 | if test x"$enable_build_grub_mkfont" = xno ; then | |
1649 | FONT_SOURCE= | |
1650 | fi | |
1651 | ||
1652 | if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then | |
1653 | if test x"$grub_build_mkfont_excuse" = x ; then | |
1654 | AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont]) | |
1655 | else | |
1656 | AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)]) | |
1657 | fi | |
1658 | fi | |
1659 | ||
1660 | AC_SUBST([FONT_SOURCE]) | |
1661 | ||
1662 | if test x"$FONT_SOURCE" = x && test x"$DJVU_FONT_SOURCE" = x && test x"$grub_build_mkfont_excuse" = x; then | |
1663 | grub_build_mkfont_excuse="no fonts" | |
1664 | fi | |
1665 | ||
1666 | ||
1667 | AC_ARG_ENABLE([grub-mount], | |
1668 | [AS_HELP_STRING([--enable-grub-mount], | |
1669 | [build and install the `grub-mount' utility (default=guessed)])]) | |
1670 | if test x"$enable_grub_mount" = xno ; then | |
1671 | grub_mount_excuse="explicitly disabled" | |
1672 | fi | |
1673 | ||
1674 | if test x"$grub_mount_excuse" = x ; then | |
1675 | AC_CHECK_LIB([fuse], [fuse_main_real], [], | |
1676 | [grub_mount_excuse="need FUSE library"]) | |
1677 | fi | |
1678 | ||
1679 | if test x"$grub_mount_excuse" = x ; then | |
1680 | # Check for fuse headers. | |
1681 | SAVED_CPPFLAGS="$CPPFLAGS" | |
1682 | CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" | |
1683 | AC_CHECK_HEADERS([fuse/fuse.h], [], | |
1684 | [grub_mount_excuse=["need FUSE headers"]]) | |
1685 | CPPFLAGS="$SAVED_CPPFLAGS" | |
1686 | fi | |
1687 | ||
1688 | if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then | |
1689 | AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled ($grub_mount_excuse)]) | |
1690 | fi | |
1691 | if test x"$grub_mount_excuse" = x ; then | |
1692 | enable_grub_mount=yes | |
1693 | else | |
1694 | enable_grub_mount=no | |
1695 | fi | |
1696 | AC_SUBST([enable_grub_mount]) | |
1697 | ||
1698 | AC_ARG_ENABLE([device-mapper], | |
1699 | [AS_HELP_STRING([--enable-device-mapper], | |
1700 | [enable Linux device-mapper support (default=guessed)])]) | |
1701 | if test x"$enable_device_mapper" = xno ; then | |
1702 | device_mapper_excuse="explicitly disabled" | |
1703 | fi | |
1704 | ||
1705 | if test x"$device_mapper_excuse" = x ; then | |
1706 | # Check for device-mapper header. | |
1707 | AC_CHECK_HEADER([libdevmapper.h], [], | |
1708 | [device_mapper_excuse="need libdevmapper header"]) | |
1709 | fi | |
1710 | ||
1711 | if test x"$device_mapper_excuse" = x ; then | |
1712 | # Check for device-mapper library. | |
1713 | AC_CHECK_LIB([devmapper], [dm_task_create], [], | |
1714 | [device_mapper_excuse="need devmapper library"]) | |
1715 | fi | |
1716 | ||
1717 | if test x"$device_mapper_excuse" = x ; then | |
1718 | # Check for device-mapper library. | |
1719 | AC_CHECK_LIB([devmapper], [dm_log_with_errno_init], | |
1720 | [], | |
1721 | [device_mapper_excuse="need devmapper library"]) | |
1722 | fi | |
1723 | ||
1724 | if test x"$device_mapper_excuse" = x ; then | |
1725 | LIBDEVMAPPER="-ldevmapper" | |
1726 | AC_DEFINE([HAVE_DEVICE_MAPPER], [1], | |
1727 | [Define to 1 if you have the devmapper library.]) | |
1728 | fi | |
1729 | ||
1730 | AC_SUBST([LIBDEVMAPPER]) | |
1731 | ||
1732 | LIBGEOM= | |
1733 | if test x$host_kernel = xkfreebsd; then | |
1734 | AC_CHECK_LIB([geom], [geom_gettree], [], | |
1735 | [AC_MSG_ERROR([Your platform requires libgeom])]) | |
1736 | LIBGEOM="-lgeom" | |
1737 | fi | |
1738 | ||
1739 | AC_SUBST([LIBGEOM]) | |
1740 | ||
1741 | AC_ARG_ENABLE([liblzma], | |
1742 | [AS_HELP_STRING([--enable-liblzma], | |
1743 | [enable liblzma integration (default=guessed)])]) | |
1744 | if test x"$enable_liblzma" = xno ; then | |
1745 | liblzma_excuse="explicitly disabled" | |
1746 | fi | |
1747 | ||
1748 | if test x"$liblzma_excuse" = x ; then | |
1749 | AC_CHECK_LIB([lzma], [lzma_code], | |
1750 | [],[liblzma_excuse="need lzma library"]) | |
1751 | fi | |
1752 | if test x"$liblzma_excuse" = x ; then | |
1753 | AC_CHECK_HEADER([lzma.h], [], [liblzma_excuse="need lzma header"]) | |
1754 | fi | |
1755 | ||
1756 | if test x"$enable_liblzma" = xyes && test x"$liblzma_excuse" != x ; then | |
1757 | AC_MSG_ERROR([liblzma support was explicitly requested but requirements are not satisfied ($liblzma_excuse)]) | |
1758 | fi | |
1759 | ||
1760 | ||
1761 | if test x"$liblzma_excuse" = x ; then | |
1762 | LIBLZMA="-llzma" | |
1763 | AC_DEFINE([USE_LIBLZMA], [1], | |
1764 | [Define to 1 if you have the LZMA library.]) | |
1765 | fi | |
1766 | ||
1767 | AC_SUBST([LIBLZMA]) | |
1768 | ||
1769 | AC_ARG_ENABLE([libzfs], | |
1770 | [AS_HELP_STRING([--enable-libzfs], | |
1771 | [enable libzfs integration (default=guessed)])]) | |
1772 | if test x"$enable_libzfs" = xno ; then | |
1773 | libzfs_excuse="explicitly disabled" | |
1774 | fi | |
1775 | ||
1776 | if test x"$libzfs_excuse" = x ; then | |
1777 | # Only check for system headers if libzfs support has not been disabled. | |
1778 | AC_CHECK_HEADERS(libzfs.h libnvpair.h) | |
1779 | fi | |
1780 | ||
1781 | if test x"$libzfs_excuse" = x ; then | |
1782 | AC_CHECK_LIB([zfs], [libzfs_init], | |
1783 | [], | |
1784 | [libzfs_excuse="need zfs library"]) | |
1785 | fi | |
1786 | ||
1787 | if test x"$libzfs_excuse" = x ; then | |
1788 | AC_CHECK_LIB([nvpair], [nvlist_lookup_string], | |
1789 | [], | |
1790 | [libzfs_excuse="need nvpair library"]) | |
1791 | fi | |
1792 | ||
1793 | if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then | |
1794 | AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied ($libzfs_excuse)]) | |
1795 | fi | |
1796 | ||
1797 | if test x"$libzfs_excuse" = x ; then | |
1798 | # We need both libzfs and libnvpair for a successful build. | |
1799 | LIBZFS="-lzfs" | |
1800 | AC_DEFINE([HAVE_LIBZFS], [1], | |
1801 | [Define to 1 if you have the ZFS library.]) | |
1802 | LIBNVPAIR="-lnvpair" | |
1803 | AC_DEFINE([HAVE_LIBNVPAIR], [1], | |
1804 | [Define to 1 if you have the NVPAIR library.]) | |
1805 | fi | |
1806 | ||
1807 | AC_SUBST([LIBZFS]) | |
1808 | AC_SUBST([LIBNVPAIR]) | |
1809 | ||
1810 | AC_ARG_ENABLE([ubuntu-recovery], | |
1811 | [AS_HELP_STRING([--enable-ubuntu-recovery], | |
1812 | [adjust boot options for the Ubuntu recovery mode (default=no)])], | |
1813 | [], [enable_ubuntu_recovery=no]) | |
1814 | if test x"$enable_ubuntu_recovery" = xyes ; then | |
1815 | UBUNTU_RECOVERY=1 | |
1816 | else | |
1817 | UBUNTU_RECOVERY=0 | |
1818 | fi | |
1819 | AC_SUBST([UBUNTU_RECOVERY]) | |
1820 | ||
1821 | AC_ARG_ENABLE([quiet-boot], | |
1822 | [AS_HELP_STRING([--enable-quiet-boot], | |
1823 | [emit fewer messages at boot time (default=no)])], | |
1824 | [], [enable_quiet_boot=no]) | |
1825 | if test x"$enable_quiet_boot" = xyes ; then | |
1826 | QUIET_BOOT=1 | |
1827 | else | |
1828 | QUIET_BOOT=0 | |
1829 | fi | |
1830 | AC_SUBST([QUIET_BOOT]) | |
1831 | ||
1832 | AC_ARG_ENABLE([quick-boot], | |
1833 | [AS_HELP_STRING([--enable-quick-boot], | |
1834 | [bypass boot menu if possible (default=no)])], | |
1835 | [], [enable_quick_boot=no]) | |
1836 | if test x"$enable_quick_boot" = xyes ; then | |
1837 | QUICK_BOOT=1 | |
1838 | else | |
1839 | QUICK_BOOT=0 | |
1840 | fi | |
1841 | AC_SUBST([QUICK_BOOT]) | |
1842 | ||
1843 | AC_ARG_ENABLE([gfxpayload-dynamic], | |
1844 | [AS_HELP_STRING([--enable-gfxpayload-dynamic], | |
1845 | [use GRUB_GFXPAYLOAD_LINUX=keep unless explicitly unsupported on current hardware (default=no)])], | |
1846 | [], [enable_gfxpayload_dynamic=no]) | |
1847 | if test x"$enable_gfxpayload_dynamic" = xyes ; then | |
1848 | GFXPAYLOAD_DYNAMIC=1 | |
1849 | else | |
1850 | GFXPAYLOAD_DYNAMIC=0 | |
1851 | fi | |
1852 | AC_SUBST([GFXPAYLOAD_DYNAMIC]) | |
1853 | ||
1854 | AC_ARG_ENABLE([vt-handoff], | |
1855 | [AS_HELP_STRING([--enable-vt-handoff], | |
1856 | [use Linux vt.handoff option for flicker-free booting (default=no)])], | |
1857 | [], [enable_vt_handoff=no]) | |
1858 | if test x"$enable_vt_handoff" = xyes ; then | |
1859 | VT_HANDOFF=1 | |
1860 | else | |
1861 | VT_HANDOFF=0 | |
1862 | fi | |
1863 | AC_SUBST([VT_HANDOFF]) | |
1864 | ||
1865 | LIBS="" | |
1866 | ||
1867 | AC_SUBST([FONT_SOURCE]) | |
1868 | AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu], | |
1869 | [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)]) | |
1870 | ||
1871 | AC_SUBST(HAVE_ASM_USCORE) | |
1872 | AC_SUBST(BSS_START_SYMBOL) | |
1873 | AC_SUBST(END_SYMBOL) | |
1874 | AC_SUBST(PACKAGE) | |
1875 | AC_SUBST(VERSION) | |
1876 | ||
1877 | AC_ARG_ENABLE([werror], | |
1878 | [AS_HELP_STRING([--disable-werror], | |
1879 | [do not use -Werror when building GRUB])]) | |
1880 | if test x"$enable_werror" != xno ; then | |
1881 | TARGET_CFLAGS="$TARGET_CFLAGS -Werror" | |
1882 | HOST_CFLAGS="$HOST_CFLAGS -Werror" | |
1883 | fi | |
1884 | ||
1885 | TARGET_CPP="$TARGET_CC -E" | |
1886 | TARGET_CCAS=$TARGET_CC | |
1887 | ||
1888 | # Includes which include make-time substitutions. They must come last | |
1889 | # as to avoid executing top_builddir in shell. | |
1890 | HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include" | |
1891 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include" | |
1892 | TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include" | |
1893 | ||
1894 | GRUB_TARGET_CPU="${target_cpu}" | |
1895 | GRUB_PLATFORM="${platform}" | |
1896 | ||
1897 | AC_SUBST(GRUB_TARGET_CPU) | |
1898 | AC_SUBST(GRUB_PLATFORM) | |
1899 | ||
1900 | AC_SUBST(TARGET_OBJCONV) | |
1901 | AC_SUBST(TARGET_CPP) | |
1902 | AC_SUBST(TARGET_CCAS) | |
1903 | AC_SUBST(TARGET_OBJ2ELF) | |
1904 | AC_SUBST(TARGET_MODULE_FORMAT) | |
1905 | AC_SUBST(TARGET_CC_VERSION) | |
1906 | ||
1907 | AC_SUBST(TARGET_CFLAGS) | |
1908 | AC_SUBST(TARGET_LDFLAGS) | |
1909 | AC_SUBST(TARGET_CPPFLAGS) | |
1910 | AC_SUBST(TARGET_CCASFLAGS) | |
1911 | ||
1912 | AC_SUBST(TARGET_IMG_LDFLAGS) | |
1913 | AC_SUBST(TARGET_IMG_CFLAGS) | |
1914 | AC_SUBST(TARGET_IMG_BASE_LDOPT) | |
1915 | AC_SUBST(TARGET_APPLE_LINKER) | |
1916 | ||
1917 | AC_SUBST(HOST_CFLAGS) | |
1918 | AC_SUBST(HOST_LDFLAGS) | |
1919 | AC_SUBST(HOST_CPPFLAGS) | |
1920 | AC_SUBST(HOST_CCASFLAGS) | |
1921 | ||
1922 | AC_SUBST(BUILD_LIBM) | |
1923 | ||
1924 | # | |
1925 | # Automake conditionals | |
1926 | # | |
1927 | ||
1928 | AM_CONDITIONAL([COND_real_platform], [test x$platform != xnone]) | |
1929 | AM_CONDITIONAL([COND_emu], [test x$platform = xemu]) | |
1930 | AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc]) | |
1931 | AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi]) | |
1932 | AM_CONDITIONAL([COND_ia64_efi], [test x$target_cpu = xia64 -a x$platform = xefi]) | |
1933 | AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu]) | |
1934 | AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275]) | |
1935 | AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot]) | |
1936 | AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot]) | |
1937 | AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi]) | |
1938 | AM_CONDITIONAL([COND_i386_xen], [test x$target_cpu = xi386 -a x$platform = xxen]) | |
1939 | AM_CONDITIONAL([COND_x86_64_xen], [test x$target_cpu = xx86_64 -a x$platform = xxen]) | |
1940 | AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson]) | |
1941 | AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips]) | |
1942 | AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc]) | |
1943 | AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275]) | |
1944 | AM_CONDITIONAL([COND_sparc64_emu], [test x$target_cpu = xsparc64 -a x$platform = xemu]) | |
1945 | AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275]) | |
1946 | AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel]) | |
1947 | AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel]) | |
1948 | AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips]) | |
1949 | AM_CONDITIONAL([COND_arm], [test x$target_cpu = xarm ]) | |
1950 | AM_CONDITIONAL([COND_arm_uboot], [test x$target_cpu = xarm -a x$platform = xuboot]) | |
1951 | AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi]) | |
1952 | AM_CONDITIONAL([COND_arm64], [test x$target_cpu = xarm64 ]) | |
1953 | AM_CONDITIONAL([COND_arm64_efi], [test x$target_cpu = xarm64 -a x$platform = xefi]) | |
1954 | ||
1955 | AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd]) | |
1956 | AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux]) | |
1957 | AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd]) | |
1958 | AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows]) | |
1959 | AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd]) | |
1960 | AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu]) | |
1961 | AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos]) | |
1962 | ||
1963 | AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x]) | |
1964 | AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes]) | |
1965 | AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes]) | |
1966 | AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes]) | |
1967 | AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes]) | |
1968 | AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x]) | |
1969 | if test x$FONT_SOURCE != x ; then | |
1970 | HAVE_FONT_SOURCE=1 | |
1971 | else | |
1972 | HAVE_FONT_SOURCE=0 | |
1973 | fi | |
1974 | AC_SUBST(HAVE_FONT_SOURCE) | |
1975 | AM_CONDITIONAL([COND_APPLE_LINKER], [test x$TARGET_APPLE_LINKER = x1]) | |
1976 | AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes]) | |
1977 | AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1]) | |
1978 | AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1]) | |
1979 | ||
1980 | AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes]) | |
1981 | ||
1982 | AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1]) | |
1983 | AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x]) | |
1984 | AM_CONDITIONAL([COND_HAVE_EXEC], [test "x$have_exec" = xy]) | |
1985 | ||
1986 | test "x$prefix" = xNONE && prefix="$ac_default_prefix" | |
1987 | test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" | |
1988 | datarootdir="$(eval echo "$datarootdir")" | |
1989 | grub_libdir="$(eval echo "$libdir")" | |
1990 | grub_localedir="$(eval echo "$localedir")" | |
1991 | grub_datadir="$(eval echo "$datadir")" | |
1992 | grub_sysconfdir="$(eval echo "$sysconfdir")" | |
1993 | AC_DEFINE_UNQUOTED(LOCALEDIR, "$grub_localedir", [Locale dir]) | |
1994 | AC_DEFINE_UNQUOTED(GRUB_LIBDIR, "$grub_libdir", [Library dir]) | |
1995 | AC_DEFINE_UNQUOTED(GRUB_DATADIR, "$grub_datadir", [Data dir]) | |
1996 | AC_DEFINE_UNQUOTED(GRUB_SYSCONFDIR, "$grub_sysconfdir", [Configuration dir]) | |
1997 | ||
1998 | ||
1999 | # Output files. | |
2000 | if test "$platform" != none; then | |
2001 | cpudir="${target_cpu}" | |
2002 | if test x${cpudir} = xmipsel; then | |
2003 | cpudir=mips; | |
2004 | fi | |
2005 | grub_CHECK_LINK_DIR | |
2006 | if test x"$link_dir" = xyes ; then | |
2007 | AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir]) | |
2008 | if test "$platform" != emu ; then | |
2009 | AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform]) | |
2010 | fi | |
2011 | else | |
2012 | mkdir -p include/grub 2>/dev/null | |
2013 | rm -rf include/grub/cpu | |
2014 | cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null | |
2015 | if test "$platform" != emu ; then | |
2016 | rm -rf include/grub/machine | |
2017 | cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null | |
2018 | fi | |
2019 | fi | |
2020 | else | |
2021 | # Just enough to stop the compiler failing with -I$(srcdir)/include. | |
2022 | mkdir -p include 2>/dev/null | |
2023 | rm -rf include/grub/cpu include/grub/machine | |
2024 | fi | |
2025 | ||
2026 | AC_CONFIG_FILES([Makefile]) | |
2027 | AC_CONFIG_FILES([grub-core/Makefile]) | |
2028 | AC_CONFIG_FILES([grub-core/gnulib/Makefile]) | |
2029 | AC_CONFIG_FILES([po/Makefile.in]) | |
2030 | AC_CONFIG_FILES([docs/Makefile]) | |
2031 | AC_CONFIG_FILES([util/bash-completion.d/Makefile]) | |
2032 | AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) | |
2033 | AC_CONFIG_FILES([config.h]) | |
2034 | ||
2035 | AC_OUTPUT | |
2036 | [ | |
2037 | echo "*******************************************************" | |
2038 | echo GRUB2 will be compiled with following components: | |
2039 | echo Platform: "$target_cpu"-"$platform" | |
2040 | if [ x"$platform" = xemu ]; then | |
2041 | if [ x"$grub_emu_sdl_excuse" = x ]; then | |
2042 | echo SDL support for grub-emu: Yes | |
2043 | else | |
2044 | echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)" | |
2045 | fi | |
2046 | if [ x"$grub_emu_pci_excuse" = x ]; then | |
2047 | echo PCI support for grub-emu: Yes | |
2048 | else | |
2049 | echo PCI support for grub-emu: No "($grub_emu_pci_excuse)" | |
2050 | fi | |
2051 | fi | |
2052 | if test x"$device_mapper_excuse" = x ; then | |
2053 | echo With devmapper support: Yes | |
2054 | else | |
2055 | echo With devmapper support: No "($device_mapper_excuse)" | |
2056 | fi | |
2057 | if [ x"$enable_mm_debug" = xyes ]; then | |
2058 | echo With memory debugging: Yes | |
2059 | else | |
2060 | echo With memory debugging: No | |
2061 | fi | |
2062 | if [ x"$enable_cache_stats" = xyes ]; then | |
2063 | echo With disk cache statistics: Yes | |
2064 | else | |
2065 | echo With disk cache statistics: No | |
2066 | fi | |
2067 | ||
2068 | if [ x"$enable_boot_time" = xyes ]; then | |
2069 | echo With boot time statistics: Yes | |
2070 | else | |
2071 | echo With boot time statistics: No | |
2072 | fi | |
2073 | ||
2074 | if [ x"$efiemu_excuse" = x ]; then | |
2075 | echo efiemu runtime: Yes | |
2076 | else | |
2077 | echo efiemu runtime: No "($efiemu_excuse)" | |
2078 | fi | |
2079 | if [ x"$grub_mkfont_excuse" = x ]; then | |
2080 | echo grub-mkfont: Yes | |
2081 | else | |
2082 | echo grub-mkfont: No "($grub_mkfont_excuse)" | |
2083 | fi | |
2084 | if [ x"$grub_mount_excuse" = x ]; then | |
2085 | echo grub-mount: Yes | |
2086 | else | |
2087 | echo grub-mount: No "($grub_mount_excuse)" | |
2088 | fi | |
2089 | if [ x"$starfield_excuse" = x ]; then | |
2090 | echo starfield theme: Yes | |
2091 | echo With DejaVuSans font from $DJVU_FONT_SOURCE | |
2092 | else | |
2093 | echo starfield theme: No "($starfield_excuse)" | |
2094 | fi | |
2095 | if [ x"$libzfs_excuse" = x ]; then | |
2096 | echo With libzfs support: Yes | |
2097 | else | |
2098 | echo With libzfs support: No "($libzfs_excuse)" | |
2099 | fi | |
2100 | if [ x"$grub_build_mkfont_excuse" = x ]; then | |
2101 | echo Build-time grub-mkfont: Yes | |
2102 | if test "x$FONT_SOURCE" = x ; then | |
2103 | echo "Without unifont" | |
2104 | else | |
2105 | echo "With unifont from $FONT_SOURCE" | |
2106 | fi | |
2107 | else | |
2108 | echo Build-time grub-mkfont: No "($grub_build_mkfont_excuse)" | |
2109 | echo "Without unifont (no build-time grub-mkfont)" | |
2110 | fi | |
2111 | if test x"$liblzma_excuse" != x ; then | |
2112 | echo "Without liblzma (no support for XZ-compressed mips images) ($liblzma_excuse)" | |
2113 | else | |
2114 | echo "With liblzma from $LIBLZMA (support for XZ-compressed mips images)" | |
2115 | fi | |
2116 | if [ x"$enable_quiet_boot" = xyes ]; then | |
2117 | echo With quiet boot: Yes | |
2118 | else | |
2119 | echo With quiet boot: No | |
2120 | fi | |
2121 | echo "*******************************************************" | |
2122 | ] |