Print this page
7661 illumos should provide 64bit perl modules (for omni)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/Makefile.lib
+++ new/usr/src/lib/Makefile.lib
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 # Copyright 2015 Gary Mills
22 22 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
23 23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 # Copyright (c) 2014, Joyent, Inc.
25 +# Copyright 2016 RackTop Systems.
25 26 #
26 27 #
27 28 # Definitions common to libraries.
28 29 #
29 30 # include global definitions; SRC should be defined in the shell.
30 31 # SRC is needed until RFE 1026993 is implemented.
31 32
32 33 include $(SRC)/Makefile.master
33 34
34 35 LORDER= lorder
35 36 TSORT= tsort
36 37
37 38 #
38 39 # By default, we define the source directory for libraries to be
39 40 # one level up from the ISA-specific directory, where the code is
40 41 # actually built. Many libraries define a 'common' directory to
41 42 # contain the source. These libraries must redefine SRCDIR as:
42 43 # SRCDIR = ../common
43 44 # Other variations are possible (../port, ../src, etc).
44 45 #
45 46 SRCDIR = ..
46 47
47 48 #
48 49 # We define MAPFILES here for the benefit of most libraries, those that
49 50 # follow the convention of having source files and other common files
50 51 # in the $(SRCDIR) directory. Libraries that do not follow this
51 52 # convention must define MAPFILES, or MAPFILEDIR for themselves.
52 53 # Libraries that do follow this convention but that need supplemental
53 54 # ISA-specific mapfiles can augment MAPFILES like this:
54 55 # MAPFILES += mapfile-vers
55 56 #
56 57 MAPFILEDIR = $(SRCDIR)
57 58 MAPFILES = $(MAPFILEDIR)/mapfile-vers
58 59
59 60 #
60 61 # If HDRDIR is left unset, then it's possible for the $(ROOTHDRDIR)/%
61 62 # install rule in lib/Makefile.targ to generate false matches if there
62 63 # are any common directory names between / and /usr/include (`xfn' is
63 64 # one common example). To prevent this, we set HDRDIR to a directory
64 65 # name that will almost surely not exist on the build machine.
65 66 #
66 67 HDRDIR= /__nonexistent_directory__
67 68
68 69 #
69 70 # We don't build archive (*.a) libraries by default anymore.
70 71 # If a component of the build needs to build an archive library
71 72 # for its own internal purposes, it can define LIBS for itself
72 73 # after including Makefile.lib, like this:
73 74 # LIBS = $(LIBRARY)
74 75 # or:
75 76 # LIBS = $(LIBRARYCCC)
76 77 # Archive libraries must not be installed in the proto area.
77 78 #
78 79 LIBS=
79 80 MACHLIBS= $(LIBS:%=$(MACH)/%)
80 81 MACHLIBS64= $(LIBS:%=$(MACH64)/%)
81 82 DYNLIB= $(LIBRARY:.a=.so$(VERS))
82 83 DYNLIBPSR= $(LIBRARY:.a=_psr.so$(VERS))
83 84 DYNLIBCCC= $(LIBRARYCCC:.a=.so$(VERS))
84 85 LIBLINKS= $(LIBRARY:.a=.so)
85 86 LIBLINKSCCC= $(LIBRARYCCC:.a=.so)
86 87 LIBNAME= $(LIBRARY:lib%.a=%)
87 88 LIBLINKPATH=
88 89 LIBNULL= null.a
89 90 ROOTHDRDIR= $(ROOT)/usr/include
90 91 ROOTLIBDIR= $(ROOT)/usr/lib
91 92 ROOTLIBDIR64= $(ROOT)/usr/lib/$(MACH64)
92 93 ROOTFS_LIBDIR= $(ROOT)/lib
93 94 ROOTFS_LIBDIR64= $(ROOT)/lib/$(MACH64)
94 95 ROOTLINTDIR= $(ROOTLIBDIR)
95 96 ROOTFS_LINTDIR= $(ROOTFS_LIBDIR)
96 97 ROOTFS_LINTDIR64= $(ROOTFS_LIBDIR64)
97 98 ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%)
98 99 HDRSRCS= $(HDRS:%=$(HDRDIR)/%)
99 100 CHECKHDRS= $(HDRSRCS:%.h=%.check)
100 101 ROOTLIBS= $(LIBS:%=$(ROOTLIBDIR)/%)
101 102 ROOTLIBS64= $(LIBS:%=$(ROOTLIBDIR64)/%)
102 103 ROOTFS_LIBS= $(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
103 104 ROOTFS_LIBS64= $(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
104 105 ROOTLINKS= $(ROOTLIBDIR)/$(LIBLINKS)
105 106 ROOTLINKS64= $(ROOTLIBDIR64)/$(LIBLINKS)
106 107 ROOTFS_LINKS= $(ROOTFS_LIBDIR)/$(LIBLINKS)
107 108 ROOTFS_LINKS64= $(ROOTFS_LIBDIR64)/$(LIBLINKS)
108 109 ROOTLINKSCCC= $(ROOTLIBDIR)/$(LIBLINKSCCC)
109 110 ROOTLINKSCCC64= $(ROOTLIBDIR64)/$(LIBLINKSCCC)
110 111 ROOTFS_LINKSCCC= $(ROOTFS_LIBDIR)/$(LIBLINKSCCC)
111 112 ROOTFS_LINKSCCC64= $(ROOTFS_LIBDIR64)/$(LIBLINKSCCC)
112 113 ROOTLINT= $(LINTSRC:%=$(ROOTLINTDIR)/%)
113 114 ROOTFS_LINT= $(LINTSRC:%=$(ROOTFS_LINTDIR)/%)
114 115 ROOTFS_LINT64= $(LINTSRC:%=$(ROOTFS_LINTDIR64)/%)
115 116 ROOTMAN3= $(ROOT)/usr/share/man/man3
116 117 ROOTMAN3FILES= $(MAN3FILES:%=$(ROOTMAN3)/%)
117 118 $(ROOTMAN3FILES) := FILEMODE= 444
118 119
119 120 # Demo rules
120 121 DEMOFILES=
121 122 DEMOFILESRCDIR= common
122 123 ROOTDEMODIRBASE= __nonexistent_directory__
123 124 ROOTDEMODIRS=
124 125 ROOTDEMOFILES= $(DEMOFILES:%=$(ROOTDEMODIRBASE)/%)
125 126 $(ROOTDEMODIRS) := DIRMODE = 755
126 127
127 128 LINTLIB= llib-l$(LIBNAME).ln
128 129 LINTFLAGS= -uaxm
129 130 LINTFLAGS64= -uaxm -m64
130 131 LINTSRC= $(LINTLIB:%.ln=%)
131 132 LINTOUT= lint.out
132 133 ARFLAGS= r
133 134 SONAME= $(DYNLIB)
134 135 # For most libraries, we should be able to resolve all symbols at link time,
135 136 # either within the library or as dependencies, all text should be pure, and
136 137 # combining relocations into one relocation table reduces startup costs.
137 138 # All options are tunable to allow overload/omission from lower makefiles.
138 139
139 140 #
140 141 # DTrace related rules
141 142 #
142 143 # These allow for multiple USDT providers to be specified by a library.
143 144 # If a library needs to break up the set of objects that are passed to
144 145 # the dtrace -G invocation, then they can place the following in heir
145 146 # Makefile.com:
146 147 #
147 148 # pics/<provider>.o := USDT_G_PICS = <files>
148 149 #
149 150 # <provider> should be replaced with the basename of one of the USDT
150 151 # providers specified in USDT_PROVIDERS in their Makefile.com.
151 152 #
152 153 USDT_HEADERS= $(USDT_PROVIDERS:%.d=%_impl.h)
153 154 USDT_PICS= $(USDT_PROVIDERS:%.d=pics/%.o)
154 155 USDT_G_PICS= $(PICS)
155 156
156 157
157 158 HSONAME= -h$(SONAME)
158 159 DYNFLAGS= $(HSONAME) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
159 160 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
160 161
161 162 LDLIBS= $(LDLIBS.lib)
162 163
163 164 OBJS= $(OBJECTS:%=objs/%)
164 165 PICS= $(OBJECTS:%=pics/%)
165 166
166 167 # Declare that all library .o's can all be made in parallel.
167 168 # The DUMMY target is for those instances where OBJS and PICS
168 169 # are empty (to avoid an unconditional .PARALLEL declaration).
↓ open down ↓ |
134 lines elided |
↑ open up ↑ |
169 170 .PARALLEL: $(OBJS) $(PICS) DUMMY
170 171
171 172 # default value for "portable" source
172 173 SRCS= $(OBJECTS:%.o=$(SRCDIR)/%.c)
173 174
174 175 # default build of an archive and a shared object,
175 176 # overridden locally when extra processing is needed
176 177 BUILD.AR= $(AR) $(ARFLAGS) $@ $(AROBJS)
177 178 BUILD.SO= $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
178 179 $(PICS) $(EXTPICS) $(USDT_PICS) $(LDLIBS)
180 +BUILD64.SO= $(CC64) $(CFLAGS64) -o $@ $(GSHARED) $(DYNFLAGS) \
181 + $(PICS) $(EXTPICS) $(USDT_PICS) -L $(ROOTLIBDIR64) $(LDLIBS)
179 182 BUILDCCC.SO= $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
180 183 $(PICS) $(EXTPICS) $(LDLIBS)
184 +BUILDCCC64.SO= $(CCC64) $(CCFLAGS64) -o $@ $(GSHARED) $(DYNFLAGS) \
185 + $(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED64)
181 186
182 187 # default dynamic library symlink
183 188 INS.liblink= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
184 189 INS.liblinkccc= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
185 190
186 191 # default 64-bit dynamic library symlink
187 192 INS.liblink64= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
188 193 INS.liblinkccc64= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
189 194
190 195 #
191 196 # If appropriate, augment POST_PROCESS_O and POST_PROCESS_SO to do CTF
192 197 # processing. We'd like to just conditionally append to POST_PROCESS_O and
193 198 # POST_PROCESS_SO, but ParallelMake has a bug which causes the same value to
194 199 # sometimes get appended more than once, which will cause ctfconvert to fail.
195 200 # So, instead we introduce CTFCONVERT_POST and CTFMERGE_POST, which are always
196 201 # appended to POST_PROCESS_O and POST_PROCESS_SO but are no-ops unless CTF
197 202 # processing should be done.
198 203 #
199 204 CTFCONVERT_POST = :
200 205 CTFMERGE_POST = :
201 206 POST_PROCESS_O += ; $(CTFCONVERT_POST)
202 207 POST_PROCESS_SO += ; $(CTFMERGE_POST)
203 208
204 209 CTFMERGE_LIB = $(CTFMERGE) $(CTFMRGFLAGS) -t -f -L VERSION -o $@ $(PICS)
205 210
206 211 # conditional assignments
207 212
208 213 $(OBJS) := sparc_CFLAGS += -xregs=no%appl
209 214
210 215 $(PICS) := sparc_CFLAGS += -xregs=no%appl $(sparc_C_PICFLAGS)
211 216 $(PICS) := sparcv9_CFLAGS += -xregs=no%appl $(sparcv9_C_PICFLAGS)
212 217 $(PICS) := i386_CFLAGS += $(i386_C_PICFLAGS)
213 218 $(PICS) := amd64_CFLAGS += $(amd64_C_PICFLAGS)
214 219 $(PICS) := CCFLAGS += $(CC_PICFLAGS)
215 220 $(PICS) := CPPFLAGS += -DPIC -D_REENTRANT
216 221 $(PICS) := sparcv9_CCFLAGS += -xregs=no%appl $(sparcv9_CC_PICFLAGS)
217 222 $(PICS) := amd64_CCFLAGS += $(amd64_CC_PICFLAGS)
218 223 $(PICS) := CFLAGS += $(CTF_FLAGS)
219 224 $(PICS) := CFLAGS64 += $(CTF_FLAGS)
220 225 $(PICS) := CTFCONVERT_POST = $(CTFCONVERT_O)
221 226 $(DYNLIB) := CTFMERGE_POST = $(CTFMERGE_LIB)
222 227
223 228 $(LINTLIB):= LOG = -DLOGGING
224 229 $(LIBRARY):= AROBJS = $(OBJS)
225 230 $(LIBRARY):= DIR = objs
226 231 $(DYNLIB):= DIR = pics
227 232 $(DYNLIBCCC):= DIR = pics
228 233
229 234 SONAMECCC= $(DYNLIBCCC)
230 235 HSONAMECCC= -h $(SONAMECCC)
231 236 #
232 237 # Keep in sync with the standard DYNFLAGS
233 238 #
234 239 $(DYNLIBCCC):= DYNFLAGS = $(HSONAMECCC) $(ZTEXT) $(ZDEFS) \
235 240 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) \
236 241 $(BDIRECT) $(NORUNPATH)
237 242
238 243
239 244 # build rule for "portable" source
240 245 objs/%.o pics/%.o: %.c
241 246 $(COMPILE.c) -o $@ $<
242 247 $(POST_PROCESS_O)
243 248
244 249 objs/%.o pics/%.o: %.cc
245 250 $(COMPILE.cc) -o $@ $<
246 251 $(POST_PROCESS_O)
247 252
248 253 .PRECIOUS: $(LIBS)
249 254
250 255 # Define the majority text domain in this directory.
251 256 TEXT_DOMAIN= SUNW_OST_OSLIB
252 257
253 258 $(ROOTMAN3)/%: %.sunman
254 259 $(INS.rename)
255 260
256 261 #
257 262 # For library source code, we expect that some symbols may not be used or
258 263 # may *appear* to be able to rescoped to static; shut lint up. Never add
259 264 # a flag here unless you're *sure* that all libraries need to be linted
260 265 # with it.
261 266 #
262 267 LINTCHECKFLAGS = -m -erroff=E_NAME_DEF_NOT_USED2
263 268 LINTCHECKFLAGS += -erroff=E_NAME_DECL_NOT_USED_DEF2
264 269
265 270 #
266 271 # Target Architecture
267 272 #
268 273 TARGETMACH= $(MACH)
269 274
270 275 #
271 276 # Allow people to define their own clobber rules. Normal makefiles
272 277 # shouldn't override this - they should override $(CLOBBERFILES) instead.
273 278 #
274 279 CLOBBERTARGFILES= $(LIBS) $(DYNLIB) $(CLOBBERFILES)
↓ open down ↓ |
84 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX