1 # |
|
2 # |
|
3 # CDDL HEADER START |
|
4 # |
|
5 # The contents of this file are subject to the terms of the |
|
6 # Common Development and Distribution License (the "License"). |
|
7 # You may not use this file except in compliance with the License. |
|
8 # |
|
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
10 # or http://www.opensolaris.org/os/licensing. |
|
11 # See the License for the specific language governing permissions |
|
12 # and limitations under the License. |
|
13 # |
|
14 # When distributing Covered Code, include this CDDL HEADER in each |
|
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
16 # If applicable, add the following below this CDDL HEADER, with the |
|
17 # fields enclosed by brackets "[]" replaced with your own identifying |
|
18 # information: Portions Copyright [yyyy] [name of copyright owner] |
|
19 # |
|
20 # CDDL HEADER END |
|
21 # |
|
22 # Copyright 2001, 2010, Oracle and/or its affiliates. All rights reserved. |
|
23 # |
|
24 # ident "@(#)Makefile.sfw 1.19 10/11/08 SMI" |
|
25 # |
|
26 |
|
27 VER = $(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh) |
|
28 TARBALL = $(VER).tar.gz |
|
29 PWD:sh=pwd |
|
30 |
|
31 include ../Makefile.cmd |
|
32 |
|
33 # We must use the c99 driver because some c99 math functions are |
|
34 # only available with this driver, and not with cc -xc99=%all |
|
35 CC = $(SPRO_VROOT)/bin/c99 |
|
36 |
|
37 CFLAGS_GENERIC = -Xc -features=extinl,extensions -xprefetch=auto |
|
38 CFLAGS_GENERIC += -xbuiltin=%none -xnorunpath -xcsi -xinline=%auto |
|
39 CFLAGS_GENERIC += -xustr=ascii_utf16_ushort -xF=%none -xthreadvar=%all |
|
40 CFLAGS_GENERIC += -xspace -xldscope=symbolic -KPIC -mt -D_REENTRANT |
|
41 CFLAGS_GENERIC += -D__EXTENSIONS__=1 -D_LARGEFILE_SOURCE |
|
42 CFLAGS_GENERIC += -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=600 -D_XPG6 |
|
43 CFLAGS_GENERIC += -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_C_SOURCE=200112L |
|
44 CFLAGS_GENERIC += -D__XOPEN_OR_POSIX -D_STRICT_STDC -D_STRICT_STDC__ |
|
45 CFLAGS_GENERIC += -D_STDC_C99 -D_ISOC99_SOURCE -D__C99FEATURES__ -DSOLARIS |
|
46 |
|
47 CFLAGS_i386 = -m32 -xregs=no%frameptr -xarch=generic -xO3 -s |
|
48 CFLAGS_sparc = -m32 -xvis=yes -xmemalign=8i -xregs=appl |
|
49 CFLAGS_sparc += -xtarget=ultra2 -xarch=sparcvis -xchip=ultra2 -xO4 -s |
|
50 CFLAGS = $(CFLAGS_GENERIC) $(CFLAGS_$(MACH)) |
|
51 |
|
52 LDFLAGS = -lc -lm -lsocket -lresolv -lnsl -lgen |
|
53 LDFLAGS += -z combreloc -z redlocsym -z ignore -z rescan -z absexec |
|
54 LDFLAGS += -KPIC |
|
55 |
|
56 LD_OPTIONS = -M $(SRC)/cmd/mapfile_noexstk |
|
57 LD_OPTIONS += -lsocket -lresolv -lnsl -lgen -z ignore |
|
58 |
|
59 # The bash test harness needs the GNU userland utilities |
|
60 GNU_PATH = /usr/gnu/bin |
|
61 |
|
62 # We need a temporary install directory to get all the *.mo |
|
63 # localization files. |
|
64 DESTDIR=$(SRC)/cmd/bash/proto-$(MACH) |
|
65 |
|
66 # We need to tell the install-sfw script where the bash system |
|
67 # scripts are. |
|
68 SCRIPTDIR=$(SRC)/cmd/bash/Solaris |
|
69 |
|
70 TARGET_ENV = CC=$(CC) CXX=$(CCC) |
|
71 TARGET_ENV += "CPPFLAGS=$(CPPFLAGS)" |
|
72 TARGET_ENV += "CFLAGS=$(CFLAGS)" |
|
73 TARGET_ENV += "LDFLAGS=$(LDFLAGS)" |
|
74 TARGET_ENV += "LD=$(CC) $(CFLAGS) $(LDFLAGS)" |
|
75 TARGET_ENV += "PATH=$(GNU_PATH):$(SFW_PATH)" |
|
76 TARGET_ENV += "MAKE=$(GMAKE)" |
|
77 TARGET_ENV += "INSTALL=$(GINSTALL)" |
|
78 |
|
79 TEST_OUTPUT = bash_test_results_$(MACH).out |
|
80 |
|
81 # For running the test harness we need to pick up some executables |
|
82 # which are built in $(top_srcdir). |
|
83 TEST_PATH = "PATH=$(SRC)/cmd/bash/$(VER):$(GNU_PATH):$(SFW_PATH)" |
|
84 |
|
85 all: $(VER)/config.status |
|
86 ( cd $(VER); env - \ |
|
87 LD_OPTIONS="$(LD_OPTIONS)" $(GMAKE) ) |
|
88 |
|
89 test: all |
|
90 ( cd $(VER) ; \ |
|
91 env - $(TARGET_ENV) $(TEST_PATH) $(GMAKE) check > \ |
|
92 $(TEST_OUTPUT) 2>&1 ) |
|
93 |
|
94 install: all |
|
95 mkdir -p $(DESTDIR) |
|
96 ( cd $(VER) ; env "DESTDIR=$(DESTDIR)" \ |
|
97 $(GMAKE) DESTDIR=$(DESTDIR) \ |
|
98 INSTALL=$(GINSTALL) install ) |
|
99 INSTDIR=$(DESTDIR) SCRIPTDIR=$(SCRIPTDIR) VERS=$(VER) $(SHELL) ./install-sfw |
|
100 |
|
101 $(VER)/configure: $(VER)/$(SFW_STAMP_UNPACKED) |
|
102 |
|
103 $(VER)/apply_patches.sh: $(PWD)/Solaris/apply_patches.sh $(VER)/configure |
|
104 ( cd $(VER) ; \ |
|
105 cp -fp ../Solaris/apply_patches.sh . ; \ |
|
106 chmod 0755 ./apply_patches.sh ; \ |
|
107 $(SHELL) ./apply_patches.sh ) |
|
108 |
|
109 $(VER)/config.status: $(VER)/apply_patches.sh |
|
110 (cd $(VER); env - $(TARGET_ENV) \ |
|
111 ./configure --prefix=$(CFGPREFIX) \ |
|
112 --localstatedir=/var \ |
|
113 --enable-alias \ |
|
114 --enable-arith-for-command \ |
|
115 --enable-array-variables \ |
|
116 --enable-bang-history \ |
|
117 --enable-brace-expansion \ |
|
118 --enable-casemod-attributes \ |
|
119 --enable-casemod-expansions \ |
|
120 --enable-command-timing \ |
|
121 --enable-cond-command \ |
|
122 --enable-cond-regexp \ |
|
123 --enable-coprocesses \ |
|
124 --enable-debugger \ |
|
125 --enable-directory-stack \ |
|
126 --enable-disabled-builtins \ |
|
127 --enable-dparen-arithmetic \ |
|
128 --enable-extended-glob \ |
|
129 --enable-help-builtin \ |
|
130 --enable-history \ |
|
131 --enable-job-control \ |
|
132 --enable-multibyte \ |
|
133 --enable-net-redirections \ |
|
134 --enable-process-substitution \ |
|
135 --enable-progcomp \ |
|
136 --enable-prompt-string-decoding \ |
|
137 --enable-readline \ |
|
138 --enable-restricted \ |
|
139 --enable-select \ |
|
140 --enable-separate-helpfiles \ |
|
141 --enable-single-help-strings \ |
|
142 --disable-strict-posix-default \ |
|
143 --enable-usg-echo-default \ |
|
144 --enable-xpg-echo-default \ |
|
145 --enable-mem-scramble \ |
|
146 --disable-profiling \ |
|
147 --enable-static-link \ |
|
148 --enable-largefile \ |
|
149 --enable-nls \ |
|
150 --with-bash-malloc \ |
|
151 --with-curses \ |
|
152 --with-installed-readline=no ) |
|
153 |
|
154 clean: |
|
155 -rm -rf $(VER) $(DESTDIR) |
|
156 |
|
157 include ../Makefile.targ |
|
158 |
|