1 dnl Configure script for GRUB. 2 dnl Copyright 1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc. 3 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. 14 15 AC_PREREQ(2.57) 16 AC_INIT([GRUB], [0.97], [bug-grub (a] gnu.org]) 17 AC_CONFIG_SRCDIR([stage2/stage2.c]) 18 AC_CONFIG_HEADER([config.h]) 19 AM_INIT_AUTOMAKE 20 21 AC_CANONICAL_HOST 22 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 28 29 AC_SUBST(host_cpu) 30 AC_SUBST(host_vendor) 31 32 # 33 # Options 34 # 35 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 42 fi 43 44 # This should be checked before AC_PROG_CC 45 if test "x$CFLAGS" = x; then 46 default_CFLAGS=yes 47 fi 48 49 if test "x$host_cpu" = xx86_64; then 50 CFLAGS="-m32 $CFLAGS" 51 fi 52 53 # 54 # Programs 55 # 56 57 AC_CHECK_TOOL(CC, gcc) 58 AC_PROG_CC 59 # We need this for older versions of Autoconf. 60 _AM_DEPENDENCIES(CC) 61 62 dnl Because recent automake complains about AS, set it here. 63 CCAS="$CC" 64 AC_SUBST(CCAS) 65 66 AC_ARG_WITH(binutils, 67 [ --with-binutils=DIR search the directory DIR to find binutils]) 68 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 76 fi 77 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 116 fi 117 118 AC_SUBST(STAGE1_CFLAGS) 119 AC_SUBST(STAGE2_CFLAGS) 120 AC_SUBST(GRUB_CFLAGS) 121 122 # Enforce coding standards. 123 CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow" 124 CPPFLAGS="$CPPFLAGS -Wpointer-arith" 125 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" 131 ]) 132 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" 140 ]) 141 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" 147 fi 148 149 if test "x$undef_flag" = xyes; then 150 CPPFLAGS="$CPPFLAGS -Wundef" 151 fi 152 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) 158 fi 159 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]) 165 fi 166 167 grub_ASM_PREFIX_REQUIREMENT 168 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]) 172 fi 173 174 grub_ASM_ABSOLUTE_WITHOUT_ASTERISK 175 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]) 181 fi 182 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]) 190 fi 191 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]) 197 fi 198 199 # Check for curses libraries. 200 AC_ARG_WITH(curses, 201 [ --without-curses do not use curses]) 202 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])]) 207 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])])]) 214 fi 215 216 AC_SUBST(GRUB_LIBS) 217 218 # Check for headers. 219 AC_CHECK_HEADERS(string.h strings.h ncurses/curses.h ncurses.h curses.h) 220 221 # Check for user options. 222 223 # filesystems support. 224 AC_ARG_ENABLE(ext2fs, 225 [ --disable-ext2fs disable ext2fs support in Stage 2]) 226 227 if test x"$enable_ext2fs" != xno; then 228 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_EXT2FS=1" 229 fi 230 231 AC_ARG_ENABLE(fat, 232 [ --disable-fat disable FAT support in Stage 2]) 233 234 if test x"$enable_fat" != xno; then 235 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_FAT=1" 236 fi 237 238 AC_ARG_ENABLE(ffs, 239 [ --disable-ffs disable FFS support in Stage 2]) 240 241 if test x"$enable_ffs" != xno; then 242 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_FFS=1" 243 fi 244 245 AC_ARG_ENABLE(ufs2, 246 [ --disable-ufs2 disable UFS2 support in Stage 2]) 247 248 if test x"$enable_ufs2" != xno; then 249 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_UFS2=1" 250 fi 251 252 AC_ARG_ENABLE(minix, 253 [ --disable-minix disable Minix fs support in Stage 2]) 254 255 if test x"$enable_minix" != xno; then 256 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_MINIX=1" 257 fi 258 259 AC_ARG_ENABLE(reiserfs, 260 [ --disable-reiserfs disable ReiserFS support in Stage 2]) 261 262 if test x"$enable_reiserfs" != xno; then 263 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1" 264 fi 265 266 AC_ARG_ENABLE(vstafs, 267 [ --disable-vstafs disable VSTa FS support in Stage 2]) 268 269 if test x"$enable_vstafs" != xno; then 270 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_VSTAFS=1" 271 fi 272 273 AC_ARG_ENABLE(jfs, 274 [ --disable-jfs disable IBM JFS support in Stage 2]) 275 276 if test x"$enable_jfs" != xno; then 277 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_JFS=1" 278 fi 279 280 AC_ARG_ENABLE(xfs, 281 [ --disable-xfs disable SGI XFS support in Stage 2]) 282 283 if test x"$enable_xfs" != xno; then 284 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_XFS=1" 285 fi 286 287 AC_ARG_ENABLE(iso9660, 288 [ --disable-iso9660 disable ISO9660 support in Stage 2]) 289 290 if test x"$enable_iso9660" != xno; then 291 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_ISO9660=1" 292 fi 293 294 dnl AC_ARG_ENABLE(tftp, 295 dnl [ --enable-tftp enable TFTP support in Stage 2]) 296 dnl 297 dnl #if test x"$enable_tftp" = xyes; then 298 dnl FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_TFTP=1" 299 dnl fi 300 301 AC_ARG_ENABLE(gunzip, 302 [ --disable-gunzip disable decompression in Stage 2]) 303 304 if test x"$enable_gunzip" = xno; then 305 FSYS_CFLAGS="$FSYS_CFLAGS -DNO_DECOMPRESSION=1" 306 fi 307 308 AC_ARG_ENABLE(md5-password, 309 [ --disable-md5-password disable MD5 password support in Stage 2]) 310 if test "x$enable_md5_password" != xno; then 311 FSYS_CFLAGS="$FSYS_CFLAGS -DUSE_MD5_PASSWORDS=1" 312 fi 313 314 dnl The netboot support. 315 dnl General options. 316 AC_ARG_ENABLE(packet-retransmission, 317 [ --disable-packet-retransmission 318 turn off packet retransmission]) 319 if test "x$enable_packet_retransmission" != xno; then 320 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCONGESTED=1" 321 fi 322 323 AC_ARG_ENABLE(pci-direct, 324 [ --enable-pci-direct access PCI directly instead of using BIOS]) 325 if test "x$enable_pci_direct" = xyes; then 326 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCONFIG_PCI_DIRECT=1" 327 fi 328 329 dnl Device drivers. 330 AC_ARG_ENABLE(3c509, 331 [ --enable-3c509 enable 3Com509 driver]) 332 if test "x$enable_3c509" = xyes; then 333 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C509" 334 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c509.o" 335 fi 336 337 AC_ARG_ENABLE(3c529, 338 [ --enable-3c529 enable 3Com529 driver]) 339 if test "x$enable_3c529" = xyes; then 340 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C529=1" 341 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c529.o" 342 fi 343 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" 349 fi 350 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" 356 fi 357 358 AC_ARG_ENABLE(cs89x0, 359 [ --enable-cs89x0 enable CS89x0 driver]) 360 if test "x$enable_cs89x0" = xyes; then 361 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_CS89X0=1" 362 NETBOOT_DRIVERS="$NETBOOT_DRIVERS cs89x0.o" 363 fi 364 365 AC_ARG_ENABLE(davicom, 366 [ --enable-davicom enable Davicom driver]) 367 if test "x$enable_davicom" = xyes; then 368 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_DAVICOM=1" 369 NETBOOT_DRIVERS="$NETBOOT_DRIVERS davicom.o" 370 fi 371 372 AC_ARG_ENABLE(depca, 373 [ --enable-depca enable DEPCA and EtherWORKS driver]) 374 if test "x$enable_depca" = xyes; then 375 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_DEPCA=1" 376 NETBOOT_DRIVERS="$NETBOOT_DRIVERS depca.o" 377 fi 378 379 AC_ARG_ENABLE(eepro, 380 [ --enable-eepro enable Etherexpress Pro/10 driver]) 381 if test "x$enable_eepro" = xyes; then 382 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EEPRO=1" 383 NETBOOT_DRIVERS="$NETBOOT_DRIVERS eepro.o" 384 fi 385 386 AC_ARG_ENABLE(eepro100, 387 [ --enable-eepro100 enable Etherexpress Pro/100 driver]) 388 if test "x$enable_eepro100" = xyes; then 389 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EEPRO100=1" 390 NETBOOT_DRIVERS="$NETBOOT_DRIVERS eepro100.o" 391 fi 392 393 AC_ARG_ENABLE(epic100, 394 [ --enable-epic100 enable SMC 83c170 EPIC/100 driver]) 395 if test "x$enable_epic100" = xyes; then 396 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EPIC100=1" 397 NETBOOT_DRIVERS="$NETBOOT_DRIVERS epic100.o" 398 fi 399 400 AC_ARG_ENABLE(3c507, 401 [ --enable-3c507 enable 3Com507 driver]) 402 if test "x$enable_3c507" = xyes; then 403 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C507=1" 404 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c507.o" 405 fi 406 407 AC_ARG_ENABLE(exos205, 408 [ --enable-exos205 enable EXOS205 driver]) 409 if test "x$enable_exos205" = xyes; then 410 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_EXOS205=1" 411 NETBOOT_DRIVERS="$NETBOOT_DRIVERS exos205.o" 412 fi 413 414 AC_ARG_ENABLE(ni5210, 415 [ --enable-ni5210 enable Racal-Interlan NI5210 driver]) 416 if test "x$enable_ni5210" = xyes; then 417 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NI5210=1" 418 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ni5210.o" 419 fi 420 421 AC_ARG_ENABLE(lance, 422 [ --enable-lance enable Lance PCI PCNet/32 driver]) 423 if test "x$enable_lance" = xyes; then 424 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_LANCE=1" 425 NETBOOT_DRIVERS="$NETBOOT_DRIVERS lance.o" 426 fi 427 428 AC_ARG_ENABLE(ne2100, 429 [ --enable-ne2100 enable Novell NE2100 driver]) 430 if test "x$enable_ne2100" = xyes; then 431 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NE2100=1" 432 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ne2100.o" 433 fi 434 435 AC_ARG_ENABLE(ni6510, 436 [ --enable-ni6510 enable Racal-Interlan NI6510 driver]) 437 if test "x$enable_ni6510" = xyes; then 438 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NI6510=1" 439 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ni6510.o" 440 fi 441 442 AC_ARG_ENABLE(natsemi, 443 [ --enable-natsemi enable NatSemi DP8381x driver]) 444 if test "x$enable_natsemi" = xyes; then 445 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NATSEMI=1" 446 NETBOOT_DRIVERS="$NETBOOT_DRIVERS natsemi.o" 447 fi 448 449 AC_ARG_ENABLE(ni5010, 450 [ --enable-ni5010 enable Racal-Interlan NI5010 driver]) 451 if test "x$enable_ni5010" = xyes; then 452 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NI5010=1" 453 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ni5010.o" 454 fi 455 456 AC_ARG_ENABLE(3c503, 457 [ --enable-3c503 enable 3Com503 driver]) 458 if test "x$enable_3c503" = xyes; then 459 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_3C503=1" 460 NETBOOT_DRIVERS="$NETBOOT_DRIVERS 3c503.o" 461 fi 462 463 AC_ARG_ENABLE(ne, 464 [ --enable-ne enable NE1000/2000 ISA driver]) 465 if test "x$enable_ne" = xyes; then 466 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NE=1" 467 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ne.o" 468 fi 469 470 AC_ARG_ENABLE(ns8390, 471 [ --enable-ns8390 enable NE2000 PCI driver]) 472 if test "x$enable_ns8390" = xyes; then 473 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_NS8390=1" 474 NETBOOT_DRIVERS="$NETBOOT_DRIVERS ns8390.o" 475 fi 476 477 AC_ARG_ENABLE(wd, 478 [ --enable-wd enable WD8003/8013, SMC8216/8416 driver]) 479 if test "x$enable_wd" = xyes; then 480 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_WD=1" 481 NETBOOT_DRIVERS="$NETBOOT_DRIVERS wd.o" 482 fi 483 484 AC_ARG_ENABLE(otulip, 485 [ --enable-otulip enable old Tulip driver]) 486 if test "x$enable_otulip" = xyes; then 487 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_OTULIP=1" 488 NETBOOT_DRIVERS="$NETBOOT_DRIVERS otulip.o" 489 fi 490 491 AC_ARG_ENABLE(rtl8139, 492 [ --enable-rtl8139 enable Realtek 8139 driver]) 493 if test "x$enable_rtl8139" = xyes; then 494 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_RTL8139=1" 495 NETBOOT_DRIVERS="$NETBOOT_DRIVERS rtl8139.o" 496 fi 497 498 AC_ARG_ENABLE(sis900, 499 [ --enable-sis900 enable SIS 900 and SIS 7016 driver]) 500 if test "x$enable_sis900" = xyes; then 501 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SIS900=1" 502 NETBOOT_DRIVERS="$NETBOOT_DRIVERS sis900.o" 503 fi 504 505 AC_ARG_ENABLE(sk-g16, 506 [ --enable-sk-g16 enable Schneider and Koch G16 driver]) 507 if test "x$enable_sk_g16" = xyes; then 508 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SK_G16=1" 509 NETBOOT_DRIVERS="$NETBOOT_DRIVERS sk_g16.o" 510 fi 511 512 AC_ARG_ENABLE(smc9000, 513 [ --enable-smc9000 enable SMC9000 driver]) 514 if test "x$enable_smc9000" = xyes; then 515 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_SMC9000=1" 516 NETBOOT_DRIVERS="$NETBOOT_DRIVERS smc9000.o" 517 fi 518 519 AC_ARG_ENABLE(tiara, 520 [ --enable-tiara enable Tiara driver]) 521 if test "x$enable_tiara" = xyes; then 522 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_TIARA=1" 523 NETBOOT_DRIVERS="$NETBOOT_DRIVERS tiara.o" 524 fi 525 526 AC_ARG_ENABLE(tulip, 527 [ --enable-tulip enable Tulip driver]) 528 if test "x$enable_tulip" = xyes; then 529 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_TULIP=1" 530 NETBOOT_DRIVERS="$NETBOOT_DRIVERS tulip.o" 531 fi 532 533 AC_ARG_ENABLE(via-rhine, 534 [ --enable-via-rhine enable Rhine-I/II driver]) 535 if test "x$enable_via_rhine" = xyes; then 536 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_VIA_RHINE=1" 537 NETBOOT_DRIVERS="$NETBOOT_DRIVERS via_rhine.o" 538 fi 539 540 AC_ARG_ENABLE(w89c840, 541 [ --enable-w89c840 enable Winbond W89c840, Compex RL100-ATX driver]) 542 if test "x$enable_w89c840" = xyes; then 543 NET_CFLAGS="$NET_CFLAGS -DINCLUDE_W89C840=1" 544 NETBOOT_DRIVERS="$NETBOOT_DRIVERS w89c840.o" 545 fi 546 547 dnl Check if the netboot support is turned on. 548 AM_CONDITIONAL(NETBOOT_SUPPORT, test "x$NET_CFLAGS" != x) 549 if test "x$NET_CFLAGS" != x; then 550 FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_TFTP=1" 551 fi 552 553 dnl Extra options. 554 AC_ARG_ENABLE(3c503-shmem, 555 [ --enable-3c503-shmem use 3c503 shared memory mode]) 556 if test "x$enable_3c503_shmem" = xyes; then 557 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DT503_SHMEM=1" 558 fi 559 560 AC_ARG_ENABLE(3c503-aui, 561 [ --enable-3c503-aui use AUI by default on 3c503 cards]) 562 if test "x$enable_3c503_aui" = xyes; then 563 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DT503_AUI=1" 564 fi 565 566 AC_ARG_ENABLE(compex-rl2000-fix, 567 [ --enable-compex-rl2000-fix 568 specify this if you have a Compex RL2000 PCI]) 569 if test "x$enable_compex_rl2000_fix" = xyes; then 570 NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCOMPEX_RL2000_FIX=1" 571 fi 572 573 AC_ARG_ENABLE(smc9000-scan, 574 [ --enable-smc9000-scan=LIST 575 probe for SMC9000 I/O addresses using LIST], 576 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DSMC9000_SCAN=$enable_smc9000_scan"]) 577 578 AC_ARG_ENABLE(ne-scan, 579 [ --enable-ne-scan=LIST probe for NE base address using LIST], 580 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNE_SCAN=$enable_ne_scan"], 581 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNE_SCAN=0x280,0x300,0x320,0x340"]) 582 583 AC_ARG_ENABLE(wd-default-mem, 584 [ --enable-wd-default-mem=MEM 585 set the default memory location for WD/SMC], 586 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DWD_DEFAULT_MEM=$enable_wd_default_mem"], 587 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DWD_DEFAULT_MEM=0xCC000"]) 588 589 AC_ARG_ENABLE(cs-scan, 590 [ --enable-cs-scan=LIST probe for CS89x0 base address using LIST], 591 [NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCS_SCAN=$enable_cs_scan"]) 592 593 dnl Diskless 594 AC_ARG_ENABLE(diskless, 595 [ --enable-diskless enable diskless support]) 596 AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes) 597 598 dnl Hercules terminal 599 AC_ARG_ENABLE(hercules, 600 [ --disable-hercules disable hercules terminal support]) 601 AM_CONDITIONAL(HERCULES_SUPPORT, test "x$enable_hercules" != xno) 602 603 dnl Serial terminal 604 AC_ARG_ENABLE(serial, 605 [ --disable-serial disable serial terminal support]) 606 AM_CONDITIONAL(SERIAL_SUPPORT, test "x$enable_serial" != xno) 607 608 dnl Simulation of the slowness of a serial device. 609 AC_ARG_ENABLE(serial-speed-simulation, 610 [ --enable-serial-speed-simulation 611 simulate the slowness of a serial device]) 612 AM_CONDITIONAL(SERIAL_SPEED_SIMULATION, 613 test "x$enable_serial_speed_simulation" = xyes) 614 615 # Sanity check. 616 if test "x$enable_diskless" = xyes; then 617 if test "x$NET_CFLAGS" = x; then 618 AC_MSG_ERROR([You must enable at least one network driver]) 619 fi 620 fi 621 622 dnl Embed a menu string in GRUB itself. 623 AC_ARG_ENABLE(preset-menu, 624 [ --enable-preset-menu=FILE 625 preset a menu file FILE in Stage 2]) 626 if test "x$enable_preset_menu" = x; then 627 : 628 else 629 if test -r $enable_preset_menu; then 630 grub_DEFINE_FILE(PRESET_MENU_STRING, [$enable_preset_menu], 631 [Define if there is user specified preset menu string]) 632 else 633 AC_MSG_ERROR([Cannot read the preset menu file $enable_preset_menu]) 634 fi 635 fi 636 637 dnl Build the example Multiboot kernel. 638 AC_ARG_ENABLE(example-kernel, 639 [ --enable-example-kernel 640 build the example Multiboot kernel]) 641 AM_CONDITIONAL(BUILD_EXAMPLE_KERNEL, test "x$enable_example_kernel" = xyes) 642 643 dnl Automatic Linux mem= option. 644 AC_ARG_ENABLE(auto-linux-mem-opt, 645 [ --disable-auto-linux-mem-opt 646 don't pass Linux mem= option automatically]) 647 if test "x$enable_auto_linux_mem_opt" = xno; then 648 : 649 else 650 AC_DEFINE(AUTO_LINUX_MEM_OPT, 1, [Define if you don't want to pass the mem= option to Linux]) 651 fi 652 653 dnl Now substitute the variables. 654 AC_SUBST(FSYS_CFLAGS) 655 AC_SUBST(NET_CFLAGS) 656 AC_SUBST(NET_EXTRAFLAGS) 657 AC_SUBST(NETBOOT_DRIVERS) 658 659 dnl Because recent automake complains about CCASFLAGS, set it here. 660 CCASFLAGS='$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)' 661 AC_SUBST(CCASFLAGS) 662 663 664 dnl Output. 665 AC_CONFIG_FILES([Makefile stage1/Makefile stage2/Makefile \ 666 docs/Makefile lib/Makefile util/Makefile \ 667 grub/Makefile netboot/Makefile util/grub-image \ 668 util/grub-install util/grub-md5-crypt \ 669 util/grub-terminfo util/grub-set-default]) 670 AC_OUTPUT 671