blob: 1758eef41c304870858879c05b5d51289f9f6051 [file] [log] [blame] [raw]
dnl Configure script for GRUB.
dnl Copyright 1999 Free Software Foundation, Inc.
dnl Permission to use, copy, modify and distribute this software and its
dnl documentation is hereby granted, provided that both the copyright
dnl notice and this permission notice appear in all copies of the
dnl software, derivative works or modified versions, and any portions
dnl thereof, and that both notices appear in supporting documentation.
dnl
dnl THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS
dnl "AS IS" CONDITION. THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
dnl LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
dnl USE OF THIS SOFTWARE.
AC_INIT(shared_src/fsys_ext2fs.c)
dnl Grab the package and version from the top debian/changelog entry.
AM_INIT_AUTOMAKE(
esyscmd([sed 's/ .*$//; q' debian/changelog]),
esyscmd([sed 's/^.*(\(.*\)).*$/\1/; q' debian/changelog]))dnl
AC_PREREQ(2.12)
AC_CANONICAL_HOST
case "$host_cpu" in
i[[3456]]86) host_cpu=i386 ;;
*) AC_MSG_ERROR([unsupported CPU type]) ;;
esac
AC_SUBST(host_cpu)
AC_SUBST(host_vendor)
#
# Options
#
sbingrub=
AC_ARG_ENABLE(sbin-grub,
[ --enable-sbin-grub build /sbin/grub command-line utility],
[test "x$enableval" = xno || sbingrub=grub])
AC_SUBST(sbingrub)
#
# Programs
#
AC_CHECK_TOOL(CC, gcc)
AC_PROG_CC
# Enforce coding standards.
CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused"
AC_CHECK_TOOL(LD, ld)
AC_CHECK_TOOL(OBJCOPY, objcopy)
# Defined in acinclude.m4.
grub_ASM_EXT_C
grub_PROG_OBJCOPY_ABSOLUTE
if test "x$grub_cv_prog_objcopy_absolute" != xyes; then
AC_MSG_ERROR([GRUB requires a working absolute objcopy; upgrade your binutils])
fi
grub_ASM_ADDR32
if test "x$grub_cv_asm_addr32" != xyes; then
AC_MSG_ERROR([GRUB requires GAS .code16 addr32 support; upgrade your binutils])
fi
# Check for curses libraries if we are building /sbin/grub.
if test -n "$sbingrub"; then
AC_CHECK_LIB(ncurses, getch, [LIBS="$LIBS -lncurses"
AC_DEFINE(HAVE_LIBCURSES)],
[AC_CHECK_LIB(curses, getch, [LIBS="$LIBS -lcurses"
AC_DEFINE(HAVE_LIBCURSES)])])
fi
# Create rules for our shared sources.
AC_SUBST_FILE(SHARED_SRC_RULES)dnl
SHARED_SRC_RULES=./ssrcrules.mk
echo creating $SHARED_SRC_RULES
rm -f $SHARED_SRC_RULES
cat > $SHARED_SRC_RULES <<EOF
# $SHARED_SRC_RULES - Rules for building objects from files in shared_src.
# Generated automatically by configure.
asm.o: \$(top_srcdir)/shared_src/asm.S
@echo '\$(COMPILE) -c \$(top_srcdir)/shared_src/asm.S'; \\
if test -d .deps; then \\
\$(COMPILE) -Wp,-MD,.deps/asm.P -c \$(top_srcdir)/shared_src/asm.S; \\
else \\
\$(COMPILE) -c \$(top_srcdir)/shared_src/asm.S; \\
fi
EOF
for f in boot common char_io cmdline disk_io gunzip fsys_ffs \
fsys_ext2fs fsys_fat stage1_5 stage2 bios; do
cat >> $SHARED_SRC_RULES <<EOF
$f.o: \$(top_srcdir)/shared_src/$f.c
@echo '\$(COMPILE) -c \$(top_srcdir)/shared_src/$f.c'; \\
if test -d .deps; then \\
\$(COMPILE) -Wp,-MD,.deps/$f.P -c \$(top_srcdir)/shared_src/$f.c; \\
else \\
\$(COMPILE) -c \$(top_srcdir)/shared_src/$f.c; \\
fi
EOF
done
AC_OUTPUT([Makefile grub/Makefile stage1/Makefile stage2/Makefile \
e2fs_stage1_5/Makefile fat_stage1_5/Makefile \
ffs_stage1_5/Makefile docs/Makefile shared_src/Makefile \
debian/Makefile])