4208N/A#
4208N/A# CDDL HEADER START
4208N/A#
4208N/A# The contents of this file are subject to the terms of the
4208N/A# Common Development and Distribution License (the "License").
4208N/A# You may not use this file except in compliance with the License.
4208N/A#
4208N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4208N/A# or http://www.opensolaris.org/os/licensing.
4208N/A# See the License for the specific language governing permissions
4208N/A# and limitations under the License.
4208N/A#
4208N/A# When distributing Covered Code, include this CDDL HEADER in each
4208N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4208N/A# If applicable, add the following below this CDDL HEADER, with the
4208N/A# fields enclosed by brackets "[]" replaced with your own identifying
4208N/A# information: Portions Copyright [yyyy] [name of copyright owner]
4208N/A#
4208N/A# CDDL HEADER END
4208N/A#
4208N/A
4208N/A#
5680N/A# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
4208N/A#
5680N/ABUILD_BITS= 64
4208N/Ainclude ../../../make-rules/shared-macros.mk
4208N/A
4208N/ACOMPONENT_NAME= ruby
4208N/ACOMPONENT_VERSION= 2.1.6
4208N/ACOMPONENT_PROJECT_URL= http://www.ruby-lang.org/
4208N/ACOMPONENT_ARCHIVE_HASH= \
4208N/A sha256:1e1362ae7427c91fa53dc9c05aee4ee200e2d7d8970a891c5bd76bee28d28be4
4208N/ACOMPONENT_ARCHIVE_URL= \
4208N/A http://cache.ruby-lang.org/pub/ruby/2.1/$(COMPONENT_ARCHIVE)
4208N/A
4208N/ATPNO= 22307
4208N/A
5680N/Ainclude $(WS_MAKE_RULES)/common.mk
4208N/A
4208N/A# COMPONENT_VERSION <major>.<minor>.<teeny>
4208N/A# is transformed into <major>.<minor> for RUBY_VER.
4208N/A# First change the separator '.' to ' ', so we can use "word" to pull the
4208N/A# first two space-separated words from the string.
4208N/ARUBY_VER_WORDS= $(subst ., ,$(COMPONENT_VERSION))
4208N/ARUBY_VER=$(word 1,$(RUBY_VER_WORDS)).$(word 2,$(RUBY_VER_WORDS))
4208N/A# the library-compatible version
4208N/ARUBY_LIB_VER=2.1.0
4208N/A
5680N/APROTORUBYDIR=$(PROTOUSRDIR)/ruby/$(RUBY_VER)
4208N/APROTO_RBCONFIG_FILE=$(PROTORUBYDIR)/lib/ruby/$(RUBY_LIB_VER)/$(MACH64)-solaris$(SOLARIS_VERSION)/rbconfig.rb
4208N/A
4208N/A# these macros are used in the package manifest
4208N/APKG_MACROS+= RUBY_VER=$(RUBY_VER) RUBY_LIB_VER=$(RUBY_LIB_VER)
4208N/A
4208N/A# Prevent re-compile of ripper.so during install, which would result in
4208N/A# an erroneous full build directory in its RUNPATH. The below change to
4208N/A# ext/ripper/Makefile is identical to what occurs during install
4208N/A# and prevents its regeneration.
4208N/ACOMPONENT_PRE_INSTALL_ACTION += \
4208N/A $(GSED) -i -e "s/^static: check/static: all/" $(BUILD_DIR_64)/ext/ripper/Makefile ; \
4208N/A $(TOUCH) -r $(BUILD_DIR_64)/ext/ripper/ripper.o $(BUILD_DIR_64)/ext/ripper/Makefile
4208N/A
4208N/A# Apply some of the edits here--including to the sed scripts themselves.
4208N/A# These modifications of ruby.1 must occur after ruby
4208N/A# is installed, not before. Although there are some other patches
4208N/A# to ruby.1 that occur before, the ruby installation does some
4208N/A# formatting of ruby.1 that won't occur if the below changes
4208N/A# are applied.
4208N/A# Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't
4208N/A# work for some of the commands in rbconfig.sedscript.
4208N/ACOMPONENT_POST_INSTALL_ACTION += \
4208N/A $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
4208N/A -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/gem.1-generic \
4208N/A > Solaris/gem.1 ; \
4208N/A $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
4208N/A -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/ruby.1.sedscript \
4208N/A > Solaris/ruby.1.sedscript.mod ; \
4208N/A $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
6613N/A -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" \
6613N/A -e "s/CFLAGS_GCC/$(CFLAGS.gcc)/" \
6613N/A -e "s/CXXFLAGS_GCC/$(CXXFLAGS.gcc)/" \
6613N/A Solaris/rbconfig.sedscript \
4208N/A > Solaris/rbconfig.sedscript.mod ; \
4208N/A $(GSED) -i -f Solaris/ruby.1.sedscript.mod \
4208N/A $(PROTORUBYDIR)/share/man/man1/ruby.1 ; \
4208N/A /usr/bin/sed -f Solaris/rbconfig.sedscript.mod \
4208N/A $(PROTO_RBCONFIG_FILE) > rbconfig.rb.mod ; \
4208N/A $(MV) rbconfig.rb.mod $(PROTO_RBCONFIG_FILE)
4208N/A
4208N/A# default LD_OPTION $(LD_B_DIRECT) causes problems--
4208N/A# during install of ruby, ruby is executed and will core dump
4208N/A# after compiling with this option
4208N/ALD_B_DIRECT=
4208N/A
4208N/A# don't use LD_Z_IGNORE: causes ruby linker problems with
4208N/A# unreferenced symbol tgetent in libreadline, similar to bug #15617172
4208N/ALD_Z_IGNORE=
4208N/A
4208N/A# sparc build sometimes fails with studio 12.3 because of 17537968;
4208N/A# -xO3 worked around the problem. Also, iropt optimizer has a
4208N/A# an assertion failure when compiling ext/socket/raddrinfo.c,
4208N/A# (CR 20704428); dropping down to -xO2 works around the bug.
4208N/Astudio_OPT.sparc.64 = -xO2
4208N/A
4208N/A# without this define, config fails frequently on i386 when including
4208N/A# /usr/include/sys/isa_defs.h with error: "ISA not supported";
4208N/A# many extensions don't get built and at least one error causes
4208N/A# the build to fail
4208N/Astudio_XBITS.i386.64 += -D__amd64
4208N/A
4208N/ACONFIGURE_PREFIX = $(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)
4208N/A
4208N/A# we are building 64-bit, but most of the ruby libraries (*.rb files)
4208N/A# are non-bit-specfic text files, so don't put them under lib/$(MACH64).
4208N/A# The 64-bit *.so libraries will be in the $(MACH64)-solaris$(SOLARIS_VERSION)
4208N/A# arch directories under lib
4208N/A
4208N/ACONFIGURE_OPTIONS += --with-rubylibprefix=$(CONFIGURE_LIBDIR.32)/ruby
4208N/ACONFIGURE_OPTIONS += --enable-shared
4208N/ACONFIGURE_OPTIONS += --enable-rpath
4208N/A# Don't need docs for ruby C source files
4208N/ACONFIGURE_OPTIONS += --disable-install-capi
4208N/ACONFIGURE_OPTIONS += --disable-option-checking
4208N/ACONFIGURE_OPTIONS += --with-openssl
4208N/A# If Ruby is configured with __builtin_setjmp, may cause
4208N/A# problems with gems compiled with gcc. Studio compiler doesn't
4208N/A# report an error for __builtin_setjmp, but gcc would.
4208N/ACONFIGURE_OPTIONS += --with-setjmp-type=_setjmp
5680N/ACONFIGURE_OPTIONS += DTRACE="$(USRSBINDIR)/dtrace"
4208N/A# ensure we use the 64-bit configuration file, not the 32-bit one
5680N/ACONFIGURE_OPTIONS += --with-tclConfig-file=$(USRLIBDIR)/64/tclConfig.sh
4208N/A
4208N/A# fiddle.so (ext/fiddle) links to libffi, which does not define
4208N/A# ffi_raw_size(), although its prototype is in libffi's
4208N/A# /usr/lib/libffi-3.0/include/ffi.h header file.
4208N/A# Defining FFI_NO_RAW_API avoids use of ffi_raw_size().
4208N/A# This is a workaround to bug
4208N/A# 17349280 - libffi is missing ffi_raw_size()
4208N/ACFLAGS += -DFFI_NO_RAW_API
4208N/A
4208N/A# keep ASLR disabled;
4208N/A# miniruby may core dump on sparc during build
4208N/AASLR_MODE = $(ASLR_DISABLE)
4208N/A
4208N/ACLEAN_PATHS += Solaris/gem.1 Solaris/rbconfig.sedscript.mod \
4208N/A Solaris/ruby.1.sedscript.mod
4208N/A
4208N/A# Some tests produce warnings if HTTP_PROXY is set
4208N/ACOMPONENT_TEST_ENV += "--unset=HTTP_PROXY"
4208N/A
4208N/A# This set of tests goes through thousands of entries in the passwd
4208N/A# and group table, taking hours to run; move it aside so we skip it.
4208N/A# There may also be spurious errors if group memberships are modified
4208N/A# during testing.
4208N/ACOMPONENT_PRE_TEST_ACTION += \
4208N/A ( if test -e $(SOURCE_DIR)/test/etc/test_etc.rb ; then \
4208N/A $(MV) $(SOURCE_DIR)/test/etc/test_etc.rb \
4208N/A $(SOURCE_DIR)/test/etc/test_etc.rb-save ; fi )
4208N/A
4208N/ACOMPONENT_TEST_TRANSFORMS += \
4208N/A '-e "/^linking shared-object ripper.so$$/d" ' \
4208N/A '-e "s|^20[0-9][0-9]-[01][1-9]-[0-3][0-9].*|XXX_DATE_TIME_XXX|" ' \
4208N/A '-e "s|\(^[[:space:]]*CC = \).*|\1|" ' \
4208N/A '-e "s|\(^[[:space:]]*LD = \).*|\1|" ' \
4208N/A '-e "s|\(^[[:space:]]*LDSHARED = \).*|\1|" ' \
4208N/A '-e "s|\(^[[:space:]]*CFLAGS = \).*|\1|" ' \
4208N/A '-e "s|\(^[[:space:]]*XCFLAGS = \).*|\1|" ' \
4208N/A '-e "s|\(^[[:space:]]*CPPFLAGS = \).*|\1|" ' \
4208N/A '-e "s|\(^[[:space:]]*DLDFLAGS = \).*|\1|" ' \
4208N/A '-e "s|\(^[[:space:]]*SOLIBS = \).*|\1|" ' \
4208N/A '-e "s|\(^cc: \).*|\1|" ' \
4208N/A '-e "s|^\.[\.FES]\+|XXX_DOTS_XXX|" ' \
4208N/A '-e "s|\(Insecure world writable dir \).*\( in PATH, mode \)[0-7].*|\1XXX_DIR_XXX\2XXX_MODE_XXX|g" ' \
4208N/A '-e "s|\(^Driver is \).*|\1XXX_RUBY_VERSION_XXX|" ' \
4208N/A '-e "s|\(^Target is \).*|\1XXX_RUBY_VERSION_XXX|" ' \
4208N/A '-e "s|\(^Finished tests in \).*|\1|" ' \
4208N/A '-e "s|^[[:space:]]*[0-9]\+) \([FSE][a-z]\+:$$\)|NUM) \1|" ' \
4208N/A '-e "s|URI::HTTP:[0-9a-fx]\+ |URI::HTTP:0xXXX |" ' \
4208N/A '-e "s|\(.*\#test_no_memory_leak \).*:$$|\1XXX_RUBY_FILE_XXX:|" ' \
4208N/A '-e "s|/tmp/.*:[0-9]\+: |XXX_TMPFILE_XXX: |" ' \
4208N/A '-e "s|[0-9]\+\( tests, \)[0-9]\+\( assertions, \)[0-9]\+\( failures, \)[0-9]\+\( errors, \)[0-9]\+\( skips\)|XXX_NUM_XXX\1XXX_NUM_XXX\2XXX_NUM_XXX\3XXX_NUM_XXX\4XXX_NUM_XXX\5|" ' \
4208N/A '-e "s|\(^ruby -v: \).*|\1XXX_RUBY_VERSION_XXX|" ' \
4208N/A '-e "s|\(\[yes-test-all\] Error \)[0-9]\+$$|\1NUM|"'
4208N/A
4208N/A# master test results are not entirely clean, so not
4208N/A# appropriate to run at top level
4208N/A$(SKIP_TEST_AT_TOP_LEVEL)
4208N/A
4208N/AREQUIRED_PACKAGES += library/database/gdbm
4208N/AREQUIRED_PACKAGES += library/libffi
4208N/AREQUIRED_PACKAGES += library/ncurses
4208N/AREQUIRED_PACKAGES += library/readline
4208N/AREQUIRED_PACKAGES += library/security/openssl
4208N/AREQUIRED_PACKAGES += library/zlib
4208N/AREQUIRED_PACKAGES += runtime/tcl-8
4208N/AREQUIRED_PACKAGES += runtime/tk-8
4208N/AREQUIRED_PACKAGES += system/core-os
4208N/AREQUIRED_PACKAGES += system/library/math
4208N/AREQUIRED_PACKAGES += x11/library/libx11