jdk/make/java/jli/Makefile
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 8793 a25480ff1a6b
child 12047 320a714614e9
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8793
diff changeset
     2
# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Java Launcher Infrastructure Library (libjli)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
# This library provides shared support for the Java launcher in all of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# its manifestations (java, javaw, javac, ...).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
BUILDDIR = ../..
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
LIBRARY = jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
PRODUCT = java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
# Must be included before Defs.gmk to be functional.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
# Note that for Windows, both a dynamic and static version are built.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
# Doing the compiles with the static library specified can be overridden
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
# by the link step, but not the reverse.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
MS_RUNTIME_STATIC = true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
include $(BUILDDIR)/common/Defs.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
4111
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3704
diff changeset
    51
ifeq ($(ZERO_BUILD), true)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3704
diff changeset
    52
ERGO_FAMILY=zero
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3704
diff changeset
    53
else
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
ifeq ($(ARCH_FAMILY), amd64)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
ERGO_FAMILY=i586
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
ERGO_FAMILY=$(ARCH_FAMILY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
endif
4111
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3704
diff changeset
    59
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
# Files to compile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
FILES_c = \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
	java.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
	splashscreen_stubs.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
	java_md.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
	parse_manifest.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
	version_comp.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
	wildcard.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
	jli_util.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
	inflate.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
	inftrees.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
	inffast.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
	zadler32.c \
3704
bd98409d8c32 4963968: zlib should be upgraded to current version of zlib
sherman
parents: 1145
diff changeset
    77
	zcrc32.c \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
	zutil.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
ifneq ($(PLATFORM), windows)
8768
4e98f3b11578 7022370: Launcher ergonomics should provide simple default implementation
dholmes
parents: 7668
diff changeset
    81
  FILES_c += ergo.c 
4e98f3b11578 7022370: Launcher ergonomics should provide simple default implementation
dholmes
parents: 7668
diff changeset
    82
  ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
4e98f3b11578 7022370: Launcher ergonomics should provide simple default implementation
dholmes
parents: 7668
diff changeset
    83
  # if the architecture specific ergo file exists then
4e98f3b11578 7022370: Launcher ergonomics should provide simple default implementation
dholmes
parents: 7668
diff changeset
    84
  # use it, else use the generic definitions from ergo.c
4e98f3b11578 7022370: Launcher ergonomics should provide simple default implementation
dholmes
parents: 7668
diff changeset
    85
  ifneq ($(wildcard $(LAUNCHER_PLATFORM_SRC)/$(ERGO_ARCH_FILE)),)
4e98f3b11578 7022370: Launcher ergonomics should provide simple default implementation
dholmes
parents: 7668
diff changeset
    86
    FILES_c += $(ERGO_ARCH_FILE)
4e98f3b11578 7022370: Launcher ergonomics should provide simple default implementation
dholmes
parents: 7668
diff changeset
    87
  else
4e98f3b11578 7022370: Launcher ergonomics should provide simple default implementation
dholmes
parents: 7668
diff changeset
    88
    OTHER_CPPFLAGS += -DUSE_GENERIC_ERGO
4e98f3b11578 7022370: Launcher ergonomics should provide simple default implementation
dholmes
parents: 7668
diff changeset
    89
  endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
# Names of arch directories
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
LIBARCH_DEFINES = -DLIBARCHNAME='"$(LIBARCH)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
  LIBARCH_DEFINES += -DLIBARCH32NAME='"$(LIBARCH32)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
  LIBARCH_DEFINES += -DLIBARCH64NAME='"$(LIBARCH64)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
OTHER_CPPFLAGS += $(LIBARCH_DEFINES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
ifneq ($(PLATFORM), windows)	# UNIX systems
4340
ec6ba551fa78 6367077: Purge LD_LIBRARY_PATH usage from the launcher
ksrini
parents: 4111
diff changeset
   103
        LD_RUNPATH_EXTRAS += ..
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
	LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
	# Note: its important to keep this order meaning -lc is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
	# last library otherwise it could cause compatibility issues
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
	# by pulling in SUNW_private symbols from libc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
	LDLIBS = -ldl -lc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
ifeq ($(USE_PTHREADS),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
	LDLIBS += -lpthread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
endif # USE_PTHREADS 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
	EXTRA_LIBS = advapi32.lib \
39
560da37936db 6596475: (launcher) javaw should call InitCommonControls
ksrini
parents: 2
diff changeset
   116
		     comctl32.lib \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
		     user32.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
	JAVALIB =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
	OTHER_LCF =  -export:JLI_Launch \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
		     -export:JLI_ManifestIterate \
1145
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   122
		     -export:JLI_SetTraceLauncher \
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   123
		     -export:JLI_ReportErrorMessage \
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   124
		     -export:JLI_ReportErrorMessageSys \
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   125
		     -export:JLI_ReportMessage \
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   126
		     -export:JLI_ReportExceptionDescription
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
OTHER_INCLUDES += -I$(ZIP_SRC)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
# Library to compile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
include $(BUILDDIR)/common/Mapfile-vers.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
include $(BUILDDIR)/common/Library.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
# On Windows, some executable objects need to be statically linked against
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
# the jli library.  Hence, we need both a standard library (archive) and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
# an import library (associated with a dll).  These both usually have the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
# extension .LIB, so they need to be placed in different directories.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
# import library is build (as usual) in the $(OBJDIR) directory while the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
# standard library is built in a "static" subdirectory.  The standard library
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
# is not delivered as part of the product, but is only needed as part of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
# the build process.  The import library is built by the standard rules
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
# in Library.gmk.  The additional rules which follow build the standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
# library.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
7041
07f4ed79094e 6995674: (launcher) make of jli fails on windows if directory exists
ksrini
parents: 5506
diff changeset
   154
STATIC_LIBRARY = $(OBJDIR)/static/$(LIBPREFIX)$(LIBRARY).lib
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
7041
07f4ed79094e 6995674: (launcher) make of jli fails on windows if directory exists
ksrini
parents: 5506
diff changeset
   156
$(STATIC_LIBRARY): $(FILES_o)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
	$(LIBEXE) -nologo -out:$@ $(FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
library:: $(STATIC_LIBRARY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
endif	# PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
# Add to ambient vpath so we pick up the library files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)