fritzkink
2023-12-27 706019354bab81fc3f01995caf1ae1a2dfa346cf
commit | author | age
9c75c0 1 #
NJ 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 #
0b8dd9 21 # Copyright 2017,2022 Gary Mills
0b2b25 22 # Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
9c75c0 23 #
NJ 24
7e1000 25 # These symbols should be used in component Makefiles
GM 26 # whenever PATH is to be defined there:
f627ef 27 #     PATH = $(PATH.illumos)
7e1000 28 #     PATH = $(PATH.gnu)
259be2 29 PATH.illumos =    $(subst $(space),:,$(strip $(PATH.prepend))):$(USRBINDIR$(BITS)):$(USRBINDIR):$(GNUBIN):$(USRSBINDIR$(BITS)):$(USRSBINDIR)
MT 30 PATH.gnu =    $(subst $(space),:,$(strip $(PATH.prepend))):$(GNUBIN):$(USRBINDIR$(BITS)):$(USRBINDIR):$(USRSBINDIR$(BITS)):$(USRSBINDIR)
7e1000 31
GM 32 # Default PATH
f627ef 33 PATH = $(PATH.illumos)
a325d4 34
b643a2 35 # The location of an internal mirror of community source archives that we build
NJ 36 # in this gate.  This mirror has been seeded to include "custom" source archives
37 # for a few components where the communities either no longer provide matching
38 # source archives or we have changes that aren't reflected in their archives or
39 # anywhere else.
58c0dd 40 #INTERNAL_ARCHIVE_MIRROR =    http://userland.us.oracle.com/source-archives
b643a2 41
NJ 42 # The location of an external mirror of community source archives that we build
43 # in this gate.  The external mirror is a replica of the internal mirror.
58c0dd 44 #EXTERNAL_ARCHIVE_MIRROR = \
AS 45 #    http://static.opensolaris.org/action/browse/userland/tarball/userland
b643a2 46
7076c9 47 DLC_ARCHIVE_MIRROR = https://dlc.openindiana.org/oi-userland/source-archives
58825e 48
b643a2 49 # Default to looking for source archives on the internal mirror and the external
NJ 50 # mirror before we hammer on the community source archive repositories.
0de8ff 51 #export DOWNLOAD_SEARCH_PATH +=    $(INTERNAL_ARCHIVE_MIRROR)
JT 52 #export DOWNLOAD_SEARCH_PATH +=    $(EXTERNAL_ARCHIVE_MIRROR)
9aea33 53
58825e 54 # Look for file at DLC server as last resort
AP 55 export DOWNLOAD_FALLBACK_PATH =  $(DLC_ARCHIVE_MIRROR)
56
9aea33 57 # The workspace starts at the mercurial root
5ada66 58 ifeq ($(origin WS_TOP), undefined)
58c0dd 59 export WS_TOP := \
974add 60     $(shell git rev-parse --show-toplevel || hg root 2>/dev/null)
5ada66 61 endif
9aea33 62
4e1558 63 USERLAND_ARCHIVES ?=    $(WS_TOP)/archives/
10a7de 64 WS_MACH =       $(WS_TOP)/$(MACH)
AP 65 WS_LOGS =       $(WS_MACH)/logs
66 WS_REPO =       $(WS_MACH)/repo
67 WS_TOOLS =      $(WS_TOP)/tools
68 WS_MAKE_RULES = $(WS_TOP)/make-rules
69 WS_COMPONENTS = $(WS_TOP)/components
70 WS_LICENSES =   $(WS_TOP)/licenses
71 WS_INCORPORATIONS =     $(WS_TOP)/incorporations
72 WS_LINT_CACHE = $(WS_MACH)/pkglint-cache
4cfb92 73
5c422f 74 # we want our pkg piplines to fail if there is an error
MS 75 # (like if pkgdepend fails in the middle of a pipe), but
76 # we don't want the builds or ./configure's failing as well.
77 # so we only set pipefail for the publish target and have
78 # to reset it for the others since they might be invoked
79 # as dependencies of publish.
80 export SHELLOPTS
81 build:        SHELLOPTS=
82 test:        SHELLOPTS=
83 install:    SHELLOPTS=
84 publish:    SHELLOPTS=pipefail
85
b602c5 86 SHELL=    /bin/bash
MS 87
1f9ba4 88 # This can be overridden to avoid rebuilding when you touch a Makefile
AP 89 MAKEFILE_PREREQ =    Makefile
90
9c75c0 91 CONSOLIDATION =    userland
d05a6f 92 PUBLISHER ?=    $(CONSOLIDATION)
c4768d 93 PUBLISHER_LOCALIZABLE ?=    $(CONSOLIDATION)-localizable
6514ee 94
1e5ead 95 # Defines $(space) as a single blank space, so we can use it to convert
AP 96 # space-separated paths to colon-separated paths in variables with
97 # $(subst $(space),:,$(strip $(SPATHS)))
98 empty :=
99 space := $(empty) $(empty)
100
3dc823 101 ROOT =            /
NJ 102
e95eac 103 # Distribution name and version
AP 104 # Note, this determines /etc/release file contents.
105 # Some OI-specific software (like slim installer or openindiana-welcome) 
106 # currently rely on format of first line in this file
107 # to determine the distribution version
108 # (it should look like OpenIndiana Hipster YYYY.MM).
109 DISTRIBUTION_NAME = OpenIndiana Hipster
5e080f 110 DISTRIBUTION_VERSION = 2023.10
097eb5 111 # Native OS version
5ada66 112 OS_VERSION :=        $(shell uname -r)
6514ee 113 SOLARIS_VERSION =    $(OS_VERSION:5.%=2.%)
097eb5 114 # Target OS version
52d240 115 PKG_SOLARIS_VERSION ?= 5.11
5b4e5c 116 PKG_OS_VERSION ?= 0.$(PKG_SOLARIS_VERSION)
e7f82d 117 # auto-conf-y platform
RL 118 i386_PLAT = pc
119 sparc_PLAT = sun
120 PLAT=$($(MACH)_PLAT)
8dc1cb 121 # For pre-gcc-9 the triplet matches the legacy definition
e7f82d 122 GNU_TRIPLET=$(MACH)-$(PLAT)-solaris$(SOLARIS_VERSION)
9c75c0 123
4cfb92 124 include $(WS_MAKE_RULES)/ips-buildinfo.mk
3dc823 125
2eec07 126 COMPILER =        gcc
72a528 127 LINKER =        gcc
0b2b25 128
262335 129 # The value of BITS is set automatically during the build process to either 32
MT 130 # or 64 as needed.
131
132 # This macro makes it possible to determine which components are only built
133 # 64-bit (default) and allow other make-rules files to adjust accordingly.
134 # Possible values are: '32', '64', '32_and_64', '64_and_32', and 'NO_ARCH' (the
135 # orderings specify build preference).
136 BUILD_BITS ?= 64
0b2b25 137
AL 138 # Based on BUILD_BITS, determine which binaries are preferred for a build.
139 # This macro is for the convenience of other make-rules files and should not be
140 # overridden by developers.
141 ifeq ($(strip $(BUILD_BITS)),64)
142 PREFERRED_BITS=64
143 endif
472377 144 # Now we prefer 64-bit
0b2b25 145 ifeq ($(strip $(BUILD_BITS)),64_and_32)
472377 146 PREFERRED_BITS=64
0b2b25 147 endif
AL 148 PREFERRED_BITS ?= 32
149
150 # Map target build to macro/variable naming conventions.  This macro is for the
151 # convenience of other make-rules files and should not be overridden by
152 # developers.
153 ifeq ($(BUILD_BITS),64_and_32)
154 MK_BITS=32_and_64
155 else
156 MK_BITS=$(strip $(BUILD_BITS))
157 endif
158
5874ab 159 #
MT 160 # Upstream support for Python is by default 5 years after the first release.
161 # We will start to obsolete Python versions according the following table:
162 #
163 # +----------------+----------------+
164 # | Python version | Obsolete after |
165 # +----------------+----------------+
166 # |      3.9       |   2025-10      |
167 # +----------------+----------------+
168 #
169 # See https://devguide.python.org/versions/
170 #
171
c72011 172 PYTHON_VERSION = 3.9
5874ab 173 PYTHON_VERSIONS = 3.9
9c75c0 174
c72011 175 # These variables are for backward compatibility only.  Components should stop
MT 176 # to use them.  Once they do so these vars should be removed.
177 PYTHON3_VERSION    = $(PYTHON_VERSION)
178 PYTHON3_VERSIONS = $(PYTHON_VERSIONS)
73db53 179 PYTHON3_RUNTIME_PKG = runtime/python-$(subst .,,$(PYTHON3_VERSION))
c72011 180 PYTHON_ALL_VERSIONS = $(PYTHON_VERSIONS)
MT 181 PYTHON_VERSIONS_ALL= $(PYTHON_VERSIONS)
73db53 182
0be775 183 # Python up to 2.7 was built both 32-bit and 64-bit.  Starting with Python 3.x
c72011 184 # the python package is built 64-bit only.  So now all PYTHON_VERSIONS are
0be775 185 # 64-bit only.
c72011 186 PYTHON_64_ONLY_VERSIONS = $(PYTHON_VERSIONS)
e45ea2 187
053684 188 # List of python versions we are currently obsoleting.  We no longer build any
MT 189 # packages for these python versions, but there still might be hanging some not
190 # obsoleted yet versioned packages built for PYTHON_VERSIONS_OBSOLETING python
191 # versions.  Or there is just the versioned runtime/python package still
192 # available.
193 #
194 # This list should be usually empty.  Intersection of
195 # PYTHON_VERSIONS_OBSOLETING and PYTHON_VERSIONS lists MUST be always empty.
5874ab 196 PYTHON_VERSIONS_OBSOLETING = 2.7 3.5 3.7
053684 197
e5ce0b 198 # PYTHON3_SOABI variable defines the naming scheme
AP 199 # of python3 extension libraries: cpython or abi3.
200 # Currently, most of the components use cpython naming scheme by default,
201 # only python/xattr and python/cryptography require abi3 naming.
202 PYTHON3_SOABI ?= cpython
203 ifeq ($(PYTHON3_SOABI),cpython)
b7829f 204 PY3_CPYTHON_NAMING=
e5ce0b 205 PY3_ABI3_NAMING=\#
AP 206 else ifeq ($(PYTHON3_SOABI),abi3)
b7829f 207 PY3_CPYTHON_NAMING=\#
e5ce0b 208 PY3_ABI3_NAMING=
AP 209 else
210 $(error "Invalid python naming scheme '$(PYTHON3_SOABI)' selected!")
211 endif
212
79b849 213 BASS_O_MATIC =    $(WS_TOOLS)/bass-o-matic
NJ 214
81cc19 215 CLONEY =    $(WS_TOOLS)/cloney
MS 216
b73714 217 CONFIG_SHELL =    /bin/bash
CM 218
79b849 219 PKG_REPO =    file:$(WS_REPO)
74300c 220
72621a 221 COMPONENT =        $(COMPONENT_DIR:$(WS_TOP)/components/%=%)
d4c8f7 222 HUMAN_VERSION ?=    $(COMPONENT_VERSION)
a93d79 223 COMPONENT_SRC_NAME =    $(COMPONENT_NAME)
RB 224
fd5ab5 225 COMPONENT_LICENSE_FILE ?= $(COMPONENT_NAME).license
226
5ada66 227 COMPONENT_DIR :=    $(shell pwd)
818f75 228 SOURCE_DIR =    $(COMPONENT_DIR)/$(COMPONENT_SRC)
c843eb 229 BUILD_DIR =    $(COMPONENT_DIR)/build
74300c 230 PROTO_DIR =    $(BUILD_DIR)/prototype/$(MACH)
9c75c0 231
9e2024 232 ARCHLIBSUBDIR32    =
637cb6 233 ARCHLIBSUBDIR64    = $(MACH64)
AL 234 ARCHLIBSUBDIR    = $(ARCHLIBSUBDIR$(BITS))
235
38e5af 236 ETCDIR =    /etc
4f8cfa 237 USRDIR =    /usr
MS 238 BINDIR =    /bin
f685ac 239 SBINDIR =    /sbin
4f8cfa 240 LIBDIR =    /lib
ffaa30 241 VARDIR =    /var
AL 242 KERNELDRVDIR =    /kernel/drv
0d49ff 243 KERNELDRVDIR32 =/kernel/drv
ffaa30 244 KERNELDRVDIR64 =/kernel/drv/$(MACH64)
0f426d 245 USRBINDIR =     $(USRDIR)/bin
724840 246 USRBINDIR32 =    $(USRDIR)/bin/$(MACH32)
2cda1c 247 USRBINDIR64 =    $(USRDIR)/bin/$(MACH64)
0f426d 248 USRSBINDIR =     $(USRDIR)/sbin
724840 249 USRSBINDIR32 =    $(USRDIR)/sbin/$(MACH32)
AL 250 USRSBINDIR64 =    $(USRDIR)/sbin/$(MACH64)
f540dc 251 USRLIBDIR =     $(USRDIR)/lib
JK 252 USRLIBDIR32 =    $(USRDIR)/lib
ffaa30 253 USRLIBDIR64 =    $(USRDIR)/lib/$(MACH64)
4f8cfa 254 USRSHAREDIR =    $(USRDIR)/share
0f426d 255 USRINCDIR =     $(USRDIR)/include
f685ac 256 USRSHARELOCALEDIR =    $(USRSHAREDIR)/locale
4f8cfa 257 USRSHAREMANDIR =    $(USRSHAREDIR)/man
8a614a 258 USRSHAREDOCDIR =    $(USRSHAREDIR)/doc
93837d 259 USRSHARELIBDIR =    $(USRSHAREDIR)/lib
4f8cfa 260 USRSHAREMAN1DIR =    $(USRSHAREMANDIR)/man1
8a614a 261 USRSHAREMAN1MDIR =    $(USRSHAREMANDIR)/man1m
4f8cfa 262 USRSHAREMAN3DIR =    $(USRSHAREMANDIR)/man3
f1282e 263 USRSHAREMAN4DIR =    $(USRSHAREMANDIR)/man4
5bb235 264 USRSHAREMAN5DIR =    $(USRSHAREMANDIR)/man5
ca81f7 265 USRSHAREMAN7DIR =    $(USRSHAREMANDIR)/man7
cb0963 266 USRSHAREMAN8DIR =    $(USRSHAREMANDIR)/man8
ffaa30 267 USRKERNELDRVDIR =    $(USRDIR)/kernel/drv
0d49ff 268 USRKERNELDRVDIR32 =    $(USRDIR)/kernel/drv
ffaa30 269 USRKERNELDRVDIR64 =    $(USRDIR)/kernel/drv/$(MACH64)
AL 270
fae1ca 271 # The *.$(BITS) variables are different from those above (better suited for
JK 272 # isaexec wrapper), and allow for default 32-bit vs. nondefault 64-bit setups
273 USRBINDIR.32 =     $(USRBINDIR)
274 USRBINDIR.64 =     $(USRBINDIR64)
275 USRSBINDIR.32 =    $(USRSBINDIR)
276 USRSBINDIR.64 =    $(USRSBINDIR64)
277 USRLIBDIR.32 =     $(USRLIBDIR)
278 USRLIBDIR.64 =     $(USRLIBDIR64)
279
38e5af 280 PROTOETCDIR =    $(PROTO_DIR)/$(ETCDIR)
8a614a 281 PROTOETCSECDIR = $(PROTO_DIR)/$(ETCDIR)/security
4f8cfa 282 PROTOUSRDIR =    $(PROTO_DIR)/$(USRDIR)
ffaa30 283 PROTOBINDIR =    $(PROTO_DIR)/$(BINDIR)
AL 284 PROTOSBINDIR =    $(PROTO_DIR)/$(SBINDIR)
8a614a 285 PROTOLIBDIR =    $(PROTO_DIR)/$(LIBDIR)
ffaa30 286 PROTOVARDIR =    $(PROTO_DIR)/$(VARDIR)
0d49ff 287 PROTOKERNELDRVDIR =      $(PROTO_DIR)/$(KERNELDRVDIR)
JK 288 PROTOKERNELDRVDIR32 =    $(PROTO_DIR)/$(KERNELDRVDIR32)
ffaa30 289 PROTOKERNELDRVDIR64 =    $(PROTO_DIR)/$(KERNELDRVDIR64)
4f8cfa 290 PROTOUSRBINDIR =    $(PROTO_DIR)/$(USRBINDIR)
724840 291 PROTOUSRBINDIR32 =    $(PROTO_DIR)/$(USRBINDIR32)
2cda1c 292 PROTOUSRBINDIR64 =    $(PROTO_DIR)/$(USRBINDIR64)
8a614a 293 PROTOUSRSBINDIR =    $(PROTO_DIR)/$(USRSBINDIR)
724840 294 PROTOUSRSBINDIR32 =    $(PROTO_DIR)/$(USRSBINDIR32)
AL 295 PROTOUSRSBINDIR64 =    $(PROTO_DIR)/$(USRSBINDIR64)
4f8cfa 296 PROTOUSRLIBDIR =    $(PROTO_DIR)/$(USRLIBDIR)
f540dc 297 PROTOUSRLIBDIR32 =    $(PROTO_DIR)/$(USRLIBDIR32)
4f8cfa 298 PROTOUSRLIBDIR64 =    $(PROTO_DIR)/$(USRLIBDIR64)
f685ac 299 PROTOUSRINCDIR =    $(PROTO_DIR)/$(USRINCDIR)
4f8cfa 300 PROTOUSRSHAREDIR =    $(PROTO_DIR)/$(USRSHAREDIR)
93837d 301 PROTOUSRSHARELIBDIR =    $(PROTO_DIR)/$(USRSHARELIBDIR)
4f8cfa 302 PROTOUSRSHAREMANDIR =    $(PROTO_DIR)/$(USRSHAREMANDIR)
8a614a 303 PROTOUSRSHAREDOCDIR =    $(PROTO_DIR)/$(USRSHAREDOCDIR)
4f8cfa 304 PROTOUSRSHAREMAN1DIR =    $(PROTO_DIR)/$(USRSHAREMAN1DIR)
8a614a 305 PROTOUSRSHAREMAN1MDIR =    $(PROTO_DIR)/$(USRSHAREMAN1MDIR)
4f8cfa 306 PROTOUSRSHAREMAN3DIR =    $(PROTO_DIR)/$(USRSHAREMAN3DIR)
f1282e 307 PROTOUSRSHAREMAN4DIR =    $(PROTO_DIR)/$(USRSHAREMAN4DIR)
CM 308 PROTOUSRSHAREMAN5DIR =    $(PROTO_DIR)/$(USRSHAREMAN5DIR)
cb0963 309 PROTOUSRSHAREMAN8DIR =    $(PROTO_DIR)/$(USRSHAREMAN8DIR)
f685ac 310 PROTOUSRSHARELOCALEDIR =    $(PROTO_DIR)/$(USRSHARELOCALEDIR)
0d49ff 311 PROTOUSRKERNELDRVDIR =      $(PROTO_DIR)/$(USRKERNELDRVDIR)
JK 312 PROTOUSRKERNELDRVDIR32 =    $(PROTO_DIR)/$(USRKERNELDRVDIR32)
ffaa30 313 PROTOUSRKERNELDRVDIR64 =    $(PROTO_DIR)/$(USRKERNELDRVDIR64)
4f8cfa 314
fae1ca 315 PROTOUSRBINDIR.32 =     $(PROTOUSRBINDIR)
JK 316 PROTOUSRBINDIR.64 =     $(PROTOUSRBINDIR64)
317 PROTOUSRSBINDIR.32 =    $(PROTOUSRSBINDIR)
318 PROTOUSRSBINDIR.64 =    $(PROTOUSRSBINDIR64)
319 PROTOUSRLIBDIR.32 =     $(PROTOUSRLIBDIR)
320 PROTOUSRLIBDIR.64 =     $(PROTOUSRLIBDIR64)
4f8cfa 321
b728c5 322 # NOTE: We do not build SFW contents
JK 323 # /usr/sfw/bin is just a historic artefact, containing symlinks
3d7f8d 324 SFWBIN =    /usr/sfw/bin
b728c5 325 SFWBIN32 =    $(SFWBIN)
JK 326 SFWBIN64 =    $(SFWBIN)/$(MACH64)
327 SFWSBIN =    /usr/sfw/sbin
328 SFWSBIN32 =    $(SFWSBIN)
329 SFWSBIN64 =    $(SFWSBIN)/$(MACH64)
f685ac 330 SFWINCLUDE =    /usr/sfw/include
3d7f8d 331 SFWLIB =    /usr/sfw/lib
b728c5 332 SFWLIB32 =    $(SFWLIB)
JK 333 SFWLIB64 =    $(SFWLIB)/$(MACH64)
1932c6 334 SFWSHARE =    /usr/sfw/share
b728c5 335 SFWSHAREMAN =    $(SFWSHARE)/man
JK 336 SFWSHAREMAN1 =    $(SFWSHAREMAN)/man1
337 PROTOSFWBIN =       $(PROTO_DIR)/$(SFWBIN)
338 PROTOSFWBIN32 =     $(PROTO_DIR)/$(SFWBIN32)
339 PROTOSFWBIN64 =     $(PROTO_DIR)/$(SFWBIN64)
340 PROTOSFWSBIN =      $(PROTO_DIR)/$(SFWSBIN)
341 PROTOSFWSBIN32 =    $(PROTO_DIR)/$(SFWSBIN32)
342 PROTOSFWSBIN64 =    $(PROTO_DIR)/$(SFWSBIN64)
3d7f8d 343 PROTOSFWLIB =    $(PROTO_DIR)/$(SFWLIB)
b728c5 344 PROTOSFWLIB32 =    $(PROTO_DIR)/$(SFWLIB32)
d92147 345 PROTOSFWLIB64 =    $(PROTO_DIR)/$(SFWLIB64)
1932c6 346 PROTOSFWSHARE =    $(PROTO_DIR)/$(SFWSHARE)
MS 347 PROTOSFWSHAREMAN =    $(PROTO_DIR)/$(SFWSHAREMAN)
348 PROTOSFWSHAREMAN1 =    $(PROTO_DIR)/$(SFWSHAREMAN1)
f685ac 349 PROTOSFWINCLUDE =    $(PROTO_DIR)/$(SFWINCLUDE)
1932c6 350
b728c5 351 # The *.$(BITS) variables are different from those above (better suited for
JK 352 # isaexec wrapper), and allow for default 32-bit vs. nondefault 64-bit setups
353 SFWBIN.32 =     $(SFWBIN)
354 SFWBIN.64 =     $(SFWBIN64)
355 SFWSBIN.32 =    $(SFWSBIN)
356 SFWSBIN.64 =    $(SFWSBIN64)
357 SFWLIB.32 =     $(SFWLIB)
358 SFWLIB.64 =     $(SFWLIB64)
359 PROTOSFWBIN.32 =    $(PROTOSFWBIN)
360 PROTOSFWBIN.64 =    $(PROTOSFWBIN64)
361 PROTOSFWSBIN.32 =    $(PROTOSFWSBIN)
362 PROTOSFWSBIN.64 =    $(PROTOSFWSBIN64)
363 PROTOSFWLIB.32 =    $(PROTOSFWLIB)
364 PROTOSFWLIB.64 =    $(PROTOSFWLIB64)
365
8a52c2 366 CLDIR =    /usr/share/common-lisp
J'S 367 PROTOCLDIR =    $(PROTO_DIR)/$(CLDIR)
368
449120 369 GNUDIR =    /usr/gnu
AL 370 GNUBIN =    $(GNUDIR)/bin
b323a7 371 GNUBIN32 =    $(GNUBIN)/$(MACH32)
JK 372 GNUBIN64 =    $(GNUBIN)/$(MACH64)
449120 373 GNUSBIN =    $(GNUDIR)/sbin
b323a7 374 GNUSBIN32 =    $(GNUSBIN)/$(MACH32)
JK 375 GNUSBIN64 =    $(GNUSBIN)/$(MACH64)
449120 376 GNULIB =    $(GNUDIR)/lib
b323a7 377 GNULIB32 =    $(GNULIB)
JK 378 GNULIB64 =    $(GNULIB)/$(MACH64)
449120 379 GNUSHARE =    $(GNUDIR)/share
b323a7 380 GNUSHAREMAN =    $(GNUSHARE)/man
JK 381 GNUSHAREMAN1 =    $(GNUSHAREMAN)/man1
382 PROTOGNUBIN =       $(PROTO_DIR)/$(GNUBIN)
383 PROTOGNUBIN32 =     $(PROTO_DIR)/$(GNUBIN32)
384 PROTOGNUBIN64 =     $(PROTO_DIR)/$(GNUBIN64)
385 PROTOGNUSBIN =      $(PROTO_DIR)/$(GNUSBIN)
386 PROTOGNUSBIN32 =    $(PROTO_DIR)/$(GNUSBIN32)
387 PROTOGNUSBIN64 =    $(PROTO_DIR)/$(GNUSBIN64)
388 PROTOGNULIB =       $(PROTO_DIR)/$(GNULIB)
389 PROTOGNULIB32 =     $(PROTO_DIR)/$(GNULIB32)
390 PROTOGNULIB64 =     $(PROTO_DIR)/$(GNULIB64)
391 PROTOGNUSHARE =     $(PROTO_DIR)/$(GNUSHARE)
1932c6 392 PROTOGNUSHAREMAN =    $(PROTO_DIR)/$(GNUSHAREMAN)
MS 393 PROTOGNUSHAREMAN1 =    $(PROTO_DIR)/$(GNUSHAREMAN1)
3d7f8d 394
fae1ca 395 # The *.$(BITS) variables are different from those above (better suited for
JK 396 # isaexec wrapper), and allow for default 32-bit vs. nondefault 64-bit setups
397 GNUBIN.32 =     $(GNUBIN)
398 GNUBIN.64 =     $(GNUBIN64)
399 GNUSBIN.32 =    $(GNUSBIN)
400 GNUSBIN.64 =    $(GNUSBIN64)
401 GNULIB.32 =     $(GNULIB)
402 GNULIB.64 =     $(GNULIB64)
403 PROTOGNUBIN.32 =    $(PROTOGNUBIN)
404 PROTOGNUBIN.64 =    $(PROTOGNUBIN64)
405 PROTOGNUSBIN.32 =    $(PROTOGNUSBIN)
406 PROTOGNUSBIN.64 =    $(PROTOGNUSBIN64)
407 PROTOGNULIB.32 =    $(PROTOGNULIB)
408 PROTOGNULIB.64 =    $(PROTOGNULIB64)
409
61c373 410 # work around _TIME, _DATE, embedded date chatter in component builds
NJ 411 # to use, set TIME_CONSTANT in the component Makefile and add $(CONSTANT_TIME)
412 # to the appropriate {CONFIGURE|BUILD|INSTALL}_ENV
79b849 413 CONSTANT_TIME =        LD_PRELOAD_32=$(WS_TOOLS)/time-$(MACH32).so
NJ 414 CONSTANT_TIME +=    LD_PRELOAD_64=$(WS_TOOLS)/time-$(MACH64).so
61c373 415 CONSTANT_TIME +=    TIME_CONSTANT=$(TIME_CONSTANT)
80b1b4 416
15328e 417 # List known architectures
AL 418 MACH_LIST = sparc i386
419
5d461f 420 # set MACH from uname -p to either sparc or i386
5ada66 421 MACH :=        $(shell uname -p)
5d461f 422
NJ 423 # set MACH32 from MACH to either sparcv7 or i86
424 MACH32_1 =    $(MACH:sparc=sparcv7)
425 MACH32 =    $(MACH32_1:i386=i86)
426
427 # set MACH64 from MACH to either sparcv9 or amd64
428 MACH64_1 =    $(MACH:sparc=sparcv9)
429 MACH64 =    $(MACH64_1:i386=amd64)
430
f1a511 431 CONFIGURE_NO_ARCH =    $(BUILD_DIR_NO_ARCH)/.configured
c2319a 432 CONFIGURE_32 =        $(BUILD_DIR_32)/.configured
BC 433 CONFIGURE_64 =        $(BUILD_DIR_64)/.configured
434
115d4d 435 # In ideal world all components should support parallel build but it is often
MT 436 # not the case.  So by default we do not run parallel build and allow
437 # components to opt-in for parallel build by setting USE_PARALLEL_BUILD = yes
438 # before the shared-macros.mk file is included.
439 PARALLEL_JOBS ?= 8
440 ifeq ($(strip $(USE_PARALLEL_BUILD)),yes)
441 COMPONENT_BUILD_GMAKE_ARGS += -j$(PARALLEL_JOBS)
442 COMPONENT_BUILD_SETUP_PY_ARGS += -j$(PARALLEL_JOBS)
443 endif
444
f1a511 445 BUILD_DIR_NO_ARCH =    $(BUILD_DIR)/$(MACH)
4f8cfa 446 BUILD_DIR_32 =        $(BUILD_DIR)/$(MACH32)
MS 447 BUILD_DIR_64 =        $(BUILD_DIR)/$(MACH64)
448
f1a511 449 BUILD_NO_ARCH =        $(BUILD_DIR_NO_ARCH)/.built
4f8cfa 450 BUILD_32 =        $(BUILD_DIR_32)/.built
MS 451 BUILD_64 =        $(BUILD_DIR_64)/.built
5d461f 452 BUILD_32_and_64 =    $(BUILD_32) $(BUILD_64)
f1a511 453 $(BUILD_DIR_NO_ARCH)/.built:    BITS=32
4158c0 454 $(BUILD_DIR_32)/.built:        BITS=32
NJ 455 $(BUILD_DIR_64)/.built:        BITS=64
5d461f 456
f1a511 457 INSTALL_NO_ARCH =    $(BUILD_DIR_NO_ARCH)/.installed
4f8cfa 458 INSTALL_32 =        $(BUILD_DIR_32)/.installed
MS 459 INSTALL_64 =        $(BUILD_DIR_64)/.installed
5d461f 460 INSTALL_32_and_64 =    $(INSTALL_32) $(INSTALL_64)
a7cc57 461 $(BUILD_DIR_32)/.installed:       BITS=32
AC 462 $(BUILD_DIR_64)/.installed:       BITS=64
4158c0 463
NJ 464 # set the default target for installation of the component
465 COMPONENT_INSTALL_TARGETS =    install
9c75c0 466
237543 467 # set the default build test results directory
AP 468 COMPONENT_TEST_BUILD_DIR =    $(BUILD_DIR)/test/$(MACH$(BITS))
469
470 # set the default master test results directory
8d70f8 471 COMPONENT_TEST_RESULTS_DIR =    $(COMPONENT_DIR)/test
RB 472
473 # set the default master test results file
9afa19 474 USE_COMMON_TEST_MASTER ?= yes
7bf8b3 475 ifeq ($(strip $(USE_COMMON_TEST_MASTER)),yes)
AL 476 COMPONENT_TEST_MASTER =        $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
477 else
8d70f8 478 COMPONENT_TEST_MASTER =        $(COMPONENT_TEST_RESULTS_DIR)/results-$(BITS).master
7bf8b3 479 endif
8d70f8 480
RB 481 # set the default test results output file
237543 482 COMPONENT_TEST_OUTPUT =        $(COMPONENT_TEST_BUILD_DIR)/test-$(BITS)-results
8d70f8 483
RB 484 # set the default test results comparison diffs file
237543 485 COMPONENT_TEST_DIFFS =        $(COMPONENT_TEST_BUILD_DIR)/test-$(BITS)-diffs
8d70f8 486
RB 487 # set the default test snapshot file
237543 488 COMPONENT_TEST_SNAPSHOT =    $(COMPONENT_TEST_BUILD_DIR)/results-$(BITS).snapshot
AP 489
490 # Normally $(GSED) is simplest, but some results files need more power.
491 COMPONENT_TEST_TRANSFORMER =    $(GSED)
8d70f8 492
RB 493 # The set of default transforms to be applied to the test results to try
494 # to normalize them.
495 COMPONENT_TEST_TRANSFORMS = \
496     '-e "s|$(@D)|\\$$(@D)|g" ' \
497     '-e "s|$(PERL)|\\$$(PERL)|g" ' \
34664f 498     '-e "s|$(PYTHON)|\\$$(PYTHON)|g" ' \
8d70f8 499     '-e "s|$(SOURCE_DIR)|\\$$(SOURCE_DIR)|g" '
658ea7 500 COMPONENT_TEST_TRANSFORMS +=    "-e 's|$(PROTO_DIR)|\$$(PROTO_DIR)|g'"
MT 501 COMPONENT_TEST_TRANSFORMS +=    "-e 's|$(BUILD_DIR)|\$$(BUILD_DIR)|g'"
8d70f8 502
RB 503 # set the default commands used to generate the file containing the set
504 # of transforms to be applied to the test results to try to normalize them.
505 COMPONENT_TEST_CREATE_TRANSFORMS = \
347810 506     print "\#!/bin/sh" > $(COMPONENT_TEST_TRANSFORM_CMD); \
27b18a 507     print '$(CAT) $(COMPONENT_TEST_OUTPUT) | \\' \
MT 508         >> $(COMPONENT_TEST_TRANSFORM_CMD); \
347810 509     print '$(COMPONENT_TEST_TRANSFORMER) ' \
MT 510         $(COMPONENT_TEST_TRANSFORMS) \
511         ' \\' >> $(COMPONENT_TEST_TRANSFORM_CMD); \
512     print '> $(COMPONENT_TEST_SNAPSHOT)' \
513         >> $(COMPONENT_TEST_TRANSFORM_CMD); \
8d70f8 514
RB 515 # set the default command for performing any test result munging
237543 516 COMPONENT_TEST_TRANSFORM_CMD =    $(COMPONENT_TEST_BUILD_DIR)/transform-$(BITS)-results
8d70f8 517
RB 518 # set the default operation to run to perform test result normalization
519 COMPONENT_TEST_PERFORM_TRANSFORM = \
347810 520     $(SHELL) $(COMPONENT_TEST_TRANSFORM_CMD); \
8d70f8 521
RB 522 # set the default command used to compare the master results with the snapshot
61a572 523 COMPONENT_TEST_COMPARE_CMD =    $(GDIFF) -uNb
8d70f8 524
RB 525 # set the default way that master and snapshot test results are compared
526 COMPONENT_TEST_COMPARE = \
347810 527     [ -e $(COMPONENT_TEST_MASTER) ] || exit 1; \
MT 528     $(COMPONENT_TEST_COMPARE_CMD) \
529         $(COMPONENT_TEST_MASTER) $(COMPONENT_TEST_SNAPSHOT) \
530         > $(COMPONENT_TEST_DIFFS); \
531     print "Test results in $(COMPONENT_TEST_OUTPUT)"; \
532     if [ -s $(COMPONENT_TEST_DIFFS) ]; \
8d70f8 533     then \
347810 534         print "Differences found."; \
MT 535         $(CAT) $(COMPONENT_TEST_DIFFS); \
536         exit 2; \
537     else \
538         print "No differences found."; \
8d70f8 539     fi
RB 540
541 # set the default env command to use for test of the component
542 COMPONENT_TEST_ENV_CMD =    $(ENV)
543
544 # set the default command to use for test of the component
545 COMPONENT_TEST_CMD =    $(GMAKE)
4158c0 546
NJ 547 # set the default target for test of the component
548 COMPONENT_TEST_TARGETS =    check
35a012 549
702558 550 # set the default directory for test of the component
AP 551 COMPONENT_TEST_DIR =    $(@D)
8d70f8 552
RB 553 # determine the type of tests we want to run.
554 ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR)/results-*.master)),)
f1a511 555 TEST_NO_ARCH =        $(BUILD_DIR_NO_ARCH)/.tested
8d70f8 556 TEST_32 =        $(BUILD_DIR_32)/.tested
RB 557 TEST_64 =        $(BUILD_DIR_64)/.tested
558 else
f1a511 559 TEST_NO_ARCH =        $(BUILD_DIR_NO_ARCH)/.tested-and-compared
8d70f8 560 TEST_32 =        $(BUILD_DIR_32)/.tested-and-compared
RB 561 TEST_64 =        $(BUILD_DIR_64)/.tested-and-compared
562 endif
563 TEST_32_and_64 =    $(TEST_32) $(TEST_64)
f1a511 564
AL 565 $(BUILD_DIR_NO_ARCH)/.tested-and-compared: BITS=32
8d70f8 566 $(BUILD_DIR_32)/.tested:        BITS=32
RB 567 $(BUILD_DIR_64)/.tested:        BITS=64
568 $(BUILD_DIR_32)/.tested-and-compared:    BITS=32
569 $(BUILD_DIR_64)/.tested-and-compared:    BITS=64
871b03 570
50cda8 571 # BUILD_TOOLS is the root of all tools not normally installed on the system.
617c23 572 BUILD_TOOLS ?=    /opt
50cda8 573
fcf34c 574 #
c5572a 575 # The CCACHE makefile variable should evaluate to empty string or a pathname
JK 576 # like /usr/bin/ccache depending on your PATH value and "which" implementation.
577 # The assignment via ":=" is important, to only do this once in a Makefile,
578 # and not on every reference to the value as "=" assignment would result in.
579 # Review `man ccache` for optional configuration tuning, like cache size etc.
580 #
581 # For production builds or suspected errors you can disable this feature by
582 # setting ENABLE_CCACHE=false (as makefile or environment variable, which
583 # is currently the default) to not even define the usage of wrapper in the
584 # userland-building makefile system.
585 # If you want to speed up your re-builds, you must set ENABLE_CCACHE=true.
fcf34c 586 # For legacy reasons, the CCACHE_DISABLE and CCACHE_NODISABLE variables (from
JK 587 # configuration of the "ccache" program itself) are also supported, but direct
588 # use is discouraged, since their syntax and usage are counter-intuitive.
c5572a 589 #
JK 590 # Still, absence of ccache in PATH is not considered a fatal error since the
591 # build would just proceed well with original compiler.
592 # Note: In code below we fast-track if the makefile CCACHE variable is defined
593 # but fall back to shell executability tests if just envvar CCACHE is passed.
fcf34c 594 #
c5572a 595 export CCACHE := $(shell \
JK 596     if test -n "$(CCACHE)" ; then \
597         echo "$(CCACHE)"; \
598     else \
fcf34c 599         if test x"$${CCACHE_DISABLE-}" != x -o x"$(CCACHE_DISABLE)" != x \
c5572a 600              -o x"$${ENABLE_CCACHE-}" = xfalse -o x"$(ENABLE_CCACHE)" = xfalse \
JK 601         ; then \
602                 echo "NOT USING CCACHE FOR OI-USERLAND because explicitly disabled" >&2 ; \
603         else \
fcf34c 604             if test x"$${CCACHE_NODISABLE-}" != x -o x"$(CCACHE_NODISABLE)" != x \
c5572a 605                  -o x"$${ENABLE_CCACHE-}" = xtrue -o x"$(ENABLE_CCACHE)" = xtrue \
JK 606             ; then \
607                 for F in \
608                     "$$CCACHE" \
609                     `which ccache 2>/dev/null | egrep '^/'` \
610                     /usr/bin/ccache \
611                 ; do if test -n "$$F" && test -x "$$F" ; then \
612                         echo "$$F" ; \
613                         echo "USING CCACHE FOR OI-USERLAND: $$F" >&2 ; \
fcf34c 614                         if test x"$${CCACHE_DISABLE-}" != x ; then \
JK 615                             echo "WARNING: envvar CCACHE_DISABLE is set, so effectively ccache will not act!" >&2 ; \
616                         fi; \
c5572a 617                         exit 0; \
JK 618                     fi; \
619                 done; \
620                 echo "NOT USING CCACHE FOR OI-USERLAND because not found" >&2 ; \
621             fi; \
622         fi; \
623     fi)
624
13aa14 625 GCC_DEFAULT =    13
926f5b 626 GCC_VERSION =    $(GCC_DEFAULT)
6d6808 627 GCC_ROOT =    /usr/gcc/$(GCC_VERSION)
9c75c0 628
e6ade5 629 # Define runtime package names to be used in dependencies
AL 630 GCC_VERSION_MAJOR    = $(shell echo $(GCC_VERSION) | $(GSED) -e 's/\([0-9]\+\)\.[0-9]\+.*/\1/')
631 GCC_RUNTIME_PKG      = system/library/gcc-$(GCC_VERSION_MAJOR)-runtime
632 GXX_RUNTIME_PKG      = system/library/g++-$(GCC_VERSION_MAJOR)-runtime
633 GFORTRAN_RUNTIME_PKG = system/library/gfortran-$(GCC_VERSION_MAJOR)-runtime
634 GOBJC_RUNTIME_PKG    = system/library/gobjc-$(GCC_VERSION_MAJOR)-runtime
635
bd9d92 636 CC.gcc.32 =    $(GCC_ROOT)/bin/gcc
3cec7d 637 CXX.gcc.32 =    $(GCC_ROOT)/bin/g++
dcd7ba 638 F77.gcc.32 =    $(GCC_ROOT)/bin/gfortran
bd9d92 639 FC.gcc.32 =    $(GCC_ROOT)/bin/gfortran
9c75c0 640
bd9d92 641 CC.gcc.64 =    $(GCC_ROOT)/bin/gcc
3cec7d 642 CXX.gcc.64 =    $(GCC_ROOT)/bin/g++
dcd7ba 643 F77.gcc.64 =    $(GCC_ROOT)/bin/gfortran
bd9d92 644 FC.gcc.64 =    $(GCC_ROOT)/bin/gfortran
9c75c0 645
8e5cd8 646 # GCC directory macros
8dc1cb 647 GCC_FULL_VERSION = $(shell $(GCC_ROOT)/bin/gcc -dumpversion)
AL 648 # Since gcc-9 the GNU triplet is x86_64-pc-solaris2.11 instead of i386-pc-solaris2.11
649 GCC_GNU_TRIPLET  = $(shell $(GCC_ROOT)/bin/gcc -dumpmachine)
8e5cd8 650 GCC_BINDIR =    $(GCC_ROOT)/bin
AL 651 GCC_LIBDIR.32 =    $(GCC_ROOT)/lib
652 GCC_LIBDIR.64 =    $(GCC_ROOT)/lib/$(MACH64)
653 GCC_LIBDIR =    $(GCC_LIBDIR.$(BITS))
654 GCC_INCDIR =    $(GCC_ROOT)/include
655 GCC_LIBGCCDIR =    $(GCC_ROOT)/lib/gcc
656 GCC_INCGXXDIR =    $(GCC_ROOT)/include/c++/$(GCC_FULL_VERSION)
259be2 657 PATH.prepend +=    $(GCC_BINDIR)
8e5cd8 658
c5572a 659 ifneq ($(strip $(CCACHE)),)
JK 660
661 CCACHE_WRAP_ROOT   =    $(WS_TOOLS)/ccache-wrap
662 export CC_gcc_32  :=    $(CC.gcc.32)
663 export CC_gcc_64  :=    $(CC.gcc.64)
664 export CXX_gcc_32 :=    $(CXX.gcc.32)
665 export CXX_gcc_64 :=    $(CXX.gcc.64)
666 CC.gcc.32  :=    $(CCACHE_WRAP_ROOT)/CC.gcc.32
667 CC.gcc.64  :=    $(CCACHE_WRAP_ROOT)/CC.gcc.64
668 CXX.gcc.32 :=    $(CCACHE_WRAP_ROOT)/CXX.gcc.32
669 CXX.gcc.64 :=    $(CCACHE_WRAP_ROOT)/CXX.gcc.64
670
671 ifneq ($(strip $(CCACHE_DIR)),)
672 export CCACHE_DIR :=    $(CCACHE_DIR)
673 endif
674
675 ifneq ($(strip $(CCACHE_LOGFILE)),)
676 export CCACHE_LOGFILE :=    $(CCACHE_LOGFILE)
677 endif
678
679 endif
9c75c0 680
61c373 681 LD =        /usr/bin/ld
9c75c0 682
f376b2 683 # Clang definitions (we only have 64 bit clang)
61f685 684 CLANG_DEFAULT =        17
MT 685 CLANG_VERSION =        $(CLANG_DEFAULT)
686 CLANG_FULL_VERSION =    $(CLANG_VERSION).0
f376b2 687 CLANG_PREFIX             = /usr/clang/$(CLANG_FULL_VERSION)
259be2 688 CLANG_BINDIR =        $(CLANG_PREFIX)/bin
f376b2 689 CLANG_LIBDIR             = $(CLANG_PREFIX)/lib
AW 690 CLANG_DEVELOPER_PKG      = developer/clang-$(CLANG_VERSION)
691 CLANG_RUNTIME_PKG        = runtime/clang-$(CLANG_VERSION)
692 REQUIRED_PACKAGES_SUBST += CLANG_DEVELOPER_PKG
693 REQUIRED_PACKAGES_SUBST += CLANG_RUNTIME_PKG
259be2 694 PATH.prepend +=        $(CLANG_BINDIR)
f376b2 695
AW 696 # Python definitions
1e61b9 697 PYTHON.2.7.VENDOR_PACKAGES.64 = /usr/lib/python2.7/vendor-packages/64
AW 698 PYTHON.2.7.VENDOR_PACKAGES.32 = /usr/lib/python2.7/vendor-packages
699 PYTHON.2.7.VENDOR_PACKAGES = $(PYTHON.2.7.VENDOR_PACKAGES.$(BITS))
700
01fbc3 701 PYTHON.3.9.VENDOR_PACKAGES.64 = /usr/lib/python3.9/vendor-packages
AL 702 PYTHON.3.9.VENDOR_PACKAGES.32 = /usr/lib/python3.9/vendor-packages
703 PYTHON.3.9.VENDOR_PACKAGES = $(PYTHON.3.9.VENDOR_PACKAGES.$(BITS))
7999b2 704
MS 705 CC =        $(CC.$(COMPILER).$(BITS))
706 CXX =        $(CXX.$(COMPILER).$(BITS))
dcd7ba 707 F77 =        $(F77.$(COMPILER).$(BITS))
AL 708 FC =        $(FC.$(COMPILER).$(BITS))
7999b2 709
1e5ead 710 RUBY_VERSION =  2.3
ebed51 711
1e5ead 712 RUBY_LIB_VERSION.2.3 = 2.3.0
abf6e5 713 RUBY_LIB_VERSION.2.6 = 2.6.0
ebed51 714 RUBY_LIB_VERSION.3.2 = 3.2.0
AW 715
1e5ead 716 RUBY.2.3 =    /usr/ruby/2.3/bin/ruby
abf6e5 717 RUBY.2.6 =    /usr/ruby/2.6/bin/ruby
ebed51 718 RUBY.3.2 =    /usr/ruby/3.2/bin/ruby
AW 719
18b823 720 RUBY =          $(RUBY.$(RUBY_VERSION))
1e5ead 721 RUBY_LIB_VERSION = $(RUBY_LIB_VERSION.$(RUBY_VERSION))
AP 722
723 # Transform Ruby scripts to call the supported
724 # version-specific ruby; used in multiple *.mk files
725 RUBY_SCRIPT_FIX_FUNC = \
726     $(GNU_GREP) -Rl '^\#! */usr/bin/env ruby' | \
727         /usr/bin/xargs -I\{\} $(GSED) -i -e \
728         '1s%^\#! */usr/bin/env ruby%\#!/usr/ruby/$(RUBY_VERSION)/bin/ruby%' \
729         \{\}
730
18b823 731 # Use the ruby lib versions to represent the RUBY_VERSIONS that
AP 732 # need to get built.  This is done because during package transformations
0de8ff 733 # both the ruby version and the ruby library version are needed.
18b823 734 RUBY_VERSIONS = $(RUBY_LIB_VERSION)
fa74c0 735
955da2 736 PYTHON_VENDOR_PACKAGES.32 = $(PYTHON.$(PYTHON_VERSION).VENDOR_PACKAGES.32)
AP 737 PYTHON_VENDOR_PACKAGES.64 = $(PYTHON.$(PYTHON_VERSION).VENDOR_PACKAGES.64)
a0613d 738 PYTHON_VENDOR_PACKAGES = $(PYTHON_VENDOR_PACKAGES.$(BITS))
fa74c0 739
a847fb 740 # python2 was built for both 32- and 64-bits.
MT 741 # python3 is built for 64-bits only.
742
1e61b9 743 PYTHON.2.7 =    /usr/bin/python2.7
AW 744 PYTHON.2.7.64 =    /usr/bin/$(MACH64)/python2.7
745
a847fb 746 PYTHON.3.9 =    /usr/bin/python3.9
MT 747 PYTHON.3.9.64 =    $(PYTHON.3.9)
01fbc3 748
4e6f9b 749 PYTHON.64 =    $(PYTHON.$(PYTHON_VERSION).64)
1e61b9 750 PYTHON.32 =    $(PYTHON.$(PYTHON_VERSION))
a847fb 751 PYTHON =    $(PYTHON.$(PYTHON_VERSION))
9c75c0 752
792915 753 TOX.3.9 =    /usr/bin/tox-3.9
MT 754 TOX =        $(TOX.$(PYTHON_VERSION))
755
5bdc52 756 # The default is site-packages, but that directory belongs to the end-user.
SS 757 # Modules which are shipped by the OS but not with the core Python distribution
758 # belong in vendor-packages.
14c7f2 759 PYTHON_DIR= /usr/lib/python$(PYTHON_VERSION)
7589de 760 PYTHON_LIB= $(PYTHON_DIR)/vendor-packages
fa74c0 761 PYTHON_DATA= $(PYTHON_LIB)
5bdc52 762
8304a6 763 # If the component has python scripts then the first line should probably
AW 764 # point at the python version currently set by the $(PYTHON) variable so
765 # as not to be influenced by the ips python mediator.
766 # In the component's Makefile define PYTHON_SCRIPTS with a list of files
767 # to be edited.
768
769 # Edit the leading #!/usr/bin/python line in python scripts to use the
770 # BUILD's $(PYTHON). The source file must be recompiled after that, as
771 # the corresponding .pyc file is outdated now.
772 PYTHON_SCRIPT_SHEBANG_FIX_FUNC = \
773     $(GSED) -i \
6f314a 774         -e '1s@/usr/bin/python3\{0,1\}$$@$(PYTHON)@' \
MT 775         -e '1s@/usr/bin/python3\{0,1\} @$(PYTHON) @' \
776         -e '1s@/usr/bin/env python3\.[0-9]\{1,\}@$(PYTHON)@' \
777         -e '1s@/usr/bin/env python3\{0,1\}@$(PYTHON)@' \
778     $(PROTO_DIR)/$(1); \
779     $(PYTHON) -m compileall $(PROTO_DIR)/$(1);
8304a6 780
AW 781 # PYTHON_SCRIPTS is a list of files from the calling Makefile.
782 PYTHON_SCRIPTS_PROCESS= \
783     $(foreach s,$(PYTHON_SCRIPTS), \
784             $(call PYTHON_SCRIPT_SHEBANG_FIX_FUNC,$(s)))
785
786 # Finally if PYTHON_SCRIPTS is defined in a Makefile then process them here.
787 # If multiple installs in the component then clear
788 # COMPONENT_POST_INSTALL_ACTION =
789 # and re-add $(PYTHON_SCRIPTS_PROCESS)
c602c4 790 COMPONENT_POST_INSTALL_ACTION += $(PYTHON_SCRIPTS_PROCESS)
8304a6 791
a419a5 792 JAVA8_HOME =    /usr/jdk/instances/openjdk1.8.0
6f9710 793 JAVA17_HOME =    /usr/jdk/instances/openjdk17.0.8
AW 794 JAVA21_HOME =    /usr/jdk/instances/openjdk21
795 JAVA_HOME = $(JAVA17_HOME)
61a323 796
d5d29a 797 # QT macros
AW 798 # We deliver version 5 in 32- and 64-bit variants.
799 QT5_VERSION = 5.15
800 QT5_BASEDIR = $(USRLIBDIR)/qt/$(QT5_VERSION)
801 QT5_BINDIR.32 = $(QT5_BASEDIR)/bin
802 QT5_LIBDIR.32 = $(QT5_BASEDIR)/lib
803 QT5_BINDIR.64 = $(QT5_BASEDIR)/bin/$(MACH64)
804 QT5_LIBDIR.64 = $(QT5_BASEDIR)/lib/$(MACH64)
805 QT5_BINDIR = $(QT5_BINDIR.$(BITS))
806 QT5_LIBDIR = $(QT5_LIBDIR.$(BITS))
807 QT5_INCDIR = $(QT5_BASEDIR)/include
808 QT5_PKG_CONFIG_PATH = $(QT5_LIBDIR)/pkgconfig
809
810 # We deliver version 6 only in a 64-bit variant.
7f56f2 811 QT6_VERSION = 6.6
d5d29a 812 QT6_BASEDIR = $(USRLIBDIR)/qt/$(QT6_VERSION)
AW 813 QT6_BINDIR = $(QT6_BASEDIR)/bin/$(MACH64)
814 QT6_LIBDIR = $(QT6_BASEDIR)/lib/$(MACH64)
815 QT6_PKG_CONFIG_PATH = $(QT6_LIBDIR)/pkgconfig
816
79897a 817 #
MT 818 # Upstream officially supports two recent major Perl versions.  They also aim
819 # to provide critical security fixes for major Perl versions whose 5.x.0
820 # release was within the past three years.
821 #
822 # We support union of both sets.  IOW, we will start to obsolete a major Perl
823 # version if its 5.x.0 was released longer than three years ago AND there are
824 # already released two newer major Perl versions.
825 #
826 # See https://perldoc.perl.org/perlpolicy
827 #
828 #
829 # We will start to obsolete major Perl versions according the following table:
830 #
831 # +--------------+----------------+
832 # | Perl version | Obsolete after |
833 # +--------------+----------------+
834 # |     5.34     |   2024-05-20   |
835 # |     5.36     |   2025-05-28   |
836 # |     5.38     |   2026-07-02   |
837 # +--------------+----------------+
838 #
839 # See https://www.cpan.org/src/README.html
840 #
841
5fb151 842 # This is the default version of Perl
412e27 843 PERL_VERSION =  5.38
9aea33 844
5fb151 845 # The PERL_VERSIONS list should always be in ascending order (newest version
MT 846 # last)
79897a 847 PERL_VERSIONS = 5.34 5.36 5.38
7b3ffe 848 # Perl up to 5.22 was built 32-bit only.  Starting with 5.24 the perl package
MT 849 # is built 64-bit only.  So now all PERL_VERSIONS are 64-bit only.
850 PERL_64_ONLY_VERSIONS = $(PERL_VERSIONS)
6bc9bf 851
45844d 852 # List of perl versions we are currently obsoleting.  We no longer build any
MT 853 # packages for these perl versions, but there still might be hanging some not
854 # obsoleted yet versioned packages built for PERL_VERSIONS_OBSOLETING perl
855 # versions.  Or there is just the versioned runtime/perl package still
856 # available.
857 #
858 # This list should be usually empty.  Intersection of PERL_VERSIONS_OBSOLETING
859 # and PERL_VERSIONS lists MUST be always empty.
ddfa6c 860 PERL_VERSIONS_OBSOLETING =
45844d 861
ecce9a 862 define perl-path-rule
MT 863 PERL.$(1) =        /usr/perl5/$(1)/bin/perl
864 POD2MAN.$(1) =        /usr/perl5/$(1)/bin/pod2man
865 PERL5BINDIR.$(1) =    /usr/perl5/$(1)/bin
866 endef
867 $(foreach perlver,$(PERL_VERSIONS),$(eval $(call perl-path-rule,$(perlver))))
6778e0 868
C 869 PERL5BINDIR =     $(PERL5BINDIR.$(PERL_VERSION))
9e2024 870 PERL =        $(PERL.$(PERL_VERSION))
871 POD2MAN =    $(POD2MAN.$(PERL_VERSION))
6bc9bf 872
5ada66 873 PERL_ARCH :=    $(shell $(PERL) -e 'use Config; print $$Config{archname}')
9581d1 874 PERL_ARCH_FUNC=    $(shell $(1) -e 'use Config; print $$Config{archname}')
6bc9bf 875 # Optimally we should ask perl which C compiler was used but it doesn't
CM 876 # result in a full path name.  Only "c" is being recorded
877 # inside perl builds while we actually need a full path to
0f8a2f 878 # the compiler.
5ada66 879 #PERL_CC :=    $(shell $(PERL) -e 'use Config; print $$Config{cc}')
6bc9bf 880
CM 881 PKG_MACROS +=   PERL_ARCH=$(PERL_ARCH)
882 PKG_MACROS +=   PERL_VERSION=$(PERL_VERSION)
883
e5ad84 884 #
MT 885 # Upstream supports major PostgreSQL versions for 5 years after its initial
886 # release.  After that one last minor version is released and then the major
887 # version is considered EOL.
888 #
889 # We will start to obsolete PostgreSQL versions according the following table:
890 #
891 # +--------------------+----------------+
892 # | PostgreSQL version | Obsolete after |
893 # +--------------------+----------------+
894 # |         12         |   2024-11-14   |
895 # |         14         |   2026-11-12   |
896 # |         15         |   2027-11-11   |
897 # +--------------------+----------------+
898 #
899 # See https://www.postgresql.org/support/versioning/
900 #
901
eb149b 902 # Config magic for Postgres/EnterpriseDB/...
cec11a 903 # Default DB version should be the newest one we do have so we detect any
MT 904 # incompatibilities as soon as possible.  Components could override this when
905 # they are not ready yet to compile with so new version.
5eb0d0 906 PG_VERSION ?=   15
eb149b 907 PG_IMPLEM ?=    postgres
7fd1f9 908 PG_VERNUM =     $(subst .,,$(PG_VERSION))
eb149b 909 # For dependencies, including REQUIRED_PACKAGES if needed
JK 910 PG_BASEPKG =    database/$(PG_IMPLEM)-$(PG_VERNUM)
b709c0 911 PG_CLIENT_PKG = $(PG_BASEPKG)/client
ddabe6 912 PG_DEVELOPER_PKG = $(PG_BASEPKG)/developer
AP 913 PG_LIBRARY_PKG = $(PG_BASEPKG)/library
703a89 914 PG_SERVICE_PKG = service/$(PG_BASEPKG)
ddabe6 915
b709c0 916 REQUIRED_PACKAGES_SUBST+= PG_CLIENT_PKG
ddabe6 917 REQUIRED_PACKAGES_SUBST+= PG_DEVELOPER_PKG
AP 918 REQUIRED_PACKAGES_SUBST+= PG_LIBRARY_PKG
703a89 919 REQUIRED_PACKAGES_SUBST+= PG_SERVICE_PKG
eb149b 920
JK 921 PG_HOME =       $(USRDIR)/$(PG_IMPLEM)/$(PG_VERSION)
c86c97 922 PG_BINDIR.32 =  $(PG_HOME)/bin/$(MACH32)
AP 923 PG_BINDIR.64 =  $(PG_HOME)/bin
eb149b 924 PG_BINDIR =     $(PG_BINDIR.$(BITS))
7fd1f9 925 PG_INCDIR =     $(PG_HOME)/include
AP 926 PG_MANDIR =     $(PG_HOME)/man
927 PG_SHAREDIR =   $(PG_HOME)/share
928 PG_DOCDIR =     $(PG_HOME)/doc
929 PG_LIBDIR.32 =  $(PG_HOME)/lib
930 PG_LIBDIR.64 =  $(PG_HOME)/lib/$(MACH64)
eb149b 931 PG_LIBDIR =     $(PG_LIBDIR.$(BITS))
7fd1f9 932 PG_CONFIG.32 =  $(PG_BINDIR.32)/pg_config
AP 933 PG_CONFIG.64 =  $(PG_BINDIR.64)/pg_config
eb149b 934 PG_CONFIG =     $(PG_CONFIG.$(BITS))
259be2 935 PATH.prepend +=    $(PG_BINDIR)
7fd1f9 936
AP 937 PKG_MACROS +=   PG_VERSION=$(PG_VERSION)
938 PKG_MACROS +=   PG_VERNUM=$(PG_VERNUM)
eb149b 939 PKG_MACROS +=   PG_BASEPKG=$(PG_BASEPKG)
JK 940
e5ad84 941 #
MT 942 # Upstream maintains long-term MariaDB releases for at least 5 years and
943 # short-term MariaDB releases for at least one year.
944 #
945 # We will start to obsolete MariaDB versions according the following table:
946 #
947 # +-----------------+----------------+
948 # | MariaDB version | Obsolete after |
949 # +-----------------+----------------+
950 # |      10.6       |   2026-07      |
951 # +-----------------+----------------+
952 #
953 # See https://mariadb.org/about/#maintenance-policy
954 #
955
eb149b 956 # Config magic for MySQL/MariaDB/Percona/...
cec11a 957 # Default DB version should be the newest one we do have so we detect any
MT 958 # incompatibilities as soon as possible.  Components could override this when
959 # they are not ready yet to compile with so new version.
eb149b 960 # NOTE: At this time the gate does not provide a recipe for actual "mysql"
JK 961 # The "/usr/mysql/*" trees are mediated to preferred MariaDB or Percona variant
cec11a 962 MYSQL_VERSION ?=   10.6
eb149b 963 MYSQL_IMPLEM ?=    mariadb
JK 964 MYSQL_VERNUM =     $(subst .,,$(MYSQL_VERSION))
e07322 965 MYSQL_MINOR =      $(word 2,$(subst .,$(space),$(MYSQL_VERSION)))
AW 966 # Beginning with mariadb 10.6 we only ship 64 bit versions. That changes the paths.
967 $(if $(shell [ $(MYSQL_MINOR) -ge 6 ] && echo "OK"), \
968     $(eval MYSQL_64_BIT_ONLY := true), \
969     $(eval MYSQL_64_BIT_ONLY := false))
eb149b 970 # For dependencies, including REQUIRED_PACKAGES if needed
JK 971 MYSQL_BASEPKG =    database/$(MYSQL_IMPLEM)-$(MYSQL_VERNUM)
b709c0 972 MYSQL_CLIENT_PKG = $(MYSQL_BASEPKG)/client
AW 973 MYSQL_DEVELOPER_PKG = $(MYSQL_BASEPKG)/developer
974 MYSQL_LIBRARY_PKG = $(MYSQL_BASEPKG)/library
975
976 REQUIRED_PACKAGES_SUBST+= MYSQL_CLIENT_PKG
977 REQUIRED_PACKAGES_SUBST+= MYSQL_DEVELOPER_PKG
978 REQUIRED_PACKAGES_SUBST+= MYSQL_LIBRARY_PKG
eb149b 979
JK 980 MYSQL_HOME =       $(USRDIR)/$(MYSQL_IMPLEM)/$(MYSQL_VERSION)
e07322 981 ifeq ($(strip $(MYSQL_64_BIT_ONLY)),false)
eb149b 982 MYSQL_BINDIR.32 =  $(MYSQL_HOME)/bin
JK 983 MYSQL_BINDIR.64 =  $(MYSQL_HOME)/bin/$(MACH64)
e07322 984 else
AW 985 MYSQL_BINDIR.64 =  $(MYSQL_HOME)/bin
986 endif
eb149b 987 MYSQL_BINDIR =     $(MYSQL_BINDIR.$(BITS))
JK 988 MYSQL_INCDIR =     $(MYSQL_HOME)/include
989 MYSQL_MANDIR =     $(MYSQL_HOME)/man
990 MYSQL_SHAREDIR =   $(MYSQL_HOME)/share
991 MYSQL_DOCDIR =     $(MYSQL_HOME)/doc
992 MYSQL_LIBDIR.32 =  $(MYSQL_HOME)/lib
993 MYSQL_LIBDIR.64 =  $(MYSQL_HOME)/lib/$(MACH64)
994 MYSQL_LIBDIR =     $(MYSQL_LIBDIR.$(BITS))
995 MYSQL_CONFIG.32 =  $(MYSQL_BINDIR.32)/mysql_config
996 MYSQL_CONFIG.64 =  $(MYSQL_BINDIR.64)/mysql_config
997 MYSQL_CONFIG =     $(MYSQL_CONFIG.$(BITS))
ac8987 998 MYSQL_PKG_CONFIG_PATH =    $(MYSQL_LIBDIR)/pkgconfig
259be2 999 PATH.prepend +=        $(MYSQL_BINDIR)
eb149b 1000
JK 1001 PKG_MACROS +=   MYSQL_VERSION=$(MYSQL_VERSION)
1002 PKG_MACROS +=   MYSQL_VERNUM=$(MYSQL_VERNUM)
1003 PKG_MACROS +=   MYSQL_BASEPKG=$(MYSQL_BASEPKG)
7fd1f9 1004
6f7416 1005 # Default libjpeg implementation layout
AL 1006 JPEG_IMPLEM ?=     libjpeg8-turbo
1007 JPEG_HOME =        $(USRLIBDIR)/$(JPEG_IMPLEM)
1008 JPEG_BINDIR.32 =   $(JPEG_HOME)/bin
1009 JPEG_BINDIR.64 =   $(JPEG_HOME)/bin/$(MACH64)
1010 JPEG_BINDIR =      $(JPEG_BINDIR.$(BITS))
1011 JPEG_INCDIR =      $(USRINCDIR)/$(JPEG_IMPLEM)
1012 JPEG_LIBDIR.32 =   $(JPEG_HOME)/lib
1013 JPEG_LIBDIR.64 =   $(JPEG_HOME)/lib/$(MACH64)
1014 JPEG_LIBDIR =      $(JPEG_LIBDIR.$(BITS))
1015 JPEG_CPPFLAGS =    -I$(JPEG_INCDIR)
1016 JPEG_CFLAGS.32 =   -Wl,-L$(JPEG_LIBDIR.32) -Wl,-R$(JPEG_LIBDIR.32)
1017 JPEG_CFLAGS.64 =   -Wl,-L$(JPEG_LIBDIR.64) -Wl,-R$(JPEG_LIBDIR.64)
1018 JPEG_CFLAGS =      $(JPEG_CFLAGS.$(BITS))
1019 JPEG_CXXFLAGS.32 = -Wl,-L$(JPEG_LIBDIR.32) -Wl,-R$(JPEG_LIBDIR.32)
1020 JPEG_CXXFLAGS.64 = -Wl,-L$(JPEG_LIBDIR.64) -Wl,-R$(JPEG_LIBDIR.64)
1021 JPEG_CXXFLAGS =    $(JPEG_CXXFLAGS.$(BITS))
1022 JPEG_LDFLAGS.32 =  -L$(JPEG_LIBDIR.32) -R$(JPEG_LIBDIR.32)
1023 JPEG_LDFLAGS.64 =  -L$(JPEG_LIBDIR.64) -R$(JPEG_LIBDIR.64)
1024 JPEG_LDFLAGS =     $(JPEG_LDFLAGS.$(BITS))
1025
82bf6a 1026 JPEG_IMPLEM_PKG = image/library/$(JPEG_IMPLEM)
AW 1027 REQUIRED_PACKAGES_SUBST += JPEG_IMPLEM_PKG
1028
23aaef 1029 # This is the default BUILD version of tcl
DL 1030 # Not necessarily the system's default version, i.e. /usr/bin/tclsh
26b2cb 1031 TCL_VERSION =  8.6
AP 1032 TCLSH.8.6.i386.32 =    /usr/bin/i86/tclsh8.6
1033 TCLSH.8.6.i386.64 =    /usr/bin/amd64/tclsh8.6
1034 TCLSH.8.6.sparc.32 =    /usr/bin/sparcv7/tclsh8.6
1035 TCLSH.8.6.sparc.64 =    /usr/bin/sparcv9/tclsh8.6
23aaef 1036 TCLSH =        $(TCLSH.$(TCL_VERSION).$(MACH).$(BITS))
DL 1037
2aa1db 1038 # ICU library
MT 1039 ICU_LIBRARY_PKG =        library/icu
1040 REQUIRED_PACKAGES_SUBST +=    ICU_LIBRARY_PKG
1041
1042
6bc9bf 1043 CCSMAKE =    /usr/ccs/bin/make
9c75c0 1044 GMAKE =        /usr/gnu/bin/make
NJ 1045 GPATCH =    /usr/gnu/bin/patch
ff1c63 1046 PATCH_LEVEL =    1
35a012 1047 GPATCH_BACKUP =    --backup --version-control=numbered
NJ 1048 GPATCH_FLAGS =    -p$(PATCH_LEVEL) $(GPATCH_BACKUP)
960e5b 1049 GSED =        /usr/gnu/bin/sed
8d70f8 1050 GDIFF =        /usr/gnu/bin/diff
RB 1051 GSORT =        /usr/gnu/bin/sort
fbf173 1052 GUNZIP =    /usr/bin/gunzip
9c75c0 1053
a99182 1054 SORT =        LC_ALL=C /usr/bin/sort
MT 1055
dd0336 1056 PKGREPO =    /usr/bin/pkgrepo
9c75c0 1057 PKGSEND =    /usr/bin/pkgsend
7bf47e 1058 ifeq   ($(strip $(PKGLINT_COMPONENT)),)
1cba4c 1059 PKGLINT =    /usr/bin/python /usr/bin/pkglint
7bf47e 1060 else
MS 1061 PKGLINT =    ${WS_TOOLS}/pkglint
1062 endif
9c75c0 1063
b06748 1064 ACLOCAL =    /usr/bin/aclocal-1.10
VM 1065 AUTOMAKE =    /usr/bin/automake-1.10
1066 AUTORECONF =     /usr/bin/autoreconf
1067
9b6169 1068 KSH93 =         /usr/bin/ksh93
9c75c0 1069 TOUCH =        /usr/bin/touch
NJ 1070 MKDIR =        /bin/mkdir -p
1071 RM =        /bin/rm -f
153732 1072 CP =        /bin/cp -f
2515dc 1073 MV =        /bin/mv -f
3d7f8d 1074 LN =        /bin/ln
8d70f8 1075 CAT =        /bin/cat
3d7f8d 1076 SYMLINK =    /bin/ln -s
61c373 1077 ENV =        /usr/bin/env
14fe6e 1078 FIND =        /usr/bin/find
3d7f8d 1079 INSTALL =    /usr/bin/ginstall
1e5ead 1080 GNU_GREP =    /usr/gnu/bin/grep
81db49 1081 CHMOD =        /usr/bin/chmod
e5e44e 1082 NAWK =        /usr/bin/nawk
SM 1083 TEE =        /usr/bin/tee
3168d6 1084 GAS =        /usr/gnu/bin/as
e2ca11 1085 GTAR =        /usr/gnu/bin/tar
3168d6 1086 STRIP =    /usr/bin/strip
617c23 1087 IPS2TGZ =     $(WS_TOOLS)/ips2tgz
2d72b3 1088 JQ =        /usr/bin/jq
ace7a9 1089 DOS2UNIX =    /usr/bin/dos2unix
baff9a 1090 TAC =        /usr/bin/tac
MT 1091 QUILT =        /usr/bin/quilt
4f8cfa 1092
MS 1093 INS.dir=        $(INSTALL) -d $@
1094 INS.file=       $(INSTALL) -m 444 $< $(@D)
3cec7d 1095
4d4a5d 1096 # OpenSSL macros
3000b1 1097 OPENSSL_DEFAULT = 3.1
4d4a5d 1098 ifeq ($(strip $(USE_OPENSSL11)),yes)
2e08ac 1099 OPENSSL_VERSION = 1.1
4d4a5d 1100 else
AL 1101 ifeq ($(strip $(USE_OPENSSL10)),yes)
2e08ac 1102 OPENSSL_VERSION = 1.0
4d4a5d 1103 else
2e08ac 1104 OPENSSL_VERSION ?= $(OPENSSL_DEFAULT)
4d4a5d 1105 endif
AL 1106 endif
f4ee69 1107 PATH.prepend+=$(OPENSSL_BINDIR)
4d4a5d 1108 OPENSSL_PREFIX= $(USRDIR)/openssl/$(OPENSSL_VERSION)
a81647 1109 OPENSSL_BINDIR.64= $(OPENSSL_PREFIX)/bin
AW 1110 OPENSSL_BINDIR.32= $(OPENSSL_PREFIX)/bin/$(MACH32)
1111 OPENSSL_BINDIR= $(OPENSSL_BINDIR.$(BITS))
1112 OPENSSL_LIBDIR.64= $(OPENSSL_PREFIX)/lib/64
1113 OPENSSL_LIBDIR.32= $(OPENSSL_PREFIX)/lib
1114 OPENSSL_LIBDIR= $(OPENSSL_LIBDIR.$(BITS))
1115 OPENSSL_PKG_CONFIG_PATH.32= $(OPENSSL_PREFIX)/lib/pkgconfig
1116 OPENSSL_PKG_CONFIG_PATH.64= $(OPENSSL_PREFIX)/lib/64/pkgconfig
1117 OPENSSL_PKG_CONFIG_PATH= $(OPENSSL_PKG_CONFIG_PATH.$(BITS))
95833b 1118 OPENSSL_INCDIR=$(OPENSSL_PREFIX)/include
4d4a5d 1119
AL 1120 # Pkg-config paths
3cec7d 1121 PKG_CONFIG_PATH.32 = /usr/lib/pkgconfig
NJ 1122 PKG_CONFIG_PATH.64 = /usr/lib/$(MACH64)/pkgconfig
0b8dd9 1123 PKG_CONFIG_PATH = \
ac8987 1124     $(OPENSSL_PKG_CONFIG_PATH):$(MYSQL_PKG_CONFIG_PATH):$(PKG_CONFIG_PATH.$(BITS)):$(PKG_CONFIG_PATH.32)
3cec7d 1125
b55e44 1126 # Set default path for environment modules
AL 1127 MODULE_VERSION =    3.2.10
1128 MODULE_PATH =        /usr/share/Modules/modulefiles
1129 MODULE_VERSIONS_PATH =    /usr/share/Modules/versions
1130
1131 # Path to bash completions
1132 BASH_COMPLETIONS_PATH =    /usr/share/bash-completion/completions
4f8cfa 1133
MS 1134 #
35a012 1135 # C preprocessor flag sets to ease feature selection.  Add the required
NJ 1136 # feature to your Makefile with CPPFLAGS += $(FEATURE_MACRO) and add to
1137 # the component build with CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)" or
1138 # similiar.
1139 #
4f8cfa 1140
35a012 1141 # Enables visibility of some c99 math functions that aren't visible by default.
NJ 1142 # What other side-effects are there?
1143 CPP_C99_EXTENDED_MATH =    -D_STDC_99
e4bbaf 1144
35a012 1145 # Enables large file support for components that have no other means of doing
NJ 1146 # so.  Use CPP_LARGEFILES and not the .32/.64 variety directly
5ada66 1147 CPP_LARGEFILES.32 :=    $(shell getconf LFS_CFLAGS)
DD 1148 CPP_LARGEFILES.64 :=    $(shell getconf LFS64_CFLAGS)
35a012 1149 CPP_LARGEFILES =        $(CPP_LARGEFILES.$(BITS))
4f8cfa 1150
35a012 1151 # Enables some #pragma redefine_extname to POSIX-compliant Standard C Library
NJ 1152 # functions. Also avoids the component's #define _POSIX_C_SOURCE to some value
1153 # we currently do not support.
1154 CPP_POSIX =    -D_POSIX_C_SOURCE=200112L -D_POSIX_PTHREAD_SEMANTICS
4f8cfa 1155
afe8c5 1156 # XPG7 mode.  This option enables XPG7 conformance, plus extensions.
AL 1157 CPP_XPG7MODE=    -D_XOPEN_SOURCE=700 -D__EXTENSIONS__=1 -D_XPG7
1158
4f8cfa 1159 # XPG6 mode.  This option enables XPG6 conformance, plus extensions.
MS 1160 # Amongst other things, this option will cause system calls like
1161 # popen (3C) and system (3C) to invoke the standards-conforming
0f8a2f 1162 # shell, /usr/xpg4/bin/sh, instead of /usr/bin/sh.  Add CPP_XPG6MODE to
35a012 1163 # CFLAGS instead of using this directly
NJ 1164 CPP_XPG6MODE=    -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6
4f8cfa 1165
0aeacd 1166 # XPG5 mode. These options are specific for C++, where _XPG6,
ST 1167 # _XOPEN_SOURCE=600 and C99 are illegal. -D__EXTENSIONS__=1 is legal in C++.
1168 CPP_XPG5MODE=   -D_XOPEN_SOURCE=500 -D__EXTENSIONS__=1 -D_XPG5
35a012 1169
NJ 1170 # Generate 32/64 bit objects
1171 CC_BITS =    -m$(BITS)
1172
9d5dbf 1173 # Turn on C99 for gcc
DH 1174 gcc_C99_ENABLE =    -std=c99
1175
35a012 1176 # Control register usage for generated code.  SPARC ABI requires system
0f8a2f 1177 # libraries not to use application registers.
15d3df 1178 gcc_XREGS.sparc =    -mno-app-regs
MS 1179 gcc_XREGS.i386 =
1180 gcc_XREGS =        $(gcc_XREGS.$(MACH))
35a012 1181
NJ 1182 # See CPP_XPG6MODE comment above.
0f8a2f 1183 XPG6MODE =        $(CPP_XPG6MODE)
35a012 1184
0aeacd 1185 # See CPP_XPG5MODE comment above. You can only use this in C++, not in C99.
0f8a2f 1186 XPG5MODE =        $(CPP_XPG5MODE)
35a012 1187
4f8cfa 1188 #
35a012 1189 # GNU C compiler flag sets to ease feature selection.  Add the required
NJ 1190 # feature to your Makefile with CFLAGS += $(FEATURE_MACRO) and add to the
1191 # component build with CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.
1192 #
4f8cfa 1193
97299f 1194 # Control the GCC optimization level.
753eab 1195 gcc_OPT.sparc.32 =    -O3 -mcpu=ultrasparc -mvis -mfsmuld
K 1196 gcc_OPT.sparc.64 =    -O3 -mcpu=ultrasparc -mvis -mfsmuld
97299f 1197 gcc_OPT.i386.32 =    -O3
GM 1198 gcc_OPT.i386.64 =    -O3
1199 gcc_OPT =        $(gcc_OPT.$(MACH).$(BITS))
4f8cfa 1200
35a012 1201 # GCC PIC code generation.  Use CC_PIC instead to select PIC code generation.
NJ 1202 gcc_PIC =    -fPIC -DPIC
4f8cfa 1203
35a012 1204 # Generic macro for PIC code generation.  Use this macro instead of the
NJ 1205 # compiler specific variant.
1206 CC_PIC =    $($(COMPILER)_PIC)
4f8cfa 1207
MS 1208
35a012 1209 # Default GNU C compiler flags.  Add the required feature to your Makefile
NJ 1210 # with CFLAGS += $(FEATURE_MACRO) and add to the component build with
1211 # CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" or similiar.  In most cases, it
1212 # should not be necessary to add CFLAGS to any environment other than the
1213 # configure environment.
1214 CFLAGS.gcc +=    $(gcc_OPT)
15d3df 1215 CFLAGS.gcc +=    $(gcc_XREGS)
4f8cfa 1216
9789f8 1217 # Default GNU C++ compiler flags.  Add the required feature to your Makefile
AL 1218 # with CXXFLAGS += $(FEATURE_MACRO) and add to the component build with
1219 # CONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)" or similiar.  In most cases, it
1220 # should not be necessary to add CXXFLAGS to any environment other than the
1221 # configure environment.
1222 CXXFLAGS.gcc +=    $(gcc_OPT)
1223 CXXFLAGS.gcc +=    $(gcc_XREGS)
1224
1225 # Default GNU FORTRAN compiler flags.  Add the required feature to your Makefile
1226 # with FCFLAGS += $(FEATURE_MACRO) and add to the component build with
1227 # CONFIGURE_OPTIONS += FCFLAGS="$(FCFLAGS)" or similiar.  In most cases, it
1228 # should not be necessary to add FCFLAGS to any environment other than the
1229 # configure environment.
1230 FCFLAGS.gcc +=    $(gcc_OPT)
1231 FCFLAGS.gcc +=    $(gcc_XREGS)
35a012 1232
NJ 1233 # Build 32 or 64 bit objects.
1234 CFLAGS +=    $(CC_BITS)
1235
1236 # Add compiler specific 'default' features
1237 CFLAGS +=    $(CFLAGS.$(COMPILER))
3cec7d 1238
614c6a 1239 # Build 32 or 64 bit objects in C++ as well.
ST 1240 CXXFLAGS +=    $(CC_BITS)
1241
9789f8 1242 # Add compiler specific 'default' features
AL 1243 CXXFLAGS +=    $(CXXFLAGS.$(COMPILER))
1244
dcd7ba 1245 # Build 32 or 64 bit objects in FORTRAN as well.
AL 1246 F77FLAGS +=    $(CC_BITS)
1247 FCFLAGS +=    $(CC_BITS)
1248
9789f8 1249 # Add compiler specific 'default' features
AL 1250 F77FLAGS +=    $(FCFLAGS.$(COMPILER))
1251 FCFLAGS +=    $(FCFLAGS.$(COMPILER))
dcd7ba 1252
35a012 1253 #
NJ 1254 # Solaris linker flag sets to ease feature selection.  Add the required
1255 # feature to your Makefile with LDFLAGS += $(FEATURE_MACRO) and add to the
1256 # component build with CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)" or similiar.
1257 #
3cec7d 1258
NJ 1259 # set the bittedness that we want to link
db2ec7 1260 ccs.ld.64 = -64
AS 1261 gcc.ld.32 = -m32
1262 gcc.ld.64 = -m64
1263 LD_BITS =      $($(LINKER).ld.$(BITS))
1264 LDFLAGS =      $(LD_BITS)
35a012 1265
NJ 1266 # Reduce the symbol table size, effectively conflicting with -g.  We should
1267 # get linker guidance here.
1268 LD_Z_REDLOCSYM =    -z redlocsym
1269
1270 # Cause the linker to rescan archive libraries and resolve remaining unresolved
1271 # symbols recursively until all symbols are resolved.  Components should be
1272 # linking in the libraries they need, in the required order.  This should
1273 # only be required if the component's native build is horribly broken.
1274 LD_Z_RESCAN_NOW =    -z rescan-now
1275
1276 LD_Z_TEXT =        -z direct
1277
3a5b3f 1278 # make sure that -lc is always present when building shared objects.
RB 1279 LD_DEF_LIBS +=        -lc
1280
35a012 1281 # make sure all symbols are defined.
NJ 1282 LD_Z_DEFS =        -z defs
1283
17fc9e 1284 # eliminate unreferenced dynamic dependencies
NJ 1285 LD_Z_IGNORE =        -z ignore
1286
35a012 1287 # use direct binding
NJ 1288 LD_B_DIRECT =        -Bdirect
1289
0f1b63 1290 # use generic macro names for enabling/disabling ASLR
AC 1291 ASLR_ENABLE =         -z aslr=enable
1292 ASLR_DISABLE =         -z aslr=disable
1293 ASLR_MODE =         $(ASLR_DISABLE)
1294
1295 # by default, turn off Address Space Layout Randomization for ELF executables;
1296 # to explicitly enable ASLR, set ASLR_MODE = $(ASLR_ENABLE)
1297 # in that component's Makefile
1298 LD_Z_ASLR =        $(ASLR_MODE)
1299
a40541 1300 # Define SSP library link flag for 32-bit objects
AL 1301 LD_SSP.32 = -lssp_ns
1302 LD_SSP.64 =
1303 LD_SSP = $(LD_SSP.$(BITS))
1304
35a012 1305 #
NJ 1306 # More Solaris linker flags that we want to be sure that everyone gets.  This
1307 # is automatically added to the calling environment during the 'build' and
1308 # 'install' phases of the component build.  Each individual feature can be
1309 # turned off by adding FEATURE_MACRO= to the component Makefile.
1310 #
1311
1312 # Create a non-executable stack when linking.
ad8773 1313 LD_MAP_NOEXSTK.i386 =    -M /usr/lib/ld/map.noexstk
AB 1314 LD_MAP_NOEXSTK.sparc =    -M /usr/lib/ld/map.noexstk
35a012 1315
NJ 1316 # Create a non-executable bss segment when linking.
1317 LD_MAP_NOEXBSS =    -M /usr/lib/ld/map.noexbss
1318
1319 # Create a non-executable data segment when linking.  Due to PLT needs, the
1320 # data segment must be executable on sparc, but the bss does not.
1321 # see mapfile comments for more information
1322 LD_MAP_NOEXDATA.i386 =    -M /usr/lib/ld/map.noexdata
1323 LD_MAP_NOEXDATA.sparc =    $(LD_MAP_NOEXBSS)
1324
1325 # Page alignment
1326 LD_MAP_PAGEALIGN =    -M /usr/lib/ld/map.pagealign
1327
1328 # Linker options to add when only building libraries
3a5b3f 1329 LD_OPTIONS_SO +=    $(LD_Z_TEXT) $(LD_Z_DEFS) $(LD_DEF_LIBS)
35a012 1330
NJ 1331 # Default linker options that everyone should get.  Do not add additional
1332 # libraries to this macro, as it will apply to everything linked during the
1333 # component build.
ad8773 1334 LD_OPTIONS +=    $(LD_MAP_NOEXSTK.$(MACH)) $(LD_MAP_NOEXDATA.$(MACH)) \
17fc9e 1335         $(LD_MAP_PAGEALIGN) $(LD_B_DIRECT) $(LD_Z_IGNORE)
1932c6 1336
0f1b63 1337 # only used on executables
AC 1338 LD_EXEC_OPTIONS = $(LD_Z_ASLR)
1339
e83e52 1340 # Environment variables and arguments passed into the build and install
1932c6 1341 # environment(s).  These are the initial settings.
MS 1342 COMPONENT_BUILD_ENV= \
0f1b63 1343     LD_OPTIONS="$(LD_OPTIONS)" \
AC 1344     LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)"
1932c6 1345 COMPONENT_INSTALL_ENV= \
0f1b63 1346     LD_OPTIONS="$(LD_OPTIONS)" \
AC 1347     LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)"
1932c6 1348
cba80e 1349 # PATH should be always set
MT 1350 COMPONENT_BUILD_ENV += PATH="$(PATH)"
1351 COMPONENT_INSTALL_ENV += PATH="$(PATH)"
1352 COMPONENT_TEST_ENV += PATH="$(PATH)"
1353
1a7b67 1354 # PERL options which depend on C options should be placed here
0f8a2f 1355 PERL_OPTIMIZE :=    $(shell $(PERL) -e 'use Config; print $$Config{optimize}')
1a7b67 1356
c5572a 1357 # Rewrite absolute source-code paths into relative for ccache, so that any
JK 1358 # workspace with a shared CCACHE_DIR can benefit when compiling a component
1359 ifneq ($(strip $(CCACHE)),)
1360 export CCACHE_BASEDIR = $(BUILD_DIR_$(BITS))
1361 COMPONENT_BUILD_ENV += CCACHE="$(CCACHE)"
1362 COMPONENT_INSTALL_ENV += CCACHE="$(CCACHE)"
1363 COMPONENT_TEST_ENV += CCACHE="$(CCACHE)"
1364 COMPONENT_BUILD_ENV += CC_gcc_32="$(CC_gcc_32)"
b5cf06 1365 COMPONENT_BUILD_ENV += CC_gcc_64="$(CC_gcc_64)"
AL 1366 COMPONENT_BUILD_ENV += CXX_gcc_32="$(CXX_gcc_32)"
c5572a 1367 COMPONENT_BUILD_ENV += CXX_gcc_64="$(CXX_gcc_64)"
JK 1368 COMPONENT_INSTALL_ENV += CC_gcc_32="$(CC_gcc_32)"
b5cf06 1369 COMPONENT_INSTALL_ENV += CC_gcc_64="$(CC_gcc_64)"
AL 1370 COMPONENT_INSTALL_ENV += CXX_gcc_32="$(CXX_gcc_32)"
c5572a 1371 COMPONENT_INSTALL_ENV += CXX_gcc_64="$(CXX_gcc_64)"
JK 1372 COMPONENT_TEST_ENV += CC_gcc_32="$(CC_gcc_32)"
b5cf06 1373 COMPONENT_TEST_ENV += CC_gcc_64="$(CC_gcc_64)"
AL 1374 COMPONENT_TEST_ENV += CXX_gcc_32="$(CXX_gcc_32)"
c5572a 1375 COMPONENT_TEST_ENV += CXX_gcc_64="$(CXX_gcc_64)"
JK 1376 COMPONENT_BUILD_ENV.$(BITS) += CCACHE_BASEDIR="$(BUILD_DIR_$(BITS))"
1377 COMPONENT_INSTALL_ENV.$(BITS) += CCACHE_BASEDIR="$(BUILD_DIR_$(BITS))"
1378 COMPONENT_TEST_ENV.$(BITS) += CCACHE_BASEDIR="$(BUILD_DIR_$(BITS))"
1379
1380 ifneq ($(strip $(CCACHE_DIR)),)
1381 COMPONENT_BUILD_ENV += CCACHE_DIR="$(CCACHE_DIR)"
1382 COMPONENT_INSTALL_ENV += CCACHE_DIR="$(CCACHE_DIR)"
1383 COMPONENT_TEST_ENV += CCACHE_DIR="$(CCACHE_DIR)"
1384 endif
1385
1386 ifneq ($(strip $(CCACHE_LOGFILE)),)
1387 COMPONENT_BUILD_ENV += CCACHE_LOGFILE="$(CCACHE_LOGFILE)"
1388 COMPONENT_INSTALL_ENV += CCACHE_LOGFILE="$(CCACHE_LOGFILE)"
1389 COMPONENT_TEST_ENV += CCACHE_LOGFILE="$(CCACHE_LOGFILE)"
1390 endif
1391
1392 endif
1393
1932c6 1394 # Add any bit-specific settings
e83e52 1395 COMPONENT_BUILD_ENV += $(COMPONENT_BUILD_ENV.$(BITS))
NJ 1396 COMPONENT_BUILD_ARGS += $(COMPONENT_BUILD_ARGS.$(BITS))
1397 COMPONENT_INSTALL_ENV += $(COMPONENT_INSTALL_ENV.$(BITS))
1398 COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
4158c0 1399
3cec7d 1400 # declare these phony so that we avoid filesystem conflicts.
d56e92 1401 .PHONY:    prep build install publish test clean clobber
3cec7d 1402
4158c0 1403 # If there are no tests to execute
NJ 1404 NO_TESTS =    test-nothing
1405 test-nothing:
1406     @echo "There are no tests available at this time."
764663 1407
NJ 1408 # default behaviour for 'component-hook' target is to echo the component
1409 # name and version information, but more complex behaviour can be implemented
1410 # via command line setting of the COMPONENT_HOOK macro.
1411 COMPONENT_HOOK ?=    echo $(COMPONENT_NAME) $(COMPONENT_VERSION)
1412
1413 component-hook:
1414     @$(COMPONENT_HOOK)
1415
8203c7 1416 # We need shell/ksh93 to be able to run scripts in the tools directory
MT 1417 USERLAND_REQUIRED_PACKAGES += shell/ksh93
39e94f 1418
d180f2 1419 #
1420 # Packages with tools that are required to build Userland components
1421 #
1349f8 1422 USERLAND_REQUIRED_PACKAGES += metapackages/build-essential
d180f2 1423
e6ade5 1424 # Define substitution rules for some packages.
AL 1425 # Such package names may change and would be better defined with a macro to
1426 # avoid mass modification of the Makefiles.
1427
1428 # Runtime package names are changed at compiler version major bumps.
1429 REQUIRED_PACKAGES_SUBST+= GCC_RUNTIME_PKG
1430 REQUIRED_PACKAGES_SUBST+= GXX_RUNTIME_PKG
1431 REQUIRED_PACKAGES_SUBST+= GFORTRAN_RUNTIME_PKG
1432 REQUIRED_PACKAGES_SUBST+= GOBJC_RUNTIME_PKG
1433
3129b3 1434 # Generate requirements on all built python version variants for given packages
ccec59 1435 USERLAND_REQUIRED_PACKAGES += $(foreach ver,$(PYTHON_VERSIONS),$(USERLAND_REQUIRED_PACKAGES.python:%=%-$(subst .,,$(ver))))
MT 1436 REQUIRED_PACKAGES += $(foreach ver,$(PYTHON_VERSIONS),$(PYTHON_REQUIRED_PACKAGES:%=%-$(subst .,,$(ver))))
1437 TEST_REQUIRED_PACKAGES += $(foreach ver,$(PYTHON_VERSIONS),$(TEST_REQUIRED_PACKAGES.python:%=%-$(subst .,,$(ver))))
3129b3 1438
45844d 1439 # Generate requirements on all built perl version variants for given packages
ccec59 1440 USERLAND_REQUIRED_PACKAGES += $(foreach ver,$(PERL_VERSIONS),$(USERLAND_REQUIRED_PACKAGES.perl:%=%-$(subst .,,$(ver))))
MT 1441 REQUIRED_PACKAGES += $(foreach ver,$(PERL_VERSIONS),$(PERL_REQUIRED_PACKAGES:%=%-$(subst .,,$(ver))))
1442 TEST_REQUIRED_PACKAGES += $(foreach ver,$(PERL_VERSIONS),$(TEST_REQUIRED_PACKAGES.perl:%=%-$(subst .,,$(ver))))
45844d 1443
f3591a 1444 # Generate conflicting packages for all built python version variants for given package
ccec59 1445 TEST_CONFLICTING_PACKAGES += $(foreach ver,$(PYTHON_VERSIONS),$(TEST_CONFLICTING_PACKAGES.python:%=%-$(subst .,,$(ver))))
f3591a 1446
baff9a 1447 # Targets for some tools rarely used by the build framework.  We do not add
MT 1448 # these tools to USERLAND_REQUIRED_PACKAGES to do not pollute it.
1449 $(QUILT):
1450     @echo
1451     @echo "$(QUILT) is missing"
1452     @echo "Please install developer/quilt package"
1453     @echo
1454     @exit 1
1455
d180f2 1456 include $(WS_MAKE_RULES)/environment.mk
1349f8 1457 include $(WS_MAKE_RULES)/depend.mk
27cdce 1458 include $(WS_MAKE_RULES)/component.mk