ocaml/0002-configure-Allow-user-defined-C-compiler-flags.patch

46 lines
1.5 KiB
Diff
Raw Normal View History

From d9bcdb9d0a27e10350b1ca90df43b401656324f1 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 29 May 2012 20:44:18 +0100
Subject: [PATCH 2/4] configure: Allow user defined C compiler flags.
---
configure.ac | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index d5040c279c..4cbba04557 100644
--- a/configure.ac
+++ b/configure.ac
@@ -759,6 +759,10 @@ AS_CASE([$host],
internal_cflags="$cc_warnings"],
[common_cflags="-O"])])
+# Allow CFLAGS and LDFLAGS to be added.
+common_cflags="$common_cflags $CFLAGS"
+cclibs="$cclibs $LDFLAGS"
+
# Enable SSE2 on x86 mingw to avoid using 80-bit registers.
AS_CASE([$host],
[i686-*-mingw32*],
@@ -2325,7 +2329,7 @@ AC_CONFIG_COMMANDS_PRE([
[mkexedebugflag="${mkexe_ldflags_prefix}${mkexedebugflag}"])
mkdll_ldflags=""
AS_IF([test -n "${LDFLAGS}"],
- [for flag in ${LDFLAGS}; do
+ [for flag in "${LDFLAGS}"; do
mkdll_ldflags="${mkdll_ldflags} ${mkexe_ldflags_prefix}${flag}"
done
mkdll_ldflags_exp="$mkdll_ldflags"])
@@ -2351,7 +2355,7 @@ ${mkdll_ldflags}"
],[
mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)'
mkdll_ldflags_exp="${oc_dll_ldflags}"
- AS_IF([test -n ${LDFLAGS}],
+ AS_IF([test -n "${LDFLAGS}"],
[mkdll_ldflags_exp="$mkdll_ldflags_exp $LDFLAGS"])
mkexe_ldflags="\$(OC_LDFLAGS) \$(LDFLAGS)"
mkexe_ldflags_exp="${oc_ldflags} ${LDFLAGS}"
--
2.41.0