Mercurial > hg > truffle
comparison make/bsd/makefiles/universal.gmk @ 4865:481a9443f721
7123386: RFE: Preserve universal builds of HotSpot on Mac OS X
Summary: Add support for packaging HotSpot JVM builds in universal binaries
Reviewed-by: dholmes, kamg, dcubed, phh
Contributed-by: james.melvin@oracle.com
author | phh |
---|---|
date | Wed, 01 Feb 2012 15:01:08 -0500 |
parents | |
children | 64b46f975ab8 |
comparison
equal
deleted
inserted
replaced
4864:b2cd0ee8f778 | 4865:481a9443f721 |
---|---|
1 # | |
2 # Copyright (c) 2006, 2012, Oracle and/or its affiliates. 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. | |
8 # | |
9 # This code is distributed in the hope that it will be useful, but WITHOUT | |
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 # version 2 for more details (a copy is included in the LICENSE file that | |
13 # accompanied this code). | |
14 # | |
15 # You should have received a copy of the GNU General Public License version | |
16 # 2 along with this work; if not, write to the Free Software Foundation, | |
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 # | |
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 # or visit www.oracle.com if you need additional information or have any | |
21 # questions. | |
22 # | |
23 # | |
24 | |
25 # macosx universal builds | |
26 universal_product: | |
27 $(MAKE) MACOSX_UNIVERSAL=true all_product_universal | |
28 universal_fastdebug: | |
29 $(MAKE) MACOSX_UNIVERSAL=true all_fastdebug_universal | |
30 universal_debug: | |
31 $(MAKE) MACOSX_UNIVERSAL=true all_debug_universal | |
32 | |
33 | |
34 # Universal builds include 1 or more architectures in a single binary | |
35 all_product_universal: | |
36 # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_PRODUCT_TARGETS) | |
37 $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_PRODUCT_TARGETS) | |
38 $(QUIETLY) $(MAKE) EXPORT_SUBDIR= universalize | |
39 all_fastdebug_universal: | |
40 # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_FASTDEBUG_TARGETS) | |
41 $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_FASTDEBUG_TARGETS) | |
42 $(QUIETLY) $(MAKE) EXPORT_SUBDIR=/fastdebug universalize | |
43 all_debug_universal: | |
44 # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_DEBUG_TARGETS) | |
45 $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_DEBUG_TARGETS) | |
46 $(QUIETLY) $(MAKE) EXPORT_SUBDIR=/debug universalize | |
47 | |
48 | |
49 # Consolidate architecture builds into a single Universal binary | |
50 universalize: $(UNIVERSAL_LIPO_LIST) $(UNIVERSAL_COPY_LIST) | |
51 $(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64} | |
52 | |
53 | |
54 # Package built libraries in a universal binary | |
55 $(UNIVERSAL_LIPO_LIST): | |
56 BUILT_LIPO_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`"; \ | |
57 if [ -n "$${BUILT_LIPO_FILES}" ]; then \ | |
58 $(MKDIR) -p $(shell dirname $@); \ | |
59 lipo -create -output $@ $${BUILT_LIPO_FILES}; \ | |
60 fi | |
61 | |
62 | |
63 # Copy built non-universal binaries in place | |
64 $(UNIVERSAL_COPY_LIST): | |
65 BUILT_COPY_FILE="$(EXPORT_JRE_LIB_DIR)/i386/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@)"; \ | |
66 if [ -f $${BUILT_COPY_FILE} ]; then \ | |
67 $(MKDIR) -p $(shell dirname $@); \ | |
68 $(CP) $${BUILT_COPY_FILE} $@; \ | |
69 fi | |
70 | |
71 | |
72 # Replace arch specific binaries with universal binaries | |
73 export_universal: | |
74 $(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64} | |
75 $(RM) -r $(JDK_IMAGE_DIR)/jre/lib/{i386,amd64} | |
76 $(RM) $(JDK_IMAGE_DIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX) | |
77 ($(CD) $(EXPORT_PATH) && \ | |
78 $(TAR) -cf - *) | \ | |
79 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xpf -) | |
80 | |
81 | |
82 # Overlay universal binaries | |
83 copy_universal: | |
84 $(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{i386,amd64} | |
85 $(RM) $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX) | |
86 ($(CD) $(EXPORT_PATH)$(COPY_SUBDIR) && \ | |
87 $(TAR) -cf - *) | \ | |
88 ($(CD) $(JDK_IMAGE_DIR)$(COPY_SUBDIR) && $(TAR) -xpf -) | |
89 | |
90 | |
91 # Additional processing for universal builds | |
92 export_product_jdk:: | |
93 $(MAKE) EXPORT_SUBDIR= export_universal | |
94 export_optimized_jdk:: | |
95 $(MAKE) EXPORT_SUBDIR= export_universal | |
96 export_fastdebug_jdk:: | |
97 $(MAKE) EXPORT_SUBDIR=/fastdebug export_universal | |
98 export_debug_jdk:: | |
99 $(MAKE) EXPORT_SUBDIR=/debug export_universal | |
100 copy_product_jdk:: | |
101 $(MAKE) COPY_SUBDIR= copy_universal | |
102 copy_fastdebug_jdk:: | |
103 $(MAKE) COPY_SUBDIR=/fastdebug copy_universal | |
104 copy_debug_jdk:: | |
105 $(MAKE) COPY_SUBDIR=/debug copy_universal | |
106 | |
107 .PHONY: universal_product universal_fastdebug universal_debug \ | |
108 all_product_universal all_fastdebug_universal all_debug_universal \ | |
109 universalize export_universal copy_universal |