|
|
f731ee |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
f731ee |
From: Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
f731ee |
Date: Sat, 18 Jan 2014 19:50:54 +0400
|
|
|
f731ee |
Subject: [PATCH] reintroduce BUILD_LDFLAGS for the cross-compile case
|
|
|
f731ee |
|
|
|
f731ee |
This allows providing separate LDFLAGS for build and host environments, which
|
|
|
f731ee |
are not necessary the same for cross-compile case. In particular, it allows
|
|
|
f731ee |
building host programs statically to not depend on presence of libraries at
|
|
|
f731ee |
run-time (e.g. MinGW DLLs on Windows) while continue to use default dynamic
|
|
|
f731ee |
linking at build time.
|
|
|
f731ee |
|
|
|
f731ee |
Also fix obsolete comments in confgure.ac - we do use different environment
|
|
|
f731ee |
for build and host now.
|
|
|
f731ee |
---
|
|
|
f731ee |
configure.ac | 13 ++++++++-----
|
|
|
f731ee |
Makefile.am | 8 ++++----
|
|
|
f731ee |
ChangeLog | 7 +++++++
|
|
|
f731ee |
INSTALL | 3 ++-
|
|
|
f731ee |
grub-core/Makefile.am | 6 +++---
|
|
|
f731ee |
5 files changed, 24 insertions(+), 13 deletions(-)
|
|
|
f731ee |
|
|
|
f731ee |
diff --git a/configure.ac b/configure.ac
|
|
|
f731ee |
index 7c5d080b8a2..2e4cf3c2e22 100644
|
|
|
f731ee |
--- a/configure.ac
|
|
|
f731ee |
+++ b/configure.ac
|
|
|
f731ee |
@@ -26,11 +26,10 @@ dnl This is necessary because the target type in autoconf does not
|
|
|
f731ee |
dnl describe such a system very well.
|
|
|
f731ee |
dnl
|
|
|
f731ee |
dnl The current strategy is to use variables with no prefix (such as
|
|
|
f731ee |
-dnl CC, CFLAGS, etc.) for the host type as well as the build type,
|
|
|
f731ee |
-dnl because GRUB does not need to use those variables for the build
|
|
|
f731ee |
-dnl type, so there is no conflict. Variables with the prefix "TARGET_"
|
|
|
f731ee |
-dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
|
|
|
f731ee |
-dnl type.
|
|
|
f731ee |
+dnl CC, CFLAGS, etc.) for the host type, variables with prefix "BUILD_"
|
|
|
f731ee |
+dnl (such as BUILD_CC, BUILD_CFLAGS, etc.) for the build type and variables
|
|
|
f731ee |
+dnl with the prefix "TARGET_" (such as TARGET_CC, TARGET_CFLAGS, etc.) are
|
|
|
f731ee |
+dnl used for the target type. See INSTALL for full list of variables.
|
|
|
f731ee |
|
|
|
f731ee |
AC_INIT([GRUB],[2.02~beta2],[bug-grub@gnu.org])
|
|
|
f731ee |
|
|
|
f731ee |
@@ -477,6 +476,7 @@ AC_SUBST(HOST_CC)
|
|
|
f731ee |
AC_SUBST(BUILD_CC)
|
|
|
f731ee |
AC_SUBST(BUILD_CFLAGS)
|
|
|
f731ee |
AC_SUBST(BUILD_CPPFLAGS)
|
|
|
f731ee |
+AC_SUBST(BUILD_LDFLAGS)
|
|
|
f731ee |
AC_SUBST(TARGET_CC)
|
|
|
f731ee |
AC_SUBST(TARGET_NM)
|
|
|
f731ee |
AC_SUBST(TARGET_RANLIB)
|
|
|
f731ee |
@@ -1290,10 +1290,12 @@ SAVED_CC="$CC"
|
|
|
f731ee |
SAVED_CPP="$CPP"
|
|
|
f731ee |
SAVED_CFLAGS="$CFLAGS"
|
|
|
f731ee |
SAVED_CPPFLAGS="$CPPFLAGS"
|
|
|
f731ee |
+SAVED_LDFLAGS="$LDFLAGS"
|
|
|
f731ee |
CC="$BUILD_CC"
|
|
|
f731ee |
CPP="$BUILD_CPP"
|
|
|
f731ee |
CFLAGS="$BUILD_CFLAGS"
|
|
|
f731ee |
CPPFLAGS="$BUILD_CPPFLAGS"
|
|
|
f731ee |
+LDFLAGS="$BUILD_LDFAGS"
|
|
|
f731ee |
|
|
|
f731ee |
unset ac_cv_c_bigendian
|
|
|
f731ee |
unset ac_cv_header_ft2build_h
|
|
|
f731ee |
@@ -1356,6 +1358,7 @@ CC="$SAVED_CC"
|
|
|
f731ee |
CPP="$SAVED_CPP"
|
|
|
f731ee |
CFLAGS="$SAVED_CFLAGS"
|
|
|
f731ee |
CPPFLAGS="$SAVED_CPPFLAGS"
|
|
|
f731ee |
+LDFLAGS="$SAVED_LDFLAGS"
|
|
|
f731ee |
|
|
|
f731ee |
|
|
|
f731ee |
DJVU_FONT_SOURCE=
|
|
|
f731ee |
diff --git a/Makefile.am b/Makefile.am
|
|
|
f731ee |
index 320e86f8f55..1bbec0e79d3 100644
|
|
|
f731ee |
--- a/Makefile.am
|
|
|
f731ee |
+++ b/Makefile.am
|
|
|
f731ee |
@@ -67,20 +67,20 @@ endif
|
|
|
f731ee |
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
|
|
|
f731ee |
|
|
|
f731ee |
build-grub-mkfont: util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c
|
|
|
f731ee |
- $(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)
|
|
|
f731ee |
+ $(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)
|
|
|
f731ee |
CLEANFILES += build-grub-mkfont
|
|
|
f731ee |
|
|
|
f731ee |
garbage-gen: util/garbage-gen.c
|
|
|
f731ee |
- $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $^
|
|
|
f731ee |
+ $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $^
|
|
|
f731ee |
CLEANFILES += garbage-gen
|
|
|
f731ee |
EXTRA_DIST += util/garbage-gen.c
|
|
|
f731ee |
|
|
|
f731ee |
build-grub-gen-asciih: util/grub-gen-asciih.c
|
|
|
f731ee |
- $(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
|
|
|
f731ee |
+ $(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
|
|
|
f731ee |
CLEANFILES += build-grub-gen-asciih
|
|
|
f731ee |
|
|
|
f731ee |
build-grub-gen-widthspec: util/grub-gen-widthspec.c
|
|
|
f731ee |
- $(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
|
|
|
f731ee |
+ $(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
|
|
|
f731ee |
CLEANFILES += build-grub-gen-widthspec
|
|
|
f731ee |
|
|
|
f731ee |
if COND_STARFIELD
|
|
|
f731ee |
diff --git a/ChangeLog b/ChangeLog
|
|
|
f731ee |
index 8534158b6c0..9c3ef2e2150 100644
|
|
|
f731ee |
--- a/ChangeLog
|
|
|
f731ee |
+++ b/ChangeLog
|
|
|
f731ee |
@@ -1,3 +1,10 @@
|
|
|
f731ee |
+2014-01-07 Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
f731ee |
+
|
|
|
f731ee |
+ * configure.ac: Add support for BUILD_LDFLAGS.
|
|
|
f731ee |
+ * Makefile.am: Use BUILD_LDFLAGS for build time programs here ...
|
|
|
f731ee |
+ * grub-core/Makefile.am: ... and here.
|
|
|
f731ee |
+ * INSTALL: Mention BUILD_LDFLAGS.
|
|
|
f731ee |
+
|
|
|
f731ee |
2014-01-18 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
f731ee |
|
|
|
f731ee |
* util/grub-mount.c: Extend GCC warning workaround to grub-mount.
|
|
|
f731ee |
diff --git a/INSTALL b/INSTALL
|
|
|
f731ee |
index db12530dff3..b67cd7f3476 100644
|
|
|
f731ee |
--- a/INSTALL
|
|
|
f731ee |
+++ b/INSTALL
|
|
|
f731ee |
@@ -168,7 +168,8 @@ corresponding platform are not needed for the platform in question.
|
|
|
f731ee |
generate sin and cos tables.
|
|
|
f731ee |
2. BUILD_CFLAGS= for C options for build.
|
|
|
f731ee |
3. BUILD_CPPFLAGS= for C preprocessor options for build.
|
|
|
f731ee |
- 4. BUILD_FREETYPE= for freetype-config for build (optional).
|
|
|
f731ee |
+ 4. BUILD_LDFLAGS= for linker options for build.
|
|
|
f731ee |
+ 5. BUILD_FREETYPE= for freetype-config for build (optional).
|
|
|
f731ee |
|
|
|
f731ee |
- For host
|
|
|
f731ee |
1. --host= to autoconf name of host.
|
|
|
f731ee |
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
|
|
|
f731ee |
index 1b3142d2160..13b7979106f 100644
|
|
|
f731ee |
--- a/grub-core/Makefile.am
|
|
|
f731ee |
+++ b/grub-core/Makefile.am
|
|
|
f731ee |
@@ -27,14 +27,14 @@ CPPFLAGS_LIBRARY += $(CPPFLAGS_PLATFORM)
|
|
|
f731ee |
CCASFLAGS_LIBRARY += $(CCASFLAGS_PLATFORM)
|
|
|
f731ee |
|
|
|
f731ee |
build-grub-pep2elf: $(top_srcdir)/util/grub-pe2elf.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c
|
|
|
f731ee |
- $(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\" $^
|
|
|
f731ee |
+ $(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\" $^
|
|
|
f731ee |
|
|
|
f731ee |
build-grub-pe2elf: $(top_srcdir)/util/grub-pe2elf.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c
|
|
|
f731ee |
- $(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\" $^
|
|
|
f731ee |
+ $(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\" $^
|
|
|
f731ee |
|
|
|
f731ee |
# gentrigtables
|
|
|
f731ee |
gentrigtables: gentrigtables.c
|
|
|
f731ee |
- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< $(BUILD_LIBM)
|
|
|
f731ee |
+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $< $(BUILD_LIBM)
|
|
|
f731ee |
CLEANFILES += gentrigtables
|
|
|
f731ee |
|
|
|
f731ee |
# trigtables.c
|