16 # fields enclosed by brackets "[]" replaced with your own identifying |
16 # fields enclosed by brackets "[]" replaced with your own identifying |
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
18 # |
18 # |
19 # CDDL HEADER END |
19 # CDDL HEADER END |
20 # |
20 # |
21 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. |
21 |
22 # |
22 # |
23 |
23 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. |
|
24 # |
|
25 BUILD_BITS= 64_and_32 |
24 # we really need to use studio so we don't like that |
26 # we really need to use studio so we don't like that |
25 # parfait is g++ in disguise |
27 # parfait is clang/llvm in disguise |
26 export PARFAIT_BUILD=no |
28 export PARFAIT_BUILD=no |
27 |
|
28 include ../../make-rules/shared-macros.mk |
29 include ../../make-rules/shared-macros.mk |
29 |
30 |
30 PATH=$(dir $(CC)):/usr/gnu/bin:/usr/bin |
31 PATH=$(dir $(CC)):$(GNUBIN):$(USRBINDIR) |
31 |
32 |
32 COMPONENT_NAME= stdcxx |
33 COMPONENT_NAME= stdcxx |
33 COMPONENT_VERSION= 4.2.1 |
34 COMPONENT_VERSION= 4.2.1 |
34 COMPONENT_PROJECT_URL= http://stdcxx.apache.org/ |
35 COMPONENT_PROJECT_URL= http://stdcxx.apache.org/ |
35 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION) |
|
36 COMPONENT_PROJECT_URL= http://stdcxx.apache.org/ |
|
37 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz |
|
38 COMPONENT_ARCHIVE_HASH= \ |
36 COMPONENT_ARCHIVE_HASH= \ |
39 sha256:00854223cbd947bf1bd85d9dabd1b2829706d9062e0007d5022082a5e4b7e15e |
37 sha256:00854223cbd947bf1bd85d9dabd1b2829706d9062e0007d5022082a5e4b7e15e |
40 COMPONENT_ARCHIVE_URL= http://www.apache.org/dist/stdcxx/$(COMPONENT_ARCHIVE) |
38 COMPONENT_ARCHIVE_URL= http://www.apache.org/dist/stdcxx/$(COMPONENT_ARCHIVE) |
41 COMPONENT_BUGDB= library/libstdcxx |
39 COMPONENT_BUGDB= library/libstdcxx |
42 |
40 |
43 TPNO= 9048 |
41 TPNO= 9048 |
44 |
42 |
45 CLEAN_PATHS += install.sh |
43 CLEAN_PATHS += install.sh |
46 |
44 |
47 include $(WS_MAKE_RULES)/prep.mk |
45 INSTALL_TARGET= |
48 include $(WS_MAKE_RULES)/configure.mk |
46 include $(WS_MAKE_RULES)/common.mk |
49 include $(WS_MAKE_RULES)/ips.mk |
|
50 |
47 |
51 SUNPRO_VERSION := $(shell $(CXX) -V 2>&1 | head -n1 \ |
48 SUNPRO_VERSION := $(shell $(CXX) -V 2>&1 | head -n1 \ |
52 | sed 's/.*C++ *\([^ ]*\).*/\1/') |
49 | sed 's/.*C++ *\([^ ]*\).*/\1/') |
53 SUNPRO_MAJOR_VERSION := $(shell echo $(SUNPRO_VERSION) | cut -f1 -d'.') |
50 SUNPRO_MAJOR_VERSION := $(shell echo $(SUNPRO_VERSION) | cut -f1 -d'.') |
54 SUNPRO_MINOR_VERSION := $(shell echo $(SUNPRO_VERSION) | cut -f2 -d'.') |
51 SUNPRO_MINOR_VERSION := $(shell echo $(SUNPRO_VERSION) | cut -f2 -d'.') |
88 |
85 |
89 ISA_PATCHES_32 = $(ISA_PATCHES_$(MACH)) |
86 ISA_PATCHES_32 = $(ISA_PATCHES_$(MACH)) |
90 ISA_PATCHES_64 = $(ISA_PATCHES_$(MACH64)) |
87 ISA_PATCHES_64 = $(ISA_PATCHES_$(MACH64)) |
91 ISA_PATCHES = $(ISA_PATCHES_$(BITS)) |
88 ISA_PATCHES = $(ISA_PATCHES_$(BITS)) |
92 |
89 |
93 PATCH_LEVEL = 1 |
|
94 |
|
95 TOPDIR = $(COMPONENT_DIR)/$(COMPONENT_SRC) |
90 TOPDIR = $(COMPONENT_DIR)/$(COMPONENT_SRC) |
96 LOCAL_BUILDDIR = $(TOPDIR)/build |
91 LOCAL_BUILDDIR = $(TOPDIR)/build |
97 MARG = -m$(BITS) |
|
98 PICFLAG = -KPIC -DPIC |
|
99 |
92 |
100 # Please see the README file in this directory for a detailed explanation |
93 # Please see the README file in this directory for a detailed explanation |
101 # about these flags, what they do, and why we need them. |
94 # about these flags, what they do, and why we need them. |
102 FLAGS_sparc = -m32 -xarch=sparcvis -xmemalign=8i |
95 FLAGS_sparc = -m32 -xarch=sparcvis -xmemalign=8i |
103 FLAGS_sparcv9 = -m64 -xarch=sparcvis -xmemalign=16i |
96 FLAGS_sparcv9 = -m64 -xarch=sparcvis -xmemalign=16i |
104 FLAGS_i386 = -m32 -xarch=386 |
97 FLAGS_i386 = -m32 -xarch=386 |
105 FLAGS_amd64 = -m64 -xarch=generic |
98 FLAGS_amd64 = -m64 -xarch=generic |
106 CFLAGS_sparc = -Xc -features=extinl -xvis=yes |
99 CFLAGS_sparc = -Xc -features=extinl -xvis=yes |
107 CFLAGS_sparc += -Qoption cg -xregs=no%appl -xbuiltin=%none -xO4 $(PICFLAG) |
100 CFLAGS_sparc += -Qoption cg -xregs=no%appl -xbuiltin=%none -xO4 $(PICFLAG) |
108 CFLAGS_i386 = -Xc -features=extinl -xregs=no%frameptr |
101 CFLAGS_i386 = -Xc -features=extinl -xregs=no%frameptr |
109 CFLAGS_i386 += -xO3 -xbuiltin=%none $(PICFLAG) |
102 CFLAGS_i386 += -xO3 -xbuiltin=%none $(CC_PIC) |
110 |
103 |
111 CFLAGS_32 = $(FLAGS_$(MACH)) $(CFLAGS_$(MACH)) |
104 CFLAGS_32 = $(FLAGS_$(MACH)) $(CFLAGS_$(MACH)) |
112 CFLAGS_64 = $(FLAGS_$(MACH64)) $(CFLAGS_$(MACH)) |
105 CFLAGS_64 = $(FLAGS_$(MACH64)) $(CFLAGS_$(MACH)) |
113 |
106 |
114 CXXFLAGS_sparc = -xvis=yes -xregs=no%appl -xO4 |
107 CXXFLAGS_sparc = -xvis=yes -xregs=no%appl -xO4 |
135 CXXFLAGS_GENERIC += $(CXXFLAGS_$(MACH)) |
128 CXXFLAGS_GENERIC += $(CXXFLAGS_$(MACH)) |
136 CXXFLAGS_GENERIC += -xlang=c99 |
129 CXXFLAGS_GENERIC += -xlang=c99 |
137 CXXFLAGS_GENERIC += -xbuiltin=%none |
130 CXXFLAGS_GENERIC += -xbuiltin=%none |
138 CXXFLAGS_GENERIC += -xinline= |
131 CXXFLAGS_GENERIC += -xinline= |
139 CXXFLAGS_GENERIC += -xlibmieee |
132 CXXFLAGS_GENERIC += -xlibmieee |
140 CXXFLAGS_GENERIC += -z ignore $(PICFLAG) |
133 CXXFLAGS_GENERIC += $(LD_Z_IGNORE) $(PICFLAG) |
141 CXXFLAGS_GENERIC += -mt -D_REENTRANT -DNDEBUG |
134 CXXFLAGS_GENERIC += -mt -D_REENTRANT -DNDEBUG |
142 CXXFLAGS_GENERIC += -D_IN_BUILD_STDCXX |
135 CXXFLAGS_GENERIC += -D_IN_BUILD_STDCXX |
143 CXXFLAGS_GENERIC += -D__EXTENSIONS__ |
136 CXXFLAGS_GENERIC += -D__EXTENSIONS__ |
144 CXXFLAGS_GENERIC += -D_LARGEFILE_SOURCE |
137 CXXFLAGS_GENERIC += -D_LARGEFILE_SOURCE |
145 CXXFLAGS_GENERIC += -D_FILE_OFFSET_BITS=64 |
138 CXXFLAGS_GENERIC += -D_FILE_OFFSET_BITS=64 |
158 CPPFLAGS += -I$(TOPDIR)/include |
151 CPPFLAGS += -I$(TOPDIR)/include |
159 |
152 |
160 # -mt will automatically pass -lthread unless we pass -lpthread |
153 # -mt will automatically pass -lthread unless we pass -lpthread |
161 # on link line. -lthread causes regressions. see man CC(1) and -mt. |
154 # on link line. -lthread causes regressions. see man CC(1) and -mt. |
162 # -lumem must be passed before -lc. |
155 # -lumem must be passed before -lc. |
163 LDFLAGS = -lpthread -lumem -lm -lc -s -z ignore |
156 LDFLAGS = -lpthread -lumem -lm -lc -s $(LD_Z_IGNORE) |
164 |
157 |
165 # We cannot have -B direct |
158 # We cannot have -B direct |
166 LD_OPTIONS = -M /usr/lib/ld/map.noexstk -M /usr/lib/ld/map.noexdata |
159 LD_OPTIONS = -M /usr/lib/ld/map.noexstk -M /usr/lib/ld/map.noexdata |
167 LD_OPTIONS += -M /usr/lib/ld/map.pagealign |
160 LD_OPTIONS += -M /usr/lib/ld/map.pagealign |
168 LD_OPTIONS += -lpthread -lumem -lm -lc -s -z ignore |
161 LD_OPTIONS += -lpthread -lumem -lm -lc -s $(LD_Z_IGNORE) |
169 |
162 |
170 # If I name it NLSPATH, gmake insists on getting its value from the |
163 # If I name it NLSPATH, gmake insists on getting its value from the |
171 # running environment. Also, it all has to be on one line. += prepends |
164 # running environment. Also, it all has to be on one line. += prepends |
172 # a whitespace. |
165 # a whitespace. |
173 BUILD_NLSPATH = :%N.cat:/usr/lib/locale/%L/%N.cat:/usr/share/locale/%L/%N.cat:$(BUILD_DIR_$(BITS))/lib/rwstderr.cat |
166 BUILD_NLSPATH = :%N.cat:/usr/lib/locale/%L/%N.cat:/usr/share/locale/%L/%N.cat:$(BUILD_DIR_$(BITS))/lib/rwstderr.cat |
174 |
167 |
175 CONFIGURE_ENV += CFLAGS="$(CFLAGS)" |
|
176 CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)" |
|
177 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)" |
|
178 CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)" |
|
179 CONFIGURE_ENV += LD_OPTIONS="$(LD_OPTIONS)" |
168 CONFIGURE_ENV += LD_OPTIONS="$(LD_OPTIONS)" |
180 CONFIGURE_ENV += LD="$(CXX) $(CXXFLAGS) $(LDFLAGS)" |
169 CONFIGURE_ENV += LD="$(CXX) $(CXXFLAGS) $(LDFLAGS)" |
181 CONFIGURE_ENV += MAKE="$(MAKE)" |
170 CONFIGURE_ENV += MAKE="$(MAKE)" |
182 CONFIGURE_ENV += TOPDIR="$(TOPDIR)" |
171 CONFIGURE_ENV += TOPDIR="$(TOPDIR)" |
183 CONFIGURE_ENV += MAKEFLAGS="" |
172 CONFIGURE_ENV += MAKEFLAGS="" |
184 |
173 |
185 CONFIGURE_OPTIONS = $(MARG) |
174 CONFIGURE_OPTIONS = $(CC_BITS) |
186 CONFIGURE_OPTIONS += -topdir=$(TOPDIR) |
175 CONFIGURE_OPTIONS += -topdir=$(TOPDIR) |
187 CONFIGURE_OPTIONS += -builddir=$(LOCAL_BUILDDIR) |
176 CONFIGURE_OPTIONS += -builddir=$(LOCAL_BUILDDIR) |
188 |
177 |
189 GCP = /usr/gnu/bin/cp |
178 GCP = /usr/gnu/bin/cp |
190 |
179 |
255 $(CHMOD) 0755 run_tests.sh ; \ |
244 $(CHMOD) 0755 run_tests.sh ; \ |
256 $(SHELL) ./run_tests.sh |
245 $(SHELL) ./run_tests.sh |
257 |
246 |
258 COMPONENT_TEST_TARGETS = |
247 COMPONENT_TEST_TARGETS = |
259 |
248 |
260 ASLR_MODE = $(ASLR_NOT_APPLICABLE) |
|
261 |
|
262 configure: $(CONFIGURE_32_and_64) |
|
263 |
|
264 build: $(BUILD_32_and_64) |
|
265 |
|
266 install: $(BUILD_DIR_32)/.built $(BUILD_DIR_64)/.built |
249 install: $(BUILD_DIR_32)/.built $(BUILD_DIR_64)/.built |
267 $(CP) $(COMPONENT_DIR)/Solaris/install.sh $(COMPONENT_DIR)/ |
250 $(CP) $(COMPONENT_DIR)/Solaris/install.sh $(COMPONENT_DIR)/ |
268 $(CHMOD) 0755 $(COMPONENT_DIR)/install.sh |
251 $(CHMOD) 0755 $(COMPONENT_DIR)/install.sh |
269 $(MKDIR) $(PROTO_DIR)/usr |
252 $(MKDIR) $(PROTO_DIR)/usr |
270 ( $(SHELL) $(COMPONENT_DIR)/install.sh \ |
253 ( $(SHELL) $(COMPONENT_DIR)/install.sh \ |
280 -componentsrc=$(COMPONENT_SRC) \ |
263 -componentsrc=$(COMPONENT_SRC) \ |
281 -srcdir=$(TOPDIR)-64 \ |
264 -srcdir=$(TOPDIR)-64 \ |
282 -mach64=$(MACH64) ) |
265 -mach64=$(MACH64) ) |
283 test -d $(TOPDIR) || $(MKDIR) $(TOPDIR) |
266 test -d $(TOPDIR) || $(MKDIR) $(TOPDIR) |
284 |
267 |
285 test: $(TEST_32_and_64) |
268 CLEAN_PATHS += $(COMPONENT_SRC)-32 $(COMPONENT_SRC)-64 |
286 |
|
287 system-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED) |
|
288 |
269 |
289 clean:: |
270 clean:: |
290 $(RM) -r $(COMPONENT_SRC) $(COMPONENT_SRC)-32 $(COMPONENT_SRC)-64 |
|
291 $(RM) -f *.sed *.out |
271 $(RM) -f *.sed *.out |
292 |
272 |
293 |
273 |
294 REQUIRED_PACKAGES += system/library |
|
295 REQUIRED_PACKAGES += system/library/c++-runtime |
274 REQUIRED_PACKAGES += system/library/c++-runtime |
296 REQUIRED_PACKAGES += system/library/math |
275 REQUIRED_PACKAGES += system/library/math |