# # Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as # published by the Free Software Foundation. Sun designates this # particular file as subject to the "Classpath" exception as provided # by Sun in the LICENSE file that accompanied this code. # # This code is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # version 2 for more details (a copy is included in the LICENSE file that # accompanied this code). # # You should have received a copy of the GNU General Public License version # 2 along with this work; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, # CA 95054 USA or visit www.sun.com if you need additional information or # have any questions. # ######################################################################## # Definitions for openjdk plugs (used by both import and export) # Names of native shared libraries PLUG_LIBRARY_NAMES= # Sub-directory where native shared libraries are located (e.g. jre/bin or...) PLUG_LOCATION_SUBDIR=$(ARCH_VM_SUBDIR) # Explicit classfile lists # WARNING: These classlists will not work with pattern rules, only used in # shell commands. # The \$$ patterns will fail in pattern rules, which want $$, # but the $$ fails in shell commands. # The shell commands are more important. # Also, the $1 pattern in these names causes problems with the # GNU make define feature, so you can't use these in define's. PLUG_JMF_CLASS_NAMES = \ com/sun/jmx/snmp/SnmpDataTypeEnums.class \ com/sun/jmx/snmp/SnmpDefinitions.class \ com/sun/jmx/snmp/SnmpOid.class \ com/sun/jmx/snmp/SnmpOidDatabase.class \ com/sun/jmx/snmp/SnmpOidDatabaseSupport.class \ com/sun/jmx/snmp/SnmpOidRecord.class \ com/sun/jmx/snmp/SnmpOidTable.class \ com/sun/jmx/snmp/SnmpOidTableSupport.class \ com/sun/jmx/snmp/SnmpParameters.class \ com/sun/jmx/snmp/SnmpPduPacket.class \ com/sun/jmx/snmp/SnmpPeer.class \ com/sun/jmx/snmp/SnmpTimeticks.class \ com/sun/jmx/snmp/SnmpVarBind.class \ com/sun/jmx/snmp/SnmpVarBindList.class \ com/sun/jmx/snmp/Timestamp.class \ com/sun/jmx/snmp/daemon/SendQ.class \ com/sun/jmx/snmp/daemon/SnmpInformRequest.class \ com/sun/jmx/snmp/daemon/SnmpQManager.class \ com/sun/jmx/snmp/daemon/SnmpRequestCounter.class \ com/sun/jmx/snmp/daemon/SnmpResponseHandler.class \ com/sun/jmx/snmp/daemon/SnmpSendServer.class \ com/sun/jmx/snmp/daemon/SnmpSession.class \ com/sun/jmx/snmp/daemon/SnmpSocket.class \ com/sun/jmx/snmp/daemon/SnmpTimerServer.class \ com/sun/jmx/snmp/daemon/WaitQ.class # Class list temp files (used by both import and export of plugs) PLUG_TEMPDIR=$(ABS_TEMPDIR)/plugs PLUG_CLASS_AREAS = jmf PLUG_CLISTS = $(PLUG_CLASS_AREAS:%=$(PLUG_TEMPDIR)/%.clist) # Create jargs file command define plug-create-jargs @$(prep-target) $(SED) -e "s@^@-C $(CLASSDESTDIR) @" $< > $@ endef # plug-create-clist-jargs # Create clist (class name list) and jargs file (input to jar) # Need these files to avoid long command lines which fail on some systems. $(PLUG_TEMPDIR)/jmf.clist: @$(prep-target) @for i in $(PLUG_JMF_CLASS_NAMES) ; do \ $(ECHO) "$$i" >> $@; \ done $(PLUG_TEMPDIR)/all.clist: $(PLUG_CLISTS) @$(prep-target) $(CAT) $(PLUG_CLISTS) > $@ $(PLUG_TEMPDIR)/jmf.jargs: $(PLUG_TEMPDIR)/jmf.clist $(plug-create-jargs) $(PLUG_TEMPDIR)/all.jargs: $(PLUG_TEMPDIR)/all.clist $(plug-create-jargs) # # Specific to OPENJDK import of binary plugs # ifdef OPENJDK # Import PLUG_IMPORT_DIR=$(BINARY_PLUGS_PATH) PLUG_IMPORT_JARFILE=$(BINARY_PLUGS_JARFILE) # Import file command define import-binary-plug-file @$(ECHO) "PLUG IMPORT: $(@F)" $(install-non-module-file) endef # import-binary-plug-file # Import classes command define import-binary-plug-classes @$(MKDIR) -p $(CLASSDESTDIR) @$(CAT) $1 | $(SED) -e 's/^/PLUG IMPORT: /' ($(CD) $(CLASSDESTDIR) && $(BOOT_JAR_CMD) xf $(PLUG_IMPORT_JARFILE) @$1 $(BOOT_JAR_JFLAGS) ) ($(CD) $(CLASSDESTDIR) && $(java-vm-cleanup) ) endef # import-binary-plug-classes # Import specific area classes (the classes are always created) import-binary-plug-jmf-classes: $(PLUG_IMPORT_JARFILE) $(PLUG_TEMPDIR)/jmf.clist $(call import-binary-plug-classes,$(PLUG_TEMPDIR)/jmf.clist) # Import all classes from the jar file import-binary-plug-jar: \ import-binary-plug-jmf-classes # Binary plug start/complete messages import-binary-plugs-started: @$(ECHO) "BinaryPlugs import started: `date`" @$(ECHO) "BINARY_PLUGS_PATH=$(BINARY_PLUGS_PATH)" import-binary-plugs-completed: @$(ECHO) "BinaryPlugs import completed: `date`" # Import lib files (only if they don't exist already) import-binary-plugs-libs: \ $(PLUG_LIBRARY_NAMES:%=$(LIB_LOCATION)/%) # Import everything import-binary-plugs: \ import-binary-plugs-started \ import-binary-plugs-libs \ import-binary-plug-jar \ import-binary-plugs-completed # All these targets are phony (no filenames) .PHONY: import-binary-plugs-started \ import-binary-plugs-completed \ import-binary-plugs-libs \ import-binary-plugs \ import-binary-plug-jar \ import-binary-plug-jmf-classes else # !OPENJDK # # Specific to exporting binary plugs for OPENJDK (e.g. OPENJDK is NOT defined) # # Export names (See make/common/Defs.gmk for BINARY_PLUGS_JARNAME definition) PLUG_EXPORT_DIRNAME=openjdk-binary-plugs-image PLUG_EXPORT_DIR=$(OUTPUTDIR)/$(PLUG_EXPORT_DIRNAME) PLUG_EXPORT_JARFILE=$(PLUG_EXPORT_DIR)/jre/lib/$(BINARY_PLUGS_JARNAME) # Export file command define export-binary-plug-file @$(ECHO) "PLUG EXPORT: $(@F)" $(install-non-module-file) endef # export-binary-plug-file # OpenJDK Binary Plug License $(PLUG_EXPORT_DIR)/LICENSE: $(CLOSED_SHARE_SRC)/doc/openjdk/binary-plugs/LICENSE $(export-binary-plug-file) export-binary-plugs-license: $(PLUG_EXPORT_DIR)/LICENSE # Create jar file of plug classes (always created) $(PLUG_EXPORT_JARFILE): $(PLUG_TEMPDIR)/all.clist $(PLUG_TEMPDIR)/all.jargs @$(prep-target) @$(ECHO) "PLUG EXPORT: $(@F)" @$(CAT) $(PLUG_TEMPDIR)/all.clist | $(SED) -e 's/^/PLUG EXPORT: /' $(BOOT_JAR_CMD) cf $@ @$(PLUG_TEMPDIR)/all.jargs $(BOOT_JAR_JFLAGS) @$(java-vm-cleanup) export-binary-plugs-jar: $(PLUG_EXPORT_JARFILE) # Export binary plug start/complete messages export-binary-plugs-started: @$(ECHO) "BinaryPlugs export started: `date`" @$(ECHO) "PLUG_EXPORT_DIR=$(PLUG_EXPORT_DIR)" $(RM) -r $(PLUG_EXPORT_DIR) @$(MKDIR) -p $(PLUG_EXPORT_DIR) @$(MKDIR) -p $(PLUG_TEMPDIR) export-binary-plugs-completed: @$(RM) -r $(PLUG_TEMPDIR) @$(ECHO) "BinaryPlugs export completed: `date`" # Export lib files (only if they don't exist already) export-binary-plugs-libs: \ $(PLUG_LIBRARY_NAMES:%=$(PLUG_EXPORT_DIR)/$(PLUG_LOCATION_SUBDIR)/%) # Export everything export-binary-plugs: \ export-binary-plugs-started \ export-binary-plugs-libs \ export-binary-plugs-license \ export-binary-plugs-jar \ export-binary-plugs-completed # All these targets are phony (no filenames) .PHONY: export-binary-plugs-started \ export-binary-plugs-license \ export-binary-plugs-jar \ export-binary-plugs-libs \ export-binary-plugs-completed \ export-binary-plugs # Rules that test the export and import of plugs (only when you can export) TEST_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-testing-plugs TEST_PLUG_COPY=$(TEST_OUTPUTDIR)/$(PLUG_EXPORT_DIRNAME)-testcopy # Run export-binary-plugs first, then use this rule to test an import test-binary-plugs: $(TEST_PLUG_COPY) $(RM) -r $(TEST_OUTPUTDIR)/$(PLUG_EXPORT_DIRNAME) $(MKDIR) -p $(TEST_OUTPUTDIR) @$(ECHO) "Testing import of plugs" ($(CD) $(JDK_TOPDIR)/make && \ $(MAKE) OPENJDK=true \ ALT_OUTPUTDIR=$(TEST_OUTPUTDIR) \ ALT_JDK_IMPORT_PATH=$(JDK_IMPORT_PATH) \ ALT_BINARY_PLUGS_PATH=$(TEST_PLUG_COPY) \ import-binary-plugs ) $(RM) -r $(TEST_OUTPUTDIR) @$(ECHO) "Testing of plugs was successful" $(TEST_PLUG_COPY): @$(ECHO) "Creating test plug copy" $(RM) -r $@ $(MKDIR) -p $(@D) $(CP) -r -p $(PLUG_EXPORT_DIR) $@ .PHONY: test-binary-plugs endif # !OPENJDK