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

46 lines
1.5 KiB
Diff

From edd903fc73b98eb784b307a47110985967cb1d09 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 4/7] 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 48aa9f0a29..fc29c88f50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -869,6 +869,10 @@ AS_CASE([$ocaml_cc_vendor],
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*],
@@ -2648,7 +2652,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"])
@@ -2674,7 +2678,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.44.0