aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2001-04-06 17:19:22 +0800
committerknu <knu@FreeBSD.org>2001-04-06 17:19:22 +0800
commitc2ad79db70fe9baefa5dbde7034aaffe2c7b7914 (patch)
tree71fbb68e6cebd4ec192f996e5ca909f667051cc1 /Mk
parent6c4c1ede9c65a08b98f093bbcbc06b783241ca39 (diff)
downloadfreebsd-ports-gnome-c2ad79db70fe9baefa5dbde7034aaffe2c7b7914.tar.gz
freebsd-ports-gnome-c2ad79db70fe9baefa5dbde7034aaffe2c7b7914.tar.zst
freebsd-ports-gnome-c2ad79db70fe9baefa5dbde7034aaffe2c7b7914.zip
Introduce a new variable: RUBY_WITH_PTHREAD.
With it, extconf.rb is modified to link with -pthread instead of -lc.
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.ruby.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/Mk/bsd.ruby.mk b/Mk/bsd.ruby.mk
index 62226d2cdf02..ebcb56a638fb 100644
--- a/Mk/bsd.ruby.mk
+++ b/Mk/bsd.ruby.mk
@@ -20,6 +20,7 @@ Ruby_Include_MAINTAINER= knu@FreeBSD.org
# RUBY_NO_BUILD_DEPENDS - Says that the port should not build-depend on ruby.
# RUBY_NO_RUN_DEPENDS - Says that the port should not run-depend on ruby.
# USE_LIBRUBY - Says that the port uses libruby.
+# RUBY_WITH_PTHREAD - Says that the port needs to be compiled with pthread.
# USE_RUBY_EXTCONF - Says that the port uses extconf.rb to configure. Implies USE_RUBY.
# RUBY_EXTCONF - Set to the alternative name of extconf.rb (default: extconf.rb).
# RUBY_EXTCONF_SUBDIRS - Set to list of subdirectories, if multiple modules are included.
@@ -215,11 +216,19 @@ ruby-extconf-configure:
.if defined(RUBY_EXTCONF_SUBDIRS)
.for d in ${RUBY_EXTCONF_SUBDIRS}
@${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}
+.endif
@cd ${WRKSRC}/${d}; \
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}
.endfor
.else
@${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}
+.endif
@cd ${WRKSRC}; \
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_FLAGS} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}
.endif