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