2
|
1 |
#
|
|
2 |
# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
#
|
|
5 |
# This code is free software; you can redistribute it and/or modify it
|
|
6 |
# under the terms of the GNU General Public License version 2 only, as
|
|
7 |
# published by the Free Software Foundation. Sun designates this
|
|
8 |
# particular file as subject to the "Classpath" exception as provided
|
|
9 |
# by Sun in the LICENSE file that accompanied this code.
|
|
10 |
#
|
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
# accompanied this code).
|
|
16 |
#
|
|
17 |
# You should have received a copy of the GNU General Public License version
|
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
#
|
|
21 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or
|
|
23 |
# have any questions.
|
|
24 |
#
|
|
25 |
|
|
26 |
#
|
|
27 |
# Java Launcher Infrastructure Library (libjli)
|
|
28 |
#
|
|
29 |
# This library provides shared support for the Java launcher in all of
|
|
30 |
# its manifestations (java, javaw, javac, ...).
|
|
31 |
#
|
|
32 |
BUILDDIR = ../..
|
|
33 |
LIBRARY = jli
|
|
34 |
PRODUCT = java
|
|
35 |
|
|
36 |
#
|
|
37 |
# Must be included before Defs.gmk to be functional.
|
|
38 |
#
|
|
39 |
# Note that for Windows, both a dynamic and static version are built.
|
|
40 |
# Doing the compiles with the static library specified can be overridden
|
|
41 |
# by the link step, but not the reverse.
|
|
42 |
#
|
|
43 |
MS_RUNTIME_STATIC = true
|
|
44 |
|
|
45 |
include $(BUILDDIR)/common/Defs.gmk
|
|
46 |
|
|
47 |
ZLIB_VERSION = 1.1.3
|
|
48 |
ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
|
|
49 |
LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
|
|
50 |
LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
|
|
51 |
|
|
52 |
ifeq ($(ARCH_FAMILY), amd64)
|
|
53 |
ERGO_FAMILY=i586
|
|
54 |
else
|
|
55 |
ERGO_FAMILY=$(ARCH_FAMILY)
|
|
56 |
endif
|
|
57 |
|
|
58 |
|
|
59 |
#
|
|
60 |
# Files to compile.
|
|
61 |
#
|
|
62 |
FILES_c = \
|
|
63 |
java.c \
|
|
64 |
splashscreen_stubs.c \
|
|
65 |
java_md.c \
|
|
66 |
parse_manifest.c \
|
|
67 |
version_comp.c \
|
|
68 |
wildcard.c \
|
|
69 |
jli_util.c \
|
|
70 |
inflate.c \
|
|
71 |
infblock.c \
|
|
72 |
inftrees.c \
|
|
73 |
infcodes.c \
|
|
74 |
inffast.c \
|
|
75 |
infutil.c \
|
|
76 |
zadler32.c \
|
|
77 |
zutil.c
|
|
78 |
|
|
79 |
ifneq ($(PLATFORM), windows)
|
|
80 |
|
|
81 |
FILES_c += \
|
|
82 |
$(CTARGDIR)ergo.c \
|
|
83 |
$(CTARGDIR)ergo_$(ERGO_FAMILY).c
|
|
84 |
endif
|
|
85 |
|
|
86 |
|
|
87 |
# Names of arch directories
|
|
88 |
LIBARCH_DEFINES = -DLIBARCHNAME='"$(LIBARCH)"'
|
|
89 |
ifeq ($(PLATFORM), solaris)
|
|
90 |
LIBARCH_DEFINES += -DLIBARCH32NAME='"$(LIBARCH32)"'
|
|
91 |
LIBARCH_DEFINES += -DLIBARCH64NAME='"$(LIBARCH64)"'
|
|
92 |
endif
|
|
93 |
|
|
94 |
OTHER_CPPFLAGS += $(LIBARCH_DEFINES)
|
|
95 |
|
|
96 |
|
|
97 |
ifneq ($(PLATFORM), windows) # UNIX systems
|
|
98 |
LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
|
|
99 |
# Note: its important to keep this order meaning -lc is the
|
|
100 |
# last library otherwise it could cause compatibility issues
|
|
101 |
# by pulling in SUNW_private symbols from libc
|
|
102 |
LDLIBS = -ldl -lc
|
|
103 |
ifeq ($(USE_PTHREADS),true)
|
|
104 |
LDLIBS += -lpthread
|
|
105 |
endif # USE_PTHREADS
|
|
106 |
endif # PLATFORM
|
|
107 |
|
|
108 |
ifeq ($(PLATFORM), windows)
|
|
109 |
EXTRA_LIBS = advapi32.lib \
|
|
110 |
user32.lib
|
|
111 |
|
|
112 |
JAVALIB =
|
|
113 |
OTHER_LCF = -export:JLI_Launch \
|
|
114 |
-export:JLI_ManifestIterate \
|
|
115 |
-export:JLI_SetTraceLauncher
|
|
116 |
|
|
117 |
# Files from zlib built here do not compile with warning level 3
|
|
118 |
# if warnings are fatal
|
|
119 |
COMPILER_WARNINGS_FATAL=false
|
|
120 |
endif
|
|
121 |
|
|
122 |
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
|
|
123 |
OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
|
|
124 |
OTHER_INCLUDES += -I$(ZIP_SRC)
|
|
125 |
|
|
126 |
#
|
|
127 |
# Library to compile.
|
|
128 |
#
|
|
129 |
include $(BUILDDIR)/common/Mapfile-vers.gmk
|
|
130 |
include $(BUILDDIR)/common/Library.gmk
|
|
131 |
|
|
132 |
#
|
|
133 |
# On Windows, some executable objects need to be statically linked against
|
|
134 |
# the jli library. Hence, we need both a standard library (archive) and
|
|
135 |
# an import library (associated with a dll). These both usually have the
|
|
136 |
# extension .LIB, so they need to be placed in different directories. The
|
|
137 |
# import library is build (as usual) in the $(OBJDIR) directory while the
|
|
138 |
# standard library is built in a "static" subdirectory. The standard library
|
|
139 |
# is not delivered as part of the product, but is only needed as part of
|
|
140 |
# the build process. The import library is built by the standard rules
|
|
141 |
# in Library.gmk. The additional rules which follow build the standard
|
|
142 |
# library.
|
|
143 |
#
|
|
144 |
ifeq ($(PLATFORM), windows)
|
|
145 |
|
|
146 |
STATIC_LIBRARY_DIR = $(OBJDIR)/static
|
|
147 |
STATIC_LIBRARY_NAME = $(LIBPREFIX)$(LIBRARY).lib
|
|
148 |
STATIC_LIBRARY = $(STATIC_LIBRARY_DIR)/$(STATIC_LIBRARY_NAME)
|
|
149 |
|
|
150 |
$(STATIC_LIBRARY_DIR): $(OBJDIR)
|
|
151 |
@$(prep-target)
|
|
152 |
@$(MKDIR) $(STATIC_LIBRARY_DIR)
|
|
153 |
|
|
154 |
$(STATIC_LIBRARY): $(STATIC_LIBRARY_DIR)
|
|
155 |
@$(prep-target)
|
|
156 |
$(LIBEXE) -nologo -out:$@ $(FILES_o)
|
|
157 |
|
|
158 |
library:: $(STATIC_LIBRARY)
|
|
159 |
|
|
160 |
endif # PLATFORM
|
|
161 |
|
|
162 |
#
|
|
163 |
# Add to ambient vpath so we pick up the library files
|
|
164 |
#
|
|
165 |
vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)
|