2127N/A#
2127N/A# CDDL HEADER START
2127N/A#
2127N/A# The contents of this file are subject to the terms of the
2127N/A# Common Development and Distribution License (the "License").
2127N/A# You may not use this file except in compliance with the License.
2127N/A#
2127N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2127N/A# or http://www.opensolaris.org/os/licensing.
2127N/A# See the License for the specific language governing permissions
2127N/A# and limitations under the License.
2127N/A#
2127N/A# When distributing Covered Code, include this CDDL HEADER in each
2127N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2127N/A# If applicable, add the following below this CDDL HEADER, with the
2127N/A# fields enclosed by brackets "[]" replaced with your own identifying
2127N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2127N/A#
2127N/A# CDDL HEADER END
2127N/A#
2127N/A
2127N/A#
3996N/A# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
2127N/A#
2127N/A
2127N/Ainclude ../../../make-rules/shared-macros.mk
2127N/A
2127N/ACOMPONENT_NAME= ruby
2127N/ACOMPONENT_VERSION= 1.9.3
4577N/ACOMPONENT_PATCH_VERSION= 551
2127N/ACOMPONENT_PROJECT_URL= http://www.ruby-lang.org/
2127N/ACOMPONENT_SRC= \
2127N/A $(COMPONENT_NAME)-$(COMPONENT_VERSION)-p$(COMPONENT_PATCH_VERSION)
2127N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
2127N/ACOMPONENT_ARCHIVE_HASH= \
4577N/A sha256:bb5be55cd1f49c95bb05b6f587701376b53d310eb1bb7c76fbd445a1c75b51e8
2127N/ACOMPONENT_ARCHIVE_URL= \
2127N/A http://ftp.ruby-lang.org/pub/ruby/1.9/$(COMPONENT_ARCHIVE)
2127N/AIPS_COMPONENT_VERSION= $(COMPONENT_VERSION).$(COMPONENT_PATCH_VERSION)
2127N/ACOMPONENT_BUGDB= utility/ruby
2127N/A
4577N/ATPNO= 20807
3661N/A
3996N/Ainclude $(WS_MAKE_RULES)/prep.mk
3996N/Ainclude $(WS_MAKE_RULES)/ips.mk
3996N/Ainclude $(WS_MAKE_RULES)/configure.mk
2127N/A
2127N/A# COMPONENT_VERSION <major>.<minor>.<teeny>
2127N/A# is transformed into <major>.<minor> for RUBY_VER.
2127N/A# First change the separator '.' to ' ', so we can use "word" to pull the
2127N/A# first two space-separated words from the string.
2127N/ARUBY_VER_WORDS= $(subst ., ,$(COMPONENT_VERSION))
2127N/ARUBY_VER=$(word 1,$(RUBY_VER_WORDS)).$(word 2,$(RUBY_VER_WORDS))
2127N/A# the library-compatible version
2127N/ARUBY_LIB_VER=1.9.1
2127N/A
2127N/APROTORUBYDIR=$(PROTO_DIR)/usr/ruby/$(RUBY_VER)
2541N/APROTO_RBCONFIG_FILE=$(PROTORUBYDIR)/lib/ruby/$(RUBY_LIB_VER)/$(MACH64)-solaris$(SOLARIS_VERSION)/rbconfig.rb
2127N/A
2127N/A# these macros are used in the package manifest
2127N/APKG_MACROS+= RUBY_VER=$(RUBY_VER) RUBY_LIB_VER=$(RUBY_LIB_VER)
2127N/A
3721N/A# Apply some of the edits here--including to the sed scripts themselves.
2127N/A# These modifications of ruby.1 must occur after ruby
2127N/A# is installed, not before. Although there are some other patches
2127N/A# to ruby.1 that occur before, the ruby installation does some
2127N/A# formatting of ruby.1 that won't occur if the below changes
2127N/A# are applied.
2127N/A# Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't
2127N/A# work for some of the commands in rbconfig.sedscript.
2127N/ACOMPONENT_POST_INSTALL_ACTION += \
3721N/A $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
2127N/A -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/gem.1-generic \
2127N/A > Solaris/gem.1 ; \
2541N/A $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
2127N/A -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/ruby.1.sedscript \
2127N/A > Solaris/ruby.1.sedscript.mod ; \
3721N/A $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
2127N/A -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/rbconfig.sedscript \
2127N/A > Solaris/rbconfig.sedscript.mod ; \
2127N/A $(GSED) -i -f Solaris/ruby.1.sedscript.mod \
2127N/A $(PROTORUBYDIR)/share/man/man1/ruby.1 ; \
2127N/A /usr/bin/sed -f Solaris/rbconfig.sedscript.mod \
2127N/A $(PROTO_RBCONFIG_FILE) > rbconfig.rb.mod ; \
2127N/A $(MV) rbconfig.rb.mod $(PROTO_RBCONFIG_FILE)
2127N/A
2127N/A# default LD_OPTION $(LD_B_DIRECT) causes problems--
2127N/A# during install of ruby, ruby is executed and will core dump
2127N/A# after compiling with this option
2127N/ALD_B_DIRECT=
2127N/A
2127N/A# don't use LD_Z_IGNORE: causes ruby linker problems with
2127N/A# unreferenced symbol tgetent in libreadline, similar to bug #15617172
2127N/ALD_Z_IGNORE=
2127N/A
2127N/A# i386 build runs into a Solaris ube compiler bug (#16775467)
2127N/A# while compiling load.c; it's having trouble with -xO4, so work around
2127N/A# by using -xO3 instead. 16775467 was patched for 12.1 compiler, so
2127N/A# the below should not no longer be necessary when we switch to
2127N/A# the 12.3 compiler
2127N/Astudio_OPT.i386.64 = -xO3
2127N/A
2127N/A# without this define, config fails frequently on i386 when including
2127N/A# /usr/include/sys/isa_defs.h with error: "ISA not supported";
2127N/A# many extensions don't get built and at least one error causes
2127N/A# the build to fail
2127N/Astudio_XBITS.i386.64 += -D__amd64
2127N/A
2127N/ACONFIGURE_PREFIX = $(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)
2127N/A# change CONFIGURE_BINDIR.64 because this path will be embedded in
2127N/A# the header for ruby scripts; we are only building 64-bit,
2127N/A# so the real path for ruby will not have $(MACH64) in it
2127N/ACONFIGURE_BINDIR.64 = $(CONFIGURE_BINDIR.32)
2127N/A# not strictly needed, since ruby doesn't use sbin, but
2127N/A# change this as well, for consistency with BINDIR
2127N/ACONFIGURE_SBINDIR.64 = $(CONFIGURE_SBINDIR.32)
2541N/A
2541N/A# we are building 64-bit, but most of the ruby libraries (*.rb files)
2541N/A# are non-bit-specfic text files, so don't put them under lib/$(MACH64).
2541N/A# The 64-bit *.so libraries will be in the $(MACH64)-solaris$(SOLARIS_VERSION)
2541N/A# arch directories under lib
2541N/A
2541N/ACONFIGURE_OPTIONS += --with-rubylibprefix=$(CONFIGURE_LIBDIR.32)/ruby
2127N/ACONFIGURE_OPTIONS += --enable-shared
2127N/ACONFIGURE_OPTIONS += --enable-rpath
3721N/A# Don't need docs for ruby C source files
3721N/ACONFIGURE_OPTIONS += --disable-install-capi
2127N/ACONFIGURE_OPTIONS += --disable-option-checking
2127N/ACONFIGURE_OPTIONS += --with-openssl
4577N/A# If Ruby is configured with __builtin_setjmp, may cause
4577N/A# problems with gems compiled with gcc. Studio compiler doesn't
4577N/A# report an error for __builtin_setjmp, but gcc would.
4577N/ACONFIGURE_OPTIONS += --with-setjmp-type=_setjmp
2127N/ACONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
2127N/A
2127N/A# fiddle.so (ext/fiddle) links to libffi, which does not define
2127N/A# ffi_raw_size(), although its prototype is in libffi's
2127N/A# /usr/lib/libffi-3.0/include/ffi.h header file.
2127N/A# Defining FFI_NO_RAW_API avoids use of ffi_raw_size().
2127N/A# This is a workaround to bug
2127N/A# 17349280 - libffi is missing ffi_raw_size()
2127N/ACFLAGS += -DFFI_NO_RAW_API
2127N/A
2401N/A# keep ASLR disabled;
2401N/A# miniruby may core dump on sparc during build
2401N/AASLR_MODE = $(ASLR_DISABLE)
2401N/A
2127N/ACLEAN_PATHS += Solaris/gem.1 Solaris/rbconfig.sedscript.mod \
2127N/A Solaris/ruby.1.sedscript.mod
2127N/A
4577N/A# This set of tests goes through thousands of entries in the passwd
4577N/A# and group table, taking hours to run; move it aside so we skip it.
4577N/A# There may also be spurious errors if group memberships are modified
4577N/A# during testing.
4577N/ACOMPONENT_PRE_TEST_ACTION += \
4577N/A ( if test -e $(SOURCE_DIR)/test/etc/test_etc.rb ; then \
4577N/A $(MV) $(SOURCE_DIR)/test/etc/test_etc.rb \
4577N/A $(SOURCE_DIR)/test/etc/test_etc.rb-save ; fi )
4577N/A
2127N/A# common targets
2127N/A
4577N/Aconfigure: $(CONFIGURE_64)
4577N/A
2127N/Abuild: $(BUILD_64)
2127N/A
2127N/Ainstall: build $(INSTALL_64)
2127N/A
2127N/Atest: $(TEST_64)
2127N/A
2127N/A
3996N/AREQUIRED_PACKAGES += library/database/gdbm
3996N/AREQUIRED_PACKAGES += library/libffi
3996N/AREQUIRED_PACKAGES += library/ncurses
3996N/AREQUIRED_PACKAGES += library/readline
3996N/AREQUIRED_PACKAGES += library/security/openssl
3996N/AREQUIRED_PACKAGES += library/zlib
3996N/AREQUIRED_PACKAGES += runtime/tcl-8
3996N/AREQUIRED_PACKAGES += runtime/tk-8
3996N/AREQUIRED_PACKAGES += system/core-os
3996N/AREQUIRED_PACKAGES += system/library
3996N/AREQUIRED_PACKAGES += system/library/math
3996N/AREQUIRED_PACKAGES += system/linker
3996N/AREQUIRED_PACKAGES += x11/library/libx11