summaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@FreeBSD.org>2001-04-06 10:11:41 +0000
committerAkinori MUSHA <knu@FreeBSD.org>2001-04-06 10:11:41 +0000
commit369ae010abeedfbeb2aaa0a594f8b2ab8017c5cb (patch)
treeecc95dacae88cdc2aa148d38b93c9c92898904ea /Mk
parentDefine RUBY_QT2_PORTREVISION and RUBY_WITH_PTHREAD in (diff)
Do the RUBY_WITH_PTHREAD hack in a more elegant way.
Notes
Notes: svn path=/head/; revision=40936
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}