Makefile revision 6613
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# CDDL HEADER START
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# The contents of this file are subject to the terms of the
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# Common Development and Distribution License (the "License").
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# You may not use this file except in compliance with the License.
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# See the License for the specific language governing permissions
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# and limitations under the License.
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# When distributing Covered Code, include this CDDL HEADER in each
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# If applicable, add the following below this CDDL HEADER, with the
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# fields enclosed by brackets "[]" replaced with your own identifying
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# information: Portions Copyright [yyyy] [name of copyright owner]
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# CDDL HEADER END
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard LoweCOMPONENT_PROJECT_URL= http://www.ruby-lang.org/
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe sha256:1e1362ae7427c91fa53dc9c05aee4ee200e2d7d8970a891c5bd76bee28d28be4
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe http://cache.ruby-lang.org/pub/ruby/2.1/$(COMPONENT_ARCHIVE)
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# COMPONENT_VERSION <major>.<minor>.<teeny>
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# is transformed into <major>.<minor> for RUBY_VER.
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# First change the separator '.' to ' ', so we can use "word" to pull the
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# first two space-separated words from the string.
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard LoweRUBY_VER_WORDS= $(subst ., ,$(COMPONENT_VERSION))
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard LoweRUBY_VER=$(word 1,$(RUBY_VER_WORDS)).$(word 2,$(RUBY_VER_WORDS))
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# the library-compatible version
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard LowePROTO_RBCONFIG_FILE=$(PROTORUBYDIR)/lib/ruby/$(RUBY_LIB_VER)/$(MACH64)-solaris$(SOLARIS_VERSION)/rbconfig.rb
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# these macros are used in the package manifest
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard LowePKG_MACROS+= RUBY_VER=$(RUBY_VER) RUBY_LIB_VER=$(RUBY_LIB_VER)
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# Prevent re-compile of ripper.so during install, which would result in
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# an erroneous full build directory in its RUNPATH. The below change to
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# ext/ripper/Makefile is identical to what occurs during install
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# and prevents its regeneration.
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe $(GSED) -i -e "s/^static: check/static: all/" $(BUILD_DIR_64)/ext/ripper/Makefile ; \
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe $(TOUCH) -r $(BUILD_DIR_64)/ext/ripper/ripper.o $(BUILD_DIR_64)/ext/ripper/Makefile
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# Apply some of the edits here--including to the sed scripts themselves.
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# These modifications of ruby.1 must occur after ruby
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# is installed, not before. Although there are some other patches
9f9230833b50b8271840dc2c12bd1e94d9df7d12Alexander Pyhalov# to ruby.1 that occur before, the ruby installation does some
9f9230833b50b8271840dc2c12bd1e94d9df7d12Alexander Pyhalov# formatting of ruby.1 that won't occur if the below changes
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# are applied.
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# work for some of the commands in rbconfig.sedscript.
9f9230833b50b8271840dc2c12bd1e94d9df7d12Alexander Pyhalov -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/gem.1-generic \
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/ruby.1.sedscript \
9f9230833b50b8271840dc2c12bd1e94d9df7d12Alexander Pyhalov /usr/bin/sed -f Solaris/rbconfig.sedscript.mod \
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# default LD_OPTION $(LD_B_DIRECT) causes problems--
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# during install of ruby, ruby is executed and will core dump
87ab362234f761757d96ff1a758ab5c3bd85ed83Richard Lowe# after compiling with this option
# an assertion failure when compiling ext/socket/raddrinfo.c,
# /usr/include/sys/isa_defs.h with error: "ISA not supported";
# /usr/lib/libffi-3.0/include/ffi.h header file.
'-e "/^linking shared-object ripper.so$$/d" ' \
'-e "s|\(Insecure world writable dir \).*\( in PATH, mode \)[0-7].*|\1XXX_DIR_XXX\2XXX_MODE_XXX|g" ' \