0
|
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 2009 Sun Microsystems, Inc. All rights reserved.
|
|
24 |
# Use is subject to license terms.
|
|
25 |
#
|
3
|
26 |
# ident "@(#)Makefile.sfw 1.20 09/11/20 SMI"
|
0
|
27 |
#
|
|
28 |
|
3
|
29 |
RUBY_VER=$(COMPONENT_VERSION:sh)
|
|
30 |
VER=$(COMPONENT_NAME:sh)-$(RUBY_VER)
|
|
31 |
TARBALL=$(VER).tar.bz2
|
|
32 |
RUBYGEMS=rubygems-1.3.5
|
0
|
33 |
|
3
|
34 |
RUBY_INSTALLDIR=$(CFGPREFIX)/ruby/1.8
|
0
|
35 |
|
|
36 |
RELEASENUM:sh=uname -r | sed -e 's/[^.]*//'
|
|
37 |
|
|
38 |
DTRACE_FLAG_i386=--enable-dtrace
|
|
39 |
DTRACE_FLAG=$(DTRACE_FLAG_$(MACH))
|
|
40 |
|
|
41 |
DTRACE_PATCH_CMD_i386="gpatch < ../patches/ruby-dtrace-1.8.7.patch; autoconf"
|
|
42 |
DTRACE_PATCH_CMD=$(DTRACE_PATCH_CMD_$(MACH))
|
|
43 |
|
3
|
44 |
RUBY_CONFIGURE_OPTIONS += --prefix=$(RUBY_INSTALLDIR)
|
|
45 |
RUBY_CONFIGURE_OPTIONS += $(DTRACE_FLAG)
|
|
46 |
RUBY_CONFIGURE_OPTIONS += --enable-shared
|
|
47 |
RUBY_CONFIGURE_OPTIONS += --enable-install-doc
|
|
48 |
RUBY_CONFIGURE_OPTIONS += --disable-option-checking
|
|
49 |
RUBY_CONFIGURE_OPTIONS += --with-openssl
|
|
50 |
RUBY_CONFIGURE_OPTIONS += --with-tk-dir=/usr
|
|
51 |
RUBY_CONFIGURE_OPTIONS += --with-curses-dir=/usr
|
|
52 |
|
|
53 |
include ../Makefile.cmd
|
|
54 |
|
0
|
55 |
RUBY_CFLAGS="-xO4 -xbuiltin=%all -xinline=%auto -xprefetch=auto -xdepend -xtarget=generic -I$(ROOT)/usr/include"
|
|
56 |
CFLAGS += -I$(ROOT)/usr/include
|
|
57 |
CPPFLAGS += -I$(ROOT)/usr/include
|
3
|
58 |
LDFLAGS = -L$(ROOT)/usr/lib -M $(SRC)/cmd/mapfile_noexstk -R/usr/sfw/lib
|
0
|
59 |
|
|
60 |
|
|
61 |
.NO_PARALLEL:
|
|
62 |
|
|
63 |
all: install-ruby .WAIT install-rubygem
|
|
64 |
for pkg in $(COMPONENT_PACKAGES:sh) ; do \
|
|
65 |
$(SRC)/tools/protofix --pkg $$pkg --perm ; \
|
|
66 |
done
|
|
67 |
|
3
|
68 |
|
|
69 |
install: all
|
|
70 |
|
|
71 |
install-ruby: $(VER)/config.status
|
0
|
72 |
for pkg in $(COMPONENT_PACKAGES:sh) ; do \
|
|
73 |
$(SRC)/tools/protofix --pkg $$pkg --perm --write ; \
|
|
74 |
done
|
3
|
75 |
(cd $(VER); \
|
0
|
76 |
env - \
|
|
77 |
"CFLAGS=$(CFLAGS)" \
|
|
78 |
"CPPFLAGS=$(CPPFLAGS)" \
|
|
79 |
"LDFLAGS=$(LDFLAGS)" \
|
|
80 |
PATH=$(SFW_PATH) \
|
|
81 |
"MAKE=$(CCSMAKE)" \
|
|
82 |
$(CCSMAKE) ;\
|
|
83 |
env - \
|
|
84 |
"DESTDIR=$(ROOT)" \
|
|
85 |
PATH=$(SFW_PATH) \
|
|
86 |
"MAKE=$(CCSMAKE)" \
|
|
87 |
$(CCSMAKE) install-all)
|
|
88 |
|
|
89 |
install-rubygem: $(RUBYGEMS)/setup.rb
|
|
90 |
(cd $(RUBYGEMS); env - \
|
|
91 |
"DESTDIR=$(ROOT)" \
|
|
92 |
PATH=$(SFW_PATH) \
|
|
93 |
LD_LIBRARY_PATH=$(ROOT)$(RUBY_INSTALLDIR)/lib \
|
|
94 |
GEM_HOME=$(ROOT)/var/ruby/1.8/gem_home \
|
|
95 |
$(ROOT)$(RUBY_INSTALLDIR)/bin/ruby \
|
|
96 |
-I$(ROOT)$(RUBY_INSTALLDIR)/lib/ruby/1.8 \
|
|
97 |
-I$(ROOT)$(RUBY_INSTALLDIR)/lib/ruby/1.8/$(MACH)-solaris2$(RELEASENUM) \
|
|
98 |
setup.rb --vendor)
|
3
|
99 |
env SFWRELEASE=$(SFWRELEASE) $(SHELL) ./install-sfw $(RUBY_VER)
|
0
|
100 |
|
|
101 |
# ruby will build with extensions:
|
|
102 |
# dynamic linked with openssl in /usr
|
|
103 |
# tk in /usr
|
|
104 |
# curses in /usr
|
|
105 |
# readline in /usr
|
3
|
106 |
$(VER)/config.status: $(VER)/configure
|
|
107 |
(cd $(VER); env - \
|
0
|
108 |
CC=$(CC) \
|
|
109 |
CFLAGS=$(RUBY_CFLAGS) \
|
|
110 |
"CPPFLAGS=$(CPPFLAGS)" \
|
|
111 |
"LDFLAGS=$(LDFLAGS)" \
|
3
|
112 |
INSTALL=$(GINSTALL) \
|
0
|
113 |
PATH=$(SFW_PATH) \
|
|
114 |
MAKE=$(CCSMAKE) \
|
3
|
115 |
$(SHELL) ./configure $(RUBY_CONFIGURE_OPTIONS))
|
|
116 |
|
|
117 |
$(VER)/configure: $(VER)/.ruby_patched
|
|
118 |
$(TOUCH) $@
|
0
|
119 |
|
3
|
120 |
$(VER)/.ruby_patched: $(VER)/.unpacked
|
|
121 |
(cd $(VER); gpatch -p0 < ../patches/ruby-usrlocal.patch)
|
|
122 |
(cd $(VER); gpatch -p0 < ../patches/ruby_Makefile_in.patch)
|
|
123 |
(cd $(VER); gpatch -p0 < ../patches/ruby_1.patch)
|
|
124 |
(cd $(VER); gpatch -p0 < ../patches/ruby_ext_Setup.patch)
|
|
125 |
(cd $(VER); gpatch -p0 < ../patches/ruby_nogdbm.patch)
|
|
126 |
(cd $(VER); gpatch -p0 < ../patches/rdoc_rb.patch)
|
|
127 |
(cd $(VER); gpatch -p1 < ../patches/mkconfig.rb.patch)
|
|
128 |
(cd $(VER); eval $(DTRACE_PATCH_CMD) )
|
|
129 |
@if test ! -L $(VER)/purelib.rb; then \
|
|
130 |
ln -s ext/purelib.rb $(VER)/purelib.rb; \
|
0
|
131 |
else :; fi
|
3
|
132 |
$(TOUCH) $@
|
0
|
133 |
|
|
134 |
$(RUBYGEMS)/setup.rb: $(RUBYGEMS).tgz
|
|
135 |
/usr/bin/gzip -dc $(RUBYGEMS).tgz | \
|
|
136 |
$(GTAR) xpf - --no-same-owner
|
3
|
137 |
touch $@
|
0
|
138 |
|
|
139 |
clean:
|
3
|
140 |
-rm -rf $(VER) \
|
0
|
141 |
$(RUBYGEMS)
|
|
142 |
|
|
143 |
include ../Makefile.targ
|
|
144 |
|
|
145 |
FRC:
|