Makefile revision 3996
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# CDDL HEADER START
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The contents of this file are subject to the terms of the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Common Development and Distribution License (the "License").
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# You may not use this file except in compliance with the License.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# or http://www.opensolaris.org/os/licensing.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# See the License for the specific language governing permissions
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# and limitations under the License.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# When distributing Covered Code, include this CDDL HEADER in each
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# If applicable, add the following below this CDDL HEADER, with the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# CDDL HEADER END
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncinclude ../../../make-rules/shared-macros.mk
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_NAME= ruby
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_VERSION= 1.9.3
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_PATCH_VERSION= 484
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_PROJECT_URL= http://www.ruby-lang.org/
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_SRC= \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(COMPONENT_NAME)-$(COMPONENT_VERSION)-p$(COMPONENT_PATCH_VERSION)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_ARCHIVE_HASH= \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync sha256:d684bc3a5ba72cda9ef30039f783c0f8cdc325bae5c8738c7bf05577cbe8f31d
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_ARCHIVE_URL= \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync http://ftp.ruby-lang.org/pub/ruby/1.9/$(COMPONENT_ARCHIVE)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncIPS_COMPONENT_VERSION= $(COMPONENT_VERSION).$(COMPONENT_PATCH_VERSION)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_BUGDB= utility/ruby
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncTPNO= 15969
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncinclude $(WS_MAKE_RULES)/prep.mk
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncinclude $(WS_MAKE_RULES)/ips.mk
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncinclude $(WS_MAKE_RULES)/configure.mk
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# COMPONENT_VERSION <major>.<minor>.<teeny>
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# is transformed into <major>.<minor> for RUBY_VER.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# First change the separator '.' to ' ', so we can use "word" to pull the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# first two space-separated words from the string.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncRUBY_VER_WORDS= $(subst ., ,$(COMPONENT_VERSION))
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncRUBY_VER=$(word 1,$(RUBY_VER_WORDS)).$(word 2,$(RUBY_VER_WORDS))
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# the library-compatible version
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncRUBY_LIB_VER=1.9.1
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncPROTORUBYDIR=$(PROTO_DIR)/usr/ruby/$(RUBY_VER)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncPROTO_RBCONFIG_FILE=$(PROTORUBYDIR)/lib/ruby/$(RUBY_LIB_VER)/$(MACH64)-solaris$(SOLARIS_VERSION)/rbconfig.rb
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# these macros are used in the package manifest
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncPKG_MACROS+= RUBY_VER=$(RUBY_VER) RUBY_LIB_VER=$(RUBY_LIB_VER)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Apply some of the edits here--including to the sed scripts themselves.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# These modifications of ruby.1 must occur after ruby
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# is installed, not before. Although there are some other patches
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# to ruby.1 that occur before, the ruby installation does some
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# formatting of ruby.1 that won't occur if the below changes
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# are applied.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# work for some of the commands in rbconfig.sedscript.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCOMPONENT_POST_INSTALL_ACTION += \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/gem.1-generic \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync > Solaris/gem.1 ; \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/ruby.1.sedscript \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync > Solaris/ruby.1.sedscript.mod ; \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/rbconfig.sedscript \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync > Solaris/rbconfig.sedscript.mod ; \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(GSED) -i -f Solaris/ruby.1.sedscript.mod \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(PROTORUBYDIR)/share/man/man1/ruby.1 ; \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /usr/bin/sed -f Solaris/rbconfig.sedscript.mod \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(PROTO_RBCONFIG_FILE) > rbconfig.rb.mod ; \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(MV) rbconfig.rb.mod $(PROTO_RBCONFIG_FILE)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# default LD_OPTION $(LD_B_DIRECT) causes problems--
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# during install of ruby, ruby is executed and will core dump
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# after compiling with this option
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncLD_B_DIRECT=
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# don't use LD_Z_IGNORE: causes ruby linker problems with
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# unreferenced symbol tgetent in libreadline, similar to bug #15617172
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncLD_Z_IGNORE=
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# i386 build runs into a Solaris ube compiler bug (#16775467)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# while compiling load.c; it's having trouble with -xO4, so work around
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# by using -xO3 instead. 16775467 was patched for 12.1 compiler, so
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# the below should not no longer be necessary when we switch to
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# the 12.3 compiler
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstudio_OPT.i386.64 = -xO3
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# without this define, config fails frequently on i386 when including
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# /usr/include/sys/isa_defs.h with error: "ISA not supported";
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# many extensions don't get built and at least one error causes
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# the build to fail
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstudio_XBITS.i386.64 += -D__amd64
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_PREFIX = $(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# change CONFIGURE_BINDIR.64 because this path will be embedded in
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# the header for ruby scripts; we are only building 64-bit,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# so the real path for ruby will not have $(MACH64) in it
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_BINDIR.64 = $(CONFIGURE_BINDIR.32)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# not strictly needed, since ruby doesn't use sbin, but
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# change this as well, for consistency with BINDIR
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_SBINDIR.64 = $(CONFIGURE_SBINDIR.32)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# we are building 64-bit, but most of the ruby libraries (*.rb files)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# are non-bit-specfic text files, so don't put them under lib/$(MACH64).
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The 64-bit *.so libraries will be in the $(MACH64)-solaris$(SOLARIS_VERSION)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# arch directories under lib
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_OPTIONS += --with-rubylibprefix=$(CONFIGURE_LIBDIR.32)/ruby
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_OPTIONS += --enable-shared
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_OPTIONS += --enable-rpath
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Don't need docs for ruby C source files
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_OPTIONS += --disable-install-capi
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_OPTIONS += --disable-option-checking
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_OPTIONS += --with-openssl
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# fiddle.so (ext/fiddle) links to libffi, which does not define
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# ffi_raw_size(), although its prototype is in libffi's
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# /usr/lib/libffi-3.0/include/ffi.h header file.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Defining FFI_NO_RAW_API avoids use of ffi_raw_size().
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# This is a workaround to bug
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# 17349280 - libffi is missing ffi_raw_size()
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCFLAGS += -DFFI_NO_RAW_API
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# keep ASLR disabled;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# miniruby may core dump on sparc during build
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncASLR_MODE = $(ASLR_DISABLE)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncCLEAN_PATHS += Solaris/gem.1 Solaris/rbconfig.sedscript.mod \
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync Solaris/ruby.1.sedscript.mod
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# common targets
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncbuild: $(BUILD_64)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncinstall: build $(INSTALL_64)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsynctest: $(TEST_64)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += library/database/gdbm
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += library/libffi
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += library/ncurses
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += library/readline
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += library/security/openssl
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += library/zlib
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += runtime/tcl-8
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += runtime/tk-8
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += system/core-os
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += system/library
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += system/library/math
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += system/linker
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncREQUIRED_PACKAGES += x11/library/libx11
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync