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.
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.
16 AC_INIT([GRUB], [0.97], [bug-grub@gnu.org])
17 AC_CONFIG_SRCDIR([stage2/stage2.c])
18 AC_CONFIG_HEADER([config.h])
24 i[[3456]]86) host_cpu=i386 ;;
25 x86_64) host_cpu=x86_64 ;;
26 *) AC_MSG_ERROR([unsupported CPU type]) ;;
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])
44 # This should be checked before AC_PROG_CC
45 if test "x$CFLAGS" = x; then
49 if test "x$host_cpu" = xx86_64; then
57 AC_CHECK_TOOL(CC, gcc)
59 # We need this for older versions of Autoconf.
62 dnl Because recent automake complains about AS, set it here.
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")
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"
89 AC_CACHE_CHECK([whether optimization for size works], size_flag, [
92 AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
95 if test "x$size_flag" = xyes; then
98 STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
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, [
105 CFLAGS="-fno-stack-protector"
108 no_stack_protector_flag=yes,
109 no_stack_protector_flag=no)
112 if test "x$no_stack_protector_flag" = xyes; then
113 STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
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"
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"
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")
157 AC_CHECK_TOOL(OBJCOPY, objcopy)
160 # Defined in acinclude.m4.
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
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.
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])])])
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"
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"
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"
246 [ --disable-ufs2 disable UFS2 support in Stage 2])
248 if test x"$enable_ufs2" != xno; then
249 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_UFS2=1"
253 [ --disable-minix disable Minix fs support in Stage 2])
255 if test x"$enable_minix" != xno; then
256 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_MINIX=1"
259 AC_ARG_ENABLE(reiserfs,
260 [ --disable-reiserfs disable ReiserFS support in Stage 2])
262 if test x"$enable_reiserfs" != xno; then
263 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
266 AC_ARG_ENABLE(vstafs,
267 [ --disable-vstafs disable VSTa FS support in Stage 2])
269 if test x"$enable_vstafs" != xno; then
270 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_VSTAFS=1"
274 [ --disable-jfs disable IBM JFS support in Stage 2])
276 if test x"$enable_jfs" != xno; then
277 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_JFS=1"
281 [ --disable-xfs disable SGI XFS support in Stage 2])
283 if test x"$enable_xfs" != xno; then
284 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_XFS=1"
287 AC_ARG_ENABLE(iso9660,
288 [ --disable-iso9660 disable ISO9660 support in Stage 2])
290 if test x"$enable_iso9660" != xno; then
291 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_ISO9660=1"
295 [ --disable-affs disable AFFS support in Stage 2])
297 if test x"$enable_affs" != xno; then
298 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_AFFS=1"
301 dnl AC_ARG_ENABLE(tftp,
302 dnl [ --enable-tftp enable TFTP support in Stage 2])
304 dnl #if test x"$enable_tftp" = xyes; then
305 dnl FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_TFTP=1"
308 AC_ARG_ENABLE(gunzip,
309 [ --disable-gunzip disable decompression in Stage 2])
311 if test x"$enable_gunzip" = xno; then
312 FSYS_CFLAGS="$FSYS_CFLAGS -DNO_DECOMPRESSION=1"
315 AC_ARG_ENABLE(md5-password,
316 [ --disable-md5-password disable MD5 password support in Stage 2])
317 if test "x$enable_md5_password" != xno; then
318 FSYS_CFLAGS="$FSYS_CFLAGS -DUSE_MD5_PASSWORDS=1"
321 dnl The netboot support.
323 AC_ARG_ENABLE(packet-retransmission,
324 [ --disable-packet-retransmission
325 turn off packet retransmission])
326 if test "x$enable_packet_retransmission" != xno; then
327 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCONGESTED=1"
330 AC_ARG_ENABLE(pci-direct,
331 [ --enable-pci-direct access PCI directly instead of using BIOS])
332 if test "x$enable_pci_direct" = xyes; then
333 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCONFIG_PCI_DIRECT=1"
338 [ --enable-3c509 enable 3Com509 driver])
339 if test "x$enable_3c509" = xyes; then
340 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C509"
341 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c509.o"
345 [ --enable-3c529 enable 3Com529 driver])
346 if test "x$enable_3c529" = xyes; then
347 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C529=1"
348 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c529.o"
352 [ --enable-3c595 enable 3Com595 driver])
353 if test "x$enable_3c595" = xyes; then
354 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C595=1"
355 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c595.o"
359 [ --enable-3c90x enable 3Com90x driver])
360 if test "x$enable_3c90x" = xyes; then
361 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C90X=1"
362 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c90x.o"
365 AC_ARG_ENABLE(cs89x0,
366 [ --enable-cs89x0 enable CS89x0 driver])
367 if test "x$enable_cs89x0" = xyes; then
368 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_CS89X0=1"
369 NETBOOT_DRIVERS="$NETBOOT_DRIVERS cs89x0.o"
372 AC_ARG_ENABLE(davicom,
373 [ --enable-davicom enable Davicom driver])
374 if test "x$enable_davicom" = xyes; then
375 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_DAVICOM=1"
376 NETBOOT_DRIVERS="$NETBOOT_DRIVERS davicom.o"
380 [ --enable-depca enable DEPCA and EtherWORKS driver])
381 if test "x$enable_depca" = xyes; then
382 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_DEPCA=1"
383 NETBOOT_DRIVERS="$NETBOOT_DRIVERS depca.o"
387 [ --enable-eepro enable Etherexpress Pro/10 driver])
388 if test "x$enable_eepro" = xyes; then
389 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EEPRO=1"
390 NETBOOT_DRIVERS="$NETBOOT_DRIVERS eepro.o"
393 AC_ARG_ENABLE(eepro100,
394 [ --enable-eepro100 enable Etherexpress Pro/100 driver])
395 if test "x$enable_eepro100" = xyes; then
396 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EEPRO100=1"
397 NETBOOT_DRIVERS="$NETBOOT_DRIVERS eepro100.o"
400 AC_ARG_ENABLE(epic100,
401 [ --enable-epic100 enable SMC 83c170 EPIC/100 driver])
402 if test "x$enable_epic100" = xyes; then
403 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EPIC100=1"
404 NETBOOT_DRIVERS="$NETBOOT_DRIVERS epic100.o"
408 [ --enable-3c507 enable 3Com507 driver])
409 if test "x$enable_3c507" = xyes; then
410 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C507=1"
411 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c507.o"
414 AC_ARG_ENABLE(exos205,
415 [ --enable-exos205 enable EXOS205 driver])
416 if test "x$enable_exos205" = xyes; then
417 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EXOS205=1"
418 NETBOOT_DRIVERS="$NETBOOT_DRIVERS exos205.o"
421 AC_ARG_ENABLE(ni5210,
422 [ --enable-ni5210 enable Racal-Interlan NI5210 driver])
423 if test "x$enable_ni5210" = xyes; then
424 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NI5210=1"
425 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ni5210.o"
429 [ --enable-lance enable Lance PCI PCNet/32 driver])
430 if test "x$enable_lance" = xyes; then
431 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_LANCE=1"
432 NETBOOT_DRIVERS="$NETBOOT_DRIVERS lance.o"
435 AC_ARG_ENABLE(ne2100,
436 [ --enable-ne2100 enable Novell NE2100 driver])
437 if test "x$enable_ne2100" = xyes; then
438 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NE2100=1"
439 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ne2100.o"
442 AC_ARG_ENABLE(ni6510,
443 [ --enable-ni6510 enable Racal-Interlan NI6510 driver])
444 if test "x$enable_ni6510" = xyes; then
445 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NI6510=1"
446 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ni6510.o"
449 AC_ARG_ENABLE(natsemi,
450 [ --enable-natsemi enable NatSemi DP8381x driver])
451 if test "x$enable_natsemi" = xyes; then
452 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NATSEMI=1"
453 NETBOOT_DRIVERS="$NETBOOT_DRIVERS natsemi.o"
456 AC_ARG_ENABLE(ni5010,
457 [ --enable-ni5010 enable Racal-Interlan NI5010 driver])
458 if test "x$enable_ni5010" = xyes; then
459 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NI5010=1"
460 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ni5010.o"
464 [ --enable-3c503 enable 3Com503 driver])
465 if test "x$enable_3c503" = xyes; then
466 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C503=1"
467 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c503.o"
471 [ --enable-ne enable NE1000/2000 ISA driver])
472 if test "x$enable_ne" = xyes; then
473 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NE=1"
474 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ne.o"
477 AC_ARG_ENABLE(ns8390,
478 [ --enable-ns8390 enable NE2000 PCI driver])
479 if test "x$enable_ns8390" = xyes; then
480 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NS8390=1"
481 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ns8390.o"
485 [ --enable-wd enable WD8003/8013, SMC8216/8416 driver])
486 if test "x$enable_wd" = xyes; then
487 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_WD=1"
488 NETBOOT_DRIVERS="$NETBOOT_DRIVERS wd.o"
491 AC_ARG_ENABLE(otulip,
492 [ --enable-otulip enable old Tulip driver])
493 if test "x$enable_otulip" = xyes; then
494 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_OTULIP=1"
495 NETBOOT_DRIVERS="$NETBOOT_DRIVERS otulip.o"
498 AC_ARG_ENABLE(rtl8139,
499 [ --enable-rtl8139 enable Realtek 8139 driver])
500 if test "x$enable_rtl8139" = xyes; then
501 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_RTL8139=1"
502 NETBOOT_DRIVERS="$NETBOOT_DRIVERS rtl8139.o"
505 AC_ARG_ENABLE(sis900,
506 [ --enable-sis900 enable SIS 900 and SIS 7016 driver])
507 if test "x$enable_sis900" = xyes; then
508 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SIS900=1"
509 NETBOOT_DRIVERS="$NETBOOT_DRIVERS sis900.o"
512 AC_ARG_ENABLE(sk-g16,
513 [ --enable-sk-g16 enable Schneider and Koch G16 driver])
514 if test "x$enable_sk_g16" = xyes; then
515 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SK_G16=1"
516 NETBOOT_DRIVERS="$NETBOOT_DRIVERS sk_g16.o"
519 AC_ARG_ENABLE(smc9000,
520 [ --enable-smc9000 enable SMC9000 driver])
521 if test "x$enable_smc9000" = xyes; then
522 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SMC9000=1"
523 NETBOOT_DRIVERS="$NETBOOT_DRIVERS smc9000.o"
527 [ --enable-tiara enable Tiara driver])
528 if test "x$enable_tiara" = xyes; then
529 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_TIARA=1"
530 NETBOOT_DRIVERS="$NETBOOT_DRIVERS tiara.o"
534 [ --enable-tulip enable Tulip driver])
535 if test "x$enable_tulip" = xyes; then
536 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_TULIP=1"
537 NETBOOT_DRIVERS="$NETBOOT_DRIVERS tulip.o"
540 AC_ARG_ENABLE(via-rhine,
541 [ --enable-via-rhine enable Rhine-I/II driver])
542 if test "x$enable_via_rhine" = xyes; then
543 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_VIA_RHINE=1"
544 NETBOOT_DRIVERS="$NETBOOT_DRIVERS via_rhine.o"
547 AC_ARG_ENABLE(w89c840,
548 [ --enable-w89c840 enable Winbond W89c840, Compex RL100-ATX driver])
549 if test "x$enable_w89c840" = xyes; then
550 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_W89C840=1"
551 NETBOOT_DRIVERS="$NETBOOT_DRIVERS w89c840.o"
554 dnl Check if the netboot support is turned on.
555 AM_CONDITIONAL(NETBOOT_SUPPORT, test "x$NET_CFLAGS" != x)
556 if test "x$NET_CFLAGS" != x; then
557 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_TFTP=1"
561 AC_ARG_ENABLE(3c503-shmem,
562 [ --enable-3c503-shmem use 3c503 shared memory mode])
563 if test "x$enable_3c503_shmem" = xyes; then
564 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DT503_SHMEM=1"
567 AC_ARG_ENABLE(3c503-aui,
568 [ --enable-3c503-aui use AUI by default on 3c503 cards])
569 if test "x$enable_3c503_aui" = xyes; then
570 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DT503_AUI=1"
573 AC_ARG_ENABLE(compex-rl2000-fix,
574 [ --enable-compex-rl2000-fix
575 specify this if you have a Compex RL2000 PCI])
576 if test "x$enable_compex_rl2000_fix" = xyes; then
577 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCOMPEX_RL2000_FIX=1"
580 AC_ARG_ENABLE(smc9000-scan,
581 [ --enable-smc9000-scan=LIST
582 probe for SMC9000 I/O addresses using LIST],
583 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DSMC9000_SCAN=$enable_smc9000_scan"])
585 AC_ARG_ENABLE(ne-scan,
586 [ --enable-ne-scan=LIST probe for NE base address using LIST],
587 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNE_SCAN=$enable_ne_scan"],
588 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNE_SCAN=0x280,0x300,0x320,0x340"])
590 AC_ARG_ENABLE(wd-default-mem,
591 [ --enable-wd-default-mem=MEM
592 set the default memory location for WD/SMC],
593 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DWD_DEFAULT_MEM=$enable_wd_default_mem"],
594 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DWD_DEFAULT_MEM=0xCC000"])
596 AC_ARG_ENABLE(cs-scan,
597 [ --enable-cs-scan=LIST probe for CS89x0 base address using LIST],
598 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCS_SCAN=$enable_cs_scan"])
601 AC_ARG_ENABLE(diskless,
602 [ --enable-diskless enable diskless support])
603 AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes)
605 dnl Hercules terminal
606 AC_ARG_ENABLE(hercules,
607 [ --disable-hercules disable hercules terminal support])
608 AM_CONDITIONAL(HERCULES_SUPPORT, test "x$enable_hercules" != xno)
611 AC_ARG_ENABLE(serial,
612 [ --disable-serial disable serial terminal support])
613 AM_CONDITIONAL(SERIAL_SUPPORT, test "x$enable_serial" != xno)
615 dnl Simulation of the slowness of a serial device.
616 AC_ARG_ENABLE(serial-speed-simulation,
617 [ --enable-serial-speed-simulation
618 simulate the slowness of a serial device])
619 AM_CONDITIONAL(SERIAL_SPEED_SIMULATION,
620 test "x$enable_serial_speed_simulation" = xyes)
623 if test "x$enable_diskless" = xyes; then
624 if test "x$NET_CFLAGS" = x; then
625 AC_MSG_ERROR([You must enable at least one network driver])
629 dnl Embed a menu string in GRUB itself.
630 AC_ARG_ENABLE(preset-menu,
631 [ --enable-preset-menu=FILE
632 preset a menu file FILE in Stage 2])
633 if test "x$enable_preset_menu" = x; then
636 if test -r $enable_preset_menu; then
637 grub_DEFINE_FILE(PRESET_MENU_STRING, [$enable_preset_menu],
638 [Define if there is user specified preset menu string])
640 AC_MSG_ERROR([Cannot read the preset menu file $enable_preset_menu])
644 dnl Build the example Multiboot kernel.
645 AC_ARG_ENABLE(example-kernel,
646 [ --enable-example-kernel
647 build the example Multiboot kernel])
648 AM_CONDITIONAL(BUILD_EXAMPLE_KERNEL, test "x$enable_example_kernel" = xyes)
650 dnl Automatic Linux mem= option.
651 AC_ARG_ENABLE(auto-linux-mem-opt,
652 [ --disable-auto-linux-mem-opt
653 don't pass Linux mem= option automatically])
654 if test "x$enable_auto_linux_mem_opt" = xno; then
657 AC_DEFINE(AUTO_LINUX_MEM_OPT, 1, [Define if you don't want to pass the mem= option to Linux])
660 dnl Now substitute the variables.
661 AC_SUBST(FSYS_CFLAGS)
663 AC_SUBST(NET_EXTRAFLAGS)
664 AC_SUBST(NETBOOT_DRIVERS)
666 dnl Because recent automake complains about CCASFLAGS, set it here.
667 CCASFLAGS='$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)'
672 AC_CONFIG_FILES([Makefile stage1/Makefile stage2/Makefile \
673 docs/Makefile lib/Makefile util/Makefile \
674 grub/Makefile netboot/Makefile util/grub-image \
675 util/grub-install util/grub-md5-crypt \
676 util/grub-terminfo util/grub-set-default])