[commit: ghc] master: Pass custom CC and LD opts to Cabal when configuring a package (e7f26cd)
git at git.haskell.org
git at git.haskell.org
Thu Mar 27 13:50:05 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e7f26cd3e7e9eb92e3eb3457730e635747b43050/ghc
>---------------------------------------------------------------
commit e7f26cd3e7e9eb92e3eb3457730e635747b43050
Author: Simon Marlow <marlowsd at gmail.com>
Date: Thu Mar 27 12:29:48 2014 +0000
Pass custom CC and LD opts to Cabal when configuring a package
Cabal compiles a program to check for the existence of foreign
libraries, so it needs to know our custom options, if any.
>---------------------------------------------------------------
e7f26cd3e7e9eb92e3eb3457730e635747b43050
rules/build-package-data.mk | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk
index c53a084..aea2adb 100644
--- a/rules/build-package-data.mk
+++ b/rules/build-package-data.mk
@@ -49,9 +49,17 @@ endif
# We filter out -Werror from SRC_CC_OPTS, because when configure tests
# for a feature it may not generate warning-free C code, and thus may
# think that the feature doesn't exist if -Werror is on.
-$1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$(filter-out -Werror,$$(SRC_CC_OPTS)) $$(CONF_CC_OPTS_STAGE$3) $$($1_CC_OPTS) $$($1_$2_CC_OPTS) $$(SRC_CC_WARNING_OPTS)"
-$1_$2_CONFIGURE_OPTS += --configure-option=LDFLAGS="$$(SRC_LD_OPTS) $$(CONF_GCC_LINKER_OPTS_STAGE$3) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)"
-$1_$2_CONFIGURE_OPTS += --configure-option=CPPFLAGS="$$(SRC_CPP_OPTS) $$(CONF_CPP_OPTS_STAGE$3) $$($1_CPP_OPTS) $$($1_$2_CPP_OPTS)"
+$1_$2_CONFIGURE_CFLAGS = $$(filter-out -Werror,$$(SRC_CC_OPTS)) $$(CONF_CC_OPTS_STAGE$3) $$($1_CC_OPTS) $$($1_$2_CC_OPTS) $$(SRC_CC_WARNING_OPTS)
+$1_$2_CONFIGURE_LDFLAGS = $$(SRC_LD_OPTS) $$(CONF_GCC_LINKER_OPTS_STAGE$3) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)
+$1_$2_CONFIGURE_CPPFLAGS = $$(SRC_CPP_OPTS) $$(CONF_CPP_OPTS_STAGE$3) $$($1_CPP_OPTS) $$($1_$2_CPP_OPTS)
+
+$1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$($1_$2_CONFIGURE_CFLAGS)"
+$1_$2_CONFIGURE_OPTS += --configure-option=LDFLAGS="$$($1_$2_CONFIGURE_LDFLAGS)"
+$1_$2_CONFIGURE_OPTS += --configure-option=CPPFLAGS="$$($1_$2_CONFIGURE_CPPFLAGS)"
+
+# Also pass these as gcc-options, because Cabal uses them to check for
+# the existence of foreign libraries.
+$1_$2_CONFIGURE_OPTS += --gcc-options="$$($1_$2_CONFIGURE_CFLAGS) $$($1_$2_CONFIGURE_LDFLAGS)"
ifneq "$$(ICONV_INCLUDE_DIRS)" ""
$1_$2_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="$$(ICONV_INCLUDE_DIRS)"
More information about the ghc-commits
mailing list