-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile.defs
187 lines (153 loc) · 5.04 KB
/
Makefile.defs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2020 Joyent, Inc.
# Copyright 2024 MNX Cloud, Inc.
#
BASE = $(PWD)
DESTDIR = $(BASE)/../proto
include $(BASE)/../../../build.env
VER.32 = $(VER)-32$(STRAP)
VER.64 = $(VER)-64$(STRAP)
OBJ.32 = $(VER.32)$(SEPARATE_BUILD:yes=.build)
OBJ.64 = $(VER.64)$(SEPARATE_BUILD:yes=.build)
CTF.32 = ctfobjects-32$(STRAP)
CTF.64 = ctfobjects-64$(STRAP)
FETCH_BASE = https://us-central.manta.mnx.io/Joyent_Dev/public/illumos-extra
ifeq ($(STRAP),strap)
STRAPPROTO = $(DESTDIR)
GCCBIN = $(DESTDIR)/usr/gcc/$(PRIMARY_COMPILER_VER)/bin/gcc
GXXBIN = $(DESTDIR)/usr/gcc/$(PRIMARY_COMPILER_VER)/bin/g++
LIBSTDCXX_RUNPATH = usr/gcc/$(PRIMARY_COMPILER_VER)/lib
else
STRAPPROTO = $(DESTDIR:proto=proto.strap)
GCCBIN = $(STRAPPROTO)/usr/bin/gcc
GXXBIN = $(STRAPPROTO)/usr/bin/g++
endif
#
# As we ship some rather downrev software, there's a good chance it might fall
# foul of newer GCC's undefined-behavior optimizations; skip those. As it's in
# general painful to ensure that $(CFLAGS) gets passed down correctly, we'll
# just set it directly as the compiler...
#
ifneq ($(PRIMARY_COMPILER_VER),4)
GCCBIN += -fno-aggressive-loop-optimizations
GXXBIN += -fno-aggressive-loop-optimizations
endif
GCC.32 = $(GCCBIN) -m32
GXX.32 = $(GXXBIN) -m32
GCC.64 = $(GCCBIN) -m64
GXX.64 = $(GXXBIN) -m64
# The version of gcc in /opt/local/bin varies depending on the pkgsrc release
GCC.host_prefix ?= /opt/local/bin
GCC.host.32 = $(GCC.host_prefix)/gcc -m32
GXX.host.32 = $(GCC.host_prefix)/g++ -m32
GCC.host.64 = $(GCC.host_prefix)/gcc -m64
GXX.host.64 = $(GCC.host_prefix)/g++ -m64
PATH = $(STRAPPROTO)/usr/bin:/usr/bin:/usr/sbin:/sbin:/opt/local/bin
MAKE = gmake
MAX_JOBS = 128
PARALLEL = -j$(MAX_JOBS)
MAKE_VERBOSE = V=1
LEX = /opt/local/bin/lex
YACC = /opt/local/bin/yacc
GPATCH = /opt/local/bin/gpatch
SYSINCDIRS = /usr/include
SYSLIBDIRS = /usr/lib /lib
BUILD32 = yes
BUILD64 =
SEPARATE_BUILD =
CPPFLAGS = $(SYSINCDIRS:%=-isystem $(DESTDIR)/%)
#
# We ship platform-private perl modules (e.g. from ntp) in this directory,
# and using this perl interpeter:
#
PATH_PERL = /usr/perl5/bin/perl
PERLLIBDIR = /usr/perl5/5.12/lib
#
# These are all definitions that relate to Sun Make. There are basically two
# different sets that we care about. The first is the boostrap make. This is
# used to build the strap make. Once we have the strap make, it is used for all
# other makes. Beacuse MAKE is used extensively to mean GNU make in these
# makefiles, we instead use SUN_MAKE and SUM_MAKE_STRAP.
#
SUN_MAKE_STRAP=/opt/local/bin/dmake
SUN_MAKE=$(STRAPPROTO)/usr/bin/dmake
#
# Because of bugs in ntp, we need to be able to refer to the target specific
# flags as well as the generic flags later on.
#
ifneq ($(STRAP),strap)
GENLDFLAGS = -Wl,-zassert-deflib -Wl,-zfatal-warnings
endif
T32_LDFLAGS = $(SYSLIBDIRS:%=-L$(DESTDIR)/%)
T64_LDFLAGS = $(SYSLIBDIRS:%=-L$(DESTDIR)/%/64)
LDFLAGS = $(T32_LDFLAGS) $(GENLDFLAGS)
LDFLAGS.64 = $(T64_LDFLAGS) $(GENLDFLAGS)
AUTOCONF_CC = CC="$(GCC.32)"
AUTOCONF_CXX = CXX="$(GXX.32)"
AUTOCONF_CC.64 = CC="$(GCC.64)"
AUTOCONF_CXX.64 = CXX="$(GXX.64)"
AUTOCONF_CPPFLAGS = CPPFLAGS="$(CPPFLAGS)"
AUTOCONF_CFLAGS = CFLAGS="$(CFLAGS)"
AUTOCONF_CFLAGS.64 = CFLAGS="$(CFLAGS.64)"
AUTOCONF_LDFLAGS = LDFLAGS="$(LDFLAGS)"
AUTOCONF_LDFLAGS.64 = LDFLAGS="$(LDFLAGS.64)"
AUTOCONF_LIBS = LIBS="$(LIBS)"
AUTOCONF_LIBS.64 = LIBS="$(LIBS.64)"
AUTOCONF_OUT = config.status
AUTOCONF_OUT.32 = $(OBJ.32)/$(AUTOCONF_OUT)
AUTOCONF_OUT.64 = $(OBJ.64)/$(AUTOCONF_OUT)
AUTOCONF_PREFIX = /usr
AUTOCONF_ENV = \
PKG_CONFIG_LIBDIR="" \
$(AUTOCONF_CC) \
$(AUTOCONF_CXX) \
$(AUTOCONF_CPPFLAGS) \
$(AUTOCONF_CFLAGS) \
$(AUTOCONF_LDFLAGS) \
$(AUTOCONF_LIBS)
AUTOCONF_ENV.64 = \
PKG_CONFIG_LIBDIR="" \
$(AUTOCONF_CC.64) \
$(AUTOCONF_CXX.64) \
$(AUTOCONF_CPPFLAGS) \
$(AUTOCONF_CFLAGS.64) \
$(AUTOCONF_LDFLAGS.64) \
$(AUTOCONF_LIBS.64)
AUTOCONF_OPTS = \
--prefix=$(AUTOCONF_PREFIX)
AUTOCONF_OPTS.32 = \
$(AUTOCONF_OPTS)
AUTOCONF_OPTS.64 = \
$(AUTOCONF_OPTS)
ALL_TGT =
OVERRIDES = $(MAKE_VERBOSE)
TARBALL = $(VER).tar.gz
TARBALL_COMPRESS = -z
UNPACK_SENTINEL = configure
FROB_SENTINEL.32 = chmod 755 $(VER.32)/$(UNPACK_SENTINEL)
FROB_SENTINEL.64 = chmod 755 $(VER.64)/$(UNPACK_SENTINEL)
PATCHSTRIP = 1
APPLY_PATCHES.32 = \
for p in $(PATCHES); do \
echo "Applying $$p"; \
$(GPATCH) -d .unpack32/$(VER) -p$(PATCHSTRIP) < "$$p" || exit 1; \
done
APPLY_PATCHES.64 = \
for p in $(PATCHES); do \
echo "Applying $$p"; \
$(GPATCH) -d .unpack64/$(VER) -p$(PATCHSTRIP) < "$$p" || exit 1; \
done
MAKE_CTF = CTFCONVERTFLAGS=$(CTFCONVERTFLAGS) $(BASE)/../tools/make-ctf
MAKE_CTF.32 = $(MAKE_CTF) $(OBJ.32) $(CTF.32) $(VER)
MAKE_CTF.64 = $(MAKE_CTF) $(OBJ.64) $(CTF.64) $(VER)
.DEFAULT_GOAL = all