components/ruby/ruby-21/Makefile
changeset 7469 422c29c822ab
parent 6615 c59de4872b2d
child 7687 1093e2a9adbd
--- a/components/ruby/ruby-21/Makefile	Thu Dec 08 05:11:05 2016 -0800
+++ b/components/ruby/ruby-21/Makefile	Thu Dec 08 12:39:42 2016 -0800
@@ -43,6 +43,9 @@
 # first two space-separated words from the string.
 RUBY_VER_WORDS=	$(subst ., ,$(COMPONENT_VERSION))
 RUBY_VER=$(word 1,$(RUBY_VER_WORDS)).$(word 2,$(RUBY_VER_WORDS))
+# RUBY_VER_NO_DOT is just <major><minor>, like RUBY_VER but no
+# '.' separating <major> and <minor>.  Used when editing manpages (see below).
+RUBY_VER_NO_DOT=$(subst .,,$(RUBY_VER))
 # the library-compatible version
 RUBY_LIB_VER=2.1.0
 
@@ -69,16 +72,18 @@
 # Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't 
 # work for some of the commands in rbconfig.sedscript.
 COMPONENT_POST_INSTALL_ACTION += \
-	$(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
-	    -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/gem.1-generic \
+	$(GSED) -e "s/RUBY_VER_NO_DOT/$(RUBY_VER_NO_DOT)/g" \
+ 	    -e "s/RUBY_VER/$(RUBY_VER)/g" \
+	    -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/g" Solaris/gem.1-generic \
 	    > Solaris/gem.1 ; \
-	$(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
-	    -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/ruby.1.sedscript \
+	$(GSED) -e "s/RUBY_VER_NO_DOT/$(RUBY_VER_NO_DOT)/g" \
+ 	    -e "s/RUBY_VER/$(RUBY_VER)/g" \
+	    -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/g" Solaris/ruby.1.sedscript \
 	    > Solaris/ruby.1.sedscript.mod ; \
-	$(GSED) -e  "s/RUBY_VER/$(RUBY_VER)/" \
-	    -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" \
-	    -e "s/CFLAGS_GCC/$(CFLAGS.gcc)/" \
-	    -e "s/CXXFLAGS_GCC/$(CXXFLAGS.gcc)/" \
+	$(GSED) -e  "s/RUBY_VER/$(RUBY_VER)/g" \
+	    -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/g" \
+	    -e "s/CFLAGS_GCC/$(CFLAGS.gcc)/g" \
+	    -e "s/CXXFLAGS_GCC/$(CXXFLAGS.gcc)/g" \
 	    Solaris/rbconfig.sedscript \
 	    > Solaris/rbconfig.sedscript.mod ; \
 	$(GSED) -i -f Solaris/ruby.1.sedscript.mod \
@@ -129,6 +134,10 @@
 CONFIGURE_OPTIONS +=	DTRACE="$(USRSBINDIR)/dtrace"
 # ensure we use the 64-bit configuration file, not the 32-bit one
 CONFIGURE_OPTIONS +=	--with-tclConfig-file=$(USRLIBDIR)/64/tclConfig.sh
+	# set mantype to "man" so tool/mdoc2man.rb is used to convert
+	# the manpages from doc to man format; otherwise mantype is "doc" and
+	# headers we add to the manpages will not work properly
+CONFIGURE_OPTIONS +=	--with-mantype=man
 
 # fiddle.so (ext/fiddle) links to libffi, which does not define
 # ffi_raw_size(), although its prototype is in libffi's