|
|
a85e8e |
From a8fb484206d0cc509ba27b8214bdb512ba258702 Mon Sep 17 00:00:00 2001
|
|
|
a85e8e |
From: Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
a85e8e |
Date: Sat, 18 Jan 2014 19:50:54 +0400
|
|
|
a85e8e |
Subject: [PATCH 022/260] reintroduce BUILD_LDFLAGS for the cross-compile case
|
|
|
a85e8e |
|
|
|
a85e8e |
This allows providing separate LDFLAGS for build and host environments, which
|
|
|
a85e8e |
are not necessary the same for cross-compile case. In particular, it allows
|
|
|
a85e8e |
building host programs statically to not depend on presence of libraries at
|
|
|
a85e8e |
run-time (e.g. MinGW DLLs on Windows) while continue to use default dynamic
|
|
|
a85e8e |
linking at build time.
|
|
|
a85e8e |
|
|
|
a85e8e |
Also fix obsolete comments in confgure.ac - we do use different environment
|
|
|
a85e8e |
for build and host now.
|
|
|
a85e8e |
---
|
|
|
a85e8e |
ChangeLog | 7 +++++++
|
|
|
a85e8e |
INSTALL | 3 ++-
|
|
|
a85e8e |
Makefile.am | 8 ++++----
|
|
|
a85e8e |
configure.ac | 13 ++++++++-----
|
|
|
a85e8e |
grub-core/Makefile.am | 6 +++---
|
|
|
a85e8e |
5 files changed, 24 insertions(+), 13 deletions(-)
|
|
|
a85e8e |
|
|
|
a85e8e |
diff --git a/ChangeLog b/ChangeLog
|
|
|
a85e8e |
index 8534158b6..9c3ef2e21 100644
|
|
|
a85e8e |
--- a/ChangeLog
|
|
|
a85e8e |
+++ b/ChangeLog
|
|
|
a85e8e |
@@ -1,3 +1,10 @@
|
|
|
a85e8e |
+2014-01-07 Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
a85e8e |
+
|
|
|
a85e8e |
+ * configure.ac: Add support for BUILD_LDFLAGS.
|
|
|
a85e8e |
+ * Makefile.am: Use BUILD_LDFLAGS for build time programs here ...
|
|
|
a85e8e |
+ * grub-core/Makefile.am: ... and here.
|
|
|
a85e8e |
+ * INSTALL: Mention BUILD_LDFLAGS.
|
|
|
a85e8e |
+
|
|
|
a85e8e |
2014-01-18 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
a85e8e |
|
|
|
a85e8e |
* util/grub-mount.c: Extend GCC warning workaround to grub-mount.
|
|
|
a85e8e |
diff --git a/INSTALL b/INSTALL
|
|
|
a85e8e |
index db12530df..b67cd7f34 100644
|
|
|
a85e8e |
--- a/INSTALL
|
|
|
a85e8e |
+++ b/INSTALL
|
|
|
a85e8e |
@@ -168,7 +168,8 @@ corresponding platform are not needed for the platform in question.
|
|
|
a85e8e |
generate sin and cos tables.
|
|
|
a85e8e |
2. BUILD_CFLAGS= for C options for build.
|
|
|
a85e8e |
3. BUILD_CPPFLAGS= for C preprocessor options for build.
|
|
|
a85e8e |
- 4. BUILD_FREETYPE= for freetype-config for build (optional).
|
|
|
a85e8e |
+ 4. BUILD_LDFLAGS= for linker options for build.
|
|
|
a85e8e |
+ 5. BUILD_FREETYPE= for freetype-config for build (optional).
|
|
|
a85e8e |
|
|
|
a85e8e |
- For host
|
|
|
a85e8e |
1. --host= to autoconf name of host.
|
|
|
a85e8e |
diff --git a/Makefile.am b/Makefile.am
|
|
|
a85e8e |
index 320e86f8f..1bbec0e79 100644
|
|
|
a85e8e |
--- a/Makefile.am
|
|
|
a85e8e |
+++ b/Makefile.am
|
|
|
a85e8e |
@@ -67,20 +67,20 @@ endif
|
|
|
a85e8e |
starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0
|
|
|
a85e8e |
|
|
|
a85e8e |
build-grub-mkfont: util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c
|
|
|
a85e8e |
- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs)
|
|
|
a85e8e |
+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs)
|
|
|
a85e8e |
CLEANFILES += build-grub-mkfont
|
|
|
a85e8e |
|
|
|
a85e8e |
garbage-gen: util/garbage-gen.c
|
|
|
a85e8e |
- $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $^
|
|
|
a85e8e |
+ $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $^
|
|
|
a85e8e |
CLEANFILES += garbage-gen
|
|
|
a85e8e |
EXTRA_DIST += util/garbage-gen.c
|
|
|
a85e8e |
|
|
|
a85e8e |
build-grub-gen-asciih: util/grub-gen-asciih.c
|
|
|
a85e8e |
- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror
|
|
|
a85e8e |
+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror
|
|
|
a85e8e |
CLEANFILES += build-grub-gen-asciih
|
|
|
a85e8e |
|
|
|
a85e8e |
build-grub-gen-widthspec: util/grub-gen-widthspec.c
|
|
|
a85e8e |
- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror
|
|
|
a85e8e |
+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror
|
|
|
a85e8e |
CLEANFILES += build-grub-gen-widthspec
|
|
|
a85e8e |
|
|
|
a85e8e |
if COND_STARFIELD
|
|
|
a85e8e |
diff --git a/configure.ac b/configure.ac
|
|
|
a85e8e |
index 7c5d080b8..2e4cf3c2e 100644
|
|
|
a85e8e |
--- a/configure.ac
|
|
|
a85e8e |
+++ b/configure.ac
|
|
|
a85e8e |
@@ -26,11 +26,10 @@ dnl This is necessary because the target type in autoconf does not
|
|
|
a85e8e |
dnl describe such a system very well.
|
|
|
a85e8e |
dnl
|
|
|
a85e8e |
dnl The current strategy is to use variables with no prefix (such as
|
|
|
a85e8e |
-dnl CC, CFLAGS, etc.) for the host type as well as the build type,
|
|
|
a85e8e |
-dnl because GRUB does not need to use those variables for the build
|
|
|
a85e8e |
-dnl type, so there is no conflict. Variables with the prefix "TARGET_"
|
|
|
a85e8e |
-dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
|
|
|
a85e8e |
-dnl type.
|
|
|
a85e8e |
+dnl CC, CFLAGS, etc.) for the host type, variables with prefix "BUILD_"
|
|
|
a85e8e |
+dnl (such as BUILD_CC, BUILD_CFLAGS, etc.) for the build type and variables
|
|
|
a85e8e |
+dnl with the prefix "TARGET_" (such as TARGET_CC, TARGET_CFLAGS, etc.) are
|
|
|
a85e8e |
+dnl used for the target type. See INSTALL for full list of variables.
|
|
|
a85e8e |
|
|
|
a85e8e |
AC_INIT([GRUB],[2.02~beta2],[bug-grub@gnu.org])
|
|
|
a85e8e |
|
|
|
a85e8e |
@@ -477,6 +476,7 @@ AC_SUBST(HOST_CC)
|
|
|
a85e8e |
AC_SUBST(BUILD_CC)
|
|
|
a85e8e |
AC_SUBST(BUILD_CFLAGS)
|
|
|
a85e8e |
AC_SUBST(BUILD_CPPFLAGS)
|
|
|
a85e8e |
+AC_SUBST(BUILD_LDFLAGS)
|
|
|
a85e8e |
AC_SUBST(TARGET_CC)
|
|
|
a85e8e |
AC_SUBST(TARGET_NM)
|
|
|
a85e8e |
AC_SUBST(TARGET_RANLIB)
|
|
|
a85e8e |
@@ -1290,10 +1290,12 @@ SAVED_CC="$CC"
|
|
|
a85e8e |
SAVED_CPP="$CPP"
|
|
|
a85e8e |
SAVED_CFLAGS="$CFLAGS"
|
|
|
a85e8e |
SAVED_CPPFLAGS="$CPPFLAGS"
|
|
|
a85e8e |
+SAVED_LDFLAGS="$LDFLAGS"
|
|
|
a85e8e |
CC="$BUILD_CC"
|
|
|
a85e8e |
CPP="$BUILD_CPP"
|
|
|
a85e8e |
CFLAGS="$BUILD_CFLAGS"
|
|
|
a85e8e |
CPPFLAGS="$BUILD_CPPFLAGS"
|
|
|
a85e8e |
+LDFLAGS="$BUILD_LDFAGS"
|
|
|
a85e8e |
|
|
|
a85e8e |
unset ac_cv_c_bigendian
|
|
|
a85e8e |
unset ac_cv_header_ft2build_h
|
|
|
a85e8e |
@@ -1356,6 +1358,7 @@ CC="$SAVED_CC"
|
|
|
a85e8e |
CPP="$SAVED_CPP"
|
|
|
a85e8e |
CFLAGS="$SAVED_CFLAGS"
|
|
|
a85e8e |
CPPFLAGS="$SAVED_CPPFLAGS"
|
|
|
a85e8e |
+LDFLAGS="$SAVED_LDFLAGS"
|
|
|
a85e8e |
|
|
|
a85e8e |
|
|
|
a85e8e |
DJVU_FONT_SOURCE=
|
|
|
a85e8e |
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
|
|
|
a85e8e |
index 1b3142d21..13b797910 100644
|
|
|
a85e8e |
--- a/grub-core/Makefile.am
|
|
|
a85e8e |
+++ b/grub-core/Makefile.am
|
|
|
a85e8e |
@@ -27,14 +27,14 @@ CPPFLAGS_LIBRARY += $(CPPFLAGS_PLATFORM)
|
|
|
a85e8e |
CCASFLAGS_LIBRARY += $(CCASFLAGS_PLATFORM)
|
|
|
a85e8e |
|
|
|
a85e8e |
build-grub-pep2elf: $(top_srcdir)/util/grub-pe2elf.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c
|
|
|
a85e8e |
- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_BUILD=1 -DGRUB_TARGET_WORDSIZE=64 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-pep2elf\" $^
|
|
|
a85e8e |
+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_BUILD=1 -DGRUB_TARGET_WORDSIZE=64 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-pep2elf\" $^
|
|
|
a85e8e |
|
|
|
a85e8e |
build-grub-pe2elf: $(top_srcdir)/util/grub-pe2elf.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c
|
|
|
a85e8e |
- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_BUILD=1 -DGRUB_TARGET_WORDSIZE=32 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-pe2elf\" $^
|
|
|
a85e8e |
+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_BUILD=1 -DGRUB_TARGET_WORDSIZE=32 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-pe2elf\" $^
|
|
|
a85e8e |
|
|
|
a85e8e |
# gentrigtables
|
|
|
a85e8e |
gentrigtables: gentrigtables.c
|
|
|
a85e8e |
- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< $(BUILD_LIBM)
|
|
|
a85e8e |
+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $< $(BUILD_LIBM)
|
|
|
a85e8e |
CLEANFILES += gentrigtables
|
|
|
a85e8e |
|
|
|
a85e8e |
# trigtables.c
|
|
|
a85e8e |
--
|
|
|
a85e8e |
2.13.0
|
|
|
a85e8e |
|