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"
115 STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-strict-aliasing -fno-reorder-functions"
119 AC_SUBST(STAGE1_CFLAGS)
120 AC_SUBST(STAGE2_CFLAGS)
121 AC_SUBST(GRUB_CFLAGS)
123 # Enforce coding standards.
124 CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow"
125 CPPFLAGS="$CPPFLAGS -Wpointer-arith"
127 AC_CACHE_CHECK([whether -Wundef works], undef_flag, [
128 saved_CPPFLAGS="$CPPFLAGS"
130 AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no)
131 CPPFLAGS="$saved_CPPFLAGS"
134 # The options `-falign-*' are supported by gcc 3.0 or later.
135 # Probably it is sufficient to only check for -falign-loops.
136 AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
137 saved_CPPFLAGS="$CPPFLAGS"
138 CPPFLAGS="-falign-loops=1"
139 AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
140 CPPFLAGS="$saved_CPPFLAGS"
143 # Force no alignment to save space.
144 if test "x$falign_loop_flag" = xyes; then
145 CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
147 CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
150 if test "x$undef_flag" = xyes; then
151 CPPFLAGS="$CPPFLAGS -Wundef"
154 if test "x$with_binutils" != x; then
155 dnl AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH")
156 AC_PATH_PROG(OBJCOPY, objcopy, , "$with_binutils:$PATH")
158 AC_CHECK_TOOL(OBJCOPY, objcopy)
161 # Defined in acinclude.m4.
163 grub_PROG_OBJCOPY_ABSOLUTE
164 if test "x$grub_cv_prog_objcopy_absolute" != xyes; then
165 AC_MSG_ERROR([GRUB requires a working absolute objcopy; upgrade your binutils])
168 grub_ASM_PREFIX_REQUIREMENT
171 if test "x$grub_cv_asm_addr32" != xyes; then
172 AC_MSG_ERROR([GRUB requires GAS .code16 addr32 support; upgrade your binutils])
175 grub_ASM_ABSOLUTE_WITHOUT_ASTERISK
177 grub_CHECK_START_SYMBOL
178 grub_CHECK_USCORE_START_SYMBOL
179 if test "x$grub_cv_check_start_symbol" != "xyes" \
180 -a "x$grub_cv_check_uscore_start_symbol" != "xyes"; then
181 AC_MSG_ERROR([Neither start nor _start is defined])
184 grub_CHECK_USCORE_USCORE_BSS_START_SYMBOL
185 grub_CHECK_USCORE_EDATA_SYMBOL
186 grub_CHECK_EDATA_SYMBOL
187 if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" != "xyes" \
188 -a "x$grub_cv_check_uscore_edata_symbol" != "xyes" \
189 -a "x$grub_cv_check_edata_symbol" != "xyes"; then
190 AC_MSG_ERROR([None of __bss_start, _edata, edata defined])
193 grub_CHECK_END_SYMBOL
194 grub_CHECK_USCORE_END_SYMBOL
195 if test "x$grub_cv_check_end_symbol" != "xyes" \
196 -a "x$grub_cv_check_uscore_end_symbol" != "xyes"; then
197 AC_MSG_ERROR([Neither end nor _end is defined])
200 # Check for curses libraries.
202 [ --without-curses do not use curses])
204 # Get the filename or the whole disk and open it.
205 # Known to work on NetBSD.
206 AC_CHECK_LIB(util, opendisk, [GRUB_LIBS="$GRUB_LIBS -lutil"
207 AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used])])
209 # Unless the user specify --without-curses, check for curses.
210 if test "x$with_curses" != "xno"; then
211 AC_CHECK_LIB(ncurses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lncurses"
212 AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])],
213 [AC_CHECK_LIB(curses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lcurses"
214 AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])])])
220 AC_CHECK_HEADERS(string.h strings.h ncurses/curses.h ncurses.h curses.h)
222 # Check for user options.
224 # filesystems support.
225 AC_ARG_ENABLE(ext2fs,
226 [ --disable-ext2fs disable ext2fs support in Stage 2])
228 if test x"$enable_ext2fs" != xno; then
229 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_EXT2FS=1"
233 [ --disable-fat disable FAT support in Stage 2])
235 if test x"$enable_fat" != xno; then
236 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_FAT=1"
240 [ --disable-ffs disable FFS support in Stage 2])
242 if test x"$enable_ffs" != xno; then
243 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_FFS=1"
247 [ --disable-ufs2 disable UFS2 support in Stage 2])
249 if test x"$enable_ufs2" != xno; then
250 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_UFS2=1"
254 [ --disable-minix disable Minix fs support in Stage 2])
256 if test x"$enable_minix" != xno; then
257 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_MINIX=1"
260 AC_ARG_ENABLE(reiserfs,
261 [ --disable-reiserfs disable ReiserFS support in Stage 2])
263 if test x"$enable_reiserfs" != xno; then
264 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
267 AC_ARG_ENABLE(vstafs,
268 [ --disable-vstafs disable VSTa FS support in Stage 2])
270 if test x"$enable_vstafs" != xno; then
271 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_VSTAFS=1"
275 [ --disable-jfs disable IBM JFS support in Stage 2])
277 if test x"$enable_jfs" != xno; then
278 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_JFS=1"
282 [ --disable-xfs disable SGI XFS support in Stage 2])
284 if test x"$enable_xfs" != xno; then
285 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_XFS=1"
288 AC_ARG_ENABLE(iso9660,
289 [ --disable-iso9660 disable ISO9660 support in Stage 2])
291 if test x"$enable_iso9660" != xno; then
292 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_ISO9660=1"
296 [ --disable-affs disable AFFS support in Stage 2])
298 if test x"$enable_affs" != xno; then
299 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_AFFS=1"
302 dnl AC_ARG_ENABLE(tftp,
303 dnl [ --enable-tftp enable TFTP support in Stage 2])
305 dnl #if test x"$enable_tftp" = xyes; then
306 dnl FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_TFTP=1"
309 AC_ARG_ENABLE(gunzip,
310 [ --disable-gunzip disable decompression in Stage 2])
312 if test x"$enable_gunzip" = xno; then
313 FSYS_CFLAGS="$FSYS_CFLAGS -DNO_DECOMPRESSION=1"
316 AC_ARG_ENABLE(md5-password,
317 [ --disable-md5-password disable MD5 password support in Stage 2])
318 if test "x$enable_md5_password" != xno; then
319 FSYS_CFLAGS="$FSYS_CFLAGS -DUSE_MD5_PASSWORDS=1"
322 dnl The netboot support.
324 AC_ARG_ENABLE(packet-retransmission,
325 [ --disable-packet-retransmission
326 turn off packet retransmission])
327 if test "x$enable_packet_retransmission" != xno; then
328 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCONGESTED=1"
331 AC_ARG_ENABLE(pci-direct,
332 [ --enable-pci-direct access PCI directly instead of using BIOS])
333 if test "x$enable_pci_direct" = xyes; then
334 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCONFIG_PCI_DIRECT=1"
339 [ --enable-3c509 enable 3Com509 driver])
340 if test "x$enable_3c509" = xyes; then
341 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C509"
342 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c509.o"
346 [ --enable-3c529 enable 3Com529 driver])
347 if test "x$enable_3c529" = xyes; then
348 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C529=1"
349 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c529.o"
353 [ --enable-3c595 enable 3Com595 driver])
354 if test "x$enable_3c595" = xyes; then
355 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C595=1"
356 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c595.o"
360 [ --enable-3c90x enable 3Com90x driver])
361 if test "x$enable_3c90x" = xyes; then
362 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C90X=1"
363 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c90x.o"
366 AC_ARG_ENABLE(cs89x0,
367 [ --enable-cs89x0 enable CS89x0 driver])
368 if test "x$enable_cs89x0" = xyes; then
369 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_CS89X0=1"
370 NETBOOT_DRIVERS="$NETBOOT_DRIVERS cs89x0.o"
373 AC_ARG_ENABLE(davicom,
374 [ --enable-davicom enable Davicom driver])
375 if test "x$enable_davicom" = xyes; then
376 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_DAVICOM=1"
377 NETBOOT_DRIVERS="$NETBOOT_DRIVERS davicom.o"
381 [ --enable-depca enable DEPCA and EtherWORKS driver])
382 if test "x$enable_depca" = xyes; then
383 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_DEPCA=1"
384 NETBOOT_DRIVERS="$NETBOOT_DRIVERS depca.o"
388 [ --enable-eepro enable Etherexpress Pro/10 driver])
389 if test "x$enable_eepro" = xyes; then
390 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EEPRO=1"
391 NETBOOT_DRIVERS="$NETBOOT_DRIVERS eepro.o"
394 AC_ARG_ENABLE(eepro100,
395 [ --enable-eepro100 enable Etherexpress Pro/100 driver])
396 if test "x$enable_eepro100" = xyes; then
397 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EEPRO100=1"
398 NETBOOT_DRIVERS="$NETBOOT_DRIVERS eepro100.o"
401 AC_ARG_ENABLE(epic100,
402 [ --enable-epic100 enable SMC 83c170 EPIC/100 driver])
403 if test "x$enable_epic100" = xyes; then
404 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EPIC100=1"
405 NETBOOT_DRIVERS="$NETBOOT_DRIVERS epic100.o"
409 [ --enable-3c507 enable 3Com507 driver])
410 if test "x$enable_3c507" = xyes; then
411 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C507=1"
412 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c507.o"
415 AC_ARG_ENABLE(exos205,
416 [ --enable-exos205 enable EXOS205 driver])
417 if test "x$enable_exos205" = xyes; then
418 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EXOS205=1"
419 NETBOOT_DRIVERS="$NETBOOT_DRIVERS exos205.o"
422 AC_ARG_ENABLE(ni5210,
423 [ --enable-ni5210 enable Racal-Interlan NI5210 driver])
424 if test "x$enable_ni5210" = xyes; then
425 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NI5210=1"
426 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ni5210.o"
430 [ --enable-lance enable Lance PCI PCNet/32 driver])
431 if test "x$enable_lance" = xyes; then
432 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_LANCE=1"
433 NETBOOT_DRIVERS="$NETBOOT_DRIVERS lance.o"
436 AC_ARG_ENABLE(ne2100,
437 [ --enable-ne2100 enable Novell NE2100 driver])
438 if test "x$enable_ne2100" = xyes; then
439 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NE2100=1"
440 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ne2100.o"
443 AC_ARG_ENABLE(ni6510,
444 [ --enable-ni6510 enable Racal-Interlan NI6510 driver])
445 if test "x$enable_ni6510" = xyes; then
446 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NI6510=1"
447 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ni6510.o"
450 AC_ARG_ENABLE(natsemi,
451 [ --enable-natsemi enable NatSemi DP8381x driver])
452 if test "x$enable_natsemi" = xyes; then
453 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NATSEMI=1"
454 NETBOOT_DRIVERS="$NETBOOT_DRIVERS natsemi.o"
457 AC_ARG_ENABLE(ni5010,
458 [ --enable-ni5010 enable Racal-Interlan NI5010 driver])
459 if test "x$enable_ni5010" = xyes; then
460 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NI5010=1"
461 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ni5010.o"
465 [ --enable-3c503 enable 3Com503 driver])
466 if test "x$enable_3c503" = xyes; then
467 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C503=1"
468 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c503.o"
472 [ --enable-ne enable NE1000/2000 ISA driver])
473 if test "x$enable_ne" = xyes; then
474 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NE=1"
475 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ne.o"
478 AC_ARG_ENABLE(ns8390,
479 [ --enable-ns8390 enable NE2000 PCI driver])
480 if test "x$enable_ns8390" = xyes; then
481 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NS8390=1"
482 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ns8390.o"
486 [ --enable-wd enable WD8003/8013, SMC8216/8416 driver])
487 if test "x$enable_wd" = xyes; then
488 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_WD=1"
489 NETBOOT_DRIVERS="$NETBOOT_DRIVERS wd.o"
492 AC_ARG_ENABLE(otulip,
493 [ --enable-otulip enable old Tulip driver])
494 if test "x$enable_otulip" = xyes; then
495 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_OTULIP=1"
496 NETBOOT_DRIVERS="$NETBOOT_DRIVERS otulip.o"
499 AC_ARG_ENABLE(rtl8139,
500 [ --enable-rtl8139 enable Realtek 8139 driver])
501 if test "x$enable_rtl8139" = xyes; then
502 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_RTL8139=1"
503 NETBOOT_DRIVERS="$NETBOOT_DRIVERS rtl8139.o"
506 AC_ARG_ENABLE(sis900,
507 [ --enable-sis900 enable SIS 900 and SIS 7016 driver])
508 if test "x$enable_sis900" = xyes; then
509 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SIS900=1"
510 NETBOOT_DRIVERS="$NETBOOT_DRIVERS sis900.o"
513 AC_ARG_ENABLE(sk-g16,
514 [ --enable-sk-g16 enable Schneider and Koch G16 driver])
515 if test "x$enable_sk_g16" = xyes; then
516 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SK_G16=1"
517 NETBOOT_DRIVERS="$NETBOOT_DRIVERS sk_g16.o"
520 AC_ARG_ENABLE(smc9000,
521 [ --enable-smc9000 enable SMC9000 driver])
522 if test "x$enable_smc9000" = xyes; then
523 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SMC9000=1"
524 NETBOOT_DRIVERS="$NETBOOT_DRIVERS smc9000.o"
528 [ --enable-tiara enable Tiara driver])
529 if test "x$enable_tiara" = xyes; then
530 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_TIARA=1"
531 NETBOOT_DRIVERS="$NETBOOT_DRIVERS tiara.o"
535 [ --enable-tulip enable Tulip driver])
536 if test "x$enable_tulip" = xyes; then
537 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_TULIP=1"
538 NETBOOT_DRIVERS="$NETBOOT_DRIVERS tulip.o"
541 AC_ARG_ENABLE(via-rhine,
542 [ --enable-via-rhine enable Rhine-I/II driver])
543 if test "x$enable_via_rhine" = xyes; then
544 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_VIA_RHINE=1"
545 NETBOOT_DRIVERS="$NETBOOT_DRIVERS via_rhine.o"
548 AC_ARG_ENABLE(w89c840,
549 [ --enable-w89c840 enable Winbond W89c840, Compex RL100-ATX driver])
550 if test "x$enable_w89c840" = xyes; then
551 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_W89C840=1"
552 NETBOOT_DRIVERS="$NETBOOT_DRIVERS w89c840.o"
555 dnl Check if the netboot support is turned on.
556 AM_CONDITIONAL(NETBOOT_SUPPORT, test "x$NET_CFLAGS" != x)
557 if test "x$NET_CFLAGS" != x; then
558 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_TFTP=1"
562 AC_ARG_ENABLE(3c503-shmem,
563 [ --enable-3c503-shmem use 3c503 shared memory mode])
564 if test "x$enable_3c503_shmem" = xyes; then
565 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DT503_SHMEM=1"
568 AC_ARG_ENABLE(3c503-aui,
569 [ --enable-3c503-aui use AUI by default on 3c503 cards])
570 if test "x$enable_3c503_aui" = xyes; then
571 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DT503_AUI=1"
574 AC_ARG_ENABLE(compex-rl2000-fix,
575 [ --enable-compex-rl2000-fix
576 specify this if you have a Compex RL2000 PCI])
577 if test "x$enable_compex_rl2000_fix" = xyes; then
578 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCOMPEX_RL2000_FIX=1"
581 AC_ARG_ENABLE(smc9000-scan,
582 [ --enable-smc9000-scan=LIST
583 probe for SMC9000 I/O addresses using LIST],
584 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DSMC9000_SCAN=$enable_smc9000_scan"])
586 AC_ARG_ENABLE(ne-scan,
587 [ --enable-ne-scan=LIST probe for NE base address using LIST],
588 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNE_SCAN=$enable_ne_scan"],
589 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNE_SCAN=0x280,0x300,0x320,0x340"])
591 AC_ARG_ENABLE(wd-default-mem,
592 [ --enable-wd-default-mem=MEM
593 set the default memory location for WD/SMC],
594 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DWD_DEFAULT_MEM=$enable_wd_default_mem"],
595 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DWD_DEFAULT_MEM=0xCC000"])
597 AC_ARG_ENABLE(cs-scan,
598 [ --enable-cs-scan=LIST probe for CS89x0 base address using LIST],
599 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCS_SCAN=$enable_cs_scan"])
602 AC_ARG_ENABLE(diskless,
603 [ --enable-diskless enable diskless support])
604 AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes)
606 dnl Hercules terminal
607 AC_ARG_ENABLE(hercules,
608 [ --disable-hercules disable hercules terminal support])
609 AM_CONDITIONAL(HERCULES_SUPPORT, test "x$enable_hercules" != xno)
612 AC_ARG_ENABLE(serial,
613 [ --disable-serial disable serial terminal support])
614 AM_CONDITIONAL(SERIAL_SUPPORT, test "x$enable_serial" != xno)
616 dnl Simulation of the slowness of a serial device.
617 AC_ARG_ENABLE(serial-speed-simulation,
618 [ --enable-serial-speed-simulation
619 simulate the slowness of a serial device])
620 AM_CONDITIONAL(SERIAL_SPEED_SIMULATION,
621 test "x$enable_serial_speed_simulation" = xyes)
624 if test "x$enable_diskless" = xyes; then
625 if test "x$NET_CFLAGS" = x; then
626 AC_MSG_ERROR([You must enable at least one network driver])
630 dnl Embed a menu string in GRUB itself.
631 AC_ARG_ENABLE(preset-menu,
632 [ --enable-preset-menu=FILE
633 preset a menu file FILE in Stage 2])
634 if test "x$enable_preset_menu" = x; then
637 if test -r $enable_preset_menu; then
638 grub_DEFINE_FILE(PRESET_MENU_STRING, [$enable_preset_menu],
639 [Define if there is user specified preset menu string])
641 AC_MSG_ERROR([Cannot read the preset menu file $enable_preset_menu])
645 dnl Build the example Multiboot kernel.
646 AC_ARG_ENABLE(example-kernel,
647 [ --enable-example-kernel
648 build the example Multiboot kernel])
649 AM_CONDITIONAL(BUILD_EXAMPLE_KERNEL, test "x$enable_example_kernel" = xyes)
651 dnl Automatic Linux mem= option.
652 AC_ARG_ENABLE(auto-linux-mem-opt,
653 [ --disable-auto-linux-mem-opt
654 don't pass Linux mem= option automatically])
655 if test "x$enable_auto_linux_mem_opt" = xno; then
658 AC_DEFINE(AUTO_LINUX_MEM_OPT, 1, [Define if you don't want to pass the mem= option to Linux])
661 dnl Now substitute the variables.
662 AC_SUBST(FSYS_CFLAGS)
664 AC_SUBST(NET_EXTRAFLAGS)
665 AC_SUBST(NETBOOT_DRIVERS)
667 dnl Because recent automake complains about CCASFLAGS, set it here.
668 CCASFLAGS='$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)'
673 AC_CONFIG_FILES([Makefile stage1/Makefile stage2/Makefile \
674 docs/Makefile lib/Makefile util/Makefile \
675 grub/Makefile netboot/Makefile util/grub-image \
676 util/grub-install util/grub-md5-crypt \
677 util/grub-terminfo util/grub-set-default])