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