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