make/bsd/makefiles/launcher.make

Thu, 15 Mar 2012 13:37:13 +0100

author
nloodin
date
Thu, 15 Mar 2012 13:37:13 +0100
changeset 3681
51612f0c0a79
parent 3518
719f7007c8e8
child 4076
15ba0e7a3ff4
permissions
-rw-r--r--

7148488: Whitebox tests for the Diagnostic Framework Parser
Reviewed-by: brutisso, sla, mgerdin

never@3156 1 #
never@3156 2 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
never@3156 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
never@3156 4 #
never@3156 5 # This code is free software; you can redistribute it and/or modify it
never@3156 6 # under the terms of the GNU General Public License version 2 only, as
never@3156 7 # published by the Free Software Foundation.
never@3156 8 #
never@3156 9 # This code is distributed in the hope that it will be useful, but WITHOUT
never@3156 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
never@3156 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
never@3156 12 # version 2 for more details (a copy is included in the LICENSE file that
never@3156 13 # accompanied this code).
never@3156 14 #
never@3156 15 # You should have received a copy of the GNU General Public License version
never@3156 16 # 2 along with this work; if not, write to the Free Software Foundation,
never@3156 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
never@3156 18 #
never@3156 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
never@3156 20 # or visit www.oracle.com if you need additional information or have any
never@3156 21 # questions.
never@3156 22 #
never@3156 23 #
never@3156 24
never@3156 25 # Rules to build gamma launcher, used by vm.make
never@3156 26
never@3156 27
never@3156 28 LAUNCHER_SCRIPT = hotspot
never@3156 29 LAUNCHER = gamma
never@3156 30
never@3156 31 LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher
never@3156 32 LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
never@3156 33 LAUNCHERFLAGS := $(ARCHFLAG) \
never@3156 34 -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
never@3156 35 -I$(LAUNCHERDIR_SHARE) \
never@3156 36 -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
never@3156 37 -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
never@3156 38 -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
never@3156 39 -DARCH=\"$(LIBARCH)\" \
never@3156 40 -DGAMMA \
never@3156 41 -DLAUNCHER_TYPE=\"gamma\" \
never@3156 42 -DLINK_INTO_$(LINK_INTO) \
never@3156 43 $(TARGET_DEFINES)
never@3156 44
never@3156 45 ifeq ($(LINK_INTO),AOUT)
never@3156 46 LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
never@3156 47 LAUNCHER_MAPFILE = mapfile_reorder
never@3156 48 LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE))
never@3156 49 LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC)
never@3156 50 LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS)
never@3156 51 else
never@3156 52 LAUNCHER.o = launcher.o
phh@3473 53 LFLAGS_LAUNCHER += -L`pwd`
phh@3473 54
phh@3473 55 # The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a
phh@3473 56 # freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting
phh@3473 57 # the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM
phh@3473 58 # first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is
phh@3473 59 # statically linked with CoreFoundation framework libs. Unfortunately, gamma's
phh@3473 60 # unique searchpath results in some unresolved symbols in the framework
phh@3473 61 # libraries, because JDK libraries are inadvertently discovered first on the
phh@3473 62 # searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*.
phh@3473 63 # So, the actual filename collision is libjpeg.dylib and libJPEG.dylib.
phh@3473 64 # To resolve this, gamma needs to also statically link with the CoreFoundation
phh@3473 65 # framework libraries.
phh@3473 66
phh@3473 67 ifeq ($(OS_VENDOR),Darwin)
phh@3473 68 LFLAGS_LAUNCHER += -framework CoreFoundation
phh@3473 69 endif
phh@3473 70
never@3156 71 LIBS_LAUNCHER += -l$(JVM) $(LIBS)
never@3156 72 endif
never@3156 73
erikj@3518 74 LINK_LAUNCHER = $(LINK.CC)
never@3156 75
erikj@3518 76 LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CXX/PRE_HOOK)
erikj@3518 77 LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CXX/POST_HOOK)
never@3156 78
never@3156 79 LAUNCHER_OUT = launcher
never@3156 80
never@3156 81 SUFFIXES += .d
never@3156 82
never@3156 83 SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
never@3156 84 SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
never@3156 85
never@3156 86 OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
never@3156 87
never@3156 88 DEPFILES := $(patsubst %.o,%.d,$(OBJS))
never@3156 89 -include $(DEPFILES)
never@3156 90
never@3156 91 $(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
never@3156 92 $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
erikj@3518 93 $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
never@3156 94
never@3156 95 $(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
never@3156 96 $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
erikj@3518 97 $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
never@3156 98
never@3156 99 $(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
never@3156 100 $(QUIETLY) echo Linking launcher...
never@3156 101 $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
never@3156 102 $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
never@3156 103 $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
never@3156 104
never@3156 105 $(LAUNCHER): $(LAUNCHER_SCRIPT)
never@3156 106
never@3156 107 $(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
never@3156 108 $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
never@3156 109 $(QUIETLY) chmod +x $@
never@3156 110

mercurial