make/solaris/makefiles/vm.make

changeset 526
a294fd0c4b38
parent 435
a61af66fc99e
child 545
a49a647afe9a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/make/solaris/makefiles/vm.make	Wed Apr 09 14:22:48 2008 -0400
     1.3 @@ -0,0 +1,206 @@
     1.4 +#
     1.5 +# Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 +#
     1.8 +# This code is free software; you can redistribute it and/or modify it
     1.9 +# under the terms of the GNU General Public License version 2 only, as
    1.10 +# published by the Free Software Foundation.
    1.11 +#
    1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.15 +# version 2 for more details (a copy is included in the LICENSE file that
    1.16 +# accompanied this code).
    1.17 +#
    1.18 +# You should have received a copy of the GNU General Public License version
    1.19 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.21 +#
    1.22 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    1.23 +# CA 95054 USA or visit www.sun.com if you need additional information or
    1.24 +# have any questions.
    1.25 +#  
    1.26 +#
    1.27 +
    1.28 +# Rules to build JVM and related libraries, included from vm.make in the build
    1.29 +# directory.
    1.30 +
    1.31 +# Common build rules.
    1.32 +MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
    1.33 +include $(MAKEFILES_DIR)/rules.make
    1.34 +
    1.35 +default: build
    1.36 +
    1.37 +#----------------------------------------------------------------------
    1.38 +# Defs
    1.39 +
    1.40 +GENERATED     = ../generated
    1.41 +
    1.42 +# read a generated file defining the set of .o's and the .o .h dependencies
    1.43 +include $(GENERATED)/Dependencies
    1.44 +
    1.45 +# read machine-specific adjustments (%%% should do this via buildtree.make?)
    1.46 +include $(MAKEFILES_DIR)/$(BUILDARCH).make
    1.47 +
    1.48 +# set VPATH so make knows where to look for source files
    1.49 +# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
    1.50 +# The incls directory contains generated header file lists for inclusion.
    1.51 +# The adfiles directory contains ad_<arch>.[ch]pp.
    1.52 +# The jvmtifiles directory contains jvmti*.[ch]pp
    1.53 +Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
    1.54 +VPATH    += $(Src_Dirs_V:%=%:)
    1.55 +
    1.56 +# set INCLUDES for C preprocessor
    1.57 +Src_Dirs_I = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED) 
    1.58 +INCLUDES += $(Src_Dirs_I:%=-I%)
    1.59 +
    1.60 +ifeq (${VERSION}, debug)
    1.61 +  SYMFLAG = -g
    1.62 +else
    1.63 +  SYMFLAG =
    1.64 +endif
    1.65 +
    1.66 +# The following variables are defined in the generated flags.make file.
    1.67 +BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
    1.68 +JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
    1.69 +BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
    1.70 +BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
    1.71 +VM_DISTRO     = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
    1.72 +
    1.73 +CPPFLAGS =           \
    1.74 +  ${SYSDEFS}         \
    1.75 +  ${INCLUDES}        \
    1.76 +  ${BUILD_VERSION}   \
    1.77 +  ${BUILD_TARGET}    \
    1.78 +  ${BUILD_USER}      \
    1.79 +  ${JRE_VERSION}     \
    1.80 +  ${VM_DISTRO}
    1.81 +
    1.82 +# CFLAGS_WARN holds compiler options to suppress/enable warnings.
    1.83 +CFLAGS += $(CFLAGS_WARN)
    1.84 +
    1.85 +# Do not use C++ exception handling
    1.86 +CFLAGS += $(CFLAGS/NOEX)
    1.87 +
    1.88 +# Extra flags from gnumake's invocation or environment
    1.89 +CFLAGS += $(EXTRA_CFLAGS)
    1.90 +
    1.91 +# Math Library (libm.so), do not use -lm.
    1.92 +#    There might be two versions of libm.so on the build system:
    1.93 +#    libm.so.1 and libm.so.2, and we want libm.so.1.
    1.94 +#    Depending on the Solaris release being used to build with,
    1.95 +#    /usr/lib/libm.so could point at a libm.so.2, so we are
    1.96 +#    explicit here so that the libjvm.so you have built will work on an
    1.97 +#    older Solaris release that might not have libm.so.2.
    1.98 +#    This is a critical factor in allowing builds on Solaris 10 or newer
    1.99 +#    to run on Solaris 8 or 9.
   1.100 +#
   1.101 +LIBM=/usr/lib$(ISA_DIR)/libm.so.1
   1.102 +
   1.103 +ifeq ("${Platform_compiler}", "sparcWorks")
   1.104 +# The whole megilla:
   1.105 +ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1)
   1.106 +# Old Comment: List the libraries in the order the compiler was designed for
   1.107 +# Not sure what the 'designed for' comment is referring too above.
   1.108 +#   The order may not be too significant anymore, but I have placed this
   1.109 +#   older libm before libCrun, just to make sure it's found and used first.
   1.110 +LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc
   1.111 +else
   1.112 +LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor
   1.113 +endif
   1.114 +else
   1.115 +LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc
   1.116 +endif
   1.117 +
   1.118 +# By default, link the *.o into the library, not the executable.
   1.119 +LINK_INTO$(LINK_INTO) = LIBJVM
   1.120 +
   1.121 +JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
   1.122 +
   1.123 +#----------------------------------------------------------------------
   1.124 +# jvm_db & dtrace
   1.125 +include $(MAKEFILES_DIR)/dtrace.make
   1.126 +
   1.127 +#----------------------------------------------------------------------
   1.128 +# JVM
   1.129 +
   1.130 +JVM    = jvm$(G_SUFFIX)
   1.131 +LIBJVM = lib$(JVM).so
   1.132 +
   1.133 +JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS)
   1.134 +
   1.135 +vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
   1.136 +
   1.137 +mapfile : $(MAPFILE) $(MAPFILE_DTRACE_OPT)
   1.138 +	rm -f $@
   1.139 +	cat $^ > $@
   1.140 +
   1.141 +mapfile_reorder : mapfile $(MAPFILE_DTRACE_OPT) $(REORDERFILE)
   1.142 +	rm -f $@
   1.143 +	cat $^ > $@
   1.144 +
   1.145 +ifeq ($(LINK_INTO),AOUT)
   1.146 +  LIBJVM.o                 =
   1.147 +  LIBJVM_MAPFILE           =
   1.148 +  LIBS_VM                  = $(LIBS)
   1.149 +else
   1.150 +  LIBJVM.o                 = $(JVM_OBJ_FILES)
   1.151 +  LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
   1.152 +  LFLAGS_VM$(LDNOMAP)      += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
   1.153 +  LFLAGS_VM                += $(SONAMEFLAG:SONAME=$(LIBJVM))
   1.154 +ifndef USE_GCC
   1.155 +  LIBS_VM                  = $(LIBS)
   1.156 +else
   1.157 +  # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
   1.158 +  # get around library dependency and compatibility issues. Must use gcc not
   1.159 +  # g++ to link.
   1.160 +  LFLAGS_VM                += $(STATIC_LIBGCC)
   1.161 +  LIBS_VM                  += $(STATIC_STDCXX) $(LIBS)
   1.162 +endif
   1.163 +endif
   1.164 +
   1.165 +ifdef USE_GCC
   1.166 +LINK_VM = $(LINK_LIB.c)
   1.167 +else
   1.168 +LINK_VM = $(LINK_LIB.CC)
   1.169 +endif
   1.170 +# making the library:
   1.171 +$(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) 
   1.172 +	$(QUIETLY) \
   1.173 +	case "$(CFLAGS_BROWSE)" in \
   1.174 +	-sbfast|-xsbfast) \
   1.175 +	    ;; \
   1.176 +	*) \
   1.177 +	    echo Linking vm...;                                                  \
   1.178 +	    $(LINK_LIB.CC/PRE_HOOK)                                              \
   1.179 +	    $(LINK_VM) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM);                \
   1.180 +	    $(LINK_LIB.CC/POST_HOOK)                                             \
   1.181 +	    rm -f $@.1; ln -s $@ $@.1;                                           \
   1.182 +	    ;; \
   1.183 +	esac
   1.184 +
   1.185 +DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
   1.186 +
   1.187 +install_jvm: $(LIBJVM)
   1.188 +	@echo "Copying $(LIBJVM) to $(DEST_JVM)"
   1.189 +	$(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
   1.190 +
   1.191 +#----------------------------------------------------------------------
   1.192 +# Other files
   1.193 +
   1.194 +# Gamma launcher
   1.195 +include $(MAKEFILES_DIR)/launcher.make
   1.196 +
   1.197 +# Signal interposition library
   1.198 +include $(MAKEFILES_DIR)/jsig.make
   1.199 +
   1.200 +# Serviceability agent
   1.201 +include $(MAKEFILES_DIR)/saproc.make
   1.202 +
   1.203 +#----------------------------------------------------------------------
   1.204 +
   1.205 +build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) checkAndBuildSA dtraceCheck
   1.206 +
   1.207 +install: install_jvm install_jsig install_saproc
   1.208 +
   1.209 +.PHONY: default build install install_jvm

mercurial