grub/configure.ac

1291 lines
40 KiB
Plaintext
Raw Normal View History

# -*- autoconf -*-
2002-12-27 08:53:07 +00:00
# Process this file with autoconf to produce a configure script.
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
2002-12-27 08:53:07 +00:00
#
# This configure.ac is free software; the author
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
dnl This configure script is complicated, because GRUB needs to deal
dnl with three potentially different types:
dnl
dnl build -- the environment for building GRUB
dnl host -- the environment for running utilities
dnl target -- the environment for running GRUB
dnl
dnl In addition, GRUB needs to deal with a platform specification
dnl which specifies the system running GRUB, such as firmware.
dnl This is necessary because the target type in autoconf does not
dnl describe such a system very well.
dnl
dnl The current strategy is to use variables with no prefix (such as
dnl CC, CFLAGS, etc.) for the host type as well as the build type,
dnl because GRUB does not need to use those variables for the build
dnl type, so there is no conflict. Variables with the prefix "TARGET_"
dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
dnl type.
AC_INIT([GRUB],[2.00],[bug-grub@gnu.org])
2002-12-27 08:53:07 +00:00
AC_CONFIG_AUX_DIR([build-aux])
# We don't want -g -O2 by default in CFLAGS
: ${CFLAGS=""}
2002-12-27 08:53:07 +00:00
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
# Checks for host and target systems.
2002-12-27 08:53:07 +00:00
AC_CANONICAL_HOST
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
AC_CANONICAL_TARGET
2002-12-27 08:53:07 +00:00
2010-05-06 06:04:04 +00:00
AM_INIT_AUTOMAKE()
AC_PREREQ(2.60)
2010-08-17 13:33:22 +00:00
AC_CONFIG_SRCDIR([include/grub/dl.h])
AC_CONFIG_HEADER([config-util.h])
# Program name transformations
AC_ARG_PROGRAM
grub_TRANSFORM([grub-bios-setup])
grub_TRANSFORM([grub-editenv])
grub_TRANSFORM([grub-install])
grub_TRANSFORM([grub-mkconfig])
grub_TRANSFORM([grub-mkfont])
grub_TRANSFORM([grub-mkimage])
2013-04-12 22:38:04 +00:00
grub_TRANSFORM([grub-glue-efi])
grub_TRANSFORM([grub-mklayout])
grub_TRANSFORM([grub-mkpasswd-pbkdf2])
grub_TRANSFORM([grub-mkrelpath])
grub_TRANSFORM([grub-mkrescue])
grub_TRANSFORM([grub-probe])
grub_TRANSFORM([grub-reboot])
grub_TRANSFORM([grub-script-check])
grub_TRANSFORM([grub-set-default])
grub_TRANSFORM([grub-sparc64-setup])
grub_TRANSFORM([grub-render-label])
# Optimization flag. Allow user to override.
if test "x$TARGET_CFLAGS" = x; then
TARGET_CFLAGS="$TARGET_CFLAGS -Os"
fi
# Default HOST_CPPFLAGS
HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_UTIL=1"
HOST_CPPFLAGS="$HOST_CPPFLAGS -DGRUB_LIBDIR=\\\"\$(pkglibdir)\\\""
HOST_CPPFLAGS="$HOST_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\""
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include"
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
case "$target_cpu" in
i[[3456]]86) target_cpu=i386 ;;
amd64) target_cpu=x86_64 ;;
sparc) target_cpu=sparc64 ;;
2009-11-21 16:33:23 +00:00
mipsel|mips64el)
target_cpu=mipsel;
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1";
;;
2009-11-21 16:33:23 +00:00
mips|mips64)
target_cpu=mips;
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1";
;;
2002-12-27 08:53:07 +00:00
esac
# Specify the platform (such as firmware).
AC_ARG_WITH([platform],
AS_HELP_STRING([--with-platform=PLATFORM],
[select the host platform [[guessed]]]))
# Guess the platform if not specified.
if test "x$with_platform" = x; then
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
case "$target_cpu"-"$target_vendor" in
i386-apple) platform=efi ;;
i386-*) platform=pc ;;
x86_64-apple) platform=efi ;;
x86_64-*) platform=pc ;;
powerpc-*) platform=ieee1275 ;;
powerpc64-*) platform=ieee1275 ;;
sparc64-*) platform=ieee1275 ;;
mipsel-*) platform=loongson ;;
mips-*) platform=arc ;;
2010-01-18 15:02:21 +00:00
ia64-*) platform=efi ;;
*) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
esac
else
platform="$with_platform"
fi
case "$target_cpu"-"$platform" in
x86_64-efi) ;;
x86_64-emu) ;;
x86_64-*) target_cpu=i386 ;;
powerpc64-ieee1275) target_cpu=powerpc ;;
esac
2008-07-17 Bean <bean123ch@gmail.com> * conf/i386/efi.rmk (pkglib_MODULES): add pci.mod and lspci.mod. (appleldr_mod_SOURCE): New variavle. (appleldr_mod_CFLAGS): Likewise. (appleldr_mod_LDFLAGS): Likewise. (pci_mod_SOURCES): Likewise. (pci_mod_CFLAGS): Likewise. (pci_mod_LDFLAGS): Likewise. (lspci_mod_SOURCES): Likewise. (lspci_mod_CFLAGS): Likewise. (lspci_mod_LDFLAGS): Likewise. * conf/x86_64-efi.rmk: New file. * disk/efi/efidisk.c (grub_efidisk_read): Wrap efi calls with efi_call_N macro. (grub_efidisk_write): Likewise. * include/efi/api.h (efi_call_0): New macro. (efi_call_1): Likewise. (efi_call_2): Likewise. (efi_call_3): Likewise. (efi_call_4): Likewise. (efi_call_5): Likewise. (efi_call_6): Likewise. * include/grub/efi/chainloader.h (grub_chainloader_cmd): Rename to grub_rescue_cmd_chainloader. * include/grub/efi/pe32.h (GRUB_PE32_MACHINE_X86_64): New macro. (grub_pe32_optional_header): Change some fields based on i386 or x86_64 platform. (GRUB_PE32_PE32_MAGIC): Likewise. * include/grub/efi/uga_draw.h: New file. * include/grub/elf.h (STN_ABS): New constant. (R_X86_64_NONE): Relocation constant for x86_64. (R_X86_64_64): Likewise. (R_X86_64_PC32): Likewise. (R_X86_64_GOT32): Likewise. (R_X86_64_PLT32): Likewise. (R_X86_64_COPY): Likewise. (R_X86_64_GLOB_DAT): Likewise. (R_X86_64_JUMP_SLOT): Likewise. (R_X86_64_RELATIVE): Likewise. (R_X86_64_GOTPCREL): Likewise. (R_X86_64_32): Likewise. (R_X86_64_32S): Likewise. (R_X86_64_16): Likewise. (R_X86_64_PC16): Likewise. (R_X86_64_8): Likewise. (R_X86_64_PC8): Likewise. * include/grub/i386/efi/pci.h: New file. * include/grub/i386/linux.h (GRUB_LINUX_EFI_SIGNATURE): Change it value based on platform. (GRUB_LINUX_EFI_SIGNATURE_0204): New constant. (GRUB_E820_RAM): Likewise. (GRUB_E820_RESERVED): Likewise. (GRUB_E820_ACPI): Likewise. (GRUB_E820_NVS): Likewise. (GRUB_E820_EXEC_CODE): Likewise. (GRUB_E820_MAX_ENTRY): Likewise. (grub_e820_mmap): New structure. (linux_kernel_header): Change the efi field according to different kernel version, also field from linux_kernel_header. * include/grub/kernel.h (grub_module_info): Add padding for x86_64. * include/grub/pci.h (GRUB_PCI_ADDR_SPACE_MASK): New constant. (GRUB_PCI_ADDR_SPACE_MEMORY): Likewise. (GRUB_PCI_ADDR_SPACE_IO): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_MASK): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_32): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_1M): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_64): Likewise. (GRUB_PCI_ADDR_MEM_PREFETCH): Likewise. (GRUB_PCI_ADDR_MEM_MASK): Likewise. (GRUB_PCI_ADDR_IO_MASK): Likewise. * include/grub/x86_64/efi/kernel.h: New file. * include/grub/x86_64/efi/loader.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * include/grub/x86_64/efi/pci.h: Likewise. * include/grub/x86_64/efi/time.h: Likewise. * include/grub/x86_64/linux.h: Likewise. * include/grub/x86_64/setjmp.h: Likewise. * include/grub/x86_64/time.h: Likewise. * include/grub/x86_64/types.h: Likewise. * kern/dl.c (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. * kern/efi/efi.c (grub_efi_locate_protocol): Wrap efi calls. (grub_efi_locate_handle): Likewise. (grub_efi_open_protocol): Likewise. (grub_efi_set_text_mode): Likewise. (grub_efi_stall): Likewise. (grub_exit): Likewise. (grub_reboot): Likewise. (grub_halt): Likewise. (grub_efi_exit_boot_services): Likewise. (grub_get_rtc): Likewise. * kern/efi/mm.c (MEMORY_MAP_SIZE): Change to 0x3000 for new models. (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. (grub_efi_allocate_pages): Wrap efi calls. (grub_efi_free_pages): Wrap efi calls. (grub_efi_get_memory_map): Wrap efi calls. * kern/x86_64/dl.c: New file. * kern/x86_64/efi/callwrap.S: Likewise. * kern/x86_64/efi/startup.S: Likewise. * loader/efi/appleloader.c: Likewise. * loader/efi/chainloader.c (cmdline): New variable. (grub_chainloader_unload): Wrap efi calls. (grub_chainloader_boot): Likewise. (grub_rescue_cmd_chainloader): Wrap efi calls, handle command line. * loader/efi/chainloader_normal.c (chainloader_command): Change grub_chainloader_cmd to grub_rescue_cmd_chainloader, pass command line. * loader/i386/efi/linux.c (allocate_pages): Change allocation method. (grub_e820_add_region): New function. (grub_linux_boot): Construct e820 map from efi map, handle x86_64 booting. (grub_find_video_card): New function. (grub_linux_setup_video): New function. (grub_rescue_cmd_linux): Probe for video information. * normal/x86_64/setjmp.S: New file. * term/efi/console.c (map_char): New function. (grub_console_putchar): Map unicode char. (grub_console_checkkey): Wrap efi calls. (grub_console_getkey): Likewise. (grub_console_getwh): Likewise. (grub_console_gotoxy): Likewise. (grub_console_cls): Likewise. (grub_console_setcolorstate): Likewise. (grub_console_setcursor): Likewise. * util/i386/efi/grub-mkimage.c: Add support for x86_64.
2008-07-17 09:50:26 +00:00
# Check if the platform is supported, make final adjustments.
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
case "$target_cpu"-"$platform" in
i386-efi) ;;
x86_64-efi) ;;
i386-pc) ;;
i386-multiboot) ;;
i386-coreboot) ;;
i386-linuxbios) platform=coreboot ;;
i386-ieee1275) ;;
2009-06-27 Pavel Roskin <proski@gnu.org> 2009-06-27 Robert Millan <rmh.grub@aybabtu.com> * include/grub/dl.h: Include grub/elf.h. (struct grub_dl): Add symtab field. * kern/dl.c [GRUB_MACHINE_QEMU]: Define GRUB_MODULES_MACHINE_READONLY. (grub_dl_resolve_symbols): Populate mod->symtab, making a copy of the header for read-only modules. (grub_dl_unload): Free mod->symtab for read-only modules. * kern/i386/dl.c: Use mod->symtab. * kern/powerpc/dl.c: Likewise. * kern/sparc64/dl.c: Likewise. * kern/x86_64/dl.c: Likewise. * conf/i386-qemu.rmk: New file. * kern/i386/qemu/startup.S: Likewise. * kern/i386/qemu/mmap.c: Likewise. * boot/i386/qemu/boot.S: Likewise. * include/grub/i386/qemu/time.h: Likewise. * include/grub/i386/qemu/serial.h: Likewise. * include/grub/i386/qemu/kernel.h: Likewise. * include/grub/i386/qemu/console.h: Likewise. * include/grub/i386/qemu/boot.h: Likewise. * include/grub/i386/qemu/init.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/i386/qemu/loader.h: Likewise. * include/grub/i386/qemu/memory.h: Likewise. * conf/i386-coreboot.rmk (GRUB_BOOT_MACHINE_LINK_ADDR) (GRUB_KERNEL_MACHINE_LINK_ADDR): New variables. [qemu] (pkglib_IMAGES): Add `boot.img'. [qemu] (boot_img_SOURCES, boot_img_ASFLAGS, boot_img_LDFLAGS) [qemu] (boot_img_FORMAT): New variables. [qemu] (bin_UTILITIES): Add `grub-mkimage'. [qemu] (grub_mkimage_SOURCES, grub_mkimage_CFLAGS): New variables. [qemu] (kernel_img_SOURCES, kernel_img_HEADERS, kernel_img_CFLAGS) [qemu] (kernel_img_ASFLAGS, kernel_img_LDFLAGS) [qemu] (kernel_img_FORMAT): New variables. * configure.ac: Recognise `i386-qemu'. * util/i386/pc/grub-mkimage.c (compress_kernel): Add dummy variant (for no compression). [GRUB_MACHINE_QEMU] (generate_image): Misc adjustments to produce a valid i386 ROM image. Make `GRUB_KERNEL_MACHINE_COMPRESSED_SIZE', `GRUB_KERNEL_MACHINE_INSTALL_DOS_PART' and `GRUB_KERNEL_MACHINE_INSTALL_BSD_PART' optional features (with ifdefs).
2009-06-27 11:18:10 +00:00
i386-qemu) ;;
powerpc-ieee1275) ;;
sparc64-ieee1275) ;;
ia64-efi) ;;
mips-qemu_mips) ;;
2011-05-17 12:02:18 +00:00
mips-qemu-mips) platform=qemu_mips;;
2011-05-13 14:36:05 +00:00
mips-arc) ;;
2013-04-25 20:42:35 +00:00
mipsel-arc) ;;
mipsel-qemu_mips) ;;
mipsel-qemu-mips) platform=qemu_mips;;
mipsel-yeeloong) platform=loongson ;;
mipsel-fuloong) platform=loongson ;;
mipsel-loongson) ;;
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
*-emu) ;;
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
2002-12-27 08:53:07 +00:00
esac
case "$target_cpu" in
i386 | powerpc) target_m32=1 ;;
x86_64 | sparc64) target_m64=1 ;;
esac
case "$host_os" in
mingw32*) host_os=cygwin ;;
esac
# This normalizes the names, and creates a new variable ("host_kernel")
# while at it, since the mapping is not always 1:1 (e.g. different OSes
# using the same kernel type).
case "$host_os" in
gnu*) host_kernel=hurd ;;
linux*) host_kernel=linux ;;
freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;;
netbsd*) host_kernel=netbsd ;;
solaris*) host_kernel=illumos ;;
darwin*) host_kernel=xnu ;;
cygwin) host_kernel=windows ;;
esac
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
case "$platform" in
coreboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_COREBOOT=1" ;;
multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;;
efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;;
ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;;
qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
2011-05-17 12:02:18 +00:00
qemu_mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
esac
case "$target_cpu" in
mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
esac
if test x${target_cpu} = xmipsel ; then
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
else
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,` -DGRUB_TARGET_CPU_`echo ${target_cpu} | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`=1"
fi
2013-04-25 20:42:35 +00:00
case "${target_cpu}-$platform" in
mips-arc)
TARGET_LINK_ADDR=0x88200000
TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000
;;
mipsel-arc)
TARGET_LINK_ADDR=0x80700000
TARGET_DECOMPRESSOR_LINK_ADDR=0x80600000
;;
mips*-qemu_mips | mips*-loongson)
2013-04-25 20:42:35 +00:00
TARGET_DECOMPRESSOR_LINK_ADDR=0x80100000
;;
esac
AC_SUBST(TARGET_LINK_ADDR)
AC_SUBST(TARGET_DECOMPRESSOR_LINK_ADDR)
TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
AC_SUBST(host_cpu)
AC_SUBST(host_os)
AC_SUBST(host_kernel)
AC_SUBST(target_cpu)
AC_SUBST(platform)
# Define default variables
have_with_bootdir=n
AC_ARG_WITH([bootdir],
AS_HELP_STRING([--with-bootdir=DIR],
[set the name of /boot directory [[guessed]]]),
[have_with_bootdir=y],
[have_with_bootdir=n])
if test x$have_with_bootdir = xy; then
bootdirname="$with_bootdir"
else
case "$host_os" in
netbsd* | openbsd*)
# Because /boot is used for the boot block in NetBSD and OpenBSD,
bootdirname='' ;;
*) bootdirname='boot' ;;
esac
fi
AC_SUBST(bootdirname)
AC_DEFINE_UNQUOTED(GRUB_BOOT_DIR_NAME, "$bootdirname",
[Default boot directory name]")
AC_ARG_WITH([grubdir],
AS_HELP_STRING([--with-grubdir=DIR],
[set the name of grub directory [[guessed]]]),
[grubdirname="$with_grubdir"],
[grubdirname="$PACKAGE"])
AC_SUBST(grubdirname)
AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
[Default grub directory name])
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
#
# Checks for build programs.
#
# Although cmp is listed in the GNU Coding Standards as a command which
# can used directly, OpenBSD lacks cmp in the default installation.
AC_CHECK_PROGS([CMP], [cmp])
if test "x$CMP" = x; then
AC_MSG_ERROR([cmp is not found])
fi
AC_CHECK_PROGS([YACC], [bison])
if test "x$YACC" = x; then
AC_MSG_ERROR([bison is not found])
fi
FONT_SOURCE=
for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
2012-09-05 14:09:41 +00:00
for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni; do
if test -f "$dir/unifont.$ext"; then
2010-06-21 00:15:49 +00:00
FONT_SOURCE="$dir/unifont.$ext"
break 2
fi
done
done
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips); then
AC_MSG_ERROR([qemu and loongson ports need unifont])
fi
AC_SUBST([FONT_SOURCE])
2010-06-21 00:15:49 +00:00
AC_PROG_RANLIB
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_LEX
AC_PROG_YACC
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
Re-enable grub-extras. * autogen.sh: Create symlinks to ${GRUB_CONTRIB} if necessary to avoid confusing Automake. Run autogen only twice, once for the top level and once for grub-core. Add Makefile.util.def and Makefile.core.def from extra modules to the appropriate autogen invocations. If Makefile.common exists in an extra module, include it in both Makefile.util.am and grub-core/Makefile.core.am; similarly, include any Makefile.util.common file in Makefile.util.am and any Makefile.core.common file in grub-core/Makefile.core.am. * conf/Makefile.common ($(top_srcdir)/grub-core/Makefile.core.am): Depend on $(top_srcdir)/grub-core/Makefile.gcry.def. ($(top_srcdir)/grub-core/Makefile.gcry.def): Remove. * grub-core/Makefile.am: Remove inclusion of Makefile.gcry.am. * gentpl.py (gvar_add): Turn GVARS into a set. (global_variable_initializers): Sort global variables on output. (vars_init): New function. (first_time): Likewise. (library): Ensure that non-global variable initialisations are emitted before the first time we emit code for a library block. Append to variables rather than setting them. Only emit noinst_LIBRARIES, BUILT_SOURCES, and CLEANFILES the first time for each conditional path. (program): installdir() emits an Autogen macro, so must be passed to var_add rather than gvar_add. (data): Likewise. (script): Likewise. (rules): New function, centralising handling for different target types. Set up Guile association lists for first_time and vars_init, and send most output to a diversion so that variable initialisations can be emitted first. (module_rules): Use new rules function. (kernel_rules): Likewise. (image_rules): Likewise. (library_rules): Likewise. (program_rules): Likewise. (script_rules): Likewise. (data_rules): Likewise. * configure.ac: Add AC_PROG_LN_S, for the benefit of ntldr-img. * .bzrignore: Add contrib and grub-core/contrib. Remove grub-core/Makefile.gcry.am.
2010-09-24 08:48:27 +00:00
AC_PROG_LN_S
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
if test "x$LEX" = "x:"; then
AC_MSG_ERROR([flex is not found])
else
version=`$LEX --version | $AWK '{ split($NF,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'`
2010-04-05 16:17:19 +00:00
if test -n "$version" -a "$version" -ge 20535; then
:
else
AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above])
fi
fi
# These are not a "must".
AC_PATH_PROGS(MAKEINFO, makeinfo true)
2002-12-27 08:53:07 +00:00
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
#
# Checks for host programs.
#
AC_PROG_CC
gl_EARLY
AC_PROG_CXX
AM_PROG_CC_C_O
AM_PROG_AS
2002-12-27 08:53:07 +00:00
# Must be GCC.
test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
AC_GNU_SOURCE
AM_GNU_GETTEXT([external])
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
AC_SYS_LARGEFILE
# Identify characteristics of the host architecture.
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long)
grub_apple_cc
if test x$grub_cv_apple_cc = xyes ; then
HOST_CPPFLAGS="$HOST_CPPFLAGS -fnested-functions"
HOST_LDFLAGS="$HOST_LDFLAGS -Wl,-allow_stack_execute"
fi
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
if test x$USE_NLS = xno; then
HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext"
fi
if test "x$cross_compiling" = xyes; then
AC_MSG_WARN([cannot generate manual pages while cross compiling])
else
AC_PATH_PROG(HELP2MAN, help2man)
fi
# Check for functions and headers.
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
#include <sys/param.h>
#include <sys/mount.h>])
AC_CHECK_MEMBERS([struct statfs.f_mntfromname],,,[$ac_includes_default
#include <sys/param.h>
#include <sys/mount.h>])
# For opendisk() and getrawpartition() on NetBSD.
# Used in util/deviceiter.c and in util/hostdisk.c.
AC_CHECK_HEADER([util.h], [
AC_CHECK_LIB([util], [opendisk], [
LIBUTIL="-lutil"
AC_DEFINE(HAVE_OPENDISK, 1, [Define if opendisk() in -lutil can be used])
])
AC_CHECK_LIB([util], [getrawpartition], [
LIBUTIL="-lutil"
AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition() in -lutil can be used])
])
])
AC_SUBST([LIBUTIL])
AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
SAVED_CFLAGS="$CFLAGS"
CFLAGS="$HOST_CFLAGS -Wtrampolines"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
int va_arg_func (int fixed, va_list args);]], [[]])],
[grub_cv_host_cc_wtrampolines=yes],
[grub_cv_host_cc_wtrampolines=no])
CFLAGS="$SAVED_CFLAGS"
])
if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then
HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines"
fi
#
# Check for host and build compilers.
#
HOST_CC=$CC
AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
[AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
# For gnulib.
gl_INIT
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
#
# Check for target programs.
#
# Find tools for the target.
if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
tmp_ac_tool_prefix="$ac_tool_prefix"
ac_tool_prefix=$target_alias-
AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
[AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
AC_CHECK_TOOL(OBJCOPY, objcopy)
AC_CHECK_TOOL(STRIP, strip)
AC_CHECK_TOOL(NM, nm)
ac_tool_prefix="$tmp_ac_tool_prefix"
else
if test "x$TARGET_CC" = x; then
TARGET_CC=$CC
fi
AC_CHECK_TOOL(OBJCOPY, objcopy)
AC_CHECK_TOOL(STRIP, strip)
AC_CHECK_TOOL(NM, nm)
fi
AC_SUBST(HOST_CC)
AC_SUBST(BUILD_CC)
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
AC_SUBST(TARGET_CC)
# Test the C compiler for the target environment.
tmp_CC="$CC"
tmp_CFLAGS="$CFLAGS"
tmp_LDFLAGS="$LDFLAGS"
tmp_CPPFLAGS="$CPPFLAGS"
tmp_LIBS="$LIBS"
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
CC="$TARGET_CC"
CFLAGS="$TARGET_CFLAGS"
CPPFLAGS="$TARGET_CPPFLAGS"
LDFLAGS="$TARGET_LDFLAGS"
LIBS=""
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
# debug flags.
WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
Increase warning level. * conf/Makefile.common (CFLAGS_GNULIB): Add -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition. * configure.ac (HOST_CFLAGS): Add bunch of -W arguments. (TARGET_CFLAGS): Likewise. (HOST_CFLAGS): Add -Werror unless --disable-werror is activated. * grub-core/Makefile.core.def (decompressor_xz): Add -Wno-unreachable-code. (normal): Add -Wno-redundant-decls. (xzio): Add -Wno-unreachable-code. (lzopio): Add -Wno-redundant-decls -Wno-error. * grub-core/commands/acpi.c: Add exception to -Wcast-align. * grub-core/commands/lsacpi.c: Add exception to -Wcast-align. * grub-core/gensymlist.sh: Add exception to -Wmissing-format-attribute. * grub-core/kern/dl.c: Add exception to -Wcast-align. * grub-core/kern/efi/efi.c (grub_efi_modules_addr): Likewise. * grub-core/kern/i386/coreboot/init.c: Add exception to -Wsuggest-attribute=noreturn. * grub-core/kern/ia64/dl.c: Add exception to -Wcast-align. * grub-core/kern/ia64/dl_helper.c: Likewise. * grub-core/kern/mips/dl.c: Likewise. * grub-core/kern/sparc64/dl.c: Likewise. * grub-core/lib/LzmaEnc.c: Add exception to -Wshadow. * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy): Likewise. (memcmp): Likewise. * grub-core/lib/pbkdf2.c: Add exception to -Wunreachable-code. * grub-core/loader/ia64/efi/linux.c: Add exception to -Wcast-align. * grub-core/loader/mips/linux.c: Likewise. * grub-core/loader/multiboot_elfxx.c: Likewise. * grub-core/script/parser.y: Add exception to -Wunreachable-code. * grub-core/video/sm712.c: Add exception to -Wcast-align. * util/import_gcry.py: Add -Wno-cast-align to modules checked by hand. * grub-core/font/font.c (grub_font_loader_init): Add explicit cast and fixme. * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Likewise. * grub-core/kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Fix prototype.
2012-02-10 15:48:48 +00:00
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
2002-12-27 08:53:07 +00:00
# Force no alignment to save space on i386.
if test "x$target_cpu" = xi386; then
AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
CFLAGS="$CFLAGS -falign-loops=1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_falign_loop=yes],
[grub_cv_cc_falign_loop=no])
2002-12-27 08:53:07 +00:00
])
if test "x$grub_cv_cc_falign_loop" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
2002-12-27 08:53:07 +00:00
else
TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
2002-12-27 08:53:07 +00:00
fi
# Some toolchains enable these features by default, but they need
# registers that aren't set up properly in GRUB.
TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
fi
# By default, GCC 4.4 generates .eh_frame sections containing unwind
# information in some cases where it previously did not. GRUB doesn't need
# these and they just use up vital space. Restore the old compiler
# behaviour.
AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_fno_dwarf2_cfi_asm=yes],
[grub_cv_cc_fno_dwarf2_cfi_asm=no])
CFLAGS="$SAVE_CFLAGS"
])
if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
fi
2002-12-27 08:53:07 +00:00
# By default, GCC 4.6 generates .eh_frame sections containing unwind
# information in some cases where it previously did not. GRUB doesn't need
# these and they just use up vital space. Restore the old compiler
# behaviour.
AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_fno_asynchronous_unwind_tables=yes],
[grub_cv_cc_fno_asynchronous_unwind_tables=no])
CFLAGS="$SAVE_CFLAGS"
])
if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables"
fi
grub_apple_target_cc
if test x$grub_cv_apple_target_cc = xyes ; then
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -fnested-functions"
CFLAGS="$CFLAGS -fnested-functions"
TARGET_APPLE_CC=1
AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
if test "x$OBJCONV" = x ; then
AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.])
fi
if test "x$OBJCONV" = x ; then
AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
fi
TARGET_IMG_LDSCRIPT=
TARGET_IMG_CFLAGS="-static"
TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20'
TARGET_IMG_BASE_LDOPT="-Wl,-image_base"
TARGET_LDFLAGS_OLDMAGIC=""
else
TARGET_APPLE_CC=0
TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
# Use linker script if present, otherwise use builtin -N script.
if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
else
TARGET_IMG_LDSCRIPT=
TARGET_IMG_LDFLAGS='-Wl,-N'
TARGET_IMG_LDFLAGS_AC='-Wl,-N'
TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
fi
TARGET_IMG_CFLAGS=
fi
AC_SUBST(TARGET_LDFLAGS_OLDMAGIC)
# For platforms where ELF is not the default link format.
AC_MSG_CHECKING([for command to convert module to ELF format])
case "${host_os}" in
cygwin) TARGET_OBJ2ELF='$(top_builddir)/grub-pe2elf';
# FIXME: put proper test here
NEED_REGISTER_FRAME_INFO=1
;;
*) NEED_REGISTER_FRAME_INFO=0 ;;
esac
AC_MSG_RESULT([$TARGET_OBJ2ELF])
AC_ARG_ENABLE([efiemu],
[AS_HELP_STRING([--enable-efiemu],
[build and install the efiemu runtimes (default=guessed)])])
if test x"$enable_efiemu" = xno ; then
efiemu_excuse="explicitly disabled"
fi
if test x"$target_cpu" != xi386 ; then
efiemu_excuse="only available on i386"
fi
if test x"$platform" = xefi ; then
efiemu_excuse="not available on efi"
fi
if test x"$efiemu_excuse" = x ; then
AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
SAVED_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_efiemu=yes],
[grub_cv_cc_efiemu=no])
CFLAGS="$SAVED_CFLAGS"
])
if test x$grub_cv_cc_efiemu = xno; then
efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
fi
fi
if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
fi
if test x"$efiemu_excuse" = x ; then
enable_efiemu=yes
else
enable_efiemu=no
fi
AC_SUBST([enable_efiemu])
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
if test "x$target_m32" = x1; then
# Force 32-bit mode.
TARGET_CFLAGS="$TARGET_CFLAGS -m32"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m32"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m32"
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
TARGET_MODULE_FORMAT="elf32"
2002-12-27 08:53:07 +00:00
fi
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
2008-07-17 Bean <bean123ch@gmail.com> * conf/i386/efi.rmk (pkglib_MODULES): add pci.mod and lspci.mod. (appleldr_mod_SOURCE): New variavle. (appleldr_mod_CFLAGS): Likewise. (appleldr_mod_LDFLAGS): Likewise. (pci_mod_SOURCES): Likewise. (pci_mod_CFLAGS): Likewise. (pci_mod_LDFLAGS): Likewise. (lspci_mod_SOURCES): Likewise. (lspci_mod_CFLAGS): Likewise. (lspci_mod_LDFLAGS): Likewise. * conf/x86_64-efi.rmk: New file. * disk/efi/efidisk.c (grub_efidisk_read): Wrap efi calls with efi_call_N macro. (grub_efidisk_write): Likewise. * include/efi/api.h (efi_call_0): New macro. (efi_call_1): Likewise. (efi_call_2): Likewise. (efi_call_3): Likewise. (efi_call_4): Likewise. (efi_call_5): Likewise. (efi_call_6): Likewise. * include/grub/efi/chainloader.h (grub_chainloader_cmd): Rename to grub_rescue_cmd_chainloader. * include/grub/efi/pe32.h (GRUB_PE32_MACHINE_X86_64): New macro. (grub_pe32_optional_header): Change some fields based on i386 or x86_64 platform. (GRUB_PE32_PE32_MAGIC): Likewise. * include/grub/efi/uga_draw.h: New file. * include/grub/elf.h (STN_ABS): New constant. (R_X86_64_NONE): Relocation constant for x86_64. (R_X86_64_64): Likewise. (R_X86_64_PC32): Likewise. (R_X86_64_GOT32): Likewise. (R_X86_64_PLT32): Likewise. (R_X86_64_COPY): Likewise. (R_X86_64_GLOB_DAT): Likewise. (R_X86_64_JUMP_SLOT): Likewise. (R_X86_64_RELATIVE): Likewise. (R_X86_64_GOTPCREL): Likewise. (R_X86_64_32): Likewise. (R_X86_64_32S): Likewise. (R_X86_64_16): Likewise. (R_X86_64_PC16): Likewise. (R_X86_64_8): Likewise. (R_X86_64_PC8): Likewise. * include/grub/i386/efi/pci.h: New file. * include/grub/i386/linux.h (GRUB_LINUX_EFI_SIGNATURE): Change it value based on platform. (GRUB_LINUX_EFI_SIGNATURE_0204): New constant. (GRUB_E820_RAM): Likewise. (GRUB_E820_RESERVED): Likewise. (GRUB_E820_ACPI): Likewise. (GRUB_E820_NVS): Likewise. (GRUB_E820_EXEC_CODE): Likewise. (GRUB_E820_MAX_ENTRY): Likewise. (grub_e820_mmap): New structure. (linux_kernel_header): Change the efi field according to different kernel version, also field from linux_kernel_header. * include/grub/kernel.h (grub_module_info): Add padding for x86_64. * include/grub/pci.h (GRUB_PCI_ADDR_SPACE_MASK): New constant. (GRUB_PCI_ADDR_SPACE_MEMORY): Likewise. (GRUB_PCI_ADDR_SPACE_IO): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_MASK): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_32): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_1M): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_64): Likewise. (GRUB_PCI_ADDR_MEM_PREFETCH): Likewise. (GRUB_PCI_ADDR_MEM_MASK): Likewise. (GRUB_PCI_ADDR_IO_MASK): Likewise. * include/grub/x86_64/efi/kernel.h: New file. * include/grub/x86_64/efi/loader.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * include/grub/x86_64/efi/pci.h: Likewise. * include/grub/x86_64/efi/time.h: Likewise. * include/grub/x86_64/linux.h: Likewise. * include/grub/x86_64/setjmp.h: Likewise. * include/grub/x86_64/time.h: Likewise. * include/grub/x86_64/types.h: Likewise. * kern/dl.c (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. * kern/efi/efi.c (grub_efi_locate_protocol): Wrap efi calls. (grub_efi_locate_handle): Likewise. (grub_efi_open_protocol): Likewise. (grub_efi_set_text_mode): Likewise. (grub_efi_stall): Likewise. (grub_exit): Likewise. (grub_reboot): Likewise. (grub_halt): Likewise. (grub_efi_exit_boot_services): Likewise. (grub_get_rtc): Likewise. * kern/efi/mm.c (MEMORY_MAP_SIZE): Change to 0x3000 for new models. (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. (grub_efi_allocate_pages): Wrap efi calls. (grub_efi_free_pages): Wrap efi calls. (grub_efi_get_memory_map): Wrap efi calls. * kern/x86_64/dl.c: New file. * kern/x86_64/efi/callwrap.S: Likewise. * kern/x86_64/efi/startup.S: Likewise. * loader/efi/appleloader.c: Likewise. * loader/efi/chainloader.c (cmdline): New variable. (grub_chainloader_unload): Wrap efi calls. (grub_chainloader_boot): Likewise. (grub_rescue_cmd_chainloader): Wrap efi calls, handle command line. * loader/efi/chainloader_normal.c (chainloader_command): Change grub_chainloader_cmd to grub_rescue_cmd_chainloader, pass command line. * loader/i386/efi/linux.c (allocate_pages): Change allocation method. (grub_e820_add_region): New function. (grub_linux_boot): Construct e820 map from efi map, handle x86_64 booting. (grub_find_video_card): New function. (grub_linux_setup_video): New function. (grub_rescue_cmd_linux): Probe for video information. * normal/x86_64/setjmp.S: New file. * term/efi/console.c (map_char): New function. (grub_console_putchar): Map unicode char. (grub_console_checkkey): Wrap efi calls. (grub_console_getkey): Likewise. (grub_console_getwh): Likewise. (grub_console_gotoxy): Likewise. (grub_console_cls): Likewise. (grub_console_setcolorstate): Likewise. (grub_console_setcursor): Likewise. * util/i386/efi/grub-mkimage.c: Add support for x86_64.
2008-07-17 09:50:26 +00:00
if test "x$target_m64" = x1; then
# Force 64-bit mode.
TARGET_CFLAGS="$TARGET_CFLAGS -m64"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -m64"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -m64"
TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
TARGET_MODULE_FORMAT="elf64"
fi
if test "$target_cpu" = x86_64; then
# Use large model to support 4G memory
AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
SAVED_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -m64 -mcmodel=large"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_mcmodel=yes],
[grub_cv_cc_mcmodel=no])
])
if test "x$grub_cv_cc_mcmodel" = xno; then
AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.])
else
TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
fi
fi
if test "$target_cpu"-"$platform" = x86_64-efi; then
# EFI writes to stack below %rsp, we must not use the red zone
AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
CFLAGS="$CFLAGS -m64 -mno-red-zone"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_no_red_zone=yes],
[grub_cv_cc_no_red_zone=no])
])
if test "x$grub_cv_cc_no_red_zone" = xno; then
AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
fi
TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
2008-07-17 Bean <bean123ch@gmail.com> * conf/i386/efi.rmk (pkglib_MODULES): add pci.mod and lspci.mod. (appleldr_mod_SOURCE): New variavle. (appleldr_mod_CFLAGS): Likewise. (appleldr_mod_LDFLAGS): Likewise. (pci_mod_SOURCES): Likewise. (pci_mod_CFLAGS): Likewise. (pci_mod_LDFLAGS): Likewise. (lspci_mod_SOURCES): Likewise. (lspci_mod_CFLAGS): Likewise. (lspci_mod_LDFLAGS): Likewise. * conf/x86_64-efi.rmk: New file. * disk/efi/efidisk.c (grub_efidisk_read): Wrap efi calls with efi_call_N macro. (grub_efidisk_write): Likewise. * include/efi/api.h (efi_call_0): New macro. (efi_call_1): Likewise. (efi_call_2): Likewise. (efi_call_3): Likewise. (efi_call_4): Likewise. (efi_call_5): Likewise. (efi_call_6): Likewise. * include/grub/efi/chainloader.h (grub_chainloader_cmd): Rename to grub_rescue_cmd_chainloader. * include/grub/efi/pe32.h (GRUB_PE32_MACHINE_X86_64): New macro. (grub_pe32_optional_header): Change some fields based on i386 or x86_64 platform. (GRUB_PE32_PE32_MAGIC): Likewise. * include/grub/efi/uga_draw.h: New file. * include/grub/elf.h (STN_ABS): New constant. (R_X86_64_NONE): Relocation constant for x86_64. (R_X86_64_64): Likewise. (R_X86_64_PC32): Likewise. (R_X86_64_GOT32): Likewise. (R_X86_64_PLT32): Likewise. (R_X86_64_COPY): Likewise. (R_X86_64_GLOB_DAT): Likewise. (R_X86_64_JUMP_SLOT): Likewise. (R_X86_64_RELATIVE): Likewise. (R_X86_64_GOTPCREL): Likewise. (R_X86_64_32): Likewise. (R_X86_64_32S): Likewise. (R_X86_64_16): Likewise. (R_X86_64_PC16): Likewise. (R_X86_64_8): Likewise. (R_X86_64_PC8): Likewise. * include/grub/i386/efi/pci.h: New file. * include/grub/i386/linux.h (GRUB_LINUX_EFI_SIGNATURE): Change it value based on platform. (GRUB_LINUX_EFI_SIGNATURE_0204): New constant. (GRUB_E820_RAM): Likewise. (GRUB_E820_RESERVED): Likewise. (GRUB_E820_ACPI): Likewise. (GRUB_E820_NVS): Likewise. (GRUB_E820_EXEC_CODE): Likewise. (GRUB_E820_MAX_ENTRY): Likewise. (grub_e820_mmap): New structure. (linux_kernel_header): Change the efi field according to different kernel version, also field from linux_kernel_header. * include/grub/kernel.h (grub_module_info): Add padding for x86_64. * include/grub/pci.h (GRUB_PCI_ADDR_SPACE_MASK): New constant. (GRUB_PCI_ADDR_SPACE_MEMORY): Likewise. (GRUB_PCI_ADDR_SPACE_IO): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_MASK): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_32): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_1M): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_64): Likewise. (GRUB_PCI_ADDR_MEM_PREFETCH): Likewise. (GRUB_PCI_ADDR_MEM_MASK): Likewise. (GRUB_PCI_ADDR_IO_MASK): Likewise. * include/grub/x86_64/efi/kernel.h: New file. * include/grub/x86_64/efi/loader.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * include/grub/x86_64/efi/pci.h: Likewise. * include/grub/x86_64/efi/time.h: Likewise. * include/grub/x86_64/linux.h: Likewise. * include/grub/x86_64/setjmp.h: Likewise. * include/grub/x86_64/time.h: Likewise. * include/grub/x86_64/types.h: Likewise. * kern/dl.c (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. * kern/efi/efi.c (grub_efi_locate_protocol): Wrap efi calls. (grub_efi_locate_handle): Likewise. (grub_efi_open_protocol): Likewise. (grub_efi_set_text_mode): Likewise. (grub_efi_stall): Likewise. (grub_exit): Likewise. (grub_reboot): Likewise. (grub_halt): Likewise. (grub_efi_exit_boot_services): Likewise. (grub_get_rtc): Likewise. * kern/efi/mm.c (MEMORY_MAP_SIZE): Change to 0x3000 for new models. (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. (grub_efi_allocate_pages): Wrap efi calls. (grub_efi_free_pages): Wrap efi calls. (grub_efi_get_memory_map): Wrap efi calls. * kern/x86_64/dl.c: New file. * kern/x86_64/efi/callwrap.S: Likewise. * kern/x86_64/efi/startup.S: Likewise. * loader/efi/appleloader.c: Likewise. * loader/efi/chainloader.c (cmdline): New variable. (grub_chainloader_unload): Wrap efi calls. (grub_chainloader_boot): Likewise. (grub_rescue_cmd_chainloader): Wrap efi calls, handle command line. * loader/efi/chainloader_normal.c (chainloader_command): Change grub_chainloader_cmd to grub_rescue_cmd_chainloader, pass command line. * loader/i386/efi/linux.c (allocate_pages): Change allocation method. (grub_e820_add_region): New function. (grub_linux_boot): Construct e820 map from efi map, handle x86_64 booting. (grub_find_video_card): New function. (grub_linux_setup_video): New function. (grub_rescue_cmd_linux): Probe for video information. * normal/x86_64/setjmp.S: New file. * term/efi/console.c (map_char): New function. (grub_console_putchar): Map unicode char. (grub_console_checkkey): Wrap efi calls. (grub_console_getkey): Likewise. (grub_console_getwh): Likewise. (grub_console_gotoxy): Likewise. (grub_console_cls): Likewise. (grub_console_setcolorstate): Likewise. (grub_console_setcursor): Likewise. * util/i386/efi/grub-mkimage.c: Add support for x86_64.
2008-07-17 09:50:26 +00:00
fi
#
# Compiler features.
#
# Position independent executable.
grub_CHECK_PIE
[# Need that, because some distributions ship compilers that include
# `-fPIE' in the default specs.
if [ x"$pie_possible" = xyes ]; then
TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
fi]
# Position independent executable.
grub_CHECK_PIC
[# Need that, because some distributions ship compilers that include
# `-fPIC' in the default specs.
if [ x"$pic_possible" = xyes ]; then
TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC"
fi]
# Smashing stack protector.
grub_CHECK_STACK_PROTECTOR
# Need that, because some distributions ship compilers that include
# `-fstack-protector' in the default specs.
if test "x$ssp_possible" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
fi
2008-07-24 Bean <bean123ch@gmail.com> * common.rmk (bin_UTILITIES): Add grub-pe2elf. (grub_pe2elf_SOURCES): New macro. (CLEANFILES): Add grub-pe2elf. * include/grub/efi/pe32.h (GRUB_PE32_SCN_ALIGN_1BYTES): New constant. (GRUB_PE32_SCN_ALIGN_2BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_4BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_8BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_16BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_32BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_64BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_SHIFT): Likewise. (GRUB_PE32_SCN_ALIGN_MASK): Likewise. (GRUB_PE32_SYM_CLASS_EXTERNAL): Likewise. (GRUB_PE32_SYM_CLASS_STATIC): Likewise. (GRUB_PE32_SYM_CLASS_FILE): Likewise. (GRUB_PE32_DT_FUNCTION): Likewise. (GRUB_PE32_REL_I386_DIR32): Likewise. (GRUB_PE32_REL_I386_REL32): Likewise. (grub_pe32_symbol): New structure. (grub_pe32_reloc): Likewise. * util/grub-pe2elf.c: New file. * configure.ac: Set TARGET_OBJ2ELF if host os is cygwin. Don't test for start symbol in non pc platform. * genmk.rb: Use TARGET_OBJ2ELF to convert native object format to elf. The following patches are from Christian Franke. * include/grub/dl.h: Remove .previous, gas supports this only for ELF format. * include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE): Remove .type, gas supports this only for ELF format. * kern/dl.c (grub_dl_resolve_dependencies): Add check for trailing nullbytes in symbol table. This fixes an infinite loop if table is zero filled. * Makefile.in: Add autoconf replacements TARGET_IMG_LDSCRIPT, TARGET_IMG_LDFLAGS and EXEEXT. * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by TARGET_IMG_LDFLAGS_AC. (grub_CHECK_STACK_ARG_PROBE): New function. * conf/i386-pc.rmk: Replace -Wl,-N by TARGET_IMG_LDFLAGS. * conf/i386-pc-cygwin-ld-img.sc: New linker script. * configure.ac: Add check for linker script "conf/${target}-img-ld.c" to set TARGET_IMG_LD* accordingly. Add check for Cygwin to set TARGET_MOD_OBJCOPY accordingly. Add call to grub_CHECK_STACK_ARG_PROBE. Use TARGET_IMG_LDFLAGS to check start, bss_start, end symbols. * genkernsyms.sh.in: Handle HAVE_ASM_USCORE case. * genmk.rb: Add EXEEXT to CLEANFILES.
2008-07-24 14:56:30 +00:00
grub_CHECK_STACK_ARG_PROBE
# Cygwin's GCC uses alloca() to probe the stackframe on static
# stack allocations above some threshold.
if test x"$sap_possible" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
fi
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--disable-werror],
[do not use -Werror when building GRUB])])
if test x"$enable_werror" != xno ; then
TARGET_CFLAGS="$TARGET_CFLAGS -Werror"
Increase warning level. * conf/Makefile.common (CFLAGS_GNULIB): Add -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition. * configure.ac (HOST_CFLAGS): Add bunch of -W arguments. (TARGET_CFLAGS): Likewise. (HOST_CFLAGS): Add -Werror unless --disable-werror is activated. * grub-core/Makefile.core.def (decompressor_xz): Add -Wno-unreachable-code. (normal): Add -Wno-redundant-decls. (xzio): Add -Wno-unreachable-code. (lzopio): Add -Wno-redundant-decls -Wno-error. * grub-core/commands/acpi.c: Add exception to -Wcast-align. * grub-core/commands/lsacpi.c: Add exception to -Wcast-align. * grub-core/gensymlist.sh: Add exception to -Wmissing-format-attribute. * grub-core/kern/dl.c: Add exception to -Wcast-align. * grub-core/kern/efi/efi.c (grub_efi_modules_addr): Likewise. * grub-core/kern/i386/coreboot/init.c: Add exception to -Wsuggest-attribute=noreturn. * grub-core/kern/ia64/dl.c: Add exception to -Wcast-align. * grub-core/kern/ia64/dl_helper.c: Likewise. * grub-core/kern/mips/dl.c: Likewise. * grub-core/kern/sparc64/dl.c: Likewise. * grub-core/lib/LzmaEnc.c: Add exception to -Wshadow. * grub-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy): Likewise. (memcmp): Likewise. * grub-core/lib/pbkdf2.c: Add exception to -Wunreachable-code. * grub-core/loader/ia64/efi/linux.c: Add exception to -Wcast-align. * grub-core/loader/mips/linux.c: Likewise. * grub-core/loader/multiboot_elfxx.c: Likewise. * grub-core/script/parser.y: Add exception to -Wunreachable-code. * grub-core/video/sm712.c: Add exception to -Wcast-align. * util/import_gcry.py: Add -Wno-cast-align to modules checked by hand. * grub-core/font/font.c (grub_font_loader_init): Add explicit cast and fixme. * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Likewise. * grub-core/kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Fix prototype.
2012-02-10 15:48:48 +00:00
HOST_CFLAGS="$HOST_CFLAGS -Werror"
fi
TARGET_CPP="$TARGET_CC -E"
TARGET_CCAS=$TARGET_CC
GRUB_TARGET_CPU="${target_cpu}"
GRUB_PLATFORM="${platform}"
AC_SUBST(GRUB_TARGET_CPU)
AC_SUBST(GRUB_PLATFORM)
AC_SUBST(OBJCONV)
AC_SUBST(TARGET_CPP)
AC_SUBST(TARGET_CCAS)
AC_SUBST(TARGET_OBJ2ELF)
AC_SUBST(TARGET_APPLE_CC)
AC_SUBST(TARGET_MODULE_FORMAT)
AC_SUBST(TARGET_CFLAGS)
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
AC_SUBST(TARGET_LDFLAGS)
AC_SUBST(TARGET_CPPFLAGS)
AC_SUBST(TARGET_CCASFLAGS)
AC_SUBST(TARGET_IMG_LDSCRIPT)
AC_SUBST(TARGET_IMG_LDFLAGS)
AC_SUBST(TARGET_IMG_CFLAGS)
AC_SUBST(TARGET_IMG_BASE_LDOPT)
AC_SUBST(HOST_CFLAGS)
AC_SUBST(HOST_LDFLAGS)
AC_SUBST(HOST_CPPFLAGS)
AC_SUBST(HOST_CCASFLAGS)
2002-12-27 08:53:07 +00:00
# Set them to their new values for the tests below.
CC="$TARGET_CC"
if test "x$TARGET_APPLE_CC" = x1 ; then
CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
else
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
fi
CPPFLAGS="$TARGET_CPPFLAGS"
if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 ; then
LIBS=
else
LIBS=-lgcc
fi
grub_ASM_USCORE
if test x$grub_cv_asm_uscore = xyes; then
CFLAGS="$CFLAGS -Wl,--defsym,_abort=_main"
else
CFLAGS="$CFLAGS -Wl,--defsym,abort=main"
fi
# Check for libgcc symbols
AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2)
if test "x$TARGET_APPLE_CC" = x1 ; then
CFLAGS="$TARGET_CFLAGS -nostdlib"
else
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
fi
LIBS=""
2002-12-27 08:53:07 +00:00
# Defined in aclocal.m4.
grub_PROG_TARGET_CC
if test "x$TARGET_APPLE_CC" != x1 ; then
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
grub_PROG_OBJCOPY_ABSOLUTE
fi
grub_PROG_LD_BUILD_ID_NONE
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org> * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
if test "x$target_cpu" = xi386; then
if test "$platform" != emu && test "x$TARGET_APPLE_CC" != x1 ; then
if test ! -z "$TARGET_IMG_LDSCRIPT"; then
# Check symbols provided by linker script.
CFLAGS="$TARGET_CFLAGS -nostdlib ${TARGET_IMG_LDFLAGS_AC} ${TARGET_IMG_BASE_LDOPT},8000 -Wl,--defsym,___main=0x8100"
fi
2008-07-24 Bean <bean123ch@gmail.com> * common.rmk (bin_UTILITIES): Add grub-pe2elf. (grub_pe2elf_SOURCES): New macro. (CLEANFILES): Add grub-pe2elf. * include/grub/efi/pe32.h (GRUB_PE32_SCN_ALIGN_1BYTES): New constant. (GRUB_PE32_SCN_ALIGN_2BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_4BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_8BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_16BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_32BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_64BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_SHIFT): Likewise. (GRUB_PE32_SCN_ALIGN_MASK): Likewise. (GRUB_PE32_SYM_CLASS_EXTERNAL): Likewise. (GRUB_PE32_SYM_CLASS_STATIC): Likewise. (GRUB_PE32_SYM_CLASS_FILE): Likewise. (GRUB_PE32_DT_FUNCTION): Likewise. (GRUB_PE32_REL_I386_DIR32): Likewise. (GRUB_PE32_REL_I386_REL32): Likewise. (grub_pe32_symbol): New structure. (grub_pe32_reloc): Likewise. * util/grub-pe2elf.c: New file. * configure.ac: Set TARGET_OBJ2ELF if host os is cygwin. Don't test for start symbol in non pc platform. * genmk.rb: Use TARGET_OBJ2ELF to convert native object format to elf. The following patches are from Christian Franke. * include/grub/dl.h: Remove .previous, gas supports this only for ELF format. * include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE): Remove .type, gas supports this only for ELF format. * kern/dl.c (grub_dl_resolve_dependencies): Add check for trailing nullbytes in symbol table. This fixes an infinite loop if table is zero filled. * Makefile.in: Add autoconf replacements TARGET_IMG_LDSCRIPT, TARGET_IMG_LDFLAGS and EXEEXT. * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by TARGET_IMG_LDFLAGS_AC. (grub_CHECK_STACK_ARG_PROBE): New function. * conf/i386-pc.rmk: Replace -Wl,-N by TARGET_IMG_LDFLAGS. * conf/i386-pc-cygwin-ld-img.sc: New linker script. * configure.ac: Add check for linker script "conf/${target}-img-ld.c" to set TARGET_IMG_LD* accordingly. Add check for Cygwin to set TARGET_MOD_OBJCOPY accordingly. Add call to grub_CHECK_STACK_ARG_PROBE. Use TARGET_IMG_LDFLAGS to check start, bss_start, end symbols. * genkernsyms.sh.in: Handle HAVE_ASM_USCORE case. * genmk.rb: Add EXEEXT to CLEANFILES.
2008-07-24 14:56:30 +00:00
grub_CHECK_BSS_START_SYMBOL
grub_CHECK_END_SYMBOL
fi
CFLAGS="$TARGET_CFLAGS"
grub_I386_ASM_PREFIX_REQUIREMENT
grub_I386_ASM_ADDR32
2002-12-27 08:53:07 +00:00
fi
2010-03-14 15:01:31 +00:00
if test "$platform" != emu; then
AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
SAVED_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
#include <stddef.h>
int va_arg_func (int fixed, va_list args);]], [[]])],
[grub_cv_cc_isystem=yes],
[grub_cv_cc_isystem=no])
CPPFLAGS="$SAVED_CPPFLAGS"
])
if test x"$grub_cv_cc_isystem" = xyes ; then
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
fi
2010-03-14 15:27:54 +00:00
fi
2009-07-16 16:37:18 +00:00
AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [
SAVED_CFLAGS="$CFLAGS"
CFLAGS="$TARGET_CFLAGS -Wtrampolines"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
int va_arg_func (int fixed, va_list args);]], [[]])],
[grub_cv_cc_wtrampolines=yes],
[grub_cv_cc_wtrampolines=no])
CFLAGS="$SAVED_CFLAGS"
])
if test x"$grub_cv_cc_wtrampolines" = xyes ; then
TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines"
fi
# Restore the flags.
CC="$tmp_CC"
CFLAGS="$tmp_CFLAGS"
CPPFLAGS="$tmp_CPPFLAGS"
LDFLAGS="$tmp_LDFLAGS"
LIBS="$tmp_LIBS"
2002-12-27 08:53:07 +00:00
#
2006-04-25 Yoshinori K. Okuji <okuji@enbug.org> A new machine-specific function "grub_machine_set_prefix" is defined. This is called after loading modules, so that a prefix initialization can use modules. Also, this change adds an intensive debugging feature for the memory manager via the configure option "--enable-mm-debug". * partmap/gpt.c (gpt_partition_map_iterate): Add one more into PART.LEN. * kern/sparc64/ieee1275/init.c (abort): Removed. (grub_stop): Likewise. (grub_exit): New function. (grub_set_prefix): Renamed to ... (grub_machine_set_prefix): ... this. (grub_machine_init): Do not call grub_set_prefix. * kern/powerpc/ieee1275/init.c (grub_set_prefix): Renamed to ... (grub_machine_set_prefix): ... this. (grub_machine_init): Do not call grub_set_prefix. * kern/i386/pc/init.c (grub_machine_set_prefix): New function. (grub_machine_init): Do not set the prefix here. * kern/i386/efi/init.c (grub_machine_set_prefix): New function. * kern/efi/init.c: Include grub/mm.h. (grub_efi_set_prefix): New function. * kern/efi/efi.c (grub_exit): Call grub_efi_fini. (grub_efi_get_filename): New function. (grub_print_device_path): Renamed to ... (grub_efi_print_device_path): ... this. * kern/mm.c [MM_DEBUG] (grub_malloc): Undefined. [MM_DEBUG] (grub_realloc): Likewise. [MM_DEBUG] (grub_free): Likewise. [MM_DEBUG] (grub_memalign): Likewise. [MM_DEBUG] (grub_mm_debug): New variable. [MM_DEBUG] (grub_debug_malloc): New function. [MM_DEBUG] (grub_debug_free): New function. [MM_DEBUG] (grub_debug_realloc): New function. [MM_DEBUG] (grub_debug_memalign): New function. * kern/misc.c (grub_abort): Print a newline to distinguish the message. * kern/main.c (grub_main): Call grub_machine_set_prefix and grub_set_root_dev after loading modules. This is necessary when setting a prefix depends on modules. * include/grub/efi/efi.h (grub_print_device_path): Renamed to ... (grub_efi_print_device_path): ... this. (grub_efi_get_filename): New prototype. (grub_efi_set_prefix): Likewise. * include/grub/efi/disk.h: Include grub/efi/api.h, grub/symbol.h and grub/disk.h. (grub_efidisk_get_device_handle): New prototype. (grub_efidisk_get_device_name): Likewise. * include/grub/mm.h: Include config.h. (MM_DEBUG): Removed. [MM_DEBUG && !GRUB_UTIL] (grub_mm_debug): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_malloc): New macro. [MM_DEBUG && !GRUB_UTIL] (grub_realloc): Likewise. [MM_DEBUG && !GRUB_UTIL] (grub_memalign): Likewise. [MM_DEBUG && !GRUB_UTIL] (grub_free): Likewise. [MM_DEBUG && !GRUB_UTIL] (grub_debug_malloc): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_debug_realloc): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_debug_memalign): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_debug_free): New prototype. * include/grub/kernel.h (grub_machine_set_prefix): New prototype. * disk/efi/efidisk.c: Include grub/partition.h. (iterate_child_devices): New function. (add_device): First, compare only last device path nodes, so that devices are sorted by the types. (grub_efidisk_get_device_handle): New function. (grub_efidisk_get_device_name): Likewise. * configure.ac (--enable-mm-debug): New option to enable the memory manager debugging feature. This makes the binary much bigger, so is disabled by default.
2006-04-25 20:08:31 +00:00
# Check for options.
#
# Memory manager debugging.
2009-06-10 21:04:23 +00:00
AC_ARG_ENABLE([mm-debug],
2006-04-25 Yoshinori K. Okuji <okuji@enbug.org> A new machine-specific function "grub_machine_set_prefix" is defined. This is called after loading modules, so that a prefix initialization can use modules. Also, this change adds an intensive debugging feature for the memory manager via the configure option "--enable-mm-debug". * partmap/gpt.c (gpt_partition_map_iterate): Add one more into PART.LEN. * kern/sparc64/ieee1275/init.c (abort): Removed. (grub_stop): Likewise. (grub_exit): New function. (grub_set_prefix): Renamed to ... (grub_machine_set_prefix): ... this. (grub_machine_init): Do not call grub_set_prefix. * kern/powerpc/ieee1275/init.c (grub_set_prefix): Renamed to ... (grub_machine_set_prefix): ... this. (grub_machine_init): Do not call grub_set_prefix. * kern/i386/pc/init.c (grub_machine_set_prefix): New function. (grub_machine_init): Do not set the prefix here. * kern/i386/efi/init.c (grub_machine_set_prefix): New function. * kern/efi/init.c: Include grub/mm.h. (grub_efi_set_prefix): New function. * kern/efi/efi.c (grub_exit): Call grub_efi_fini. (grub_efi_get_filename): New function. (grub_print_device_path): Renamed to ... (grub_efi_print_device_path): ... this. * kern/mm.c [MM_DEBUG] (grub_malloc): Undefined. [MM_DEBUG] (grub_realloc): Likewise. [MM_DEBUG] (grub_free): Likewise. [MM_DEBUG] (grub_memalign): Likewise. [MM_DEBUG] (grub_mm_debug): New variable. [MM_DEBUG] (grub_debug_malloc): New function. [MM_DEBUG] (grub_debug_free): New function. [MM_DEBUG] (grub_debug_realloc): New function. [MM_DEBUG] (grub_debug_memalign): New function. * kern/misc.c (grub_abort): Print a newline to distinguish the message. * kern/main.c (grub_main): Call grub_machine_set_prefix and grub_set_root_dev after loading modules. This is necessary when setting a prefix depends on modules. * include/grub/efi/efi.h (grub_print_device_path): Renamed to ... (grub_efi_print_device_path): ... this. (grub_efi_get_filename): New prototype. (grub_efi_set_prefix): Likewise. * include/grub/efi/disk.h: Include grub/efi/api.h, grub/symbol.h and grub/disk.h. (grub_efidisk_get_device_handle): New prototype. (grub_efidisk_get_device_name): Likewise. * include/grub/mm.h: Include config.h. (MM_DEBUG): Removed. [MM_DEBUG && !GRUB_UTIL] (grub_mm_debug): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_malloc): New macro. [MM_DEBUG && !GRUB_UTIL] (grub_realloc): Likewise. [MM_DEBUG && !GRUB_UTIL] (grub_memalign): Likewise. [MM_DEBUG && !GRUB_UTIL] (grub_free): Likewise. [MM_DEBUG && !GRUB_UTIL] (grub_debug_malloc): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_debug_realloc): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_debug_memalign): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_debug_free): New prototype. * include/grub/kernel.h (grub_machine_set_prefix): New prototype. * disk/efi/efidisk.c: Include grub/partition.h. (iterate_child_devices): New function. (add_device): First, compare only last device path nodes, so that devices are sorted by the types. (grub_efidisk_get_device_handle): New function. (grub_efidisk_get_device_name): Likewise. * configure.ac (--enable-mm-debug): New option to enable the memory manager debugging feature. This makes the binary much bigger, so is disabled by default.
2006-04-25 20:08:31 +00:00
AS_HELP_STRING([--enable-mm-debug],
[include memory manager debugging]),
2006-04-25 Yoshinori K. Okuji <okuji@enbug.org> A new machine-specific function "grub_machine_set_prefix" is defined. This is called after loading modules, so that a prefix initialization can use modules. Also, this change adds an intensive debugging feature for the memory manager via the configure option "--enable-mm-debug". * partmap/gpt.c (gpt_partition_map_iterate): Add one more into PART.LEN. * kern/sparc64/ieee1275/init.c (abort): Removed. (grub_stop): Likewise. (grub_exit): New function. (grub_set_prefix): Renamed to ... (grub_machine_set_prefix): ... this. (grub_machine_init): Do not call grub_set_prefix. * kern/powerpc/ieee1275/init.c (grub_set_prefix): Renamed to ... (grub_machine_set_prefix): ... this. (grub_machine_init): Do not call grub_set_prefix. * kern/i386/pc/init.c (grub_machine_set_prefix): New function. (grub_machine_init): Do not set the prefix here. * kern/i386/efi/init.c (grub_machine_set_prefix): New function. * kern/efi/init.c: Include grub/mm.h. (grub_efi_set_prefix): New function. * kern/efi/efi.c (grub_exit): Call grub_efi_fini. (grub_efi_get_filename): New function. (grub_print_device_path): Renamed to ... (grub_efi_print_device_path): ... this. * kern/mm.c [MM_DEBUG] (grub_malloc): Undefined. [MM_DEBUG] (grub_realloc): Likewise. [MM_DEBUG] (grub_free): Likewise. [MM_DEBUG] (grub_memalign): Likewise. [MM_DEBUG] (grub_mm_debug): New variable. [MM_DEBUG] (grub_debug_malloc): New function. [MM_DEBUG] (grub_debug_free): New function. [MM_DEBUG] (grub_debug_realloc): New function. [MM_DEBUG] (grub_debug_memalign): New function. * kern/misc.c (grub_abort): Print a newline to distinguish the message. * kern/main.c (grub_main): Call grub_machine_set_prefix and grub_set_root_dev after loading modules. This is necessary when setting a prefix depends on modules. * include/grub/efi/efi.h (grub_print_device_path): Renamed to ... (grub_efi_print_device_path): ... this. (grub_efi_get_filename): New prototype. (grub_efi_set_prefix): Likewise. * include/grub/efi/disk.h: Include grub/efi/api.h, grub/symbol.h and grub/disk.h. (grub_efidisk_get_device_handle): New prototype. (grub_efidisk_get_device_name): Likewise. * include/grub/mm.h: Include config.h. (MM_DEBUG): Removed. [MM_DEBUG && !GRUB_UTIL] (grub_mm_debug): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_malloc): New macro. [MM_DEBUG && !GRUB_UTIL] (grub_realloc): Likewise. [MM_DEBUG && !GRUB_UTIL] (grub_memalign): Likewise. [MM_DEBUG && !GRUB_UTIL] (grub_free): Likewise. [MM_DEBUG && !GRUB_UTIL] (grub_debug_malloc): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_debug_realloc): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_debug_memalign): New prototype. [MM_DEBUG && !GRUB_UTIL] (grub_debug_free): New prototype. * include/grub/kernel.h (grub_machine_set_prefix): New prototype. * disk/efi/efidisk.c: Include grub/partition.h. (iterate_child_devices): New function. (add_device): First, compare only last device path nodes, so that devices are sorted by the types. (grub_efidisk_get_device_handle): New function. (grub_efidisk_get_device_name): Likewise. * configure.ac (--enable-mm-debug): New option to enable the memory manager debugging feature. This makes the binary much bigger, so is disabled by default.
2006-04-25 20:08:31 +00:00
[AC_DEFINE([MM_DEBUG], [1],
[Define to 1 if you enable memory manager debugging.])])
AC_ARG_ENABLE([cache-stats],
AS_HELP_STRING([--enable-cache-stats],
[enable disk cache statistics collection]))
if test x$enable_cache_stats = xyes; then
DISK_CACHE_STATS=1
else
DISK_CACHE_STATS=0
fi
AC_SUBST([DISK_CACHE_STATS])
AC_ARG_ENABLE([boot-time],
AS_HELP_STRING([--enable-boot-time],
[enable boot time statistics collection]))
if test x$enable_boot_time = xyes; then
BOOT_TIME_STATS=1
else
BOOT_TIME_STATS=0
fi
AC_SUBST([BOOT_TIME_STATS])
AC_ARG_ENABLE([grub-emu-usb],
[AS_HELP_STRING([--enable-grub-emu-usb],
2009-07-16 16:37:18 +00:00
[build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
2009-11-20 09:28:42 +00:00
AC_ARG_ENABLE([grub-emu-sdl],
[AS_HELP_STRING([--enable-grub-emu-sdl],
[build and install the `grub-emu' debugging utility with SDL support (default=guessed)])])
2009-10-14 08:11:59 +00:00
AC_ARG_ENABLE([grub-emu-pci],
[AS_HELP_STRING([--enable-grub-emu-pci],
[build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
if test "$platform" = emu; then
if test x"$enable_grub_emu_usb" != xyes ; then
grub_emu_usb_excuse="not enabled"
2009-07-16 16:37:18 +00:00
fi
2009-10-14 08:36:37 +00:00
2009-11-25 14:15:30 +00:00
if test x"$enable_grub_emu_pci" = xyes ; then
grub_emu_usb_excuse="conflicts with PCI support"
fi
2009-07-16 16:37:18 +00:00
[if [ x"$grub_emu_usb_excuse" = x ]; then
# Check for libusb libraries.]
2009-07-16 16:37:18 +00:00
AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
[grub_emu_usb_excuse=["need libusb library"]])
AC_SUBST([LIBUSB])
2009-07-16 16:37:18 +00:00
[fi]
[if [ x"$grub_emu_usb_excuse" = x ]; then
# Check for headers.]
AC_CHECK_HEADERS([usb.h], [],
[grub_emu_usb_excuse=["need libusb headers"]])
[fi]
if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled])
2009-07-16 16:37:18 +00:00
fi
if test x"$grub_emu_usb_excuse" = x ; then
enable_grub_emu_usb=yes
else
enable_grub_emu_usb=no
fi
2009-11-20 09:28:42 +00:00
if test x"$enable_grub_emu_sdl" = xno ; then
grub_emu_sdl_excuse="explicitely disabled"
fi
[if [ x"$grub_emu_sdl_excuse" = x ]; then
# Check for libSDL libraries.]
AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
[grub_emu_sdl_excuse=["libSDL libraries are required to build \`grub-emu' with SDL support"]])
AC_SUBST([LIBSDL])
[fi]
2009-12-25 20:32:46 +00:00
2009-11-20 09:28:42 +00:00
[if [ x"$grub_emu_sdl_excuse" = x ]; then
# Check for headers.]
AC_CHECK_HEADERS([SDL/SDL.h], [],
[grub_emu_sdl_excuse=["libSDL header file is required to build \`grub-emu' with SDL support"]])
[fi]
2009-12-25 20:32:46 +00:00
2009-11-20 09:28:42 +00:00
if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled])
fi
if test x"$grub_emu_sdl_excuse" = x ; then
enable_grub_emu_sdl=yes
else
enable_grub_emu_sdl=no
fi
2009-10-14 08:11:59 +00:00
if test x"$enable_grub_emu_pci" != xyes ; then
2009-10-14 08:36:37 +00:00
grub_emu_pci_excuse="not enabled"
fi
if test x"$enable_grub_emu_usb" = xyes ; then
grub_emu_pci_excuse="conflicts with USB support"
fi
[if [ x"$grub_emu_pci_excuse" = x ]; then
# Check for libpci libraries.]
2009-10-14 16:17:18 +00:00
AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"],
[grub_emu_pci_excuse=["need libpciaccess library"]])
AC_SUBST([LIBPCIACCESS])
2009-10-14 08:36:37 +00:00
[fi]
[if [ x"$grub_emu_pci_excuse" = x ]; then
# Check for headers.]
AC_CHECK_HEADERS([pci/pci.h], [],
2009-10-14 16:17:18 +00:00
[grub_emu_pci_excuse=["need libpciaccess headers"]])
2009-10-14 08:36:37 +00:00
[fi]
if test x"$grub_emu_pci_excuse" = x ; then
enable_grub_emu_pci=yes
else
2009-12-25 20:32:46 +00:00
2009-10-14 08:36:37 +00:00
enable_grub_emu_pci=no
2009-10-14 08:11:59 +00:00
fi
2009-11-20 09:28:42 +00:00
AC_SUBST([enable_grub_emu_sdl])
AC_SUBST([enable_grub_emu_usb])
2009-10-14 08:11:59 +00:00
AC_SUBST([enable_grub_emu_pci])
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
fi
AC_ARG_ENABLE([grub-mkfont],
[AS_HELP_STRING([--enable-grub-mkfont],
2009-07-16 16:37:18 +00:00
[build and install the `grub-mkfont' utility (default=guessed)])])
if test x"$enable_grub_mkfont" = xno ; then
grub_mkfont_excuse="explicitly disabled"
2009-07-16 16:37:18 +00:00
fi
if test x"$grub_mkfont_excuse" = x ; then
# Check for freetype libraries.
AC_CHECK_PROGS([FREETYPE], [freetype-config])
if test "x$FREETYPE" = x ; then
grub_mkfont_excuse=["need freetype2 library"]
fi
fi
if test x"$grub_mkfont_excuse" = x ; then
# Check for freetype libraries.
freetype_cflags=`freetype-config --cflags`
freetype_libs=`freetype-config --libs`
SAVED_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $freetype_cflags"
AC_CHECK_HEADERS([ft2build.h], [],
[grub_mkfont_excuse=["need freetype2 headers"]])
CPPFLAGS="$SAVED_CPPFLAGS"
fi
2009-07-16 16:37:18 +00:00
if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
2009-07-16 16:37:18 +00:00
fi
if test x"$grub_mkfont_excuse" = x ; then
enable_grub_mkfont=yes
else
enable_grub_mkfont=no
fi
if test x"$enable_grub_mkfont" = xno && test "x$platform" = xloongson; then
AC_MSG_ERROR([loongson port needs grub-mkfont])
fi
AC_SUBST([enable_grub_mkfont])
AC_SUBST([freetype_cflags])
AC_SUBST([freetype_libs])
Starfield theme. * Makefile.am: Define starfield_DATA and dejavu.pf2 generation. * conf/Makefile.common: Define starfielddir. * configure.ac: Configure starfield. * themes/starfield/COPYING.CC-BY-SA-3.0: New file. * themes/starfield/README: Likewise. * themes/starfield/blob_w.png: Likewise. * themes/starfield/boot_menu_c.png: Likewise. * themes/starfield/boot_menu_e.png: Likewise. * themes/starfield/boot_menu_n.png: Likewise. * themes/starfield/boot_menu_ne.png: Likewise. * themes/starfield/boot_menu_nw.png: Likewise. * themes/starfield/boot_menu_s.png: Likewise. * themes/starfield/boot_menu_se.png: Likewise. * themes/starfield/boot_menu_sw.png: Likewise. * themes/starfield/boot_menu_w.png: Likewise. * themes/starfield/slider_c.png: Likewise. * themes/starfield/slider_n.png: Likewise. * themes/starfield/slider_s.png: Likewise. * themes/starfield/src/blob_nw.xcf: Likewise. * themes/starfield/src/bootmenu/: Likewise. * themes/starfield/src/bootmenu/center.xcf: Likewise. * themes/starfield/src/bootmenu/corner.xcf: Likewise. * themes/starfield/src/bootmenu/side.xcf: Likewise. * themes/starfield/src/slider_c.xcf: Likewise. * themes/starfield/src/slider_n.xcf: Likewise. * themes/starfield/src/slider_s.xcf: Likewise. * themes/starfield/src/terminalbox/: Likewise. * themes/starfield/src/terminalbox/center.xcf: Likewise. * themes/starfield/src/terminalbox/corner.xcf: Likewise. * themes/starfield/src/terminalbox/side.xcf: Likewise. * themes/starfield/starfield.png: Likewise. * themes/starfield/terminal_box_c.png: Likewise. * themes/starfield/terminal_box_e.png: Likewise. * themes/starfield/terminal_box_n.png: Likewise. * themes/starfield/terminal_box_ne.png: Likewise. * themes/starfield/terminal_box_nw.png: Likewise. * themes/starfield/terminal_box_s.png: Likewise. * themes/starfield/terminal_box_se.png: Likewise. * themes/starfield/terminal_box_sw.png: Likewise. * themes/starfield/terminal_box_w.png: Likewise. * themes/starfield/theme.txt: Likewise.
2012-02-23 16:21:38 +00:00
DJVU_FONT_SOURCE=
starfield_excuse=
if test x$enable_grub_mkfont = xno; then
starfield_excuse="No grub-mkfont"
fi
if test x"$starfield_excuse" = x; then
Starfield theme. * Makefile.am: Define starfield_DATA and dejavu.pf2 generation. * conf/Makefile.common: Define starfielddir. * configure.ac: Configure starfield. * themes/starfield/COPYING.CC-BY-SA-3.0: New file. * themes/starfield/README: Likewise. * themes/starfield/blob_w.png: Likewise. * themes/starfield/boot_menu_c.png: Likewise. * themes/starfield/boot_menu_e.png: Likewise. * themes/starfield/boot_menu_n.png: Likewise. * themes/starfield/boot_menu_ne.png: Likewise. * themes/starfield/boot_menu_nw.png: Likewise. * themes/starfield/boot_menu_s.png: Likewise. * themes/starfield/boot_menu_se.png: Likewise. * themes/starfield/boot_menu_sw.png: Likewise. * themes/starfield/boot_menu_w.png: Likewise. * themes/starfield/slider_c.png: Likewise. * themes/starfield/slider_n.png: Likewise. * themes/starfield/slider_s.png: Likewise. * themes/starfield/src/blob_nw.xcf: Likewise. * themes/starfield/src/bootmenu/: Likewise. * themes/starfield/src/bootmenu/center.xcf: Likewise. * themes/starfield/src/bootmenu/corner.xcf: Likewise. * themes/starfield/src/bootmenu/side.xcf: Likewise. * themes/starfield/src/slider_c.xcf: Likewise. * themes/starfield/src/slider_n.xcf: Likewise. * themes/starfield/src/slider_s.xcf: Likewise. * themes/starfield/src/terminalbox/: Likewise. * themes/starfield/src/terminalbox/center.xcf: Likewise. * themes/starfield/src/terminalbox/corner.xcf: Likewise. * themes/starfield/src/terminalbox/side.xcf: Likewise. * themes/starfield/starfield.png: Likewise. * themes/starfield/terminal_box_c.png: Likewise. * themes/starfield/terminal_box_e.png: Likewise. * themes/starfield/terminal_box_n.png: Likewise. * themes/starfield/terminal_box_ne.png: Likewise. * themes/starfield/terminal_box_nw.png: Likewise. * themes/starfield/terminal_box_s.png: Likewise. * themes/starfield/terminal_box_se.png: Likewise. * themes/starfield/terminal_box_sw.png: Likewise. * themes/starfield/terminal_box_w.png: Likewise. * themes/starfield/theme.txt: Likewise.
2012-02-23 16:21:38 +00:00
for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu; do
Starfield theme. * Makefile.am: Define starfield_DATA and dejavu.pf2 generation. * conf/Makefile.common: Define starfielddir. * configure.ac: Configure starfield. * themes/starfield/COPYING.CC-BY-SA-3.0: New file. * themes/starfield/README: Likewise. * themes/starfield/blob_w.png: Likewise. * themes/starfield/boot_menu_c.png: Likewise. * themes/starfield/boot_menu_e.png: Likewise. * themes/starfield/boot_menu_n.png: Likewise. * themes/starfield/boot_menu_ne.png: Likewise. * themes/starfield/boot_menu_nw.png: Likewise. * themes/starfield/boot_menu_s.png: Likewise. * themes/starfield/boot_menu_se.png: Likewise. * themes/starfield/boot_menu_sw.png: Likewise. * themes/starfield/boot_menu_w.png: Likewise. * themes/starfield/slider_c.png: Likewise. * themes/starfield/slider_n.png: Likewise. * themes/starfield/slider_s.png: Likewise. * themes/starfield/src/blob_nw.xcf: Likewise. * themes/starfield/src/bootmenu/: Likewise. * themes/starfield/src/bootmenu/center.xcf: Likewise. * themes/starfield/src/bootmenu/corner.xcf: Likewise. * themes/starfield/src/bootmenu/side.xcf: Likewise. * themes/starfield/src/slider_c.xcf: Likewise. * themes/starfield/src/slider_n.xcf: Likewise. * themes/starfield/src/slider_s.xcf: Likewise. * themes/starfield/src/terminalbox/: Likewise. * themes/starfield/src/terminalbox/center.xcf: Likewise. * themes/starfield/src/terminalbox/corner.xcf: Likewise. * themes/starfield/src/terminalbox/side.xcf: Likewise. * themes/starfield/starfield.png: Likewise. * themes/starfield/terminal_box_c.png: Likewise. * themes/starfield/terminal_box_e.png: Likewise. * themes/starfield/terminal_box_n.png: Likewise. * themes/starfield/terminal_box_ne.png: Likewise. * themes/starfield/terminal_box_nw.png: Likewise. * themes/starfield/terminal_box_s.png: Likewise. * themes/starfield/terminal_box_se.png: Likewise. * themes/starfield/terminal_box_sw.png: Likewise. * themes/starfield/terminal_box_w.png: Likewise. * themes/starfield/theme.txt: Likewise.
2012-02-23 16:21:38 +00:00
if test -f "$dir/DejaVuSans.$ext"; then
DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext"
break 2
fi
done
done
if test "x$DJVU_FONT_SOURCE" = x; then
starfield_excuse="No DejaVu found"
fi
fi
AC_SUBST([DJVU_FONT_SOURCE])
AC_ARG_ENABLE([grub-mount],
[AS_HELP_STRING([--enable-grub-mount],
[build and install the `grub-mount' utility (default=guessed)])])
if test x"$enable_grub_mount" = xno ; then
grub_mount_excuse="explicitly disabled"
2011-01-08 18:51:08 +00:00
fi
if test x"$grub_mount_excuse" = x ; then
2011-01-08 18:51:08 +00:00
AC_CHECK_LIB([fuse], [fuse_main_real], [],
[grub_mount_excuse="need FUSE library"])
2011-01-08 18:51:08 +00:00
fi
if test x"$grub_mount_excuse" = x ; then
2011-01-08 18:51:08 +00:00
# Check for fuse headers.
SAVED_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26"
2011-01-08 18:51:08 +00:00
AC_CHECK_HEADERS([fuse/fuse.h], [],
[grub_mount_excuse=["need FUSE headers"]])
2011-01-08 18:51:08 +00:00
CPPFLAGS="$SAVED_CPPFLAGS"
fi
if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then
AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled])
2011-01-08 18:51:08 +00:00
fi
if test x"$grub_mount_excuse" = x ; then
enable_grub_mount=yes
2011-01-08 18:51:08 +00:00
else
enable_grub_mount=no
2011-01-08 18:51:08 +00:00
fi
AC_SUBST([enable_grub_mount])
2011-01-08 18:51:08 +00:00
AC_ARG_ENABLE([device-mapper],
[AS_HELP_STRING([--enable-device-mapper],
[enable Linux device-mapper support (default=guessed)])])
if test x"$enable_device_mapper" = xno ; then
device_mapper_excuse="explicitly disabled"
fi
2011-01-08 16:01:38 +00:00
if test x"$device_mapper_excuse" = x ; then
# Check for device-mapper header.
AC_CHECK_HEADER([libdevmapper.h], [],
[device_mapper_excuse="need libdevmapper header"])
fi
if test x"$device_mapper_excuse" = x ; then
# Check for device-mapper library.
AC_CHECK_LIB([devmapper], [dm_task_create], [],
[device_mapper_excuse="need devmapper library"])
fi
if test x"$device_mapper_excuse" = x ; then
# Check for device-mapper library.
AC_CHECK_LIB([devmapper], [dm_log_with_errno_init],
[],
[device_mapper_excuse="need devmapper library"])
fi
if test x"$device_mapper_excuse" = x ; then
LIBDEVMAPPER="-ldevmapper";
AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
[Define to 1 if you have the devmapper library.])
fi
2010-08-18 14:55:16 +00:00
AC_SUBST([LIBDEVMAPPER])
LIBGEOM=
if test x$host_kernel = xkfreebsd; then
AC_CHECK_LIB([geom], [geom_gettree], [],
[AC_MSG_ERROR([Your platform requires libgeom])])
LIBGEOM="-lgeom"
fi
AC_SUBST([LIBGEOM])
2010-09-21 19:35:46 +00:00
AC_CHECK_LIB([lzma], [lzma_code],
[LIBLZMA="-llzma"
AC_DEFINE([HAVE_LIBLZMA], [1],
[Define to 1 if you have the LZMA library.])],)
AC_SUBST([LIBLZMA])
AC_ARG_ENABLE([libzfs],
[AS_HELP_STRING([--enable-libzfs],
[enable libzfs integration (default=guessed)])])
if test x"$enable_libzfs" = xno ; then
libzfs_excuse="explicitly disabled"
fi
2010-08-19 11:24:00 +00:00
if test x"$libzfs_excuse" = x ; then
# Only check for system headers if libzfs support has not been disabled.
AC_CHECK_HEADERS(libzfs.h libnvpair.h)
fi
if test x"$libzfs_excuse" = x ; then
AC_CHECK_LIB([zfs], [libzfs_init],
[],
[libzfs_excuse="need zfs library"])
fi
if test x"$libzfs_excuse" = x ; then
AC_CHECK_LIB([nvpair], [nvlist_print],
[],
[libzfs_excuse="need nvpair library"])
fi
if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then
AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied])
fi
if test x"$libzfs_excuse" = x ; then
# We need both libzfs and libnvpair for a successful build.
LIBZFS="-lzfs"
AC_DEFINE([HAVE_LIBZFS], [1],
[Define to 1 if you have the ZFS library.])
LIBNVPAIR="-lnvpair"
AC_DEFINE([HAVE_LIBNVPAIR], [1],
[Define to 1 if you have the NVPAIR library.])
fi
AC_SUBST([LIBZFS])
2010-08-19 11:24:00 +00:00
AC_SUBST([LIBNVPAIR])
LIBS=""
AC_SUBST([FONT_SOURCE])
AS_IF([test x$target_cpu = xi386 -a x$platform = xqemu],
[AC_SUBST([GRUB_BOOT_MACHINE_LINK_ADDR], 0xffe00)])
AS_IF([test x$TARGET_APPLE_CC = x1],
[AC_SUBST([USE_APPLE_CC_FIXES], yes)])
AC_SUBST(HAVE_ASM_USCORE)
AC_SUBST(ADDR32)
AC_SUBST(DATA32)
AC_SUBST(BSS_START_SYMBOL)
AC_SUBST(END_SYMBOL)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(NEED_ENABLE_EXECUTE_STACK)
AC_SUBST(NEED_REGISTER_FRAME_INFO)
#
# Automake conditionals
#
2010-05-06 06:04:04 +00:00
AM_CONDITIONAL([COND_emu], [test x$platform = xemu])
AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc])
AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi])
2010-08-31 19:47:26 +00:00
AM_CONDITIONAL([COND_ia64_efi], [test x$target_cpu = xia64 -a x$platform = xefi])
AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu])
AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275])
AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
2013-04-25 20:42:35 +00:00
AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc])
AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
2010-08-23 07:53:56 +00:00
AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
AM_CONDITIONAL([COND_HOST_NETBSD], [test x$host_kernel = xnetbsd])
AM_CONDITIONAL([COND_HOST_WINDOWS], [test x$host_kernel = xwindows])
AM_CONDITIONAL([COND_HOST_KFREEBSD], [test x$host_kernel = xkfreebsd])
AM_CONDITIONAL([COND_HOST_XNU], [test x$host_kernel = xxnu])
AM_CONDITIONAL([COND_HOST_ILLUMOS], [test x$host_kernel = xillumos])
2010-06-07 11:53:54 +00:00
AM_CONDITIONAL([COND_MAN_PAGES], [test x$cross_compiling = xno -a x$HELP2MAN != x])
AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes])
AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x])
2010-08-20 07:30:11 +00:00
AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1])
AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1])
AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1])
AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes])
AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin])
Starfield theme. * Makefile.am: Define starfield_DATA and dejavu.pf2 generation. * conf/Makefile.common: Define starfielddir. * configure.ac: Configure starfield. * themes/starfield/COPYING.CC-BY-SA-3.0: New file. * themes/starfield/README: Likewise. * themes/starfield/blob_w.png: Likewise. * themes/starfield/boot_menu_c.png: Likewise. * themes/starfield/boot_menu_e.png: Likewise. * themes/starfield/boot_menu_n.png: Likewise. * themes/starfield/boot_menu_ne.png: Likewise. * themes/starfield/boot_menu_nw.png: Likewise. * themes/starfield/boot_menu_s.png: Likewise. * themes/starfield/boot_menu_se.png: Likewise. * themes/starfield/boot_menu_sw.png: Likewise. * themes/starfield/boot_menu_w.png: Likewise. * themes/starfield/slider_c.png: Likewise. * themes/starfield/slider_n.png: Likewise. * themes/starfield/slider_s.png: Likewise. * themes/starfield/src/blob_nw.xcf: Likewise. * themes/starfield/src/bootmenu/: Likewise. * themes/starfield/src/bootmenu/center.xcf: Likewise. * themes/starfield/src/bootmenu/corner.xcf: Likewise. * themes/starfield/src/bootmenu/side.xcf: Likewise. * themes/starfield/src/slider_c.xcf: Likewise. * themes/starfield/src/slider_n.xcf: Likewise. * themes/starfield/src/slider_s.xcf: Likewise. * themes/starfield/src/terminalbox/: Likewise. * themes/starfield/src/terminalbox/center.xcf: Likewise. * themes/starfield/src/terminalbox/corner.xcf: Likewise. * themes/starfield/src/terminalbox/side.xcf: Likewise. * themes/starfield/starfield.png: Likewise. * themes/starfield/terminal_box_c.png: Likewise. * themes/starfield/terminal_box_e.png: Likewise. * themes/starfield/terminal_box_n.png: Likewise. * themes/starfield/terminal_box_ne.png: Likewise. * themes/starfield/terminal_box_nw.png: Likewise. * themes/starfield/terminal_box_s.png: Likewise. * themes/starfield/terminal_box_se.png: Likewise. * themes/starfield/terminal_box_sw.png: Likewise. * themes/starfield/terminal_box_w.png: Likewise. * themes/starfield/theme.txt: Likewise.
2012-02-23 16:21:38 +00:00
AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x])
2002-12-27 08:53:07 +00:00
# Output files.
cpudir="${target_cpu}"
if test x${cpudir} = xmipsel; then
cpudir=mips;
fi
grub_CHECK_LINK_DIR
if test x"$link_dir" = xyes ; then
AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir])
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
if test "$platform" != emu ; then
AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform])
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
fi
else
mkdir -p include/grub 2>/dev/null
rm -rf include/grub/cpu
cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
if test "$platform" != emu ; then
rm -rf include/grub/machine
cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
fi
fi
2010-08-17 13:33:22 +00:00
2010-05-06 06:04:04 +00:00
AC_CONFIG_FILES([Makefile])
2010-08-17 13:33:22 +00:00
AC_CONFIG_FILES([grub-core/Makefile])
AC_CONFIG_FILES([grub-core/gnulib/Makefile])
AC_CONFIG_FILES([po/Makefile.in])
2010-05-06 06:04:04 +00:00
AC_CONFIG_FILES([docs/Makefile])
AC_CONFIG_FILES([util/bash-completion.d/Makefile])
2002-12-27 08:53:07 +00:00
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
AC_CONFIG_FILES([config.h])
2010-05-06 06:04:04 +00:00
2002-12-27 08:53:07 +00:00
AC_OUTPUT
2009-07-16 16:37:18 +00:00
[
echo "*******************************************************"
echo GRUB2 will be compiled with following components:
echo Platform: "$target_cpu"-"$platform"
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
if [ x"$platform" = xemu ]; then
2009-07-16 16:37:18 +00:00
if [ x"$grub_emu_usb_excuse" = x ]; then
echo USB support for grub-emu: Yes
else
echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
fi
2009-11-20 09:28:42 +00:00
if [ x"$grub_emu_sdl_excuse" = x ]; then
echo SDL support for grub-emu: Yes
else
echo SDL support for grub-emu: No "($grub_emu_sdl_excuse)"
fi
2009-10-14 08:36:37 +00:00
if [ x"$grub_emu_pci_excuse" = x ]; then
echo PCI support for grub-emu: Yes
else
echo PCI support for grub-emu: No "($grub_emu_pci_excuse)"
fi
Cheery-pick grub-emu split from experimental (rev 1361) 2009-11-23 Robert Millan <rmh.grub@aybabtu.com> * configure.ac: Detect all `emu' platforms. Define GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove --enable-grub-emu logic. Disable include/grub/machine symlink on `emu' platforms. * genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation. * gensymlist.sh.in: Likewise. * include/grub/i386/coreboot/machine.h: Remove file. * include/grub/i386/efi/machine.h: Likewise. * include/grub/i386/ieee1275/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * commands/acpi.c: Remove `<grub/machine/machine.h>'. * commands/halt.c: Likewise. * commands/reboot.c: Likewise. * include/grub/autoefi.h: Likewise. * include/grub/i386/at_keyboard.h: Likewise. * include/grub/i386/kernel.h: Likewise. * include/grub/i386/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * kern/dl.c: Likewise. * kern/i386/coreboot/init.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. * include/grub/time.h [!GRUB_MACHINE_EMU]: Remove `<grub/machine/machine.h>' [!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro. * util/misc.c: Remove `<grub/machine/machine.h>' and `<grub/machine/time.h>'. * Makefile.in (enable_grub_emu): Remove variable. Include $(srcdir)/conf/any-emu.mk for the `emu' platform. * conf/any-emu.rmk: New file. * conf/common.rmk (grub_emu_init.lst, grub_emu_init.h) (grub_emu_init.c): Move from here ... * conf/any-emu.rmk: ... to here. * conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'. (grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ... * conf/any-emu.rmk: ... to here.
2009-11-23 15:31:54 +00:00
fi
if test x"$device_mapper_excuse" = x ; then
echo With devmapper support: Yes
else
echo With devmapper support: No "($device_mapper_excuse)"
fi
2009-07-16 16:37:18 +00:00
if [ x"$enable_mm_debug" = xyes ]; then
echo With memory debugging: Yes
else
echo With memory debugging: No
fi
if [ x"$enable_cache_stats" = xyes ]; then
echo With disk cache statistics: Yes
else
echo With disk cache statistics: No
fi
if [ x"$enable_boot_time" = xyes ]; then
echo With boot time statistics: Yes
else
echo With boot time statistics: No
fi
2009-07-16 16:37:18 +00:00
if [ x"$efiemu_excuse" = x ]; then
echo efiemu runtime: Yes
else
echo efiemu runtime: No "($efiemu_excuse)"
fi
if [ x"$grub_mkfont_excuse" = x ]; then
echo grub-mkfont: Yes
else
echo grub-mkfont: No "($grub_mkfont_excuse)"
fi
if [ x"$grub_mount_excuse" = x ]; then
echo grub-mount: Yes
2011-01-08 18:51:08 +00:00
else
echo grub-mount: No "($grub_mount_excuse)"
2011-01-08 18:51:08 +00:00
fi
Starfield theme. * Makefile.am: Define starfield_DATA and dejavu.pf2 generation. * conf/Makefile.common: Define starfielddir. * configure.ac: Configure starfield. * themes/starfield/COPYING.CC-BY-SA-3.0: New file. * themes/starfield/README: Likewise. * themes/starfield/blob_w.png: Likewise. * themes/starfield/boot_menu_c.png: Likewise. * themes/starfield/boot_menu_e.png: Likewise. * themes/starfield/boot_menu_n.png: Likewise. * themes/starfield/boot_menu_ne.png: Likewise. * themes/starfield/boot_menu_nw.png: Likewise. * themes/starfield/boot_menu_s.png: Likewise. * themes/starfield/boot_menu_se.png: Likewise. * themes/starfield/boot_menu_sw.png: Likewise. * themes/starfield/boot_menu_w.png: Likewise. * themes/starfield/slider_c.png: Likewise. * themes/starfield/slider_n.png: Likewise. * themes/starfield/slider_s.png: Likewise. * themes/starfield/src/blob_nw.xcf: Likewise. * themes/starfield/src/bootmenu/: Likewise. * themes/starfield/src/bootmenu/center.xcf: Likewise. * themes/starfield/src/bootmenu/corner.xcf: Likewise. * themes/starfield/src/bootmenu/side.xcf: Likewise. * themes/starfield/src/slider_c.xcf: Likewise. * themes/starfield/src/slider_n.xcf: Likewise. * themes/starfield/src/slider_s.xcf: Likewise. * themes/starfield/src/terminalbox/: Likewise. * themes/starfield/src/terminalbox/center.xcf: Likewise. * themes/starfield/src/terminalbox/corner.xcf: Likewise. * themes/starfield/src/terminalbox/side.xcf: Likewise. * themes/starfield/starfield.png: Likewise. * themes/starfield/terminal_box_c.png: Likewise. * themes/starfield/terminal_box_e.png: Likewise. * themes/starfield/terminal_box_n.png: Likewise. * themes/starfield/terminal_box_ne.png: Likewise. * themes/starfield/terminal_box_nw.png: Likewise. * themes/starfield/terminal_box_s.png: Likewise. * themes/starfield/terminal_box_se.png: Likewise. * themes/starfield/terminal_box_sw.png: Likewise. * themes/starfield/terminal_box_w.png: Likewise. * themes/starfield/theme.txt: Likewise.
2012-02-23 16:21:38 +00:00
if [ x"$starfield_excuse" = x ]; then
echo starfield theme: Yes
else
echo starfield theme: No "($starfield_excuse)"
fi
if [ x"$libzfs_excuse" = x ]; then
echo With libzfs support: Yes
else
echo With libzfs support: No "($libzfs_excuse)"
fi
2009-07-16 16:37:18 +00:00
echo "*******************************************************"
]