Merge branch 'master' of git://github.com/illumos/illumos-gate
[unleashed.git] / usr / src / grub / grub-0.97 / configure.ac
blob59fe93f7606ddedab6022686603ca8d7ca85dad4
1 dnl Configure script for GRUB.
2 dnl Copyright 1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc.
4 dnl Permission to use, copy, modify and distribute this software and its
5 dnl documentation is hereby granted, provided that both the copyright
6 dnl notice and this permission notice appear in all copies of the
7 dnl software, derivative works or modified versions, and any portions
8 dnl thereof, and that both notices appear in supporting documentation.
9 dnl
10 dnl THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS
11 dnl "AS IS" CONDITION.  THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
12 dnl LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
13 dnl USE OF THIS SOFTWARE.
15 AC_PREREQ(2.57)
16 AC_INIT([GRUB], [0.97], [bug-grub@gnu.org])
17 AC_CONFIG_SRCDIR([stage2/stage2.c])
18 AC_CONFIG_HEADER([config.h])
19 AM_INIT_AUTOMAKE
21 AC_CANONICAL_HOST
23 case "$host_cpu" in
24 i[[3456]]86) host_cpu=i386 ;;
25 x86_64) host_cpu=x86_64 ;;
26 *) AC_MSG_ERROR([unsupported CPU type]) ;;
27 esac
29 AC_SUBST(host_cpu)
30 AC_SUBST(host_vendor)
33 # Options
36 AM_MAINTAINER_MODE
37 if test "x$enable_maintainer_mode" = xyes; then
38   AC_PATH_PROG(PERL,perl)
39   if test -z "$PERL"; then
40     AC_MSG_ERROR([perl not found])
41   fi
44 # This should be checked before AC_PROG_CC
45 if test "x$CFLAGS" = x; then
46   default_CFLAGS=yes
49 if test "x$host_cpu" = xx86_64; then
50   CFLAGS="-m32 $CFLAGS"
54 # Programs
57 AC_CHECK_TOOL(CC, gcc)
58 AC_PROG_CC
59 # We need this for older versions of Autoconf.
60 _AM_DEPENDENCIES(CC)
62 dnl Because recent automake complains about AS, set it here.
63 CCAS="$CC"
64 AC_SUBST(CCAS)
66 AC_ARG_WITH(binutils,
67   [  --with-binutils=DIR     search the directory DIR to find binutils])
69 if test "x$with_binutils" != x; then
70 dnl AC_PATH_TOOL is not seen in autoconf 2.13, so use AC_PATH_PROG
71 dnl instead for now. It is preferable when you cross-compile GRUB.
72 dnl  AC_PATH_TOOL(RANLIB, ranlib, :, "$with_binutils:$PATH")
73   AC_PATH_PROG(RANLIB, ranlib, :, "$with_binutils:$PATH")
74 else
75   AC_PROG_RANLIB
78 # optimization flags
79 if test "x$ac_cv_prog_gcc" = xyes; then
80   if test "x$default_CFLAGS" = xyes; then
81     # Autoconf may set CFLAGS to -O2 and/or -g. So eliminate them.
82     CFLAGS="`echo $CFLAGS | sed -e 's/-g//g' -e 's/-O[[0-9]]//g'` -g"
83     # If the user specify the directory for binutils, add the option `-B'.
84     if test "x$with_binutils" != x; then
85       CFLAGS="-B$with_binutils/ $CFLAGS"
86     fi
87     STAGE1_CFLAGS="-O2"
88     GRUB_CFLAGS="-O2"
89     AC_CACHE_CHECK([whether optimization for size works], size_flag, [
90       saved_CFLAGS=$CFLAGS
91       CFLAGS="-Os -g"
92       AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
93       CFLAGS=$saved_CFLAGS
94     ])
95     if test "x$size_flag" = xyes; then
96       STAGE2_CFLAGS="-Os"
97     else
98       STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
99     fi
100     # OpenBSD has a GCC extension for protecting applications from
101     # stack smashing attacks, but GRUB doesn't want this feature.
102     AC_CACHE_CHECK([whether gcc has -fno-stack-protector],
103                    no_stack_protector_flag, [
104       saved_CFLAGS=$CFLAGS
105       CFLAGS="-fno-stack-protector"
106       AC_TRY_COMPILE(,
107                      ,
108                      no_stack_protector_flag=yes,
109                      no_stack_protector_flag=no)
110       CFLAGS=$saved_CFLAGS
111     ])
112     if test "x$no_stack_protector_flag" = xyes; then
113       STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
114     fi
115   fi
118 AC_SUBST(STAGE1_CFLAGS)
119 AC_SUBST(STAGE2_CFLAGS)
120 AC_SUBST(GRUB_CFLAGS)
122 # Enforce coding standards.
123 CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow"
124 CPPFLAGS="$CPPFLAGS -Wpointer-arith"
126 AC_CACHE_CHECK([whether -Wundef works], undef_flag, [
127   saved_CPPFLAGS="$CPPFLAGS"
128   CPPFLAGS="-Wundef"
129   AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no)
130   CPPFLAGS="$saved_CPPFLAGS"
133 # The options `-falign-*' are supported by gcc 3.0 or later.
134 # Probably it is sufficient to only check for -falign-loops.
135 AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
136   saved_CPPFLAGS="$CPPFLAGS"
137   CPPFLAGS="-falign-loops=1"
138   AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
139   CPPFLAGS="$saved_CPPFLAGS"
142 # Force no alignment to save space.
143 if test "x$falign_loop_flag" = xyes; then
144   CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
145 else
146   CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
149 if test "x$undef_flag" = xyes; then
150   CPPFLAGS="$CPPFLAGS -Wundef"
153 if test "x$with_binutils" != x; then
154 dnl  AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH")
155   AC_PATH_PROG(OBJCOPY, objcopy, , "$with_binutils:$PATH")
156 else
157   AC_CHECK_TOOL(OBJCOPY, objcopy)
160 # Defined in acinclude.m4.
161 grub_ASM_USCORE
162 grub_PROG_OBJCOPY_ABSOLUTE
163 if test "x$grub_cv_prog_objcopy_absolute" != xyes; then
164   AC_MSG_ERROR([GRUB requires a working absolute objcopy; upgrade your binutils])
167 grub_ASM_PREFIX_REQUIREMENT
169 grub_ASM_ADDR32
170 if test "x$grub_cv_asm_addr32" != xyes; then
171   AC_MSG_ERROR([GRUB requires GAS .code16 addr32 support; upgrade your binutils])
174 grub_ASM_ABSOLUTE_WITHOUT_ASTERISK
176 grub_CHECK_START_SYMBOL
177 grub_CHECK_USCORE_START_SYMBOL
178 if test "x$grub_cv_check_start_symbol" != "xyes" \
179         -a "x$grub_cv_check_uscore_start_symbol" != "xyes"; then
180   AC_MSG_ERROR([Neither start nor _start is defined])
183 grub_CHECK_USCORE_USCORE_BSS_START_SYMBOL
184 grub_CHECK_USCORE_EDATA_SYMBOL
185 grub_CHECK_EDATA_SYMBOL
186 if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" != "xyes" \
187         -a "x$grub_cv_check_uscore_edata_symbol" != "xyes" \
188         -a "x$grub_cv_check_edata_symbol" != "xyes"; then
189   AC_MSG_ERROR([None of __bss_start, _edata, edata defined])
192 grub_CHECK_END_SYMBOL
193 grub_CHECK_USCORE_END_SYMBOL
194 if test "x$grub_cv_check_end_symbol" != "xyes" \
195         -a "x$grub_cv_check_uscore_end_symbol" != "xyes"; then
196   AC_MSG_ERROR([Neither end nor _end is defined])
199 # Check for curses libraries.
200 AC_ARG_WITH(curses,
201   [  --without-curses        do not use curses])
203 # Get the filename or the whole disk and open it.
204 # Known to work on NetBSD.
205 AC_CHECK_LIB(util, opendisk, [GRUB_LIBS="$GRUB_LIBS -lutil"
206   AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used])])
208 # Unless the user specify --without-curses, check for curses.
209 if test "x$with_curses" != "xno"; then
210   AC_CHECK_LIB(ncurses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lncurses"
211   AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])],
212     [AC_CHECK_LIB(curses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lcurses"
213        AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])])])
216 AC_SUBST(GRUB_LIBS)
218 # Check for headers.
219 AC_CHECK_HEADERS(string.h strings.h ncurses/curses.h ncurses.h curses.h)
221 # Check for user options.
223 # filesystems support.
224 AC_ARG_ENABLE(ext2fs,
225   [  --disable-ext2fs        disable ext2fs support in Stage 2])
227 if test x"$enable_ext2fs" != xno; then
228   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_EXT2FS=1"
231 AC_ARG_ENABLE(fat,
232   [  --disable-fat           disable FAT support in Stage 2])
234 if test x"$enable_fat" != xno; then
235   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_FAT=1"
238 AC_ARG_ENABLE(ffs,
239   [  --disable-ffs           disable FFS support in Stage 2])
241 if test x"$enable_ffs" != xno; then
242   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_FFS=1"
245 AC_ARG_ENABLE(ufs,
246   [  --disable-ufs           disable UFS support in Stage 2])
248 if test x"$enable_ufs" != xno; then
249   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_UFS=1"
252 AC_ARG_ENABLE(ufs2,
253   [  --disable-ufs2          disable UFS2 support in Stage 2])
255 if test x"$enable_ufs2" != xno; then
256   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_UFS2=1"
259 AC_ARG_ENABLE(minix,
260   [  --disable-minix         disable Minix fs support in Stage 2])
262 if test x"$enable_minix" != xno; then
263   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_MINIX=1"
266 AC_ARG_ENABLE(reiserfs,
267   [  --disable-reiserfs      disable ReiserFS support in Stage 2])
269 if test x"$enable_reiserfs" != xno; then
270   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
273 AC_ARG_ENABLE(vstafs,
274   [  --disable-vstafs        disable VSTa FS support in Stage 2])
276 if test x"$enable_vstafs" != xno; then
277   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_VSTAFS=1"
280 AC_ARG_ENABLE(jfs,
281   [  --disable-jfs           disable IBM JFS support in Stage 2])
283 if test x"$enable_jfs" != xno; then
284   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_JFS=1"
287 AC_ARG_ENABLE(xfs,
288   [  --disable-xfs           disable SGI XFS support in Stage 2])
290 if test x"$enable_xfs" != xno; then
291   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_XFS=1"
294 AC_ARG_ENABLE(zfs,
295   [  --disable-zfs           disable ZFS support in Stage 2])
297 if test x"$enable_zfs" != xno; then
298   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_ZFS=1"
301 AC_ARG_ENABLE(iso9660,
302   [  --disable-iso9660       disable ISO9660 support in Stage 2])
304 if test x"$enable_iso9660" != xno; then
305   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_ISO9660=1"
308 dnl AC_ARG_ENABLE(tftp,
309 dnl [  --enable-tftp           enable TFTP support in Stage 2])
310 dnl 
311 dnl #if test x"$enable_tftp" = xyes; then
312 dnl FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_TFTP=1"
313 dnl fi
315 AC_ARG_ENABLE(gunzip,
316   [  --disable-gunzip        disable decompression in Stage 2])
318 if test x"$enable_gunzip" = xno; then
319   FSYS_CFLAGS="$FSYS_CFLAGS -DNO_DECOMPRESSION=1"
322 AC_ARG_ENABLE(md5-password,
323   [  --disable-md5-password  disable MD5 password support in Stage 2])
324 if test "x$enable_md5_password" != xno; then
325   FSYS_CFLAGS="$FSYS_CFLAGS -DUSE_MD5_PASSWORDS=1"
328 dnl The netboot support.
329 dnl General options.
330 AC_ARG_ENABLE(packet-retransmission,
331   [  --disable-packet-retransmission
332                           turn off packet retransmission])
333 if test "x$enable_packet_retransmission" != xno; then
334   NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCONGESTED=1 -DCONFIG_PCI"
337 AC_ARG_ENABLE(pci-direct,
338   [  --enable-pci-direct     access PCI directly instead of using BIOS])
339 if test "x$enable_pci_direct" = xyes; then
340   NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCONFIG_PCI_DIRECT=1"
343 dnl Device drivers.
344 AC_ARG_ENABLE(3c595,
345   [  --enable-3c595          enable 3Com595 driver])
346 if test "x$enable_3c595" = xyes; then
347   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C595=1"
348   NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c595.o"
351 AC_ARG_ENABLE(3c90x,
352   [  --enable-3c90x          enable 3Com90x driver])
353 if test "x$enable_3c90x" = xyes; then
354   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C90X=1"
355   NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c90x.o"
358 AC_ARG_ENABLE(davicom,
359   [  --enable-davicom        enable Davicom driver])
360 if test "x$enable_davicom" = xyes; then
361   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_DAVICOM=1"
362   NETBOOT_DRIVERS="$NETBOOT_DRIVERS davicom.o"
365 AC_ARG_ENABLE(e1000,
366   [  --enable-e1000          enable Etherexpress Pro/1000 driver])
367 if test "x$enable_e1000" = xyes; then
368   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_E1000=1"
369   NETBOOT_DRIVERS="$NETBOOT_DRIVERS e1000.o"
372 AC_ARG_ENABLE(eepro100,
373   [  --enable-eepro100       enable Etherexpress Pro/100 driver])
374 if test "x$enable_eepro100" = xyes; then
375   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EEPRO100=1"
376   NETBOOT_DRIVERS="$NETBOOT_DRIVERS eepro100.o"
379 AC_ARG_ENABLE(epic100,
380   [  --enable-epic100        enable SMC 83c170 EPIC/100 driver])
381 if test "x$enable_epic100" = xyes; then
382   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EPIC100=1"
383   NETBOOT_DRIVERS="$NETBOOT_DRIVERS epic100.o"
386 AC_ARG_ENABLE(forcedeth,
387   [  --enable-forcedeth      enable Nvidia Geforce driver])
388 if test "x$enable_forcedeth" = xyes; then
389   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_FORCEDETH=1"
390   NETBOOT_DRIVERS="$NETBOOT_DRIVERS forcedeth.o"
393 AC_ARG_ENABLE(natsemi,
394   [  --enable-natsemi        enable NatSemi DP8381x driver])
395 if test "x$enable_natsemi" = xyes; then
396   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NATSEMI=1"
397   NETBOOT_DRIVERS="$NETBOOT_DRIVERS natsemi.o"
400 AC_ARG_ENABLE(ns83820,
401   [  --enable-ns83820        enable NS83820 driver])
402 if test "x$enable_ns83820" = xyes; then
403   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NS83820=1"
404   NETBOOT_DRIVERS="$NETBOOT_DRIVERS ns83820.o"
407 AC_ARG_ENABLE(ns8390,
408   [  --enable-ns8390         enable NE2000 PCI driver])
409 if test "x$enable_ns8390" = xyes; then
410   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NS8390=1"
411   NETBOOT_DRIVERS="$NETBOOT_DRIVERS ns8390.o"
414 AC_ARG_ENABLE(pcnet32,
415   [  --enable-pcnet32        enable AMD Lance/PCI PCNet/32 driver])
416 if test "x$enable_pcnet32" = xyes; then
417   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_PCNET32=1"
418   NETBOOT_DRIVERS="$NETBOOT_DRIVERS pcnet32.o"
421 AC_ARG_ENABLE(pnic,
422   [  --enable-pnic           enable Bochs Pseudo Nic driver])
423 if test "x$enable_pnic" = xyes; then
424   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_PNIC=1"
425   NETBOOT_DRIVERS="$NETBOOT_DRIVERS pnic.o"
428 AC_ARG_ENABLE(rtl8139,
429   [  --enable-rtl8139        enable Realtek 8139 driver])
430 if test "x$enable_rtl8139" = xyes; then
431   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_RTL8139=1"
432   NETBOOT_DRIVERS="$NETBOOT_DRIVERS rtl8139.o"
435 AC_ARG_ENABLE(r8169,
436   [  --enable-r8169          enable Realtek 8169 driver])
437 if test "x$enable_r8169" = xyes; then
438   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_R8169=1"
439   NETBOOT_DRIVERS="$NETBOOT_DRIVERS r8169.o"
442 AC_ARG_ENABLE(sis900,
443   [  --enable-sis900         enable SIS 900 and SIS 7016 driver])
444 if test "x$enable_sis900" = xyes; then
445   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SIS900=1"
446   NETBOOT_DRIVERS="$NETBOOT_DRIVERS sis900.o"
449 AC_ARG_ENABLE(sundance,
450   [  --enable-sundance       enable Sundance ST201 driver])
451 if test "x$enable_sundance" = xyes; then
452   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SUNDANCE=1"
453   NETBOOT_DRIVERS="$NETBOOT_DRIVERS sundance.o"
456 AC_ARG_ENABLE(tg3,
457   [  --enable-tg3            enable Broadcom Tigon3 driver])
458 if test "x$enable_tg3" = xyes; then
459   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_TG3=1"
460   NETBOOT_DRIVERS="$NETBOOT_DRIVERS tg3.o"
463 AC_ARG_ENABLE(tulip,
464   [  --enable-tulip          enable Tulip driver])
465 if test "x$enable_tulip" = xyes; then
466   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_TULIP=1"
467   NETBOOT_DRIVERS="$NETBOOT_DRIVERS tulip.o"
470 AC_ARG_ENABLE(tlan,
471   [  --enable-tlan           enable TI ThunderLAN driver])
472 if test "x$enable_tlan" = xyes; then
473   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_TLAN=1"
474   NETBOOT_DRIVERS="$NETBOOT_DRIVERS tlan.o"
477 AC_ARG_ENABLE(undi,
478   [  --enable-undi           enable PXE UNDI driver])
479 if test "x$enable_undi" = xyes; then
480   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_UNDI=1"
481   NETBOOT_DRIVERS="$NETBOOT_DRIVERS undi.o"
484 AC_ARG_ENABLE(via-rhine,
485   [  --enable-via-rhine      enable Rhine-I/II driver])
486 if test "x$enable_via_rhine" = xyes; then
487   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_VIA_RHINE=1"
488   NETBOOT_DRIVERS="$NETBOOT_DRIVERS via_rhine.o"
491 AC_ARG_ENABLE(w89c840,
492   [  --enable-w89c840        enable Winbond W89c840 driver])
493 if test "x$enable_w89c840" = xyes; then
494   NET_CFLAGS="$NET_CFLAGS -DINCLUDE_W89C840=1"
495   NETBOOT_DRIVERS="$NETBOOT_DRIVERS w89c840.o"
498 dnl Check if the netboot support is turned on.
499 AM_CONDITIONAL(NETBOOT_SUPPORT, test "x$NET_CFLAGS" != x)
500 if test "x$NET_CFLAGS" != x; then
501   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_TFTP=1"
504 dnl extra flag for ns8390.c
505 AC_ARG_ENABLE(compex-rl2000-fix,
506   [  --enable-compex-rl2000-fix
507                           specify this if you have a Compex RL2000 PCI])
508 if test "x$enable_compex_rl2000_fix" = xyes; then
509   NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCOMPEX_RL2000_FIX=1"
512 AC_ARG_ENABLE(ne-scan,
513   [  --enable-ne-scan=LIST   probe for NE base address using LIST],
514   [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNE_SCAN=$enable_ne_scan"],
515   [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNE_SCAN=0x280,0x300,0x320,0x340"])
517 AC_ARG_ENABLE(wd-default-mem,
518   [  --enable-wd-default-mem=MEM
519                           set the default memory location for WD/SMC],
520   [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DWD_DEFAULT_MEM=$enable_wd_default_mem"],
521   [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DWD_DEFAULT_MEM=0xCC000"])
523 dnl Diskless
524 AC_ARG_ENABLE(diskless,
525   [  --enable-diskless       enable diskless support])
526 AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes)
528 dnl Graphical splashscreen support
529 AC_ARG_ENABLE(graphics,
530   [  --disable-graphics      disable graphics terminal support])
531 AM_CONDITIONAL(GRAPHICS_SUPPORT, test "x$enable_graphics" != xno)
533 dnl Hercules terminal
534 AC_ARG_ENABLE(hercules,
535   [  --disable-hercules      disable hercules terminal support])
536 AM_CONDITIONAL(HERCULES_SUPPORT, test "x$enable_hercules" != xno)
538 dnl Serial terminal
539 AC_ARG_ENABLE(serial,
540   [  --disable-serial        disable serial terminal support])
541 AM_CONDITIONAL(SERIAL_SUPPORT, test "x$enable_serial" != xno)
543 dnl Simulation of the slowness of a serial device.
544 AC_ARG_ENABLE(serial-speed-simulation,
545   [  --enable-serial-speed-simulation
546                           simulate the slowness of a serial device])
547 AM_CONDITIONAL(SERIAL_SPEED_SIMULATION,
548   test "x$enable_serial_speed_simulation" = xyes)
550 # Sanity check.
551 if test "x$enable_diskless" = xyes; then
552   if test "x$NET_CFLAGS" = x; then
553     AC_MSG_ERROR([You must enable at least one network driver])
554   fi
557 dnl Embed a menu string in GRUB itself.
558 AC_ARG_ENABLE(preset-menu,
559   [  --enable-preset-menu=FILE
560                           preset a menu file FILE in Stage 2])
561 if test "x$enable_preset_menu" = x; then
562   :
563 else
564   if test -r $enable_preset_menu; then
565     grub_DEFINE_FILE(PRESET_MENU_STRING, [$enable_preset_menu],
566                      [Define if there is user specified preset menu string])
567   else
568     AC_MSG_ERROR([Cannot read the preset menu file $enable_preset_menu])
569   fi
572 dnl Build the example Multiboot kernel.
573 AC_ARG_ENABLE(example-kernel,
574   [  --enable-example-kernel
575                           build the example Multiboot kernel])
576 AM_CONDITIONAL(BUILD_EXAMPLE_KERNEL, test "x$enable_example_kernel" = xyes)
578 dnl Automatic Linux mem= option.
579 AC_ARG_ENABLE(auto-linux-mem-opt,
580   [  --disable-auto-linux-mem-opt
581                           don't pass Linux mem= option automatically])
582 if test "x$enable_auto_linux_mem_opt" = xno; then
583   :
584 else
585   AC_DEFINE(AUTO_LINUX_MEM_OPT, 1, [Define if you don't want to pass the mem= option to Linux])
588 dnl Now substitute the variables.
589 AC_SUBST(FSYS_CFLAGS)
590 AC_SUBST(NET_CFLAGS)
591 AC_SUBST(NET_EXTRAFLAGS)
592 AC_SUBST(NETBOOT_DRIVERS)
594 dnl Because recent automake complains about CCASFLAGS, set it here.
595 CCASFLAGS='$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)'
596 AC_SUBST(CCASFLAGS)
599 dnl Output.
600 AC_CONFIG_FILES([Makefile stage1/Makefile stage2/Makefile \
601                  docs/Makefile lib/Makefile util/Makefile \
602                  grub/Makefile netboot/Makefile util/grub-image \
603                  util/grub-install util/grub-md5-crypt \
604                  util/grub-terminfo util/grub-set-default])
605 AC_OUTPUT