blob: 01ea5bd271feae741f3bf69b3d5b96511ab9b830 [file] [log] [blame]
duke6e45e102007-12-01 00:00:00 +00001#
xdonod10b8cf2008-07-02 12:55:45 -07002# Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
duke6e45e102007-12-01 00:00:00 +00003# 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. Sun designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Sun in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22# CA 95054 USA or visit www.sun.com if you need additional information or
23# have any questions.
24#
25
26#
27# Makefile to specify compiler flags for programs and libraries
28# targeted to Solaris. Should not contain any rules.
29#
30# WARNING: This file is shared with other workspaces.
31# So when it includes other files, it must use JDK_TOPDIR.
32#
33
34# Warning: the following variables are overridden by Defs.gmk. Set
35# values will be silently ignored:
36# CFLAGS (set $(OTHER_CFLAGS) instead)
37# CPPFLAGS (set $(OTHER_CPPFLAGS) instead)
38# CXXFLAGS (set $(OTHER_CXXFLAGS) instead)
39# LDFLAGS (set $(OTHER_LDFAGS) instead)
40# LDLIBS (set $(EXTRA_LIBS) instead)
41# LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
42# LINTFLAGS (set $(OTHER_LINTFLAGS) instead)
43
44# Get shared JDK settings
45include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
46
47ifndef PLATFORM_SRC
ohair26e0af62008-03-04 09:52:54 -080048PLATFORM_SRC = $(BUILDDIR)/../src/solaris
duke6e45e102007-12-01 00:00:00 +000049endif # PLATFORM_SRC
50
51# Platform specific closed sources
52ifndef OPENJDK
53 ifndef CLOSED_PLATFORM_SRC
ohair26e0af62008-03-04 09:52:54 -080054 CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
duke6e45e102007-12-01 00:00:00 +000055 endif
56endif
57
58# platform specific include files
59PLATFORM_INCLUDE_NAME = $(PLATFORM)
60PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
61
62# suffix used for make dependencies files
63DEPEND_SUFFIX = d
64# suffix used for lint files
65LINT_SUFFIX = ln
66# The suffix applied to the library name for FDLIBM
67FDDLIBM_SUFFIX = a
68# The suffix applied to scripts (.bat for windows, nothing for unix)
69SCRIPT_SUFFIX =
70# CC compiler object code output directive flag value
71CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
72CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
73
74#
75# Default HPI libraries. Build will build only native unless
76# overriden at the make command line. This makes it convenient for
77# people doing, say, a pthreads port -- they can create a posix
78# directory here, and say "gnumake HPIS=posix" at the top
79# level.
80#
81HPIS = native
82
83#
84# Java default optimization (-x04/-O2) etc. Applies to the VM.
85#
86ifeq ($(PRODUCT), java)
87 _OPT = $(CC_HIGHER_OPT)
88else
89 _OPT = $(CC_LOWER_OPT)
90 CPPFLAGS_DBG += -DLOGGING -DDBINFO
91endif
92
93#
94# If -Xa is in CFLAGS_COMMON it will end up ahead of $(POPT) for the
95# optimized build, and that ordering of the flags completely freaks
96# out cc. Hence, -Xa is instead in each CFLAGS variant.
97#
98# The more unusual options to the Sun C compiler:
99# -v Stricter type checking, more error checking
100# (To turn ALL warnings into fatals, use -errwarn=%all)
101# -xstrconst Place string literals and constants in read-only area
102# (means you can't write on your string literals)
103# -xs Force debug information (stabs) into the .so or a.out
104# (makes the library/executable debuggable without the
105# .o files needing to be around, but at a space cost)
106# -g & -O If you add the -g option to the optimized compiles
107# you will get better stack retraces, the code is
108# still optimized. This includes a space cost too.
109# -xc99=%none Do NOT allow for c99 extensions to be used.
110# e.g. declarations must precede statements
111# -xCC Allow the C++ style of comments in C: //
112# Required with many of the source files.
113# -mt Assume multi-threaded (important)
114#
115
116#
117# Debug flag for C and C++ compiler
118#
119CFLAGS_DEBUG_OPTION=-g
120CXXFLAGS_DEBUG_OPTION=-g
121
122# Turn off -g if we are doing tcov build
123ifdef TCOV_BUILD
124 CFLAGS_DEBUG_OPTION=
125 CXXFLAGS_DEBUG_OPTION=
126endif
127
128# FASTDEBUG: Optimize the -g builds, gives us a faster debug java
129# If true adds -O to the debug compiles. This allows for any assert
130# tests to remain and debug checking. The resulting code is faster
131# but less debuggable. Stack traces are still valid, although only
132# approximate line numbers are given. Printing of local variables
133# during a debugging session is not possible, but stepping and
134# printing of global or static variables should be possible.
135# Performance/size of files should be about the same, maybe smaller.
136#
137ifeq ($(FASTDEBUG), true)
138 CC_FASTDEBUG_OPT = $(CC_LOWER_OPT)
139 CFLAGS_DEBUG_OPTION = -g $(CC_FASTDEBUG_OPT)
140 CXXFLAGS_DEBUG_OPTION = -g0 $(CC_FASTDEBUG_OPT)
141endif
142
143CFLAGS_COMMON = -v -mt -L$(OBJDIR) -xc99=%none
144CFLAGS_COMMON += -xCC
145CFLAGS_COMMON += -errshort=tags
146CFLAGS_OPT = $(POPT)
147CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION)
148CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED)
149
150# Assume MT behavior all the time (important)
151CXXFLAGS_COMMON = -mt
152
153# Assume no C++ exceptions are used
154CXXFLAGS_COMMON += -features=no%except -DCC_NOEX
155
156# For C++, these options tell it to assume nothing about locating libraries
157# either at compile time, or at runtime. Use of these options will likely
158# require the use of -L and -R options to indicate where libraries will
159# be found at compile time (-L) and at runtime (-R).
160# The /usr/lib location comes for free, so no need to specify that one.
161# Note: C is much simplier and there is no need for these options. This
162# is mostly needed to avoid dependencies on libraries in the
163# Compiler install area, also see LIBCXX and LIBM.
164CXXFLAGS_COMMON += -norunpath -xnolib
165
166#
167# Treat compiler warnings as errors, if requested
168#
169ifeq ($(COMPILER_WARNINGS_FATAL),true)
170 CFLAGS_COMMON += -errwarn=%all
171 CXXFLAGS_COMMON += -errwarn=%all
172endif
173
174CXXFLAGS_OPT = $(POPT)
175CXXFLAGS_DBG = $(CXXFLAGS_DEBUG_OPTION)
176CXXFLAGS_COMMON += $(CFLAGS_REQUIRED)
177
178# Add -xstrconst to the library compiles. This forces all string
179# literals into the read-only data section, which prevents them from
180# being written to and increases the runtime pages shared on the system.
181#
182ifdef LIBRARY
183 CFLAGS_COMMON +=-xstrconst
184endif
185
186# Source browser database
187#
188# COMPILE_WITH_SB
189# If defined adds -xsb to compiles and creates a
190# source browsing database during compilation.
191#
192ifdef COMPILE_WITH_SB
193 ifeq ($(LIBRARY), java)
194 CFLAGS_DBG += -xsb
195 endif
196endif
197
198# Lint Flags:
199# -Xa ANSI C plus K&R, favor ANSI rules
duke6e45e102007-12-01 00:00:00 +0000200# -fd report on old style func defs
201# -errchk=structarg report on 64bit struct args by value
202# -errchk=longptr64 report on 64bit to 32bit issues (ignores casts)
203# -errchk=parentheses report on suggested use of extra parens
204# -v suppress unused args
205# -x suppress unused externs
206# -u suppress extern func/vars used/defined
207# -errfmt=simple use one line errors with position info
ohair3f083862008-06-04 09:38:18 -0700208# $(LINT_XARCH_OPTION) See Compiler-sun.gwk
duke6e45e102007-12-01 00:00:00 +0000209
210LINTFLAGS_COMMON = -Xa
211LINTFLAGS_COMMON += -fd
212LINTFLAGS_COMMON += -errchk=structarg,longptr64,parentheses
213LINTFLAGS_COMMON += -v
214LINTFLAGS_COMMON += -x
215LINTFLAGS_COMMON += -u
216LINTFLAGS_COMMON += -errfmt=simple
217LINTFLAGS_OPT =
218LINTFLAGS_DBG =
219
220# The -W0,-noglobal tells the compiler to NOT generate mangled global
221# ELF data symbols for file local static data.
222# This can break fix&continue, but we'd rather do the same compilations
223# for deliverable bits as we do for non-deliverable bits
224# Tell the compilers to never generate globalized names, all the time.
225CFLAGS_COMMON += -W0,-noglobal
226
ohair3f083862008-06-04 09:38:18 -0700227# If we have a specific arch value to use, add it
228CFLAGS_COMMON += $(XARCH_OPTION)
229CXXFLAGS_COMMON += $(XARCH_OPTION)
230ASFLAGS_COMMON += $(AS_XARCH_OPTION)
231EXTRA_LIBS += $(XARCH_OPTION)
232LINTFLAGS_COMMON += $(LINT_XARCH_OPTION)
duke6e45e102007-12-01 00:00:00 +0000233
234#
235# uncomment the following to build with PERTURBALOT set
236#
237# OTHER_CFLAGS += -DPERTURBALOT
238#
239
240CPPFLAGS_COMMON = -D$(ARCH_FAMILY) -D__solaris__ -D_REENTRANT
241CPPFLAGS_OPT =
242CPPFLAGS_DBG = -DDEBUG
243
244ifeq ($(ARCH_FAMILY), i586)
245 # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
246 # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
247 # (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h).
248 # Note: -Dmacro is the same as #define macro 1
249 # -Dmacro= is the same as #define macro
250 #
251 CPPFLAGS_COMMON += -DcpuIntel -D_LITTLE_ENDIAN= -D$(LIBARCH)
252 # Turn off a superfluous compiler error message on Intel
253 CFLAGS_COMMON += -erroff=E_BAD_PRAGMA_PACK_VALUE
254endif
255
256# Java memory management is based on memory mapping by default, but a
257# system only assuming malloc/free can be built by adding -DUSE_MALLOC
258
259CPPFLAGS_COMMON += -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS
260CPPFLAGS_OPT += -DTRIMMED
261
262LDFLAGS_DEFS_OPTION = -z defs
263LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION)
264
265#
266# -L paths for finding and -ljava
267#
268LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
269LDFLAGS_OPT =
270LDFLAGS_DBG =
271
272#
273# We never really want the incremental linker, ever
274# The -xildoff option tells Sun's compilers to NOT use incremental linker
275#
276LDFLAGS_COMMON += -xildoff
277
278ifdef LIBRARY
279 # Libraries need to locate other libraries at runtime, and you can tell
280 # a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
281 # buried inside the .so. The $ORIGIN says to look relative to where
282 # the library itself is and it can be followed with relative paths from
283 # that. By default we always look in $ORIGIN, optionally we add relative
284 # paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
285 # The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
286 # Try: 'dump -Lv lib*.so' to see these settings in a library.
287 #
288 LDFLAGS_COMMON += -R\$$ORIGIN
289 LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-R\$$ORIGIN/%)
290endif
291
292EXTRA_LIBS += -lc
293
294# Postprocessing is done on the images directories only
295#
296ifeq ($(VARIANT), OPT)
297 ifeq ($(PARTIAL_GPROF), true)
298 NO_STRIP = true
299 endif
300 ifeq ($(GPROF), true)
301 NO_STRIP = true
302 endif
303 ifneq ($(NO_STRIP), true)
304 # Debug 'strip -x' leaves local function Elf symbols (better stack traces)
305 POST_STRIP_PROCESS = $(STRIP) -x
306 endif
307endif
308POST_MCS_PROCESS=$(MCS) -d -a "JDK $(FULL_VERSION)"
309
310#
311# Sun C compiler will take -M and pass it on to ld.
312# Usage: ld $(LD_MAPFILE_FLAG) mapfile *.o
313#
314ifeq ($(CC_VERSION),gcc)
315LD_MAPFILE_FLAG = -Xlinker -M -Xlinker
316else
317LD_MAPFILE_FLAG = -M
318endif
319
320#
321# Variables globally settable from the make command line (default
322# values in brackets):
323# GPROF (false)
324# Eg: % gnumake GPROF=true
325GPROF = false
326ifeq ($(GPROF), true)
327 CFLAGS_COMMON += -DGPROF -xpg
328 EXTRA_LIBS += -xpg
329endif
330
331# PARTIAL_GPROF is to be used ONLY during compilation - it should not
332# appear during linking of libraries or programs. It also should
333# prevent linking with -z defs to allow a symbol to remain undefined.
334#
335PARTIAL_GPROF = false
336ifeq ($(PARTIAL_GPROF), true)
337 CFLAGS_GPROF += -xpg
338 LDFLAGS_DEFS_OPTION = -z nodefs
339endif
340
341#
342# For a TCOV build we add in the TCOV_OPTION
343#
344ifdef TCOV_BUILD
345 TCOV_OPTION = -xprofile=tcov
346 LDFLAGS_COMMON += $(TCOV_OPTION) -Kpic
347 CFLAGS_COMMON += $(TCOV_OPTION)
348 CXXFLAGS_COMMON += $(TCOV_OPTION)
349 EXTRA_LIBS += $(TCOV_OPTION)
350 LDNOMAP=true
351endif
352
353#
354# Solaris only uses native threads.
355#
356THREADS_FLAG= native
357THREADS_DIR= threads
358
359#
360# Support for Quantify.
361#
362ifdef QUANTIFY
363 QUANTIFY_CMD = quantify
364 QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
365 LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS)
366 ifdef LIBRARY
367 CFLAGS_COMMON += -K PIC
368 endif
369endif
370
371#
372# Support for Purify.
373#
374ifdef PURIFY
375 PURIFY_CMD = /net/suntools.eng/export/tools/sparc/bin/purify
376 PURIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
377 LINK_PRE_CMD = $(PURIFY_CMD) $(PURIFY_OPTIONS)
378 ifdef LIBRARY
379 CFLAGS_COMMON += -K PIC
380 endif
381endif
382
383#
384# Different "levels" of optimization.
385#
386ifeq ($(CC_VERSION),gcc)
387 CC_HIGHEST_OPT = -O3
388 CC_HIGHER_OPT = -O3
389 CC_LOWER_OPT = -O2
390 CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer
391 CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer
392 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
393 # (See Rules.gmk) May need to wait for gcc 5?
394 AUTOMATIC_PCH_OPTION =
395else
396 # Highest could be -xO5, but indications are that -xO5 should be reserved
397 # for a per-file use, on sources with known performance impacts.
398 CC_HIGHEST_OPT = -xO4
399 CC_HIGHER_OPT = -xO4
400 CC_LOWER_OPT = -xO2
401 #
402 # WARNING: Use of _OPT=$(CC_HIGHEST_OPT) in your Makefile needs to be
403 # done with care, there are some assumptions below that need to
404 # be understood about the use of pointers, and IEEE behavior.
405 #
406 # Use non-standard floating point mode (not IEEE 754)
407 CC_HIGHEST_OPT += -fns
408 # Do some simplification of floating point arithmetic (not IEEE 754)
409 CC_HIGHEST_OPT += -fsimple
410 # Use single precision floating point with 'float'
411 CC_HIGHEST_OPT += -fsingle
412 # Assume memory references via basic pointer types do not alias
413 # (Source with excessing pointer casting and data access with mixed
414 # pointer types are not recommended)
415 CC_HIGHEST_OPT += -xalias_level=basic
416 # Use intrinsic or inline versions for math/std functions
417 # (If you expect perfect errno behavior, do not use this)
418 CC_HIGHEST_OPT += -xbuiltin=%all
419 # Loop data dependency optimizations (need -xO3 or higher)
420 CC_HIGHEST_OPT += -xdepend
421 # Pointer parameters to functions do not overlap
422 # (Similar to -xalias_level=basic usage, but less obvious sometimes.
423 # If you pass in multiple pointers to the same data, do not use this)
424 CC_HIGHEST_OPT += -xrestrict
425 # Inline some library routines
426 # (If you expect perfect errno behavior, do not use this)
427 CC_HIGHEST_OPT += -xlibmil
428 # Use optimized math routines
429 # (If you expect perfect errno behavior, do not use this)
430 # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
431 # CC_HIGHEST_OPT += -xlibmopt
432 ifeq ($(ARCH_FAMILY), sparc)
433 # Assume at most 8byte alignment, raise SIGBUS on error
434 ### Presents an ABI issue with customer JNI libs?
435 ####CC_HIGHEST_OPT += -xmemalign=8s
436 # Automatic prefetch instructions, explicit prefetch macros
437 CC_HIGHEST_OPT += -xprefetch=auto,explicit
438 # Pick ultra as the chip to optimize to
439 CC_HIGHEST_OPT += -xchip=ultra
440 endif
441 ifeq ($(ARCH), i586)
442 # Pick pentium as the chip to optimize to
443 CC_HIGHEST_OPT += -xchip=pentium
444 endif
445 ifdef LIBRARY
446 # The Solaris CBE (Common Build Environment) requires that the use
447 # of appl registers be disabled when compiling a public library (or
448 # a library that's loaded by a public library) on sparc.
449 CFLAGS_REQUIRED_sparc += -xregs=no%appl
450 CFLAGS_REQUIRED_sparcv9 += -xregs=no%appl
451 endif
452 ifeq ($(shell $(EXPR) $(CC_VER) \> 5.6), 1)
453 # Do NOT use the frame pointer register as a general purpose opt register
454 CFLAGS_REQUIRED_i586 += -xregs=no%frameptr
455 CFLAGS_REQUIRED_amd64 += -xregs=no%frameptr
456 # We MUST allow data alignment of 4 for sparc V8 (32bit)
457 # Presents an ABI issue with customer JNI libs? We must be able to
458 # to handle 4byte aligned objects? (rare occurance, but possible?)
459 CFLAGS_REQUIRED_sparc += -xmemalign=4s
460 endif
461 # Just incase someone trys to use the SOS9 compilers
462 ifeq ($(CC_VER), 5.6)
463 # We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s)
464 CFLAGS_REQUIRED_sparc += -xmemalign=4s
465 endif
466 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
467 # (See Rules.gmk) The SS11 -xpch=auto* options appear to be broken.
468 AUTOMATIC_PCH_OPTION =
469endif
470CC_NO_OPT =
471
472# If NO_OPTIMIZATIONS is defined in the environment, turn all optimzations off
473ifdef NO_OPTIMIZATIONS
474 CC_HIGHEST_OPT = $(CC_NO_OPT)
475 CC_HIGHER_OPT = $(CC_NO_OPT)
476 CC_LOWER_OPT = $(CC_NO_OPT)
477endif
478
479# Flags required all the time
480CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
481
482# Add processor specific options for optimizations
483CC_HIGHEST_OPT += $(_OPT_$(ARCH))
484CC_HIGHER_OPT += $(_OPT_$(ARCH))
485CC_LOWER_OPT += $(_OPT_$(ARCH))
486
487# Secret compiler optimization options that should be in the above macros
488# but since they differ in format from C to C++, are added into the C or
489# C++ specific macros for compiler flags.
490#
491# On i586 we need to tell the code generator to ALWAYS use a
492# frame pointer.
493ifeq ($(ARCH_FAMILY), i586)
494 # Note that in 5.7, this is done with -xregs=no%frameptr
495 ifeq ($(CC_VER), 5.5)
496 # It's not exactly clear when this optimization kicks in, the
497 # current assumption is -xO4 or greater and for C++ with
498 # the -features=no%except option and -xO4 and greater.
499 # Bottom line is, we ALWAYS want a frame pointer!
500 CXXFLAGS_OPT += -Qoption ube -Z~B
501 CFLAGS_OPT += -Wu,-Z~B
502 ifeq ($(FASTDEBUG), true)
503 CXXFLAGS_DBG += -Qoption ube -Z~B
504 CFLAGS_DBG += -Wu,-Z~B
505 endif
506 endif
507endif
508#
509# Optimizer for sparc needs to be told not to do certain things
510# related to frames or save instructions.
511ifeq ($(ARCH_FAMILY), sparc)
512 # NOTE: Someday the compilers will provide a high-level option for this.
513 # Use save instructions instead of add instructions
514 # This was an optimization starting in SC5.0 that made it hard for us to
515 # find the "save" instruction (which got turned into an "add")
516 CXXFLAGS_OPT += -Qoption cg -Qrm-s
517 CFLAGS_OPT += -Wc,-Qrm-s
518 ifeq ($(FASTDEBUG), true)
519 CXXFLAGS_DBG += -Qoption cg -Qrm-s
520 CFLAGS_DBG += -Wc,-Qrm-s
521 endif
522 #
523 # NOTE: Someday the compilers will provide a high-level option for this.
524 # Don't allow tail call code optimization. Started in SC5.0.
525 # We don't like code of this form:
526 # save
527 # <code>
528 # call foo
529 # restore
530 # because we can't tell if the method will have a stack frame
531 # and register windows or not.
532 CXXFLAGS_OPT += -Qoption cg -Qiselect-T0
533 CFLAGS_OPT += -Wc,-Qiselect-T0
534 ifeq ($(FASTDEBUG), true)
535 CXXFLAGS_DBG += -Qoption cg -Qiselect-T0
536 CFLAGS_DBG += -Wc,-Qiselect-T0
537 endif
538endif
539
540#
541# Path and option to link against the VM, if you have to. Note that
542# there are libraries that link against only -ljava, but they do get
543# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
544# the library itself should not.
545#
546VM_NAME = server
547JVMLIB = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm
548JAVALIB = -ljava $(JVMLIB)
549
550# Part of INCREMENTAL_BUILD mechanism.
551# Compiler emits things like: path/file.o: file.h
552# We want something like: relative_path/file.o relative_path/file.d: file.h
553# In addition on Solaris, any include file starting with / is deleted,
554# this gets rid of things like /usr/include files, which never change.
555CC_DEPEND = -xM1
556CC_DEPEND_FILTER = $(SED) -e '/:[ ]*[/]/d' -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' | $(SORT) -u
557
558# Location of openwin libraries (do we really need this anymore?)
559OPENWIN_HOME = /usr/openwin
560OPENWIN_LIB = $(OPENWIN_HOME)/lib$(ISA_DIR)
561
562# Runtime graphics library search paths...
563OPENWIN_RUNTIME_LIB = /usr/openwin/lib$(ISA_DIR)
564AWT_RUNPATH = -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_RUNTIME_LIB)
565
566# C++ Runtime library (libCrun.so), use instead of -lCrun.
567# Originally used instead of -lCrun to guarantee use of the system
568# .so version and not the .a or .so that came with the compilers.
569# With the newer compilers this could probably change back to -lCrun but
570# in general this is ok to continue to do.
571LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1
572
573# Math Library (libm.so), do not use -lm.
574# There might be two versions of libm.so on the build system:
575# libm.so.1 and libm.so.2, and we want libm.so.1.
576# Depending on the Solaris release being used to build with,
577# /usr/lib/libm.so could point at a libm.so.2, so we are
578# explicit here so that the libjvm.so you have built will work on an
579# older Solaris release that might not have libm.so.2.
580# This is a critical factor in allowing builds on Solaris 10 or newer
581# to run on Solaris 8 or 9.
582#
583# Note: Historically there was also a problem picking up a static version
584# of libm.a from the compiler area, but that problem has gone away
585# with the newer compilers. Use of libm.a would cause .so bloat.
586#
587LIBM = /usr/lib$(ISA_DIR)/libm.so.1
588
589# Socket library
590LIBSOCKET = -lsocket
591
592# GLOBAL_KPIC: If set means all libraries are PIC, position independent code
593# EXCEPT for select compiles
594# If a .o file is compiled non-PIC then it should be forced
595# into the RW data segment with a mapfile option. This is done
596# with object files which generated from .s files.
597# The -ztext enforces that no relocations remain in the text segment
598# so that it remains purely read-only for optimum system performance.
599# Some libraries may use a smaller size (13bit -Kpic) on sparc instead of
600# (32 bit -KPIC) and will override GLOBAL_KPIC appropriately.
601#
602PIC_CODE_LARGE = -KPIC
603PIC_CODE_SMALL = -Kpic
604ifndef TCOV_BUILD
605 GLOBAL_KPIC = $(PIC_CODE_LARGE)
606 CXXFLAGS_COMMON += $(GLOBAL_KPIC)
607 CFLAGS_COMMON += $(GLOBAL_KPIC)
608 LDFLAGS_COMMON += -ztext
609endif # TCOV_BUILD
610
611# If your platform has DPS, it will have Type1 fonts too, in which case
612# it is best to enable DPS support until such time as 2D's rasteriser
613# can fully handle Type1 fonts in all cases. Default is "yes".
614# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
615# DPS (Displayable PostScript) is available on Solaris machines
616
617HAVE_DPS = yes
618
619#
620# Japanese manpages
621#
622JA_SOURCE_ENCODING = eucJP
623JA_TARGET_ENCODINGS = eucJP UTF-8 PCK
624
625# Settings for the JDI - Serviceability Agent binding.
626HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
627SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
628INCLUDE_SA=true
629