1 # |
|
2 # CDDL HEADER START |
|
3 # |
|
4 # The contents of this file are subject to the terms of the |
|
5 # Common Development and Distribution License (the "License"). |
|
6 # You may not use this file except in compliance with the License. |
|
7 # |
|
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 # or http://www.opensolaris.org/os/licensing. |
|
10 # See the License for the specific language governing permissions |
|
11 # and limitations under the License. |
|
12 # |
|
13 # When distributing Covered Code, include this CDDL HEADER in each |
|
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 # If applicable, add the following below this CDDL HEADER, with the |
|
16 # fields enclosed by brackets "[]" replaced with your own identifying |
|
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 # |
|
19 # CDDL HEADER END |
|
20 # |
|
21 |
|
22 # |
|
23 # Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
|
24 # |
|
25 |
|
26 include ../../../make-rules/shared-macros.mk |
|
27 |
|
28 COMPONENT_NAME= ruby |
|
29 COMPONENT_VERSION= 1.9.3 |
|
30 COMPONENT_PATCH_VERSION= 551 |
|
31 COMPONENT_PROJECT_URL= http://www.ruby-lang.org/ |
|
32 COMPONENT_SRC= \ |
|
33 $(COMPONENT_NAME)-$(COMPONENT_VERSION)-p$(COMPONENT_PATCH_VERSION) |
|
34 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz |
|
35 COMPONENT_ARCHIVE_HASH= \ |
|
36 sha256:bb5be55cd1f49c95bb05b6f587701376b53d310eb1bb7c76fbd445a1c75b51e8 |
|
37 COMPONENT_ARCHIVE_URL= \ |
|
38 http://ftp.ruby-lang.org/pub/ruby/1.9/$(COMPONENT_ARCHIVE) |
|
39 IPS_COMPONENT_VERSION= $(COMPONENT_VERSION).$(COMPONENT_PATCH_VERSION) |
|
40 COMPONENT_BUGDB= utility/ruby |
|
41 |
|
42 TPNO= 20807 |
|
43 |
|
44 include $(WS_MAKE_RULES)/prep.mk |
|
45 include $(WS_MAKE_RULES)/ips.mk |
|
46 include $(WS_MAKE_RULES)/configure.mk |
|
47 |
|
48 # COMPONENT_VERSION <major>.<minor>.<teeny> |
|
49 # is transformed into <major>.<minor> for RUBY_VER. |
|
50 # First change the separator '.' to ' ', so we can use "word" to pull the |
|
51 # first two space-separated words from the string. |
|
52 RUBY_VER_WORDS= $(subst ., ,$(COMPONENT_VERSION)) |
|
53 RUBY_VER=$(word 1,$(RUBY_VER_WORDS)).$(word 2,$(RUBY_VER_WORDS)) |
|
54 # the library-compatible version |
|
55 RUBY_LIB_VER=1.9.1 |
|
56 |
|
57 PROTORUBYDIR=$(PROTO_DIR)/usr/ruby/$(RUBY_VER) |
|
58 PROTO_RBCONFIG_FILE=$(PROTORUBYDIR)/lib/ruby/$(RUBY_LIB_VER)/$(MACH64)-solaris$(SOLARIS_VERSION)/rbconfig.rb |
|
59 |
|
60 # these macros are used in the package manifest |
|
61 PKG_MACROS+= RUBY_VER=$(RUBY_VER) RUBY_LIB_VER=$(RUBY_LIB_VER) |
|
62 |
|
63 # Apply some of the edits here--including to the sed scripts themselves. |
|
64 # These modifications of ruby.1 must occur after ruby |
|
65 # is installed, not before. Although there are some other patches |
|
66 # to ruby.1 that occur before, the ruby installation does some |
|
67 # formatting of ruby.1 that won't occur if the below changes |
|
68 # are applied. |
|
69 # Fix generated rbconfig.rb using /usr/bin/sed; gsed doesn't |
|
70 # work for some of the commands in rbconfig.sedscript. |
|
71 COMPONENT_POST_INSTALL_ACTION += \ |
|
72 $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \ |
|
73 -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/gem.1-generic \ |
|
74 > Solaris/gem.1 ; \ |
|
75 $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \ |
|
76 -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/ruby.1.sedscript \ |
|
77 > Solaris/ruby.1.sedscript.mod ; \ |
|
78 $(GSED) -e "s/RUBY_VER/$(RUBY_VER)/" \ |
|
79 -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/rbconfig.sedscript \ |
|
80 > Solaris/rbconfig.sedscript.mod ; \ |
|
81 $(GSED) -i -f Solaris/ruby.1.sedscript.mod \ |
|
82 $(PROTORUBYDIR)/share/man/man1/ruby.1 ; \ |
|
83 /usr/bin/sed -f Solaris/rbconfig.sedscript.mod \ |
|
84 $(PROTO_RBCONFIG_FILE) > rbconfig.rb.mod ; \ |
|
85 $(MV) rbconfig.rb.mod $(PROTO_RBCONFIG_FILE) |
|
86 |
|
87 # default LD_OPTION $(LD_B_DIRECT) causes problems-- |
|
88 # during install of ruby, ruby is executed and will core dump |
|
89 # after compiling with this option |
|
90 LD_B_DIRECT= |
|
91 |
|
92 # don't use LD_Z_IGNORE: causes ruby linker problems with |
|
93 # unreferenced symbol tgetent in libreadline, similar to bug #15617172 |
|
94 LD_Z_IGNORE= |
|
95 |
|
96 # i386 build runs into a Solaris ube compiler bug (#16775467) |
|
97 # while compiling load.c; it's having trouble with -xO4, so work around |
|
98 # by using -xO3 instead. 16775467 was patched for 12.1 compiler, so |
|
99 # the below should not no longer be necessary when we switch to |
|
100 # the 12.3 compiler |
|
101 studio_OPT.i386.64 = -xO3 |
|
102 |
|
103 # sparc build sometimes fails with studio 12.3 because of 17537968. |
|
104 studio_OPT.sparc.64 = -xO3 |
|
105 |
|
106 # without this define, config fails frequently on i386 when including |
|
107 # /usr/include/sys/isa_defs.h with error: "ISA not supported"; |
|
108 # many extensions don't get built and at least one error causes |
|
109 # the build to fail |
|
110 studio_XBITS.i386.64 += -D__amd64 |
|
111 |
|
112 CONFIGURE_PREFIX = $(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER) |
|
113 # change CONFIGURE_BINDIR.64 because this path will be embedded in |
|
114 # the header for ruby scripts; we are only building 64-bit, |
|
115 # so the real path for ruby will not have $(MACH64) in it |
|
116 CONFIGURE_BINDIR.64 = $(CONFIGURE_BINDIR.32) |
|
117 # not strictly needed, since ruby doesn't use sbin, but |
|
118 # change this as well, for consistency with BINDIR |
|
119 CONFIGURE_SBINDIR.64 = $(CONFIGURE_SBINDIR.32) |
|
120 |
|
121 # we are building 64-bit, but most of the ruby libraries (*.rb files) |
|
122 # are non-bit-specfic text files, so don't put them under lib/$(MACH64). |
|
123 # The 64-bit *.so libraries will be in the $(MACH64)-solaris$(SOLARIS_VERSION) |
|
124 # arch directories under lib |
|
125 |
|
126 CONFIGURE_OPTIONS += --with-rubylibprefix=$(CONFIGURE_LIBDIR.32)/ruby |
|
127 CONFIGURE_OPTIONS += --enable-shared |
|
128 CONFIGURE_OPTIONS += --enable-rpath |
|
129 # Don't need docs for ruby C source files |
|
130 CONFIGURE_OPTIONS += --disable-install-capi |
|
131 CONFIGURE_OPTIONS += --disable-option-checking |
|
132 CONFIGURE_OPTIONS += --with-openssl |
|
133 # If Ruby is configured with __builtin_setjmp, may cause |
|
134 # problems with gems compiled with gcc. Studio compiler doesn't |
|
135 # report an error for __builtin_setjmp, but gcc would. |
|
136 CONFIGURE_OPTIONS += --with-setjmp-type=_setjmp |
|
137 CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" |
|
138 |
|
139 # fiddle.so (ext/fiddle) links to libffi, which does not define |
|
140 # ffi_raw_size(), although its prototype is in libffi's |
|
141 # /usr/lib/libffi-3.0/include/ffi.h header file. |
|
142 # Defining FFI_NO_RAW_API avoids use of ffi_raw_size(). |
|
143 # This is a workaround to bug |
|
144 # 17349280 - libffi is missing ffi_raw_size() |
|
145 CFLAGS += -DFFI_NO_RAW_API |
|
146 |
|
147 # keep ASLR disabled; |
|
148 # miniruby may core dump on sparc during build |
|
149 ASLR_MODE = $(ASLR_DISABLE) |
|
150 |
|
151 CLEAN_PATHS += Solaris/gem.1 Solaris/rbconfig.sedscript.mod \ |
|
152 Solaris/ruby.1.sedscript.mod |
|
153 |
|
154 # This set of tests goes through thousands of entries in the passwd |
|
155 # and group table, taking hours to run; move it aside so we skip it. |
|
156 # There may also be spurious errors if group memberships are modified |
|
157 # during testing. |
|
158 COMPONENT_PRE_TEST_ACTION += \ |
|
159 ( if test -e $(SOURCE_DIR)/test/etc/test_etc.rb ; then \ |
|
160 $(MV) $(SOURCE_DIR)/test/etc/test_etc.rb \ |
|
161 $(SOURCE_DIR)/test/etc/test_etc.rb-save ; fi ) |
|
162 |
|
163 # common targets |
|
164 |
|
165 configure: $(CONFIGURE_64) |
|
166 |
|
167 build: $(BUILD_64) |
|
168 |
|
169 install: build $(INSTALL_64) |
|
170 |
|
171 test: $(TEST_64) |
|
172 |
|
173 system-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED) |
|
174 |
|
175 REQUIRED_PACKAGES += library/database/gdbm |
|
176 REQUIRED_PACKAGES += library/libffi |
|
177 REQUIRED_PACKAGES += library/ncurses |
|
178 REQUIRED_PACKAGES += library/readline |
|
179 REQUIRED_PACKAGES += library/security/openssl |
|
180 REQUIRED_PACKAGES += library/zlib |
|
181 REQUIRED_PACKAGES += runtime/tcl-8 |
|
182 REQUIRED_PACKAGES += runtime/tk-8 |
|
183 REQUIRED_PACKAGES += system/core-os |
|
184 REQUIRED_PACKAGES += system/library |
|
185 REQUIRED_PACKAGES += system/library/math |
|
186 REQUIRED_PACKAGES += x11/library/libx11 |
|