aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2001-04-06 18:11:41 +0800
committerknu <knu@FreeBSD.org>2001-04-06 18:11:41 +0800
commit77feffd5d3859c7a2803d28f3a04930e2cff7b2f (patch)
tree6ea8de865e0a618c4f86b56d06b27915697dd3ca /Mk
parent0019d7e5a24aed7fa9533c660db98cdbdea21ac6 (diff)
downloadfreebsd-ports-gnome-77feffd5d3859c7a2803d28f3a04930e2cff7b2f.tar.gz
freebsd-ports-gnome-77feffd5d3859c7a2803d28f3a04930e2cff7b2f.tar.zst
freebsd-ports-gnome-77feffd5d3859c7a2803d28f3a04930e2cff7b2f.zip
Do the RUBY_WITH_PTHREAD hack in a more elegant way.
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.ruby.mk18
1 files changed, 15 insertions, 3 deletions
diff --git a/Mk/bsd.ruby.mk b/Mk/bsd.ruby.mk
index ebcb56a638fb..d40471ba1a4f 100644
--- a/Mk/bsd.ruby.mk
+++ b/Mk/bsd.ruby.mk
@@ -208,7 +208,9 @@ RUBY_FLAGS+= -d
USE_RUBY= yes
RUBY_EXTCONF?= extconf.rb
-CONFIGURE_ARGS+= --with-opt-dir="${LOCALBASE}"
+CONFIGURE_ARGS+= --with-opt-dir="${LOCALBASE}" \
+ --with-pthread-cflags="${PTHREAD_CFLAGS}" \
+ --with-pthread-libs="${PTHREAD_LIBS}"
do-configure: ruby-extconf-configure
@@ -218,7 +220,12 @@ ruby-extconf-configure:
@${ECHO_MSG} "===> Running ${RUBY_EXTCONF} in ${d} to configure"
.if defined(RUBY_WITH_PTHREAD)
cd ${WRKSRC}/${d}; \
- ${RUBY} ${RUBY_FLAGS} -i -pe 'if ~ /\brequire\s+[\047"]mkmf[\047"]/ then $$_ += "$$libs.sub!(/-lc\\b/, \"\"); $$libs += \" -pthread \"\n"; end' ${RUBY_EXTCONF}
+ ${RUBY} ${RUBY_FLAGS} -i -pe '~ /\brequire\s+[\047"]mkmf[\047"]/ \
+ and $$_ += %Q|\
+ $$libs.sub!(/-lc\\b/, "")\n \
+ $$libs += " " + with_config("pthread-libs") + " "\n \
+ $$CFLAGS += " " + with_config("pthread-cflags") + " "\n \
+ |' ${RUBY_EXTCONF}
.endif
@cd ${WRKSRC}/${d}; \
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}
@@ -227,7 +234,12 @@ ruby-extconf-configure:
@${ECHO_MSG} "===> Running ${RUBY_EXTCONF} to configure"
.if defined(RUBY_WITH_PTHREAD)
cd ${WRKSRC}; \
- ${RUBY} ${RUBY_FLAGS} -i -pe 'if ~ /\brequire\s+[\047"]mkmf[\047"]/ then $$_ += "$$libs.sub!(/-lc\\b/, \"\"); $$libs += \" -pthread \"\n"; end' ${RUBY_EXTCONF}
+ ${RUBY} ${RUBY_FLAGS} -i -pe '~ /\brequire\s+[\047"]mkmf[\047"]/ \
+ and $$_ += %Q|\
+ $$libs.sub!(/-lc\\b/, "")\n \
+ $$libs += " " + with_config("pthread-libs") + " "\n \
+ $$CFLAGS += " " + with_config("pthread-cflags") + " "\n \
+ |' ${RUBY_EXTCONF}
.endif
@cd ${WRKSRC}; \
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}