2002-12-27 08:53:07 +00:00
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
2010-01-01 20:32:30 +00:00
|
|
|
# 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.
|
|
|
|
|
|
|
|
|
2010-03-01 18:07:48 +00:00
|
|
|
AC_INIT([GRUB],[1.98],[bug-grub@gnu.org])
|
2009-11-16 19:31:29 +00:00
|
|
|
AM_INIT_AUTOMAKE()
|
2009-11-25 17:37:04 +00:00
|
|
|
AC_PREREQ(2.60)
|
2004-04-04 13:46:03 +00:00
|
|
|
AC_CONFIG_SRCDIR([include/grub/dl.h])
|
2002-12-27 08:53:07 +00:00
|
|
|
AC_CONFIG_HEADER([config.h])
|
|
|
|
|
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
|
|
|
|
2007-04-10 21:38:26 +00:00
|
|
|
# Program name transformations
|
|
|
|
AC_ARG_PROGRAM
|
|
|
|
|
2009-12-29 14:04:18 +00:00
|
|
|
# Optimization flag. Allow user to override.
|
|
|
|
if test "x$TARGET_CFLAGS" = x; then
|
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -Os"
|
|
|
|
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
|
|
|
case "$target_cpu" in
|
2009-06-29 12:19:08 +00:00
|
|
|
i[[3456]]86) target_cpu=i386 ;;
|
2010-03-04 21:33:49 +00:00
|
|
|
amd64) target_cpu=x86_64 ;;
|
2009-06-29 12:19:08 +00:00
|
|
|
sparc) target_cpu=sparc64 ;;
|
2009-11-21 16:33:23 +00:00
|
|
|
mipsel|mips64el)
|
2009-10-18 13:06:47 +00:00
|
|
|
target_cpu=mips;
|
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPSEL=1";
|
|
|
|
CFLAGS="$CFLAGS -DGRUB_CPU_MIPSEL=1";
|
|
|
|
;;
|
2009-11-21 16:33:23 +00:00
|
|
|
mips|mips64)
|
2009-10-18 13:06:47 +00:00
|
|
|
target_cpu=mips;
|
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPS=1";
|
|
|
|
CFLAGS="$CFLAGS -DGRUB_CPU_MIPS=1";
|
|
|
|
;;
|
2002-12-27 08:53:07 +00:00
|
|
|
esac
|
|
|
|
|
2006-05-08 19:29:10 +00:00
|
|
|
# Specify the platform (such as firmware).
|
|
|
|
AC_ARG_WITH([platform],
|
|
|
|
AS_HELP_STRING([--with-platform=PLATFORM],
|
2006-05-09 00:05:49 +00:00
|
|
|
[select the host platform [[guessed]]]))
|
2006-05-08 19:29:10 +00:00
|
|
|
|
|
|
|
# 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
|
2006-05-08 19:29:10 +00:00
|
|
|
i386-apple) platform=efi ;;
|
|
|
|
i386-*) platform=pc ;;
|
2008-07-17 18:13:57 +00:00
|
|
|
x86_64-apple) platform=efi ;;
|
2008-07-17 15:31:16 +00:00
|
|
|
x86_64-*) platform=pc ;;
|
2006-05-08 19:29:10 +00:00
|
|
|
powerpc-*) platform=ieee1275 ;;
|
2008-07-17 18:13:57 +00:00
|
|
|
powerpc64-*) platform=ieee1275 ;;
|
2006-05-08 19:29:10 +00:00
|
|
|
sparc64-*) platform=ieee1275 ;;
|
2009-10-18 12:10:31 +00:00
|
|
|
mips-*) platform=yeeloong ;;
|
2008-07-17 18:13:57 +00:00
|
|
|
*) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
|
2006-05-08 19:29:10 +00:00
|
|
|
esac
|
|
|
|
else
|
|
|
|
platform="$with_platform"
|
|
|
|
fi
|
|
|
|
|
2008-07-17 18:13:57 +00:00
|
|
|
# Adjust CPU unless target was explicitly specified.
|
|
|
|
if test -z "$target_alias"; then
|
|
|
|
case "$target_cpu"-"$platform" in
|
|
|
|
x86_64-efi) ;;
|
2010-02-07 01:07:35 +00:00
|
|
|
x86_64-emu) ;;
|
2008-07-18 03:21:47 +00:00
|
|
|
x86_64-*) target_cpu=i386 ;;
|
|
|
|
powerpc64-ieee1275) target_cpu=powerpc ;;
|
2008-07-17 09:50:26 +00:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2008-07-17 18:13:57 +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
|
2006-05-08 19:29:10 +00:00
|
|
|
i386-efi) ;;
|
2008-07-18 03:21:47 +00:00
|
|
|
x86_64-efi) ;;
|
2006-05-08 19:29:10 +00:00
|
|
|
i386-pc) ;;
|
2010-05-01 12:06:53 +00:00
|
|
|
i386-multiboot) ;;
|
2008-07-17 15:05:12 +00:00
|
|
|
i386-coreboot) ;;
|
2008-07-17 18:13:57 +00:00
|
|
|
i386-linuxbios) platform=coreboot ;;
|
2008-01-15 20:05:44 +00:00
|
|
|
i386-ieee1275) ;;
|
2009-06-27 11:18:10 +00:00
|
|
|
i386-qemu) ;;
|
2006-05-08 19:29:10 +00:00
|
|
|
powerpc-ieee1275) ;;
|
|
|
|
sparc64-ieee1275) ;;
|
2009-12-02 07:49:36 +00:00
|
|
|
mips-qemu-mips) ;;
|
2009-10-18 12:10:31 +00:00
|
|
|
mips-yeeloong) ;;
|
2009-11-23 15:31:54 +00:00
|
|
|
*-emu) ;;
|
2008-07-17 18:13:57 +00:00
|
|
|
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
|
2002-12-27 08:53:07 +00:00
|
|
|
esac
|
|
|
|
|
2008-07-18 03:21:47 +00:00
|
|
|
case "$target_cpu" in
|
|
|
|
i386 | powerpc) target_m32=1 ;;
|
|
|
|
x86_64 | sparc64) target_m64=1 ;;
|
|
|
|
esac
|
|
|
|
|
2008-08-29 19:55:23 +00:00
|
|
|
case "$host_os" in
|
2009-11-09 19:58:24 +00:00
|
|
|
mingw32*) host_os=cygwin ;;
|
2008-08-29 19:55:23 +00:00
|
|
|
esac
|
|
|
|
|
2009-03-04 22:00:41 +00:00
|
|
|
# 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 ;;
|
2009-10-26 00:41:54 +00:00
|
|
|
freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;;
|
2010-04-10 15:07:33 +00:00
|
|
|
netbsd*) host_kernel=netbsd ;;
|
2009-03-04 22:00:41 +00:00
|
|
|
cygwin) host_kernel=windows ;;
|
|
|
|
esac
|
|
|
|
|
2009-11-23 15:31:54 +00:00
|
|
|
case "$platform" in
|
|
|
|
coreboot) machine_CFLAGS="-DGRUB_MACHINE_COREBOOT=1" ;;
|
2010-05-01 12:06:53 +00:00
|
|
|
multiboot) machine_CFLAGS="-DGRUB_MACHINE_MULTIBOOT=1" ;;
|
2009-11-23 15:31:54 +00:00
|
|
|
efi) machine_CFLAGS="-DGRUB_MACHINE_EFI=1" ;;
|
|
|
|
ieee1275) machine_CFLAGS="-DGRUB_MACHINE_IEEE1275=1" ;;
|
|
|
|
qemu) machine_CFLAGS="-DGRUB_MACHINE_QEMU=1" ;;
|
|
|
|
pc) machine_CFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;;
|
|
|
|
emu) machine_CFLAGS="-DGRUB_MACHINE_EMU=1" ;;
|
2010-02-12 19:08:56 +00:00
|
|
|
yeeloong) machine_CFLAGS="-DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
|
|
|
|
qemu-mips) machine_CFLAGS="-DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
|
2009-11-23 15:31:54 +00:00
|
|
|
esac
|
2010-02-12 19:08:56 +00:00
|
|
|
case "$target_cpu" in
|
|
|
|
mips) machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_MIPS=1" ;;
|
|
|
|
sparc64) machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
|
|
|
|
esac
|
2010-04-26 08:56:12 +00:00
|
|
|
machine_CFLAGS="$machine_CFLAGS -DMACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
|
2010-02-12 19:08:56 +00:00
|
|
|
|
2009-11-23 15:31:54 +00:00
|
|
|
CFLAGS="$CFLAGS $machine_CFLAGS"
|
2009-12-05 10:08:26 +00:00
|
|
|
TARGET_ASFLAGS="$TARGET_ASFLAGS $machine_CFLAGS"
|
2009-11-23 15:31:54 +00:00
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS $machine_CFLAGS"
|
|
|
|
|
2009-02-08 19:59:32 +00:00
|
|
|
AC_SUBST(host_cpu)
|
|
|
|
AC_SUBST(host_os)
|
2009-03-04 22:00:41 +00:00
|
|
|
AC_SUBST(host_kernel)
|
2008-08-29 19:55:23 +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
|
|
|
AC_SUBST(target_cpu)
|
2006-05-08 19:29:10 +00:00
|
|
|
AC_SUBST(platform)
|
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 build programs.
|
|
|
|
#
|
2006-01-03 17:58:02 +00:00
|
|
|
|
2006-05-30 00:32:29 +00:00
|
|
|
# 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
|
|
|
|
|
2006-01-03 17:58:02 +00:00
|
|
|
AC_CHECK_PROGS([YACC], [bison])
|
2005-11-26 23:40:24 +00:00
|
|
|
if test "x$YACC" = x; then
|
2006-05-30 00:32:29 +00:00
|
|
|
AC_MSG_ERROR([bison is not found])
|
2005-11-26 23:40:24 +00:00
|
|
|
fi
|
|
|
|
|
2010-06-08 10:09:34 +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/unifont; do
|
|
|
|
if test -f "$dir/unifont.$ext"; then
|
|
|
|
AC_SUBST([FONT_SOURCE], [$dir/unifont.$ext])
|
|
|
|
break 2
|
|
|
|
fi
|
|
|
|
done
|
2007-12-25 09:09:43 +00:00
|
|
|
done
|
|
|
|
|
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
|
2010-04-05 15:38:30 +00:00
|
|
|
AC_PROG_LEX
|
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
|
2009-09-23 17:18:06 +00:00
|
|
|
AC_PROG_MKDIR_P
|
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
|
|
|
|
2010-05-28 17:13:48 +00:00
|
|
|
if test "x$LEX" = "x:"; then
|
2010-04-05 15:38:30 +00:00
|
|
|
AC_MSG_ERROR([flex is not found])
|
|
|
|
else
|
2010-04-10 12:36:45 +00:00
|
|
|
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
|
2010-04-05 15:38:30 +00:00
|
|
|
:
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2008-02-09 12:31:11 +00:00
|
|
|
# These are not a "must".
|
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_PATH_PROG(RUBY, ruby)
|
2009-09-21 18:22:27 +00:00
|
|
|
AC_PATH_PROG(MAKEINFO, makeinfo)
|
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
|
2002-12-27 08:53:07 +00:00
|
|
|
# Must be GCC.
|
|
|
|
test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
|
|
|
|
|
2006-06-13 22:50:01 +00:00
|
|
|
AC_GNU_SOURCE
|
2010-01-01 20:32:30 +00:00
|
|
|
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)
|
|
|
|
|
2009-06-04 19:53:52 +00:00
|
|
|
grub_apple_cc
|
2009-06-15 22:45:17 +00:00
|
|
|
if test x$grub_cv_apple_cc = xyes ; then
|
2009-06-04 19:53:52 +00:00
|
|
|
CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
|
|
|
|
ASFLAGS="$ASFLAGS -DAPPLE_CC=1"
|
|
|
|
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
|
|
|
|
2009-09-11 14:17:35 +00:00
|
|
|
if test "x$cross_compiling" = xyes; then
|
|
|
|
AC_MSG_WARN([cannot generate manual pages while cross compiling])
|
|
|
|
else
|
|
|
|
AC_PATH_PROG(HELP2MAN, help2man)
|
|
|
|
fi
|
|
|
|
|
2006-06-13 22:50:01 +00:00
|
|
|
# Check for functions.
|
2009-12-07 16:46:24 +00:00
|
|
|
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf)
|
2006-06-13 22:50:01 +00:00
|
|
|
|
2009-11-08 23:01:34 +00:00
|
|
|
# For grub-mkisofs
|
|
|
|
AC_HEADER_MAJOR
|
|
|
|
AC_HEADER_DIRENT
|
2009-11-09 19:58:24 +00:00
|
|
|
AC_CHECK_FUNCS(memmove sbrk strdup lstat getuid getgid)
|
2009-11-08 23:01:34 +00:00
|
|
|
AC_CHECK_HEADERS(sys/mkdev.h sys/sysmacros.h malloc.h termios.h sys/types.h)
|
2010-01-25 09:06:55 +00:00
|
|
|
AC_CHECK_HEADERS(unistd.h string.h strings.h sys/stat.h sys/fcntl.h limits.h)
|
2009-11-08 23:01:34 +00:00
|
|
|
|
2010-04-10 15:07:33 +00:00
|
|
|
# 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])
|
|
|
|
|
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.
|
|
|
|
#
|
|
|
|
|
2009-04-12 04:33:18 +00:00
|
|
|
# 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(TARGET_CC)
|
|
|
|
|
|
|
|
|
|
|
|
# Test the C compiler for the target environment.
|
|
|
|
tmp_CC="$CC"
|
|
|
|
tmp_CFLAGS="$CFLAGS"
|
|
|
|
tmp_LDFLAGS="$LDFLAGS"
|
|
|
|
tmp_CPPFLAGS="$CPPFLAGS"
|
2006-06-01 15:51:51 +00:00
|
|
|
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"
|
2006-06-01 15:51:51 +00:00
|
|
|
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
|
|
|
|
2009-12-29 14:04:18 +00:00
|
|
|
# debug flags.
|
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
|
|
|
|
-Wundef -Wstrict-prototypes -g"
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2009-12-29 14:04:18 +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"
|
2008-09-21 17:38:33 +00:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
2009-12-29 14:04:18 +00:00
|
|
|
[grub_cv_cc_falign_loop=yes],
|
|
|
|
[grub_cv_cc_falign_loop=no])
|
2002-12-27 08:53:07 +00:00
|
|
|
])
|
|
|
|
|
2009-12-29 14:04:18 +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
|
2009-12-29 14:04:18 +00:00
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
|
2002-12-27 08:53:07 +00:00
|
|
|
fi
|
|
|
|
|
2009-12-29 14:04:18 +00:00
|
|
|
# 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
|
2009-09-03 23:00:25 +00:00
|
|
|
|
2009-12-29 14:04:18 +00:00
|
|
|
# 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"
|
|
|
|
])
|
2009-09-03 23:00:25 +00:00
|
|
|
|
2009-12-29 14:04:18 +00:00
|
|
|
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
|
|
|
|
2009-06-04 19:53:52 +00:00
|
|
|
grub_apple_target_cc
|
2009-06-15 22:45:17 +00:00
|
|
|
if test x$grub_cv_apple_target_cc = xyes ; then
|
2009-06-04 19:53:52 +00:00
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -DAPPLE_CC=1 -fnested-functions"
|
|
|
|
CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions"
|
|
|
|
TARGET_ASFLAGS="$TARGET_ASFLAGS -DAPPLE_CC=1"
|
|
|
|
TARGET_APPLE_CC=1
|
2009-06-04 20:54:14 +00:00
|
|
|
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
|
2009-06-04 19:53:52 +00:00
|
|
|
TARGET_IMG_LDSCRIPT=
|
|
|
|
TARGET_IMG_CFLAGS="-static"
|
|
|
|
TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
|
|
|
|
TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,'
|
|
|
|
else
|
|
|
|
TARGET_APPLE_CC=0
|
|
|
|
# Use linker script if present, otherwise use builtin -N script.
|
|
|
|
if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
|
|
|
|
TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
|
|
|
|
TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT} -Wl,-Ttext,"
|
2010-04-18 17:57:50 +00:00
|
|
|
TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc -Wl,-Ttext,"
|
2009-06-04 19:53:52 +00:00
|
|
|
else
|
|
|
|
TARGET_IMG_LDSCRIPT=
|
|
|
|
TARGET_IMG_LDFLAGS='-Wl,-N -Wl,-Ttext,'
|
|
|
|
TARGET_IMG_LDFLAGS_AC='-Wl,-N -Wl,-Ttext,'
|
|
|
|
fi
|
|
|
|
TARGET_IMG_CFLAGS=
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(TARGET_IMG_LDSCRIPT)
|
|
|
|
AC_SUBST(TARGET_IMG_LDFLAGS)
|
|
|
|
AC_SUBST(TARGET_IMG_CFLAGS)
|
|
|
|
|
|
|
|
# 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
|
2010-04-11 19:24:21 +00:00
|
|
|
cygwin) TARGET_OBJ2ELF='grub-pe2elf';
|
|
|
|
# FIXME: put proper test here
|
|
|
|
AC_DEFINE([NEED_REGISTER_FRAME_INFO], 1,
|
|
|
|
[Define to 1 if GCC generates calls to __register_frame_info()])
|
|
|
|
;;
|
2009-06-04 19:53:52 +00:00
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
AC_SUBST(TARGET_OBJ2ELF)
|
|
|
|
AC_MSG_RESULT([$TARGET_OBJ2ELF])
|
|
|
|
|
|
|
|
|
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"
|
2010-02-10 00:39:23 +00:00
|
|
|
TARGET_ASFLAGS="$TARGET_CFLAGS -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"
|
2009-06-04 19:53:52 +00:00
|
|
|
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 09:50:26 +00:00
|
|
|
if test "x$target_m64" = x1; then
|
|
|
|
# Force 64-bit mode.
|
2009-03-04 05:56:31 +00:00
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -m64"
|
2010-02-10 00:39:23 +00:00
|
|
|
TARGET_ASFLAGS="$TARGET_ASFLAGS -m64"
|
2009-03-04 05:56:31 +00:00
|
|
|
TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
|
2009-06-04 19:53:52 +00:00
|
|
|
TARGET_MODULE_FORMAT="elf64"
|
2009-03-04 05:56:31 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$target_cpu"-"$platform" = x86_64-efi; then
|
|
|
|
# Use large model to support 4G memory
|
2009-02-24 13:19:46 +00:00
|
|
|
AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
|
2009-06-04 20:25:11 +00:00
|
|
|
SAVED_CFLAGS=$CFLAGS
|
|
|
|
CFLAGS="$CFLAGS -m64 -mcmodel=large"
|
2009-02-24 13:19:46 +00:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
|
|
|
[grub_cv_cc_mcmodel=yes],
|
|
|
|
[grub_cv_cc_mcmodel=no])
|
|
|
|
])
|
2009-06-04 20:25:11 +00:00
|
|
|
if test "x$grub_cv_cc_mcmodel" = xno; then
|
2010-04-21 19:26:56 +00:00
|
|
|
AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.])
|
2009-06-04 20:25:11 +00:00
|
|
|
else
|
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
|
2009-02-24 13:19:46 +00:00
|
|
|
fi
|
2009-03-04 05:56:31 +00:00
|
|
|
|
|
|
|
# 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, [
|
2009-06-04 20:25:11 +00:00
|
|
|
CFLAGS="$CFLAGS -m64 -mno-red-zone"
|
2009-03-04 05:56:31 +00:00
|
|
|
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
|
|
|
|
|
2009-06-04 20:25:11 +00:00
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone"
|
2008-07-17 09:50:26 +00:00
|
|
|
fi
|
|
|
|
|
2007-02-03 11:36:13 +00:00
|
|
|
#
|
|
|
|
# Compiler features.
|
|
|
|
#
|
|
|
|
|
2008-09-19 06:55:20 +00:00
|
|
|
# Need __enable_execute_stack() for nested function trampolines?
|
|
|
|
grub_CHECK_ENABLE_EXECUTE_STACK
|
|
|
|
|
2009-09-03 16:32:14 +00:00
|
|
|
# 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]
|
|
|
|
|
2007-02-03 11:36:13 +00:00
|
|
|
# Smashing stack protector.
|
|
|
|
grub_CHECK_STACK_PROTECTOR
|
2008-02-13 03:35:48 +00:00
|
|
|
# Need that, because some distributions ship compilers that include
|
2007-02-03 11:36:13 +00:00
|
|
|
# `-fstack-protector' in the default specs.
|
2008-02-13 03:35:48 +00:00
|
|
|
if test "x$ssp_possible" = xyes; then
|
|
|
|
TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector"
|
|
|
|
fi
|
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
|
2007-02-03 11:36:13 +00:00
|
|
|
|
2009-09-16 19:32:44 +00:00
|
|
|
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"
|
|
|
|
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
|
|
|
AC_SUBST(TARGET_CFLAGS)
|
2009-06-04 19:53:52 +00:00
|
|
|
AC_SUBST(TARGET_MODULE_FORMAT)
|
2009-06-04 20:54:14 +00:00
|
|
|
AC_SUBST(OBJCONV)
|
2009-06-04 19:53:52 +00:00
|
|
|
AC_SUBST(TARGET_APPLE_CC)
|
|
|
|
AC_SUBST(TARGET_ASFLAGS)
|
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_CPPFLAGS)
|
|
|
|
AC_SUBST(TARGET_LDFLAGS)
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2006-06-01 15:51:51 +00:00
|
|
|
# Set them to their new values for the tests below.
|
|
|
|
CC="$TARGET_CC"
|
2009-06-18 14:02:23 +00:00
|
|
|
if test "x$TARGET_APPLE_CC" = x1 ; then
|
2010-01-23 21:56:08 +00:00
|
|
|
CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
|
2009-06-18 14:02:23 +00:00
|
|
|
else
|
2010-04-11 14:14:51 +00:00
|
|
|
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
|
2009-06-18 14:02:23 +00:00
|
|
|
fi
|
2006-06-01 15:51:51 +00:00
|
|
|
CPPFLAGS="$TARGET_CPPFLAGS"
|
|
|
|
LDFLAGS="$TARGET_LDFLAGS"
|
2010-01-23 21:56:08 +00:00
|
|
|
LIBS=-lgcc
|
|
|
|
|
2010-04-11 14:14:51 +00:00
|
|
|
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
|
|
|
|
|
2010-01-23 21:56:08 +00:00
|
|
|
# Check for libgcc symbols
|
|
|
|
AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x)
|
|
|
|
|
|
|
|
if test "x$TARGET_APPLE_CC" = x1 ; then
|
|
|
|
CFLAGS="$TARGET_CFLAGS -nostdlib"
|
|
|
|
else
|
|
|
|
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
|
|
|
|
fi
|
2010-01-26 00:57:56 +00:00
|
|
|
LIBS=""
|
2006-06-01 15:51:51 +00:00
|
|
|
|
2002-12-27 08:53:07 +00:00
|
|
|
# Defined in aclocal.m4.
|
2008-07-17 20:19:55 +00:00
|
|
|
grub_PROG_TARGET_CC
|
2009-06-04 19:53:52 +00:00
|
|
|
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
|
2009-06-04 19:53:52 +00:00
|
|
|
fi
|
2008-07-02 19:03:23 +00:00
|
|
|
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
|
2010-04-24 20:41:52 +00:00
|
|
|
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}8000 -Wl,--defsym,___main=0x8100"
|
|
|
|
fi
|
2008-07-24 14:56:30 +00:00
|
|
|
grub_CHECK_BSS_START_SYMBOL
|
|
|
|
grub_CHECK_END_SYMBOL
|
|
|
|
fi
|
|
|
|
CFLAGS="$TARGET_CFLAGS"
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_I386_ASM_PREFIX_REQUIREMENT
|
|
|
|
grub_I386_ASM_ADDR32
|
|
|
|
grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
|
2003-12-03 19:17:27 +00:00
|
|
|
else
|
2005-08-07 17:12:52 +00:00
|
|
|
AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
|
2002-12-27 08:53:07 +00:00
|
|
|
fi
|
|
|
|
|
2009-05-22 21:15:31 +00:00
|
|
|
AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL)
|
|
|
|
#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
|
|
|
|
#else
|
|
|
|
#define NESTED_FUNC_ATTR
|
|
|
|
#endif])
|
|
|
|
|
2009-07-16 16:37:18 +00:00
|
|
|
AC_ARG_ENABLE([efiemu],
|
|
|
|
[AS_HELP_STRING([--enable-efiemu],
|
|
|
|
[build and install the efiemu runtimes (default=guessed)])])
|
|
|
|
if test x"$enable_efiemu" = xno ; then
|
2009-07-16 22:22:02 +00:00
|
|
|
efiemu_excuse="explicitly disabled"
|
2009-07-16 16:37:18 +00:00
|
|
|
fi
|
|
|
|
if test x"$efiemu_excuse" = x ; then
|
2009-07-16 22:33:20 +00:00
|
|
|
AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [
|
2009-07-16 23:00:59 +00:00
|
|
|
CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
|
2009-07-16 16:37:18 +00:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
|
|
|
[grub_cv_cc_efiemu=yes],
|
|
|
|
[grub_cv_cc_efiemu=no])
|
|
|
|
])
|
2009-07-16 22:43:58 +00:00
|
|
|
if test x$grub_cv_cc_efiemu = xno; then
|
2009-07-20 13:48:41 +00:00
|
|
|
efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib"
|
2009-07-16 16:37:18 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then
|
2009-07-16 22:22:02 +00:00
|
|
|
AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled])
|
2009-07-16 16:37:18 +00:00
|
|
|
fi
|
|
|
|
if test x"$efiemu_excuse" = x ; then
|
|
|
|
enable_efiemu=yes
|
|
|
|
else
|
|
|
|
enable_efiemu=no
|
|
|
|
fi
|
|
|
|
AC_SUBST([enable_efiemu])
|
|
|
|
|
2010-03-14 15:01:31 +00:00
|
|
|
if test "$platform" != emu; then
|
2010-03-06 16:22:04 +00:00
|
|
|
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>
|
|
|
|
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
|
|
|
|
2006-04-02 08:53:31 +00:00
|
|
|
# Restore the flags.
|
2002-12-27 14:14:06 +00:00
|
|
|
CC="$tmp_CC"
|
|
|
|
CFLAGS="$tmp_CFLAGS"
|
|
|
|
CPPFLAGS="$tmp_CPPFLAGS"
|
2006-04-02 08:53:31 +00:00
|
|
|
LDFLAGS="$tmp_LDFLAGS"
|
2006-06-01 15:51:51 +00:00
|
|
|
LIBS="$tmp_LIBS"
|
2002-12-27 08:53:07 +00:00
|
|
|
|
2006-12-13 22:30:19 +00:00
|
|
|
#
|
2006-04-25 20:08:31 +00:00
|
|
|
# Check for options.
|
2006-12-13 22:30:19 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# Memory manager debugging.
|
2009-06-10 21:04:23 +00:00
|
|
|
AC_ARG_ENABLE([mm-debug],
|
2006-04-25 20:08:31 +00:00
|
|
|
AS_HELP_STRING([--enable-mm-debug],
|
2006-07-12 20:42:52 +00:00
|
|
|
[include memory manager debugging]),
|
2006-04-25 20:08:31 +00:00
|
|
|
[AC_DEFINE([MM_DEBUG], [1],
|
|
|
|
[Define to 1 if you enable memory manager debugging.])])
|
|
|
|
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
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)])])
|
|
|
|
|
2010-02-07 14:17:26 +00:00
|
|
|
AC_ARG_ENABLE([grub-emu-modules],
|
|
|
|
[AS_HELP_STRING([--enable-grub-emu-modules],
|
|
|
|
[Support module loading in `grub-emu' debugging utility (default=no)])])
|
|
|
|
|
2009-11-23 15:31:54 +00:00
|
|
|
if test "$platform" = emu; then
|
|
|
|
missing_ncurses=
|
|
|
|
[# Check for curses libraries.]
|
2006-12-13 22:30:19 +00:00
|
|
|
AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
|
|
|
|
[AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
|
2009-11-23 15:31:54 +00:00
|
|
|
[missing_ncurses=[true]])])
|
2006-12-13 22:30:19 +00:00
|
|
|
AC_SUBST([LIBCURSES])
|
2009-11-23 15:31:54 +00:00
|
|
|
[if [ x"$missing_ncurses" = x ]; then ]
|
2006-12-13 22:30:19 +00:00
|
|
|
[# Check for headers.]
|
|
|
|
AC_CHECK_HEADERS([ncurses/curses.h], [],
|
|
|
|
[AC_CHECK_HEADERS([ncurses.h], [],
|
|
|
|
[AC_CHECK_HEADERS([curses.h], [],
|
2009-11-23 15:31:54 +00:00
|
|
|
[missing_ncurses=[true]])])])
|
2009-07-16 16:37:18 +00:00
|
|
|
[fi]
|
2009-11-23 15:31:54 +00:00
|
|
|
if test x"$missing_ncurses" = xtrue ; then
|
|
|
|
AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
|
2009-07-16 16:37:18 +00:00
|
|
|
fi
|
2009-11-23 15:31:54 +00:00
|
|
|
|
2010-02-07 14:17:26 +00:00
|
|
|
if test x"$enable_grub_emu_modules" = xyes ; then
|
|
|
|
TARGET_NO_MODULES=no
|
|
|
|
else
|
|
|
|
TARGET_NO_MODULES=yes
|
|
|
|
fi
|
|
|
|
AC_SUBST(TARGET_NO_MODULES)
|
|
|
|
|
2010-04-24 20:41:52 +00:00
|
|
|
if test "$TARGET_NO_MODULES" = yes ; then
|
|
|
|
# Do not convert modules, otherwise linkage may fail (Cygwin only).
|
|
|
|
# FIXME: Should be checked above before TARGET_OBJ2ELF is set first.
|
|
|
|
TARGET_OBJ2ELF=
|
|
|
|
fi
|
|
|
|
|
2009-07-16 16:37:18 +00:00
|
|
|
if test x"$enable_grub_emu_usb" = xno ; then
|
2009-07-16 22:22:02 +00:00
|
|
|
grub_emu_usb_excuse="explicitly disabled"
|
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
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
# Check for libusb libraries.]
|
2009-07-16 16:37:18 +00:00
|
|
|
AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"],
|
2009-07-20 13:48:41 +00:00
|
|
|
[grub_emu_usb_excuse=["need libusb library"]])
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
AC_SUBST([LIBUSB])
|
2009-07-16 16:37:18 +00:00
|
|
|
[fi]
|
|
|
|
[if [ x"$grub_emu_usb_excuse" = x ]; then
|
|
|
|
# Check for headers.]
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
AC_CHECK_HEADERS([usb.h], [],
|
2009-07-20 13:48:41 +00:00
|
|
|
[grub_emu_usb_excuse=["need libusb headers"]])
|
2006-12-13 22:30:19 +00:00
|
|
|
[fi]
|
2009-10-15 12:09:56 +00:00
|
|
|
if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then
|
2009-07-16 22:22:02 +00:00
|
|
|
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])
|
2009-02-08 Marco Gerards <marco@gnu.org>
* Makefile.in (enable_grub_emu_usb): New variable.
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'.
(grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c',
`util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'.
(grub_emu_LDFLAGS): Add `$(LIBUSB)'.
(pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod',
`usbtest.mod' and `usbms.mod'.
(usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS)
(usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS)
(uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS,
(ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS)
(usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New
variables.
* disk/usbms.c: New file.
* include/grub/usb.h: Likewise.
* include/grub/usbtrans.h: Likewise.
* include/grub/usbdesc.h: Likewise.
* bus/usb/usbtrans.c: Likewise.
* bus/usb/ohci.c: Likewise.
* bus/usb/uhci.c: Likewise.
* bus/usb/usbhub.c: Likewise.
* bus/usb/usb.c: Likewise.
* commands/usbtest.c: Likewise.
* util/usb.c: Likewise.
* include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'.
* configure.ac: Test for libusb presence.
* util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'.
2009-02-08 17:58:32 +00:00
|
|
|
AC_SUBST([enable_grub_emu_usb])
|
2009-10-14 08:11:59 +00:00
|
|
|
AC_SUBST([enable_grub_emu_pci])
|
2009-11-23 15:31:54 +00:00
|
|
|
fi
|
2006-12-13 22:30:19 +00:00
|
|
|
|
2008-02-04 08:45:07 +00:00
|
|
|
AC_ARG_ENABLE([grub-fstest],
|
|
|
|
[AS_HELP_STRING([--enable-grub-fstest],
|
2009-07-16 16:37:18 +00:00
|
|
|
[build and install the `grub-fstest' debugging utility (default=guessed)])])
|
|
|
|
if test x"$enable_grub_fstest" = xno ; then
|
2009-07-16 22:22:02 +00:00
|
|
|
grub_fstest_excuse="explicitly disabled"
|
2009-07-16 16:37:18 +00:00
|
|
|
fi
|
|
|
|
if test x"$grub_fstest_excuse" = x ; then
|
|
|
|
enable_grub_fstest=yes
|
|
|
|
else
|
|
|
|
enable_grub_fstest=no
|
|
|
|
fi
|
2008-02-04 08:45:07 +00:00
|
|
|
AC_SUBST([enable_grub_fstest])
|
|
|
|
|
2009-01-13 16:34:26 +00:00
|
|
|
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
|
2009-07-16 22:22:02 +00:00
|
|
|
grub_mkfont_excuse="explicitly disabled"
|
2009-07-16 16:37:18 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test x"$grub_mkfont_excuse" = x ; then
|
2009-01-13 16:34:26 +00:00
|
|
|
# Check for freetype libraries.
|
|
|
|
AC_CHECK_PROGS([FREETYPE], [freetype-config])
|
|
|
|
if test "x$FREETYPE" = x ; then
|
2009-07-20 13:48:41 +00:00
|
|
|
grub_mkfont_excuse=["need freetype2 library"]
|
2009-01-13 16:34:26 +00:00
|
|
|
fi
|
|
|
|
freetype_cflags=`freetype-config --cflags`
|
|
|
|
freetype_libs=`freetype-config --libs`
|
|
|
|
fi
|
2010-02-09 13:09:08 +00:00
|
|
|
|
|
|
|
if test x"$grub_mkfont_excuse" = x ; then
|
|
|
|
# Check for freetype libraries.
|
2010-03-06 20:27:04 +00:00
|
|
|
SAVED_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $freetype_cflags"
|
2010-02-09 13:09:08 +00:00
|
|
|
AC_CHECK_HEADERS([ft2build.h], [],
|
|
|
|
[grub_mkfont_excuse=["need freetype2 headers"]])
|
2010-03-06 20:27:04 +00:00
|
|
|
CPPFLAGS="$SAVED_CPPFLAGS"
|
2010-02-09 13:09:08 +00:00
|
|
|
fi
|
|
|
|
|
2009-07-16 16:37:18 +00:00
|
|
|
if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
|
2009-07-16 22:22:02 +00:00
|
|
|
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
|
2009-01-13 16:34:26 +00:00
|
|
|
AC_SUBST([enable_grub_mkfont])
|
|
|
|
AC_SUBST([freetype_cflags])
|
|
|
|
AC_SUBST([freetype_libs])
|
|
|
|
|
2010-01-25 17:47:51 +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
|
|
|
|
|
|
|
|
if test x"$device_mapper_excuse" = x ; then
|
|
|
|
# Check for device-mapper library.
|
|
|
|
AC_CHECK_LIB([devmapper], [dm_task_create],
|
|
|
|
[LDFLAGS="$LDFLAGS -ldevmapper"
|
|
|
|
AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
|
|
|
|
[Define to 1 if you have the devmapper library.])],
|
|
|
|
[device_mapper_excuse="need devmapper library"])
|
|
|
|
fi
|
|
|
|
|
2009-06-04 19:53:52 +00:00
|
|
|
AC_SUBST(ASFLAGS)
|
2009-05-03 06:39:37 +00:00
|
|
|
|
2002-12-27 08:53:07 +00:00
|
|
|
# Output files.
|
2009-03-21 07:48:28 +00:00
|
|
|
grub_CHECK_LINK_DIR
|
|
|
|
if test x"$link_dir" = xyes ; then
|
2009-11-23 15:31:54 +00:00
|
|
|
AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu])
|
|
|
|
if test "$platform" != emu ; then
|
|
|
|
AC_CONFIG_LINKS([include/grub/machine:include/grub/$target_cpu/$platform])
|
|
|
|
fi
|
2009-03-21 07:48:28 +00:00
|
|
|
else
|
|
|
|
mkdir -p include/grub 2>/dev/null
|
|
|
|
rm -rf include/grub/cpu
|
|
|
|
cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
|
2009-11-23 15:31:54 +00:00
|
|
|
if test "$platform" != emu ; then
|
|
|
|
rm -rf include/grub/machine
|
|
|
|
cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
|
|
|
|
fi
|
2009-03-21 07:48:28 +00:00
|
|
|
fi
|
2006-04-26 21:58:36 +00:00
|
|
|
AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
|
2002-12-27 08:53:07 +00:00
|
|
|
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
|
|
|
|
AC_OUTPUT
|
2009-07-16 16:37:18 +00:00
|
|
|
[
|
|
|
|
echo "*******************************************************"
|
|
|
|
echo GRUB2 will be compiled with following components:
|
|
|
|
echo Platform: "$target_cpu"-"$platform"
|
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
|
2010-02-07 14:17:26 +00:00
|
|
|
if [ x"$TARGET_NO_MODULES" = xno ]; then
|
|
|
|
echo Module support for grub-emu: Yes
|
|
|
|
else
|
|
|
|
echo Module support for grub-emu: No
|
|
|
|
fi
|
2009-11-23 15:31:54 +00:00
|
|
|
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"$efiemu_excuse" = x ]; then
|
|
|
|
echo efiemu runtime: Yes
|
|
|
|
else
|
|
|
|
echo efiemu runtime: No "($efiemu_excuse)"
|
|
|
|
fi
|
|
|
|
if [ x"$grub_fstest_excuse" = x ]; then
|
|
|
|
echo grub-fstest: Yes
|
|
|
|
else
|
|
|
|
echo grub-fstest: No "($grub_fstest_excuse)"
|
|
|
|
fi
|
|
|
|
if [ x"$grub_mkfont_excuse" = x ]; then
|
|
|
|
echo grub-mkfont: Yes
|
|
|
|
else
|
|
|
|
echo grub-mkfont: No "($grub_mkfont_excuse)"
|
|
|
|
fi
|
|
|
|
echo "*******************************************************"
|
|
|
|
]
|