summaryrefslogtreecommitdiff
path: root/rules/build-package-way.mk
diff options
context:
space:
mode:
Diffstat (limited to 'rules/build-package-way.mk')
-rw-r--r--rules/build-package-way.mk31
1 files changed, 17 insertions, 14 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index 73fc684257..9c101c4a9d 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -134,20 +134,23 @@ endif # "$3" "v"
$(call profEnd, build-package-way($1,$2,$3))
endef # build-package-way
-# $1 = dir
-# $2 = distdir
-# $3 = way
-# $4 = extra flags
-# $5 = object files to link
-# $6 = output filename
define build-dll
- $(call cmd,$1_$2_HC) $($1_$2_$3_ALL_HC_OPTS) $($1_$2_$3_GHC_LD_OPTS) $4 $5 \
- -shared -dynamic -dynload deploy \
- $(addprefix -l,$($1_$2_EXTRA_LIBRARIES)) \
- -no-auto-link-packages \
- -o $6
-# Now check that the DLL doesn't have too many symbols. See trac #5987.
- SYMBOLS=`$(OBJDUMP) -p $6 | sed -n "1,/^.Ordinal\/Name Pointer/ D; p; /^$$/ q" | tail -n +2 | wc -l`; echo "Number of symbols in $6: $$SYMBOLS"
- case `$(OBJDUMP) -p $6 | sed -n "1,/^.Ordinal\/Name Pointer/ D; p; /^$$/ q" | grep "\[ *0\]" | wc -l` in 1) echo DLL $6 OK;; 0) echo No symbols in DLL $6; exit 1;; [0-9]*) echo Too many symbols in DLL $6; $(OBJDUMP) -p $6 | sed -n "1,/^.Ordinal\/Name Pointer/ D; p; /^$$/ q" | tail; exit 1;; *) echo bad DLL $6; exit 1;; esac
+# Call out to the shell script to decide how to build the util dll.
+# 1 = dir
+# 2 = distdir
+# 3 = way
+# 4 = extra flags
+# 5 = extra libraries to link
+# 6 = object files to link
+# 7 = output filename
+# 8 = link command
+# 9 = create delay load import lib
+# 10 = SxS Name
+# 11 = SxS Version
+$(gen-dll_INPLACE) link "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$(call cmd,$1_$2_HC) $(subst -no-hs-main,,$($1_$2_$3_ALL_HC_OPTS) $($1_$2_$3_GHC_LD_OPTS)) \
+ -shared -dynamic -dynload deploy \
+ $(addprefix -l,$($1_$2_EXTRA_LIBRARIES)) \
+ -no-auto-link-packages" "$8" \
+ "$9" "${10}"
endef