hotspot/make/solaris/makefiles/vm.make
author kvn
Wed, 12 Nov 2008 11:01:31 -0800
changeset 1549 710f8deef989
parent 670 ddf3e9583f2f
child 4493 9204129f065e
permissions -rw-r--r--
6769748: Fix solaris makefiles for the case when "CC -V" produces several lines Summary: Fix solaris makefiles for 5.10 compilers Reviewed-by: jcoomes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
670
ddf3e9583f2f 6719955: Update copyright year
xdono
parents: 357
diff changeset
     2
# Copyright 1998-2008 Sun Microsystems, Inc.  All Rights Reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
# CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
# have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
# Rules to build JVM and related libraries, included from vm.make in the build
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
# directory.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
# Common build rules.
338
5cf9f61d76f4 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 1
diff changeset
    29
MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
include $(MAKEFILES_DIR)/rules.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
default: build
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
# Defs
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
GENERATED     = ../generated
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
# read a generated file defining the set of .o's and the .o .h dependencies
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
include $(GENERATED)/Dependencies
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
# read machine-specific adjustments (%%% should do this via buildtree.make?)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
include $(MAKEFILES_DIR)/$(BUILDARCH).make
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
# set VPATH so make knows where to look for source files
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
# The incls directory contains generated header file lists for inclusion.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
# The adfiles directory contains ad_<arch>.[ch]pp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
# The jvmtifiles directory contains jvmti*.[ch]pp
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
VPATH    += $(Src_Dirs_V:%=%:)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
# set INCLUDES for C preprocessor
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
Src_Dirs_I = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED) 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
INCLUDES += $(Src_Dirs_I:%=-I%)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
ifeq (${VERSION}, debug)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  SYMFLAG = -g
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  SYMFLAG =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
# The following variables are defined in the generated flags.make file.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents: 1
diff changeset
    66
HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
VM_DISTRO     = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
CPPFLAGS =           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  ${SYSDEFS}         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  ${INCLUDES}        \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  ${BUILD_VERSION}   \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  ${BUILD_TARGET}    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  ${BUILD_USER}      \
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents: 1
diff changeset
    77
  ${HS_LIB_ARCH}     \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  ${JRE_VERSION}     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  ${VM_DISTRO}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
CFLAGS += $(CFLAGS_WARN)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
# Do not use C++ exception handling
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
CFLAGS += $(CFLAGS/NOEX)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
# Extra flags from gnumake's invocation or environment
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
CFLAGS += $(EXTRA_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
# Math Library (libm.so), do not use -lm.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
#    There might be two versions of libm.so on the build system:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
#    libm.so.1 and libm.so.2, and we want libm.so.1.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
#    Depending on the Solaris release being used to build with,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
#    /usr/lib/libm.so could point at a libm.so.2, so we are
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
#    explicit here so that the libjvm.so you have built will work on an
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
#    older Solaris release that might not have libm.so.2.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
#    This is a critical factor in allowing builds on Solaris 10 or newer
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
#    to run on Solaris 8 or 9.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
LIBM=/usr/lib$(ISA_DIR)/libm.so.1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
ifeq ("${Platform_compiler}", "sparcWorks")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
# The whole megilla:
1549
710f8deef989 6769748: Fix solaris makefiles for the case when "CC -V" produces several lines
kvn
parents: 670
diff changeset
   104
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
# Old Comment: List the libraries in the order the compiler was designed for
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
# Not sure what the 'designed for' comment is referring too above.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
#   The order may not be too significant anymore, but I have placed this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
#   older libm before libCrun, just to make sure it's found and used first.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
# By default, link the *.o into the library, not the executable.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
LINK_INTO$(LINK_INTO) = LIBJVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
# jvm_db & dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
include $(MAKEFILES_DIR)/dtrace.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
# JVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
JVM    = jvm$(G_SUFFIX)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
LIBJVM = lib$(JVM).so
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
mapfile : $(MAPFILE) $(MAPFILE_DTRACE_OPT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
	rm -f $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
	cat $^ > $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
mapfile_reorder : mapfile $(MAPFILE_DTRACE_OPT) $(REORDERFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
	rm -f $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
	cat $^ > $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
ifeq ($(LINK_INTO),AOUT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  LIBJVM.o                 =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  LIBJVM_MAPFILE           =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  LIBS_VM                  = $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  LIBJVM.o                 = $(JVM_OBJ_FILES)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  LFLAGS_VM$(LDNOMAP)      += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  LFLAGS_VM                += $(SONAMEFLAG:SONAME=$(LIBJVM))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
ifndef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  LIBS_VM                  = $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  # get around library dependency and compatibility issues. Must use gcc not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  # g++ to link.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  LFLAGS_VM                += $(STATIC_LIBGCC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  LIBS_VM                  += $(STATIC_STDCXX) $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
LINK_VM = $(LINK_LIB.c)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
LINK_VM = $(LINK_LIB.CC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
# making the library:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
$(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
	$(QUIETLY) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
	case "$(CFLAGS_BROWSE)" in \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
	-sbfast|-xsbfast) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
	    ;; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
	*) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
	    echo Linking vm...;                                                  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
	    $(LINK_LIB.CC/PRE_HOOK)                                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
	    $(LINK_VM) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM);                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
	    $(LINK_LIB.CC/POST_HOOK)                                             \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
	    rm -f $@.1; ln -s $@ $@.1;                                           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
	    ;; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
	esac
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
install_jvm: $(LIBJVM)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
	@echo "Copying $(LIBJVM) to $(DEST_JVM)"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
	$(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
# Other files
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
# Gamma launcher
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
include $(MAKEFILES_DIR)/launcher.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
# Signal interposition library
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
include $(MAKEFILES_DIR)/jsig.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
# Serviceability agent
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
include $(MAKEFILES_DIR)/saproc.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) checkAndBuildSA dtraceCheck
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
install: install_jvm install_jsig install_saproc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
.PHONY: default build install install_jvm