summaryrefslogtreecommitdiff
path: root/rules/distdir-way-opts.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-03-05 14:48:25 +0000
committerIan Lynagh <igloo@earth.li>2011-03-05 14:48:25 +0000
commite28cbcd8bbb9a5730b370fad7d974c460132554a (patch)
treec8c2aa124a4094abcea04691e14c7550d826a4d8 /rules/distdir-way-opts.mk
parent61899158575bc64e692d6ab350c43c5d8ec1d8e2 (diff)
downloadhaskell-e28cbcd8bbb9a5730b370fad7d974c460132554a.tar.gz
Avoid some shell calls in the build system
The DEP_INCLUDE_DIRS and DEP_LIB_DIRS variables always contain single-quote dirs, so we can use e.g. $(subst $(space)',$(space)-L',$(space)$($1_$2_DEP_LIB_DIRS_SINGLE_QUOTED)) to add -L to the front of each dir. I've appended "_SINGLE_QUOTED" to the variable names so we don't accidentally add bare directories to them.
Diffstat (limited to 'rules/distdir-way-opts.mk')
-rw-r--r--rules/distdir-way-opts.mk10
1 files changed, 4 insertions, 6 deletions
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index bd09ad1528..bebbc4d04b 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -79,10 +79,8 @@ else
$1_$2_DEP_INCLUDE_DIRS_FLAG = -I
endif
-# We have to do this mangling using the shell, because words may contain
-# spaces and GNU make doesn't have any quoting interpretation.
-ifneq ($$(strip $$($1_$2_DEP_INCLUDE_DIRS)),)
-$1_$2_CC_INC_FLAGS:=$$(shell for i in $$($1_$2_DEP_INCLUDE_DIRS); do echo $$($1_$2_DEP_INCLUDE_DIRS_FLAG)\"$$$$i\"; done)
+ifneq ($$(strip $$($1_$2_DEP_INCLUDE_DIRS_SINGLE_QUOTED)),)
+$1_$2_CC_INC_FLAGS := $$(subst $$(space)',$$(space)$$($1_$2_DEP_INCLUDE_DIRS_FLAG)',$$(space)$$($1_$2_DEP_INCLUDE_DIRS_SINGLE_QUOTED))
endif
# The CONF_CC_OPTS_STAGE$4 options are what we use to get gcc to
@@ -104,8 +102,8 @@ $1_$2_DIST_CC_OPTS = \
$$($1_$2_CC_INC_FLAGS) \
$$($1_$2_DEP_CC_OPTS)
-ifneq ($$(strip $$($1_$2_DEP_LIB_DIRS)),)
-$1_$2_DIST_LD_LIB_DIRS:=$$(shell for i in $$($1_$2_DEP_LIB_DIRS); do echo \"-L$$$$i\"; done)
+ifneq ($$(strip $$($1_$2_DEP_LIB_DIRS_SINGLE_QUOTED)),)
+$1_$2_DIST_LD_LIB_DIRS := $$(subst $$(space)',$$(space)-L',$$(space)$$($1_$2_DEP_LIB_DIRS_SINGLE_QUOTED))
endif
$1_$2_DIST_LD_OPTS = \