0N/A#
2085N/A# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
0N/A# by Oracle in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
1472N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1472N/A#
1472N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A# or visit www.oracle.com if you need additional information or have any
0N/A# questions.
0N/A#
1879N/A
1879N/A#
1879N/A# Java Launcher Infrastructure Library (libjli)
1879N/A#
1879N/A# This library provides shared support for the Java launcher in all of
1879N/A# its manifestations (java, javaw, javac, ...).
1879N/A#
1879N/ABUILDDIR = ../..
1879N/ALIBRARY = jli
1879N/APRODUCT = java
1879N/A
1879N/A#
1879N/A# Must be included before Defs.gmk to be functional.
1879N/A#
1879N/A# Note that for Windows, both a dynamic and static version are built.
1879N/A# Doing the compiles with the static library specified can be overridden
1879N/A# by the link step, but not the reverse.
1879N/A#
1879N/AMS_RUNTIME_STATIC = true
1879N/A
1879N/Ainclude $(BUILDDIR)/common/Defs.gmk
1879N/A
1879N/Aifneq ($(SYSTEM_ZLIB),true)
1879N/A ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
1879N/Aelse # SYSTEM_ZLIB
1879N/A OTHER_CFLAGS += $(ZLIB_CFLAGS)
1879N/Aendif #SYSTEM_ZLIB
1879N/ALAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
1879N/A
1879N/A# set the platform specific directory for macosx, also this platform shares
1879N/A# substantial family ties with its siblings (solaris and linux), thus we add
1879N/A# solaris src path to its compilation dependencies.
1879N/Aifeq ($(PLATFORM), macosx)
1879N/A LAUNCHER_PLATFORM_SRC = $(BUILDDIR)/../src/macosx/bin
1879N/A LAUNCHER_SOLARIS_PLATFORM_SRC = $(BUILDDIR)/../src/solaris/bin
1929N/Aelse # !MACOSX
1879N/A LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
1879N/Aendif #PLATFORM
1879N/A
1879N/Aifeq ($(ZERO_BUILD), true)
1879N/A ERGO_FAMILY=zero
1879N/Aelse # !ZERO_BUILD
1879N/A ifneq (,$(findstring $(ARCH_FAMILY), amd64 x86_64))
1879N/A ERGO_FAMILY=i586
1879N/A else # !X86 FAMILY
1879N/A ERGO_FAMILY=$(ARCH_FAMILY)
1879N/A endif #ARCH_FAMILY
1879N/Aendif # ZERO_BUILD
1879N/A
1879N/A#
1879N/A# Files to compile.
1879N/A#
2073N/AFILES_c = java.c \
2073N/A splashscreen_stubs.c \
2073N/A parse_manifest.c \
2073N/A version_comp.c \
2073N/A wildcard.c \
2073N/A jli_util.c
2073N/A
2073N/Aifneq ($(SYSTEM_ZLIB),true)
1879N/A FILES_c += inflate.c \
1879N/A inftrees.c \
1879N/A inffast.c \
1879N/A zadler32.c \
1879N/A zcrc32.c \
1879N/A zutil.c
0N/Aendif # SYSTEM_ZLIB
0N/A
0N/A# add platform specific files
0N/Aifeq ($(PLATFORM), windows)
1601N/A FILES_c += java_md.c \
1601N/A cmdtoargs.c
0N/Aelse # NIXES
0N/A FILES_c += java_md_common.c
0N/A ifeq ($(PLATFORM), macosx)
0N/A FILES_c += java_md_macosx.c
0N/A else # SOLARIS/LINUX
0N/A FILES_c += java_md_solinux.c
0N/A FILES_c += ergo.c
0N/A ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
0N/A # if the architecture specific ergo file exists then
0N/A # use it, else use the generic definitions from ergo.c
0N/A ifneq ($(wildcard $(LAUNCHER_PLATFORM_SRC)/$(ERGO_ARCH_FILE)),)
0N/A FILES_c += $(ERGO_ARCH_FILE)
0N/A else # !ERGO_ARCH_FILE
0N/A OTHER_CPPFLAGS += -DUSE_GENERIC_ERGO
0N/A endif # ERGO_ARCH_FILE
0N/A endif #MACOSX
0N/Aendif #WINDOWS
0N/A
0N/A# Names of arch directories
0N/ALIBARCH_DEFINES = -DLIBARCHNAME='"$(LIBARCH)"'
0N/Aifeq ($(PLATFORM), solaris)
0N/A LIBARCH_DEFINES += -DLIBARCH32NAME='"$(LIBARCH32)"'
0N/A LIBARCH_DEFINES += -DLIBARCH64NAME='"$(LIBARCH64)"'
0N/Aendif # PLATFORM
0N/A
1320N/Aifeq ($(PLATFORM), macosx)
1320N/A OTHER_CPPFLAGS += $(LIBARCH_DEFINES) -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
1940N/Aelse # ! MACOSX
0N/A OTHER_CPPFLAGS += $(LIBARCH_DEFINES)
0N/Aendif #PLATFORM
0N/A
0N/Aifneq ($(PLATFORM), windows) # UNIX systems
0N/A ifeq ($(PLATFORM), macosx)
0N/A LIB_LOCATION = $(LIBDIR)/jli
2085N/A else # SOLARIS/LINUX
0N/A LD_RUNPATH_EXTRAS += ..
0N/A LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
0N/A # Note: it is important to keep this order, meaning -lc as the
0N/A # last library, otherwise it could cause compatibility issues
0N/A # by pulling in SUNW_private symbols from libc
0N/A LDLIBS = -ldl -lc
0N/A ifeq ($(USE_PTHREADS),true)
0N/A LDLIBS += -lpthread
0N/A endif # USE_PTHREADS
0N/A endif # PLATFORM
0N/Aendif # PLATFORM
0N/A
0N/Aifeq ($(PLATFORM), windows)
0N/A EXTRA_LIBS = advapi32.lib \
0N/A comctl32.lib \
199N/A user32.lib
199N/A JAVALIB =
0N/A OTHER_LCF = -export:JLI_Launch \
0N/A -export:JLI_ManifestIterate \
0N/A -export:JLI_SetTraceLauncher \
0N/A -export:JLI_ReportErrorMessage \
0N/A -export:JLI_ReportErrorMessageSys \
0N/A -export:JLI_ReportMessage \
0N/A -export:JLI_ReportExceptionDescription \
0N/A -export:JLI_MemAlloc \
0N/A -export:JLI_CmdToArgs \
0N/A -export:JLI_GetStdArgc \
0N/A -export:JLI_GetStdArgs
0N/Aendif # PLATFORM
0N/A
0N/AOTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
0N/AOTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
0N/Aifneq ($(SYSTEM_ZLIB),true)
0N/A OTHER_INCLUDES += -I$(ZIP_SRC)
242N/Aelse # !SYSTEM_ZLIB
242N/A LDLIBS += $(ZLIB_LIBS)
242N/Aendif # SYSTEM_ZLIB
2627N/A
2627N/A#
2627N/A# Library to compile.
2627N/A#
2627N/Ainclude $(BUILDDIR)/common/Mapfile-vers.gmk
2627N/Ainclude $(BUILDDIR)/common/Library.gmk
2627N/A
2627N/A#
2627N/A# On Windows, some executable objects need to be statically linked against
2627N/A# the jli library. Hence, we need both a standard library (archive) and
2627N/A# an import library (associated with a dll). These both usually have the
2627N/A# extension .LIB, so they need to be placed in different directories. The
2627N/A# import library is build (as usual) in the $(OBJDIR) directory while the
2627N/A# standard library is built in a "static" subdirectory. The standard library
2627N/A# is not delivered as part of the product, but is only needed as part of
2627N/A# the build process. The import library is built by the standard rules
2627N/A# in Library.gmk. The additional rules which follow build the standard
2627N/A# library.
2627N/A#
2627N/Aifeq ($(PLATFORM), windows)
2627N/A STATIC_LIBRARY = $(OBJDIR)/static/$(LIBPREFIX)$(LIBRARY).lib
2627N/A
2627N/A $(STATIC_LIBRARY): $(FILES_o)
2627N/A @$(prep-target)
2627N/A $(LIBEXE) -nologo -out:$@ $(FILES_o)
2627N/A
2627N/A library:: $(STATIC_LIBRARY)
2627N/Aendif # PLATFORM
2627N/A
0N/Aifeq ($(PLATFORM), macosx)
0N/A # Some Obj-C code is embedded in java_md_macosx.c, we stipulate so, using
0N/A # "-x" option. Not doing so will cause the compiler to choose the language
0N/A # based on the filename suffix, also "-Os" optimizes the file for size.
0N/A CFLAGS_$(VARIANT)/java_md_macosx.o = -Os -x objective-c
0N/A # Needed for linking the various launchers
0N/A LDFLAGS += -framework Cocoa -framework Security \
0N/A -framework ApplicationServices
0N/A # Add solaris sources containing common logic to the header path
0N/A OTHER_INCLUDES += -I$(LAUNCHER_SOLARIS_PLATFORM_SRC)
0N/Aendif # PLATFORM
0N/A
0N/ASTATIC_LIBRARY_DIR = $(OBJDIR)/static
0N/ASTATIC_LIBRARY_NAME = lib$(LIBRARY).a
0N/ASTATIC_LIBRARY = $(STATIC_LIBRARY_DIR)/$(STATIC_LIBRARY_NAME)
0N/A
0N/A$(STATIC_LIBRARY_DIR): | $(OBJDIR)
0N/A @$(MKDIR) $(STATIC_LIBRARY_DIR)
0N/A
0N/A$(STATIC_LIBRARY): $(STATIC_LIBRARY_DIR)
0N/A @$(prep-target)
20N/A $(AR) $(ARFLAGS) $@ $(FILES_o)
20N/A
20N/Alibrary:: $(STATIC_LIBRARY)
20N/A
20N/Avpath %.c $(LAUNCHER_SHARE_SRC) $(LAUNCHER_PLATFORM_SRC)
20N/Aifneq ($(SYSTEM_ZLIB),true)
20N/A vpath %.c $(ZIP_SRC)
20N/Aelse # !SYSTEM_ZLIB
20N/A #
20N/A # Add to ambient vpath so we pick up the library files, for macos we add
20N/A # solaris sources which contains the common logic for all nixes
20N/A #
20N/A ifeq ($(PLATFORM), macosx)
20N/A vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC) \
0N/A $(LAUNCHER_SOLARIS_PLATFORM_SRC)
0N/A else # !MACOSX
0N/A vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)
0N/A endif # MACOSX
0N/Aendif # SYSTEM_LIB
0N/A