PlatformLibraries.gmk revision 8845:4be14673b9bf
1# 2# Copyright (c) 2011, 2013, 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. Oracle designates this 8# particular file as subject to the "Classpath" exception as provided 9# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22# or visit www.oracle.com if you need additional information or have any 23# questions. 24# 25 26ifeq ($(OPENJDK_TARGET_OS), macosx) 27 28 $(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE, \ 29 LIBRARY := AppleScriptEngine, \ 30 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 31 SRC := $(JDK_TOPDIR)/src/macosx/native/apple/applescript, \ 32 LANG := C, \ 33 OPTIMIZATION := LOW, \ 34 CFLAGS := $(CFLAGS_JDKLIB) \ 35 -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \ 36 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 37 -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \ 38 LDFLAGS := $(LDFLAGS_JDKLIB) \ 39 $(call SET_SHARED_LIBRARY_ORIGIN), \ 40 LDFLAGS_SUFFIX := -framework Cocoa \ 41 -framework Carbon \ 42 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 43 -framework JavaNativeFoundation \ 44 $(LDFLAGS_JDKLIB_SUFFIX), \ 45 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \ 46 DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 47 48 $(BUILD_LIBAPPLESCRIPTENGINE): $(BUILD_LIBJAVA) 49 50 BUILD_LIBRARIES += $(BUILD_LIBAPPLESCRIPTENGINE) 51 52endif 53 54########################################################################################## 55 56ifeq ($(OPENJDK_TARGET_OS), macosx) 57 58 $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP, \ 59 LIBRARY := osxapp, \ 60 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 61 SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \ 62 LANG := C, \ 63 OPTIMIZATION := LOW, \ 64 CFLAGS := $(CFLAGS_JDKLIB) \ 65 -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \ 66 -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \ 67 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 68 -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \ 69 LDFLAGS := $(LDFLAGS_JDKLIB) \ 70 $(call SET_SHARED_LIBRARY_ORIGIN), \ 71 LDFLAGS_SUFFIX_macosx := \ 72 -framework Accelerate \ 73 -framework ApplicationServices \ 74 -framework AudioToolbox \ 75 -framework Carbon \ 76 -framework Cocoa \ 77 -framework Security \ 78 -framework ExceptionHandling \ 79 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 80 -framework JavaNativeFoundation \ 81 -framework JavaRuntimeSupport \ 82 -framework OpenGL \ 83 -framework IOSurface \ 84 -framework QuartzCore, \ 85 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxapp, \ 86 DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 87 88 BUILD_LIBRARIES += $(BUILD_LIBOSXAPP) 89 90endif 91 92########################################################################################## 93 94ifeq ($(OPENJDK_TARGET_OS), macosx) 95 96 LIBOSX_DIRS := \ 97 $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \ 98 $(JDK_TOPDIR)/src/macosx/native/java/util \ 99 $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \ 100 $(JDK_TOPDIR)/src/macosx/native/apple/security \ 101 $(JDK_TOPDIR)/src/macosx/native/apple/launcher 102 103 $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \ 104 LIBRARY := osx, \ 105 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 106 SRC := $(LIBOSX_DIRS), \ 107 LANG := C, \ 108 OPTIMIZATION := LOW, \ 109 CFLAGS := $(CFLAGS_JDKLIB) \ 110 $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \ 111 -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \ 112 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 113 -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \ 114 LDFLAGS := $(LDFLAGS_JDKLIB) \ 115 $(call SET_SHARED_LIBRARY_ORIGIN), \ 116 LDFLAGS_SUFFIX_macosx := \ 117 -losxapp \ 118 -framework Cocoa \ 119 -framework ApplicationServices \ 120 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 121 -framework JavaNativeFoundation \ 122 -framework JavaRuntimeSupport \ 123 -framework Security \ 124 -framework SystemConfiguration \ 125 $(LDFLAGS_JDKLIB_SUFFIX), \ 126 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosx, \ 127 DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 128 129 BUILD_LIBRARIES += $(BUILD_LIBOSX) 130 131 $(BUILD_LIBOSX): $(BUILD_LIBOSXAPP) 132 133 $(BUILD_LIBOSX): $(BUILD_LIBJAVA) 134 135endif 136 137########################################################################################## 138 139ifeq ($(OPENJDK_TARGET_OS), macosx) 140 141 $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC32, \ 142 LIBRARY := JObjC, \ 143 OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc32, \ 144 SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \ 145 $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native, \ 146 LANG := C, \ 147 OPTIMIZATION := LOW, \ 148 CFLAGS := -fpascal-strings \ 149 -fobjc-gc \ 150 -gdwarf-2 \ 151 $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \ 152 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 153 -m32, \ 154 LDFLAGS := $(LDFLAGS_JDKLIB) \ 155 -m32, \ 156 LDFLAGS_SUFFIX := -framework Foundation -framework JavaVM \ 157 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 158 -framework JavaNativeFoundation \ 159 -lffi, \ 160 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc32, \ 161 DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 162 163 $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC64, \ 164 LIBRARY := JObjC, \ 165 OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc64, \ 166 SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \ 167 $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native, \ 168 LANG := C, \ 169 OPTIMIZATION := LOW, \ 170 CFLAGS := -fpascal-strings \ 171 -fobjc-gc \ 172 -gdwarf-2 \ 173 $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \ 174 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 175 , \ 176 LDFLAGS := -fpascal-strings \ 177 -fobjc-gc \ 178 -gdwarf-2 \ 179 $(LDFLAGS_JDKLIB) \ 180 $(call SET_SHARED_LIBRARY_ORIGIN), \ 181 LDFLAGS_SUFFIX := -framework Foundation -framework JavaVM \ 182 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ 183 -framework JavaNativeFoundation \ 184 -lffi, \ 185 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc64, \ 186 DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 187 188 $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX): $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64) 189 $(LIPO) -create -output $@ $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64) 190 191 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX) 192 193endif 194 195########################################################################################## 196 197ifndef OPENJDK 198 ifeq ($(OPENJDK_TARGET_OS), windows) 199 200 ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge 201 202 define SetupAccessBridge 203 # Parameter 1 Suffix 204 # Parameter 2 Machine 205 # Parameter 3 ACCESSBRIDGE_ARCH_ suffix 206 207 $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1, \ 208 LIBRARY = JAWTAccessBridge$1, \ 209 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 210 SRC := $(ACCESSBRIDGE_SRCDIR), \ 211 INCLUDE_FILES := JAWTAccessBridge.cpp, \ 212 LANG := C++, \ 213 OPTIMIZATION := LOW, \ 214 CFLAGS := $(CFLAGS_JDKLIB) \ 215 -DACCESSBRIDGE_ARCH_$3, \ 216 LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \ 217 winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \ 218 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \ 219 -subsystem:windows -machine:$2 \ 220 -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF, \ 221 VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \ 222 RC_FLAGS := $(RC_FLAGS), \ 223 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \ 224 DEBUG_SYMBOLS := true) 225 226 $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) 227 228 $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \ 229 LIBRARY = JavaAccessBridge$1, \ 230 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 231 SRC := $(ACCESSBRIDGE_SRCDIR), \ 232 INCLUDE_FILES := AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \ 233 AccessBridgeJavaEntryPoints.cpp \ 234 AccessBridgeMessages.cpp JavaAccessBridge.cpp, \ 235 LANG := C++, \ 236 OPTIMIZATION := LOW, \ 237 CFLAGS := $(CFLAGS_JDKLIB) \ 238 -DACCESSBRIDGE_ARCH_$3, \ 239 LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \ 240 winspool.lib comdlg32.lib advapi32.lib shell32.lib \ 241 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \ 242 -subsystem:windows -machine:$2 \ 243 -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF, \ 244 VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \ 245 RC_FLAGS := $(RC_FLAGS), \ 246 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1, \ 247 DEBUG_SYMBOLS := true) 248 249 $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1, \ 250 LIBRARY = WindowsAccessBridge$1, \ 251 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 252 SRC := $(ACCESSBRIDGE_SRCDIR), \ 253 INCLUDE_FILES := AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \ 254 AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \ 255 WinAccessBridge.cpp AccessBridgeDebug.cpp \ 256 AccessBridgeEventHandler.cpp, \ 257 LANG := C++, \ 258 OPTIMIZATION := LOW, \ 259 CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \ 260 -DACCESSBRIDGE_ARCH_$3, \ 261 LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \ 262 winspool.lib comdlg32.lib advapi32.lib shell32.lib \ 263 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \ 264 -subsystem:windows -machine:$2 \ 265 -def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF, \ 266 VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \ 267 RC_FLAGS := $(RC_FLAGS), \ 268 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1, \ 269 DEBUG_SYMBOLS := true) 270 271 BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \ 272 $$(BUILD_WINDOWSACCESSBRIDGE$1) 273 274 endef 275 276 ifeq ($(OPENJDK_TARGET_CPU_BITS), 32) 277 $(eval $(call SetupAccessBridge,-32,I386,32)) 278 $(eval $(call SetupAccessBridge,,I386,LEGACY)) 279 else 280 $(eval $(call SetupAccessBridge,-64,X64,64)) 281 endif 282 endif 283endif 284