summaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@FreeBSD.org>2001-04-06 09:19:22 +0000
committerAkinori MUSHA <knu@FreeBSD.org>2001-04-06 09:19:22 +0000
commitf6ea67858746e3b0efe1c1ea659f74af2405c39a (patch)
tree684e19cf7f71ec5ef260b19f3770b75ac03df95b /Mk
parentMove regex pthread tweak from pre-patch to post-patch to avoid breakage on (diff)
Introduce a new variable: RUBY_WITH_PTHREAD.
With it, extconf.rb is modified to link with -pthread instead of -lc.
Notes
Notes: svn path=/head/; revision=40932
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