1 #
2 # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 2 along with this work; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
116 ifeq ($(BUILD_FLAVOR), product)
117 FULL_DEBUG_SYMBOLS ?= 1
118 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
119 else
120 # debug variants always get Full Debug Symbols (if available)
121 ENABLE_FULL_DEBUG_SYMBOLS = 1
122 endif
123 _JUNK_ := $(shell \
124 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
125 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
126
127 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
128 # Default OBJCOPY comes from the SUNWbinutils package:
129 DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
130 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
131 ifneq ($(ALT_OBJCOPY),)
132 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
133 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
134 endif
135
136 ifeq ($(OBJCOPY),)
137 _JUNK_ := $(shell \
138 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
139 ENABLE_FULL_DEBUG_SYMBOLS=0
140 _JUNK_ := $(shell \
141 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
142 else
143 _JUNK_ := $(shell \
144 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
145
146 # Library stripping policies for .debuginfo configs:
147 # all_strip - strips everything from the library
148 # min_strip - strips most stuff from the library; leaves minimum symbols
149 # no_strip - does not strip the library at all
150 #
151 # Oracle security policy requires "all_strip". A waiver was granted on
152 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
153 #
154 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
155 #
|
1 #
2 # Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 2 along with this work; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
116 ifeq ($(BUILD_FLAVOR), product)
117 FULL_DEBUG_SYMBOLS ?= 1
118 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
119 else
120 # debug variants always get Full Debug Symbols (if available)
121 ENABLE_FULL_DEBUG_SYMBOLS = 1
122 endif
123 _JUNK_ := $(shell \
124 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
125 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
126
127 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
128 # Default OBJCOPY comes from the SUNWbinutils package:
129 DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
130 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
131 ifneq ($(ALT_OBJCOPY),)
132 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
133 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
134 endif
135
136 ifneq ($(OBJCOPY),)
137 # OBJCOPY version check:
138 # - version number is last blank separate word on first line
139 # - version number formats that have been seen:
140 # - <major>.<minor>
141 # - <major>.<minor>.<micro>
142 #
143 # Full Debug Symbols on Solaris needs version 2.21.1 or newer.
144 #
145 OBJCOPY_VERS_CHK := $(shell \
146 $(OBJCOPY) --version \
147 | sed -n \
148 -e 's/.* //' \
149 -e '/^[01]\./b bad' \
150 -e '/^2\./{' \
151 -e ' s/^2\.//' \
152 -e ' /^[0-9]$$/b bad' \
153 -e ' /^[0-9]\./b bad' \
154 -e ' /^1[0-9]$$/b bad' \
155 -e ' /^1[0-9]\./b bad' \
156 -e ' /^20\./b bad' \
157 -e ' /^21\.0$$/b bad' \
158 -e ' /^21\.0\./b bad' \
159 -e '}' \
160 -e ':good' \
161 -e 's/.*/VALID_VERSION/p' \
162 -e 'q' \
163 -e ':bad' \
164 -e 's/.*/BAD_VERSION/p' \
165 -e 'q' \
166 )
167 ifeq ($(OBJCOPY_VERS_CHK),BAD_VERSION)
168 _JUNK_ := $(shell \
169 echo >&2 "WARNING: $(OBJCOPY) --version info:"; \
170 $(OBJCOPY) --version | sed -n -e 's/^/WARNING: /p' -e 'q' >&2; \
171 echo >&2 "WARNING: an objcopy version of 2.21.1 or newer" \
172 "is needed to create valid .debuginfo files."; \
173 echo >&2 "WARNING: ignoring above objcopy command."; \
174 echo >&2 "WARNING: patch 149063-01 or newer contains the" \
175 "correct Solaris 10 SPARC version."; \
176 echo >&2 "WARNING: patch 149064-01 or newer contains the" \
177 "correct Solaris 10 X86 version."; \
178 echo >&2 "WARNING: Solaris 11 Update 1 contains the" \
179 "correct version."; \
180 )
181 OBJCOPY=
182 endif
183 endif
184
185 ifeq ($(OBJCOPY),)
186 _JUNK_ := $(shell \
187 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
188 ENABLE_FULL_DEBUG_SYMBOLS=0
189 _JUNK_ := $(shell \
190 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
191 else
192 _JUNK_ := $(shell \
193 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
194
195 # Library stripping policies for .debuginfo configs:
196 # all_strip - strips everything from the library
197 # min_strip - strips most stuff from the library; leaves minimum symbols
198 # no_strip - does not strip the library at all
199 #
200 # Oracle security policy requires "all_strip". A waiver was granted on
201 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
202 #
203 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
204 #
|