2
+ − 1
#
+ − 2
# Copyright 1997-2007 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
# JDK jars where component classes come from as second choice
+ − 27
JDK_RT_JAR = $(JDK_IMPORT_PATH)/jre/lib/rt.jar
+ − 28
JDK_TOOLS_JAR = $(JDK_IMPORT_PATH)/lib/tools.jar
+ − 29
JDK_RESOURCES_JAR = $(JDK_IMPORT_PATH)/jre/lib/resources.jar
+ − 30
+ − 31
# The specific packages that come from or go to rt.jar and tools.jar
+ − 32
# IF the component deliverables are not available.
+ − 33
IMPORT_TOOLS_PACKAGES =
+ − 34
IMPORT_RT_PACKAGES =
+ − 35
+ − 36
# The following will add to IMPORT_TOOLS_PACKAGES and/or IMPORT_RT_PACKAGES
+ − 37
ifndef LANGTOOLS_DIST
+ − 38
include $(BUILDDIR)/common/internal/Defs-langtools.gmk
+ − 39
endif
+ − 40
ifndef CORBA_DIST
+ − 41
include $(BUILDDIR)/common/internal/Defs-corba.gmk
+ − 42
endif
+ − 43
ifndef JAXP_DIST
+ − 44
include $(BUILDDIR)/common/internal/Defs-jaxp.gmk
+ − 45
endif
+ − 46
ifndef JAXWS_DIST
+ − 47
include $(BUILDDIR)/common/internal/Defs-jaxws.gmk
+ − 48
endif
+ − 49
+ − 50
# Clean up these lists so empty lists are empty
+ − 51
IMPORT_TOOLS_PACKAGES := $(strip $(IMPORT_TOOLS_PACKAGES))
+ − 52
IMPORT_RT_PACKAGES := $(strip $(IMPORT_RT_PACKAGES))
+ − 53
+ − 54
# Relative paths to import component deliverables
+ − 55
CLASSES_JAR_FILE=lib/classes.jar
+ − 56
SRC_ZIP_FILE=lib/src.zip
+ − 57
BIN_ZIP_FILE=lib/bin.zip
+ − 58
DOC_ZIP_FILE=lib/doc.zip
+ − 59
+ − 60
#################################################################
+ − 61
# Macros:
+ − 62
+ − 63
# Importing component class files
+ − 64
define import-one-classes
+ − 65
@if [ "$($1)" != "" ] ; then \
+ − 66
$(ECHO) "Importing classes from component $1"; \
+ − 67
$(call Unjar,$2,$($1)/$(CLASSES_JAR_FILE),); \
+ − 68
fi
+ − 69
endef
+ − 70
+ − 71
# Importing optional component doc files (for man pages?)
+ − 72
define import-one-docs
+ − 73
@if [ "$($1)" != "" -a -f $($1)/$(DOC_ZIP_FILE) ] ; then \
+ − 74
$(ECHO) "Importing docs from component $1"; \
+ − 75
$(call Unzipper,$2,$($1)/$(DOC_ZIP_FILE)); \
+ − 76
fi
+ − 77
endef
+ − 78
+ − 79
# Importing optional component src files (for jdk src.zip and javadoc)
+ − 80
define import-one-sources
+ − 81
@if [ "$($1)" != "" ] ; then \
+ − 82
$(ECHO) "Importing sources from component $1"; \
+ − 83
$(call Unzipper,$2,$($1)/$(SRC_ZIP_FILE)); \
+ − 84
fi
+ − 85
endef
+ − 86
+ − 87
# Importing optional component bin files (for install image)
+ − 88
define import-one-binaries
+ − 89
@if [ "$($1)" != "" -a -f $($1)/$(BIN_ZIP_FILE) ] ; then \
+ − 90
$(ECHO) "Importing binaries from component $1"; \
+ − 91
$(call Unzipper,$2,$($1)/$(BIN_ZIP_FILE)); \
+ − 92
fi
+ − 93
endef
+ − 94
+ − 95
# Unzip zip file $2 into directory $1 (if $2 exists)
+ − 96
# Warning: $2 must be absolute path not relative
+ − 97
define Unzipper
+ − 98
( \
+ − 99
$(MKDIR) -p $1; \
+ − 100
$(ECHO) "( $(CD) $1 && $(UNZIP) -o $2 )"; \
+ − 101
( $(CD) $1 && $(UNZIP) -o $2 ) \
+ − 102
)
+ − 103
endef
+ − 104
+ − 105
# Unjar directories $3 from jar file $2 into directory $1 (if $2 exists)
+ − 106
# Warning: $2 must be absolute path not relative
+ − 107
define Unjar
+ − 108
( \
+ − 109
$(MKDIR) -p $1; \
+ − 110
$(ECHO) "( $(CD) $1 && $(BOOT_JAR_CMD) xfv $2 $3 )" ; \
+ − 111
( $(CD) $1 && $(BOOT_JAR_CMD) xfv $2 $3 ) \
+ − 112
)
+ − 113
endef
+ − 114
+ − 115
# Import all component sources into directory $1
+ − 116
define import-component-sources
+ − 117
$(call import-one-sources,LANGTOOLS_DIST,$1)
+ − 118
$(call import-one-sources,CORBA_DIST,$1)
+ − 119
$(call import-one-sources,JAXP_DIST,$1)
+ − 120
$(call import-one-sources,JAXWS_DIST,$1)
+ − 121
endef
+ − 122
+ − 123
# Import all component docs into directory $1 (optional)
+ − 124
define import-component-docs
+ − 125
$(call import-one-docs,LANGTOOLS_DIST,$1)
+ − 126
$(call import-one-docs,CORBA_DIST,$1)
+ − 127
$(call import-one-docs,JAXP_DIST,$1)
+ − 128
$(call import-one-docs,JAXWS_DIST,$1)
+ − 129
endef
+ − 130
+ − 131
# Import all component bins into directory $1 (optional)
+ − 132
define import-component-binaries
+ − 133
$(call import-one-binaries,LANGTOOLS_DIST,$1)
+ − 134
$(call import-one-binaries,CORBA_DIST,$1)
+ − 135
$(call import-one-binaries,JAXP_DIST,$1)
+ − 136
$(call import-one-binaries,JAXWS_DIST,$1)
+ − 137
if [ "$(CORBA_DIST)" = "" ] ; then \
+ − 138
$(MKDIR) -p $(OUTPUTDIR)/lib ; \
+ − 139
( $(CD) $(JDK_IMPORT_PATH) && $(CP) $(IMPORT_CORBA_BINARIES) $(ABS_OUTPUTDIR)/lib ) ; \
+ − 140
fi
+ − 141
endef
+ − 142
+ − 143
# Import all component classes into directory $1
+ − 144
# Here we special case classes coming from JDK when component not supplied
+ − 145
define import-component-classes
+ − 146
$(ECHO) "Import classes from $(JDK_IMPORT_PATH)"
+ − 147
if [ "$(IMPORT_TOOLS_PACKAGES)" != "" ] ; then \
+ − 148
$(call Unjar,$1,$(JDK_RESOURCES_JAR),$(IMPORT_TOOLS_PACKAGES)); \
+ − 149
$(call Unjar,$1,$(JDK_TOOLS_JAR),$(IMPORT_TOOLS_PACKAGES)); \
+ − 150
fi
+ − 151
if [ "$(IMPORT_RT_PACKAGES)" != "" ] ; then \
+ − 152
$(call Unjar,$1,$(JDK_RESOURCES_JAR),$(IMPORT_RT_PACKAGES)); \
+ − 153
$(call Unjar,$1,$(JDK_RT_JAR),$(IMPORT_RT_PACKAGES)); \
+ − 154
fi
+ − 155
$(call import-one-classes,LANGTOOLS_DIST,$1)
+ − 156
$(call import-one-classes,CORBA_DIST,$1)
+ − 157
$(call import-one-classes,JAXP_DIST,$1)
+ − 158
$(call import-one-classes,JAXWS_DIST,$1)
+ − 159
endef
+ − 160
+ − 161
# Clean up import files
+ − 162
define import-component-sources-clean
+ − 163
$(RM) -r $1
+ − 164
endef
+ − 165
define import-component-docs-clean
+ − 166
$(RM) -r $1
+ − 167
endef
+ − 168
define import-component-classes-clean
+ − 169
$(RM) -r $(IMPORT_TOOLS_PACKAGES:%=$1/%)
+ − 170
$(RM) -r $(IMPORT_RT_PACKAGES:%=$1/%)
+ − 171
endef
+ − 172