Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a new $way_libsuf variable for library suffix+extension

This allows the library file type to depend on the way. This is needed
to use .so/.dll libs for the "dyn" way rather than always using .a libs.
For example: thr_debug_dyn_libsuf="_thr_debug-ghc6.11.20090426.so"
  • Loading branch information...
commit 66b0d2dea58a0eb13889e86069b9d8297de4c19c 1 parent ce14988
@dcoutts dcoutts authored
Showing with 11 additions and 1 deletion.
  1. +1 −1  rules/build-package-way.mk
  2. +10 −0 rules/way-prelims.mk
View
2  rules/build-package-way.mk
@@ -20,7 +20,7 @@ $$(foreach dir,$$($1_$2_HS_SRC_DIRS),\
$(call hs-objs,$1,$2,$3)
-$1_$2_$3_LIB = $1/$2/build/libHS$$($1_PACKAGE)-$$($1_$2_VERSION)$$($3__way).a
+$1_$2_$3_LIB = $1/$2/build/libHS$$($1_PACKAGE)-$$($1_$2_VERSION)$$($3_libsuf)
$1_$2_$3_MKSTUBOBJS = find $1/$2/build -name "*_stub.$$($3_osuf)" -print
# HACK ^^^ we tried to use $(wildcard), but apparently it fails due to
View
10 rules/way-prelims.mk
@@ -21,4 +21,14 @@ endif
$1_osuf = $$($1_way_)o
$1_hisuf = $$($1_way_)hi
$1_hcsuf = $$($1_way_)hc
+
+ifneq "$(findstring dyn,$1)" ""
+# If the way includes "dyn" then it's a dynamic lib way. We mangle the
+# way name to remove "dyn" (or "_dyn") and we change the suffix to
+# include the versioned dynamic lib extension (eg .so or .dynlib).
+# For example: thr_debug_dyn_libsuf="_thr_debug-ghc6.11.20090426.so"
+$1_libsuf = $$($(subst dyn,,$(subst _dyn,,$1))__way)-ghc$(ProjectVersion)$(soext)
+else
+$1_libsuf = $$($1__way).a
+endif
endef
Please sign in to comment.
Something went wrong with that request. Please try again.