~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, Colin Watson, Evan Broder, Mario Limonciello
  • Date: 2010-11-24 13:59:55 UTC
  • mfrom: (1.17.6 upstream) (17.6.15 experimental)
  • Revision ID: james.westby@ubuntu.com-20101124135955-r6ii5sepayr7jt53
Tags: 1.99~20101124-1ubuntu1
[ Colin Watson ]
* Resynchronise with Debian experimental.  Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
    recovery mode, quiet option, tweak how memtest86+ is displayed, and
    use UUIDs where appropriate.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel= options if kdump and makedumpfile are available.
  - If other operating systems are installed, then automatically unhide
    the menu.  Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
    if available to check whether Shift is pressed.  If it is, show the
    menu, otherwise boot immediately.  If keystatus is not available, then
    fall back to a short delay interruptible with Escape.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Don't display introductory message about line editing unless we're
    actually offering a shell prompt.  Don't clear the screen just before
    booting if we never drew the menu in the first place.
  - Remove some verbose messages printed before reading the configuration
    file.
  - Suppress progress messages as the kernel and initrd load for
    non-recovery kernel menu entries.
  - Change prepare_grub_to_access_device to handle filesystems
    loop-mounted on file images.
  - Ignore devices loop-mounted from files in 10_linux.
  - Show the boot menu if the previous boot failed, that is if it failed
    to get to the end of one of the normal runlevels.
  - Don't generate /boot/grub/device.map during grub-install or
    grub-mkconfig by default.
  - Adjust upgrade version checks for Ubuntu.
  - Don't display "GRUB loading" unless Shift is held down.
  - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate
    our backport of the grub-doc split.
  - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
  - Look for .mo files in /usr/share/locale-langpack as well, in
    preference.
  - Make sure GRUB_TIMEOUT isn't quoted unnecessarily.
  - Probe all devices in 'grub-probe --target=drive' if
    /boot/grub/device.map is missing.
  - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
  - Use qemu rather than qemu-system-i386.
  - Program vesafb on BIOS systems rather than efifb.
  - Add a grub-rescue-efi-amd64 package containing a rescue CD-ROM image
    for EFI-AMD64.
  - On Wubi, don't ask for an install device, but just update wubildr
    using the diverted grub-install.
  - When embedding the core image in a post-MBR gap, check for and avoid
    sectors matching any of a list of known signatures.
  - Disable video_bochs and video_cirrus on PC BIOS systems, as probing
    PCI space seems to break on some systems.
* Downgrade "ACPI shutdown failed" error to a debug message, since it can
  cause spurious test failures.

[ Evan Broder ]
* Enable lua from grub-extras.
* Incorporate the bitop library into lua.
* Add enum_pci function to grub module in lua.
* Switch back to gfxpayload=keep by default, unless the video hardware
  is known to not support it.

[ Mario Limonciello ]
* Built part_msdos and vfat into bootx64.efi (LP: #677758)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- autoconf -*-
 
2
 
1
3
# Process this file with autoconf to produce a configure script.
2
4
 
3
5
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010  Free Software Foundation, Inc.
30
32
dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
31
33
dnl type.
32
34
 
33
 
 
34
35
AC_INIT([GRUB],[0],[bug-grub@gnu.org]) dnl version is filled by debian/rules
 
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
AC_CANONICAL_TARGET
 
45
 
35
46
AM_INIT_AUTOMAKE()
36
47
AC_PREREQ(2.60)
37
48
AC_CONFIG_SRCDIR([include/grub/dl.h])
38
 
AC_CONFIG_HEADER([config.h])
39
 
 
40
 
# Checks for host and target systems.
41
 
AC_CANONICAL_HOST
42
 
AC_CANONICAL_TARGET
 
49
AC_CONFIG_HEADER([config-util.h])
43
50
 
44
51
# Program name transformations
45
52
AC_ARG_PROGRAM
49
56
  TARGET_CFLAGS="$TARGET_CFLAGS -Os"
50
57
fi
51
58
 
 
59
# Default HOST_CPPFLAGS
 
60
HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
 
61
HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
 
62
HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1"
 
63
HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_LIBDIR=\\\"\$(pkglibdir)\\\""
 
64
HOST_CPPFLAGS="$HOST_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\""
 
65
 
 
66
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W"
 
67
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include"
 
68
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include"
 
69
 
52
70
case "$target_cpu" in
53
71
  i[[3456]]86)  target_cpu=i386 ;;
54
72
  amd64)        target_cpu=x86_64 ;;
55
73
  sparc)        target_cpu=sparc64 ;;
56
74
  mipsel|mips64el)
57
 
                target_cpu=mips;    
58
 
                TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPSEL=1"; 
59
 
                CFLAGS="$CFLAGS -DGRUB_CPU_MIPSEL=1";
 
75
                target_cpu=mips;
 
76
                machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1";
60
77
                ;;
61
78
  mips|mips64)
62
 
                target_cpu=mips;    
63
 
                TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPS=1"; 
64
 
                CFLAGS="$CFLAGS -DGRUB_CPU_MIPS=1";
 
79
                target_cpu=mips;
 
80
                machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1";
65
81
                ;;
66
82
esac
67
83
 
136
152
esac
137
153
 
138
154
case "$platform" in
139
 
  coreboot)     machine_CFLAGS="-DGRUB_MACHINE_COREBOOT=1" ;;
140
 
  multiboot)    machine_CFLAGS="-DGRUB_MACHINE_MULTIBOOT=1" ;;
141
 
  efi)          machine_CFLAGS="-DGRUB_MACHINE_EFI=1" ;;
142
 
  ieee1275)     machine_CFLAGS="-DGRUB_MACHINE_IEEE1275=1" ;;
143
 
  qemu)         machine_CFLAGS="-DGRUB_MACHINE_QEMU=1" ;;
144
 
  pc)           machine_CFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;;
145
 
  emu)          machine_CFLAGS="-DGRUB_MACHINE_EMU=1" ;;
146
 
  yeeloong)     machine_CFLAGS="-DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
147
 
  qemu-mips)    machine_CFLAGS="-DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
 
155
  coreboot)     machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;;
 
156
  multiboot)    machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;;
 
157
  efi)          machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;;
 
158
  ieee1275)     machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;;
 
159
  qemu)         machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
 
160
  pc)           machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
 
161
  emu)          machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
 
162
  yeeloong)     machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
 
163
  qemu-mips)    machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
148
164
esac
149
165
case "$target_cpu" in
150
 
  mips)         machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_MIPS=1" ;;
151
 
  sparc64)      machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
 
166
  mips)         machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
 
167
  sparc64)      machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
152
168
esac
153
 
machine_CFLAGS="$machine_CFLAGS -DMACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
 
169
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
154
170
 
155
 
CFLAGS="$CFLAGS $machine_CFLAGS"
156
 
TARGET_ASFLAGS="$TARGET_ASFLAGS $machine_CFLAGS"
157
 
TARGET_CFLAGS="$TARGET_CFLAGS $machine_CFLAGS"
 
171
HOST_CPPFLAGS="$HOST_CPPFLAGS $machine_CPPFLAGS"
 
172
TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
158
173
 
159
174
AC_SUBST(host_cpu)
160
175
AC_SUBST(host_os)
163
178
AC_SUBST(target_cpu)
164
179
AC_SUBST(platform)
165
180
 
 
181
# Define default variables
 
182
case "$host_os" in
 
183
  netbsd* | openbsd*)
 
184
        # Because /boot is used for the boot block in NetBSD and OpenBSD,
 
185
        bootdirname=''      ;;
 
186
  *)    bootdirname='boot'  ;;
 
187
esac
 
188
bootdirname=`echo "$bootdirname" | sed "$program_transform_name"`
 
189
AC_SUBST(bootdirname)
 
190
AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname",
 
191
    [Default boot directory name]")
 
192
 
 
193
grubdirname=`echo "$PACKAGE" | sed "$program_transform_name"`
 
194
AC_SUBST(grubdirname)
 
195
AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
 
196
    [Default grub directory name])
 
197
 
166
198
#
167
199
# Checks for build programs.
168
200
#
194
226
   AC_MSG_ERROR([qemu and yeeloong ports need unifont])
195
227
fi
196
228
 
197
 
AC_SUBST([FONT_SOURCE]) 
 
229
AC_SUBST([FONT_SOURCE])
198
230
 
 
231
AC_PROG_RANLIB
199
232
AC_PROG_INSTALL
200
233
AC_PROG_AWK
201
234
AC_PROG_LEX
 
235
AC_PROG_YACC
202
236
AC_PROG_MAKE_SET
203
237
AC_PROG_MKDIR_P
 
238
AC_PROG_LN_S
204
239
 
205
240
if test "x$LEX" = "x:"; then
206
241
  AC_MSG_ERROR([flex is not found])
214
249
fi
215
250
 
216
251
# These are not a "must".
217
 
AC_PATH_PROG(RUBY, ruby)
218
252
AC_PATH_PROG(MAKEINFO, makeinfo)
219
253
 
220
254
#
222
256
#
223
257
 
224
258
AC_PROG_CC
 
259
gl_EARLY
 
260
AM_PROG_CC_C_O
 
261
AM_PROG_AS
 
262
 
225
263
# Must be GCC.
226
264
test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
227
265
 
236
274
 
237
275
grub_apple_cc
238
276
if test x$grub_cv_apple_cc = xyes ; then
239
 
  CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
240
 
  ASFLAGS="$ASFLAGS -DAPPLE_CC=1"
 
277
  HOST_CPPFLAGS="$HOST_CPPFLAGS -DAPPLE_CC=1"
 
278
  HOST_CFLAGS="$HOST_CFLAGS -fnested-functions"
241
279
fi
242
280
 
243
281
if test "x$cross_compiling" = xyes; then
247
285
fi
248
286
 
249
287
# Check for functions and headers.
250
 
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getfsstat getmntany)
251
 
AC_CHECK_HEADERS(libzfs.h libnvpair.h)
 
288
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
 
289
AC_CHECK_HEADERS(libzfs.h libnvpair.h sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h)
 
290
 
 
291
AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
 
292
#include <sys/param.h>
 
293
#include <sys/mount.h>])
 
294
 
 
295
AC_CHECK_MEMBERS([struct statfs.f_mntfromname],,,[$ac_includes_default
 
296
#include <sys/param.h>
 
297
#include <sys/mount.h>])
252
298
 
253
299
# For opendisk() and getrawpartition() on NetBSD.
254
300
# Used in util/deviceiter.c and in util/hostdisk.c.
265
311
AC_SUBST([LIBUTIL])
266
312
 
267
313
#
 
314
# Check for host and build compilers.
 
315
#
 
316
HOST_CC=$CC
 
317
AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
 
318
                 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
 
319
 
 
320
# For gnulib.
 
321
gl_INIT
 
322
 
 
323
#
268
324
# Check for target programs.
269
325
#
270
326
 
288
344
  AC_CHECK_TOOL(STRIP, strip)
289
345
  AC_CHECK_TOOL(NM, nm)
290
346
fi
 
347
AC_SUBST(HOST_CC)
 
348
AC_SUBST(BUILD_CC)
291
349
AC_SUBST(TARGET_CC)
292
350
 
293
 
 
294
351
# Test the C compiler for the target environment.
295
352
tmp_CC="$CC"
296
353
tmp_CFLAGS="$CFLAGS"
304
361
LIBS=""
305
362
 
306
363
# debug flags.
307
 
TARGET_CFLAGS="$TARGET_CFLAGS -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
308
 
               -Wundef -Wstrict-prototypes -g"
 
364
TARGET_CFLAGS="$TARGET_CFLAGS -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g"
 
365
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
309
366
 
310
367
# Force no alignment to save space on i386.
311
368
if test "x$target_cpu" = xi386; then
344
401
  TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
345
402
fi
346
403
 
 
404
if test "${target_cpu}-${platform}" = mips-yeeloong; then
 
405
  AC_CACHE_CHECK([whether -march=loongson2f works], [grub_cv_cc_march_loongson2f], [
 
406
    SAVE_CFLAGS="$CFLAGS"
 
407
    CFLAGS="$CFLAGS -march=loongson2f"
 
408
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
 
409
        [grub_cv_cc_march_loongson2f=yes],
 
410
        [grub_cv_cc_march_loongson2f=no])
 
411
    CFLAGS="$SAVE_CFLAGS"
 
412
  ])
 
413
 
 
414
  if test "x$grub_cv_cc_march_loongson2f" = xyes; then
 
415
    TARGET_CFLAGS="$TARGET_CFLAGS -march=loongson2f"
 
416
  else
 
417
    TARGET_CFLAGS="$TARGET_CFLAGS -march=mips3"
 
418
  fi
 
419
fi
 
420
 
347
421
grub_apple_target_cc
348
422
if test x$grub_cv_apple_target_cc = xyes ; then
349
 
  TARGET_CFLAGS="$TARGET_CFLAGS -DAPPLE_CC=1 -fnested-functions"
 
423
  TARGET_CPPFLAGS="$TARGET_CPPFLAGS -DAPPLE_CC=1"
 
424
  TARGET_CFLAGS="$TARGET_CFLAGS -fnested-functions"
 
425
 
350
426
  CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
351
 
  TARGET_ASFLAGS="$TARGET_ASFLAGS -DAPPLE_CC=1"
352
427
  TARGET_APPLE_CC=1
353
428
  AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
354
429
  if test "x$OBJCONV" = x ; then
359
434
  fi
360
435
  TARGET_IMG_LDSCRIPT=
361
436
  TARGET_IMG_CFLAGS="-static"
362
 
  TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
363
 
  TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
 
437
  TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
 
438
  TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
 
439
  TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
364
440
else
365
441
  TARGET_APPLE_CC=0
366
442
# Use linker script if present, otherwise use builtin -N script.
367
 
if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
368
 
  TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
369
 
  TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}  -Wl,-Ttext,"
370
 
  TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc  -Wl,-Ttext,"
 
443
if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
 
444
  TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
 
445
  TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
 
446
  TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
 
447
  TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
371
448
else
372
449
  TARGET_IMG_LDSCRIPT=
373
 
  TARGET_IMG_LDFLAGS='-Wl,-N  -Wl,-Ttext,'
374
 
  TARGET_IMG_LDFLAGS_AC='-Wl,-N  -Wl,-Ttext,'
 
450
  TARGET_IMG_LDFLAGS='-Wl,-N'
 
451
  TARGET_IMG_LDFLAGS_AC='-Wl,-N'
 
452
  TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
375
453
fi
376
454
TARGET_IMG_CFLAGS=
377
455
fi
378
456
 
379
 
AC_SUBST(TARGET_IMG_LDSCRIPT)
380
 
AC_SUBST(TARGET_IMG_LDFLAGS)
381
 
AC_SUBST(TARGET_IMG_CFLAGS)
382
 
 
383
457
# For platforms where ELF is not the default link format.
384
458
AC_MSG_CHECKING([for command to convert module to ELF format])
385
459
case "${host_os}" in
386
 
  cygwin) TARGET_OBJ2ELF='grub-pe2elf';
 
460
  cygwin) TARGET_OBJ2ELF='$(grub_utildir)/grub-pe2elf';
387
461
# FIXME: put proper test here
388
 
  AC_DEFINE([NEED_REGISTER_FRAME_INFO], 1,
389
 
            [Define to 1 if GCC generates calls to __register_frame_info()])
 
462
  NEED_REGISTER_FRAME_INFO=1
390
463
  ;;
391
 
  *) ;;
 
464
  *) NEED_REGISTER_FRAME_INFO=0 ;;
392
465
esac
393
 
AC_SUBST(TARGET_OBJ2ELF)
394
466
AC_MSG_RESULT([$TARGET_OBJ2ELF])
395
467
 
396
 
 
397
468
if test "x$target_m32" = x1; then
398
469
  # Force 32-bit mode.
399
470
  TARGET_CFLAGS="$TARGET_CFLAGS -m32"
400
 
  TARGET_ASFLAGS="$TARGET_CFLAGS -m32"
 
471
  TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
401
472
  TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
402
473
  TARGET_MODULE_FORMAT="elf32"
403
474
fi
405
476
if test "x$target_m64" = x1; then
406
477
  # Force 64-bit mode.
407
478
  TARGET_CFLAGS="$TARGET_CFLAGS -m64"
408
 
  TARGET_ASFLAGS="$TARGET_ASFLAGS -m64"
 
479
  TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
409
480
  TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
410
481
  TARGET_MODULE_FORMAT="elf64"
411
482
fi
475
546
  TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
476
547
fi
477
548
 
478
 
AC_SUBST(TARGET_CFLAGS)
479
 
AC_SUBST(TARGET_MODULE_FORMAT)
 
549
TARGET_CPP="$TARGET_CC -E"
 
550
TARGET_CCAS=$TARGET_CC
 
551
 
480
552
AC_SUBST(OBJCONV)
 
553
AC_SUBST(TARGET_CPP)
 
554
AC_SUBST(TARGET_CCAS)
 
555
AC_SUBST(TARGET_OBJ2ELF)
481
556
AC_SUBST(TARGET_APPLE_CC)
482
 
AC_SUBST(TARGET_ASFLAGS)
 
557
AC_SUBST(TARGET_MODULE_FORMAT)
 
558
 
 
559
AC_SUBST(TARGET_CFLAGS)
 
560
AC_SUBST(TARGET_LDFLAGS)
483
561
AC_SUBST(TARGET_CPPFLAGS)
484
 
AC_SUBST(TARGET_LDFLAGS)
 
562
AC_SUBST(TARGET_CCASFLAGS)
 
563
 
 
564
AC_SUBST(TARGET_IMG_LDSCRIPT)
 
565
AC_SUBST(TARGET_IMG_LDFLAGS)
 
566
AC_SUBST(TARGET_IMG_CFLAGS)
 
567
AC_SUBST(TARGET_IMG_BASE_LDOPT)
 
568
 
 
569
AC_SUBST(HOST_CFLAGS)
 
570
AC_SUBST(HOST_LDFLAGS)
 
571
AC_SUBST(HOST_CPPFLAGS)
 
572
AC_SUBST(HOST_CCASFLAGS)
485
573
 
486
574
# Set them to their new values for the tests below.
487
575
CC="$TARGET_CC"
491
579
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
492
580
fi
493
581
CPPFLAGS="$TARGET_CPPFLAGS"
494
 
LDFLAGS="$TARGET_LDFLAGS"
 
582
if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 ; then
 
583
LIBS=
 
584
else
495
585
LIBS=-lgcc
 
586
fi
496
587
 
497
588
grub_ASM_USCORE
498
589
if test x$grub_cv_asm_uscore = xyes; then
521
612
  if test "$platform" != emu && test "x$TARGET_APPLE_CC" != x1 ; then
522
613
    if test ! -z "$TARGET_IMG_LDSCRIPT"; then
523
614
      # Check symbols provided by linker script.
524
 
      CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC}8000 -Wl,--defsym,___main=0x8100"
 
615
      CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},8000 -Wl,--defsym,___main=0x8100"
525
616
    fi
526
617
    grub_CHECK_BSS_START_SYMBOL
527
618
    grub_CHECK_END_SYMBOL
529
620
  CFLAGS="$TARGET_CFLAGS"
530
621
  grub_I386_ASM_PREFIX_REQUIREMENT
531
622
  grub_I386_ASM_ADDR32
532
 
  grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
533
 
else
534
 
  AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
535
623
fi
536
624
 
537
 
AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL)
538
 
#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
539
 
#else
540
 
#define NESTED_FUNC_ATTR
541
 
#endif])
542
 
 
543
625
AC_ARG_ENABLE([efiemu],
544
626
              [AS_HELP_STRING([--enable-efiemu],
545
627
                             [build and install the efiemu runtimes (default=guessed)])])
546
628
if test x"$enable_efiemu" = xno ; then
547
629
  efiemu_excuse="explicitly disabled"
548
630
fi
 
631
if test x"$target_cpu" != xi386 ; then
 
632
  efiemu_excuse="only available on i386"
 
633
fi
 
634
if test x"$platform" = xefi ; then
 
635
  efiemu_excuse="not available on efi"
 
636
fi
549
637
if test x"$efiemu_excuse" = x ; then
550
638
  AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
551
639
    CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
583
671
fi
584
672
fi
585
673
 
 
674
AC_CACHE_CHECK([whether -Wno-trampolines work], [grub_cv_cc_wnotrampolines], [
 
675
  SAVED_CFLAGS="$CFLAGS"
 
676
  # Test for -Wtrampolines rather than -Wno-trampolines to reduce confusion
 
677
  # in the event of later failures (since -Wno-* is always accepted, but
 
678
  # produces a diagnostic if something else is wrong).
 
679
  CFLAGS="$TARGET_CFLAGS -Wtrampolines"
 
680
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
 
681
int va_arg_func (int fixed, va_list args);]], [[]])],
 
682
      [grub_cv_cc_wnotrampolines=yes],
 
683
      [grub_cv_cc_wnotrampolines=no])
 
684
  CFLAGS="$SAVED_CFLAGS"
 
685
])
 
686
 
 
687
if test x"$grub_cv_cc_wnotrampolines" = xyes ; then
 
688
  TARGET_CFLAGS="$TARGET_CFLAGS -Wno-trampolines"
 
689
fi
 
690
 
586
691
# Restore the flags.
587
692
CC="$tmp_CC"
588
693
CFLAGS="$tmp_CFLAGS"
613
718
              [AS_HELP_STRING([--enable-grub-emu-pci],
614
719
                             [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
615
720
 
616
 
AC_ARG_ENABLE([grub-emu-modules],
617
 
              [AS_HELP_STRING([--enable-grub-emu-modules],
618
 
                             [Support module loading in `grub-emu' debugging utility (default=no)])])
619
 
 
620
721
if test "$platform" = emu; then
621
722
  missing_ncurses=
622
723
[# Check for curses libraries.]
635
736
  AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
636
737
fi
637
738
 
638
 
if test x"$enable_grub_emu_modules" = xyes ; then
639
 
  TARGET_NO_MODULES=no
640
 
else
641
 
  TARGET_NO_MODULES=yes
642
 
fi
643
 
AC_SUBST(TARGET_NO_MODULES)
644
 
 
645
 
if test "$TARGET_NO_MODULES" = yes ; then
646
 
  # Do not convert modules, otherwise linkage may fail (Cygwin only).
647
 
  # FIXME: Should be checked above before TARGET_OBJ2ELF is set first.
648
 
  TARGET_OBJ2ELF=
649
 
fi
650
 
 
651
 
if test x"$enable_grub_emu_usb" = xno ; then
652
 
  grub_emu_usb_excuse="explicitly disabled"
 
739
if test x"$enable_grub_emu_usb" != xyes ; then
 
740
   grub_emu_usb_excuse="not enabled"
653
741
fi
654
742
 
655
743
if test x"$enable_grub_emu_pci" = xyes ; then
733
821
AC_SUBST([enable_grub_emu_pci])
734
822
fi
735
823
 
736
 
AC_ARG_ENABLE([grub-fstest],
737
 
              [AS_HELP_STRING([--enable-grub-fstest],
738
 
                             [build and install the `grub-fstest' debugging utility (default=guessed)])])
739
 
if test x"$enable_grub_fstest" = xno ; then
740
 
  grub_fstest_excuse="explicitly disabled"
741
 
fi
742
 
if test x"$grub_fstest_excuse" = x ; then
743
 
enable_grub_fstest=yes
744
 
else
745
 
enable_grub_fstest=no
746
 
fi
747
 
AC_SUBST([enable_grub_fstest])
748
 
 
749
824
AC_ARG_ENABLE([grub-mkfont],
750
825
              [AS_HELP_STRING([--enable-grub-mkfont],
751
826
                             [build and install the `grub-mkfont' utility (default=guessed)])])
759
834
  if test "x$FREETYPE" = x ; then
760
835
    grub_mkfont_excuse=["need freetype2 library"]
761
836
  fi
 
837
fi
 
838
 
 
839
if test x"$grub_mkfont_excuse" = x ; then
 
840
  # Check for freetype libraries.
762
841
  freetype_cflags=`freetype-config --cflags`
763
842
  freetype_libs=`freetype-config --libs`
764
 
fi
765
 
 
766
 
if test x"$grub_mkfont_excuse" = x ; then
767
 
  # Check for freetype libraries.
768
843
  SAVED_CPPFLAGS="$CPPFLAGS"
769
844
  CPPFLAGS="$CPPFLAGS $freetype_cflags"
770
845
  AC_CHECK_HEADERS([ft2build.h], [],
793
868
 
794
869
if test x"$device_mapper_excuse" = x ; then
795
870
  # Check for device-mapper library.
796
 
  AC_CHECK_LIB([devmapper], [dm_task_create],
797
 
               [LDFLAGS="$LDFLAGS -ldevmapper"
798
 
                AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
799
 
                          [Define to 1 if you have the devmapper library.])],
800
 
               [device_mapper_excuse="need devmapper library"])
801
 
fi
 
871
  AC_CHECK_LIB([devmapper], [dm_task_create], [],
 
872
               [device_mapper_excuse="need devmapper library"])
 
873
fi
 
874
 
 
875
if test x"$device_mapper_excuse" = x ; then
 
876
  # Check for device-mapper library.
 
877
  AC_CHECK_LIB([devmapper], [dm_log_with_errno_init],
 
878
               [],
 
879
               [device_mapper_excuse="need devmapper library"])
 
880
fi
 
881
 
 
882
if test x"$device_mapper_excuse" = x ; then
 
883
   LIBDEVMAPPER="-ldevmapper";
 
884
   AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
 
885
             [Define to 1 if you have the devmapper library.])
 
886
fi
 
887
 
 
888
AC_SUBST([LIBDEVMAPPER])
 
889
 
 
890
AC_CHECK_LIB([lzma], [lzma_code],
 
891
             [LIBLZMA="-llzma"
 
892
              AC_DEFINE([HAVE_LIBLZMA], [1],
 
893
                        [Define to 1 if you have the LZMA library.])],)
 
894
AC_SUBST([LIBLZMA])
802
895
 
803
896
AC_CHECK_LIB([zfs], [libzfs_init],
804
 
             [LDFLAGS="$LDFLAGS -lzfs"
 
897
             [LIBZFS="-lzfs"
805
898
              AC_DEFINE([HAVE_LIBZFS], [1],
806
899
                        [Define to 1 if you have the ZFS library.])],)
 
900
AC_SUBST([LIBZFS])
 
901
 
807
902
AC_CHECK_LIB([nvpair], [nvlist_print],
808
 
             [LDFLAGS="$LDFLAGS -lnvpair"
 
903
             [LIBNVPAIR="-lnvpair"
809
904
              AC_DEFINE([HAVE_LIBNVPAIR], [1],
810
905
                        [Define to 1 if you have the NVPAIR library.])],)
811
 
 
812
 
AC_SUBST(ASFLAGS)
 
906
AC_SUBST([LIBNVPAIR])
 
907
 
 
908
LIBS=""
 
909
 
 
910
pkglibrootdir='$(libdir)'/`echo $PACKAGE | sed "$program_transform_name"`
 
911
AC_SUBST(pkglibrootdir)
 
912
 
 
913
AC_SUBST([FONT_SOURCE])
 
914
AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
 
915
            [AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
 
916
AS_IF([test x$TARGET_APPLE_CC = x1],
 
917
            [AC_SUBST([USE_APPLE_CC_FIXES], yes)])
 
918
 
 
919
AC_SUBST(HAVE_ASM_USCORE)
 
920
AC_SUBST(ADDR32)
 
921
AC_SUBST(DATA32)
 
922
AC_SUBST(BSS_START_SYMBOL)
 
923
AC_SUBST(END_SYMBOL)
 
924
AC_SUBST(PACKAGE)
 
925
AC_SUBST(VERSION)
 
926
AC_SUBST(NEED_ENABLE_EXECUTE_STACK)
 
927
AC_SUBST(NEED_REGISTER_FRAME_INFO)
 
928
 
 
929
#
 
930
# Automake conditionals
 
931
#
 
932
 
 
933
AM_CONDITIONAL([COND_emu], [test x$platform = xemu])
 
934
AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc])
 
935
AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi])
 
936
AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu])
 
937
AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275])
 
938
AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
 
939
AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
 
940
AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
 
941
AM_CONDITIONAL([COND_mips_yeeloong], [test x$target_cpu = xmips -a x$platform = xyeeloong])
 
942
AM_CONDITIONAL([COND_mips_qemu_mips], [test x$target_cpu = xmips -a x$platform = xqemu_mips])
 
943
AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
 
944
AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
 
945
AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips])
 
946
 
 
947
AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
 
948
AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
 
949
AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
 
950
AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
 
951
AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
 
952
 
 
953
AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
 
954
AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
 
955
AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
 
956
AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
 
957
AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
 
958
AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
 
959
AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x])
 
960
AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1])
 
961
AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
 
962
 
 
963
AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
813
964
 
814
965
# Output files.
815
966
grub_CHECK_LINK_DIR
827
978
    cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
828
979
  fi
829
980
fi
830
 
AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
 
981
 
 
982
AC_CONFIG_FILES([Makefile])
 
983
AC_CONFIG_FILES([grub-core/Makefile])
 
984
AC_CONFIG_FILES([grub-core/gnulib/Makefile])
 
985
AC_CONFIG_FILES([po/Makefile.in])
 
986
AC_CONFIG_FILES([docs/Makefile])
 
987
AC_CONFIG_FILES([util/bash-completion.d/Makefile])
831
988
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
 
989
AC_CONFIG_FILES([config.h])
 
990
 
832
991
AC_OUTPUT
833
992
[
834
993
echo "*******************************************************"
850
1009
else
851
1010
echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
852
1011
fi
853
 
if [ x"$TARGET_NO_MODULES" = xno ]; then
854
 
echo Module support for grub-emu: Yes
 
1012
fi
 
1013
if test x"$device_mapper_excuse" = x ; then
 
1014
echo With devmapper support: Yes
855
1015
else
856
 
echo Module support for grub-emu: No
857
 
fi
 
1016
echo With devmapper support: No "($device_mapper_excuse)"
858
1017
fi
859
1018
if [ x"$enable_mm_debug" = xyes ]; then
860
1019
echo With memory debugging: Yes
866
1025
else
867
1026
echo efiemu runtime: No "($efiemu_excuse)"
868
1027
fi
869
 
if [ x"$grub_fstest_excuse" = x ]; then
870
 
echo grub-fstest: Yes
871
 
else
872
 
echo grub-fstest: No "($grub_fstest_excuse)"
873
 
fi
874
1028
if [ x"$grub_mkfont_excuse" = x ]; then
875
1029
echo grub-mkfont: Yes
876
1030
else