1 #
   2 # Copyright (c) 2011, 2014, 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 
  26 ifeq ($(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       LDFLAGS := $(LDFLAGS_JDKLIB) \
  37           $(call SET_SHARED_LIBRARY_ORIGIN), \
  38       LDFLAGS_SUFFIX := -framework Cocoa \
  39           -framework Carbon \
  40           -framework JavaNativeFoundation \
  41           $(LDFLAGS_JDKLIB_SUFFIX), \
  42       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \
  43       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  44 
  45   $(BUILD_LIBAPPLESCRIPTENGINE): $(BUILD_LIBJAVA)
  46 
  47   BUILD_LIBRARIES += $(BUILD_LIBAPPLESCRIPTENGINE)
  48 
  49 endif
  50 
  51 ##########################################################################################
  52 
  53 ifeq ($(OPENJDK_TARGET_OS), macosx)
  54 
  55   $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP, \
  56       LIBRARY := osxapp, \
  57       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  58       SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
  59       LANG := C, \
  60       OPTIMIZATION := LOW, \
  61       CFLAGS := $(CFLAGS_JDKLIB) \
  62           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
  63           -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp, \
  64       LDFLAGS := $(LDFLAGS_JDKLIB) \
  65           $(call SET_SHARED_LIBRARY_ORIGIN), \
  66       LDFLAGS_SUFFIX_macosx := \
  67           -framework Accelerate \
  68           -framework ApplicationServices \
  69           -framework AudioToolbox \
  70           -framework Carbon \
  71           -framework Cocoa \
  72           -framework Security \
  73           -framework ExceptionHandling \
  74           -framework JavaNativeFoundation \
  75           -framework JavaRuntimeSupport \
  76           -framework OpenGL \
  77           -framework IOSurface \
  78           -framework QuartzCore, \
  79       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxapp, \
  80       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
  81 
  82   BUILD_LIBRARIES += $(BUILD_LIBOSXAPP)
  83 
  84 endif
  85 
  86 ##########################################################################################
  87 
  88 ifeq ($(OPENJDK_TARGET_OS), macosx)
  89 
  90   LIBOSX_DIRS := \
  91       $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \
  92       $(JDK_TOPDIR)/src/macosx/native/java/util \
  93       $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \
  94       $(JDK_TOPDIR)/src/macosx/native/apple/security \
  95       $(JDK_TOPDIR)/src/macosx/native/apple/launcher
  96 
  97   $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \
  98       LIBRARY := osx, \
  99       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 100       SRC := $(LIBOSX_DIRS), \
 101       LANG := C, \
 102       OPTIMIZATION := LOW, \
 103       CFLAGS := $(CFLAGS_JDKLIB) \
 104           $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \
 105           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
 106       LDFLAGS := $(LDFLAGS_JDKLIB) \
 107           $(call SET_SHARED_LIBRARY_ORIGIN), \
 108       LDFLAGS_SUFFIX_macosx := \
 109           -losxapp \
 110           -framework Cocoa \
 111           -framework ApplicationServices \
 112           -framework JavaNativeFoundation \
 113           -framework JavaRuntimeSupport \
 114           -framework Security \
 115           -framework SystemConfiguration \
 116           $(LDFLAGS_JDKLIB_SUFFIX), \
 117       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosx, \
 118       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 119 
 120   BUILD_LIBRARIES += $(BUILD_LIBOSX)
 121 
 122   $(BUILD_LIBOSX): $(BUILD_LIBOSXAPP)
 123 
 124   $(BUILD_LIBOSX): $(BUILD_LIBJAVA)
 125 
 126 endif
 127 
 128 ##########################################################################################
 129 
 130 ifndef OPENJDK
 131   ifeq ($(OPENJDK_TARGET_OS), windows)
 132 
 133     ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/windows/native/sun/bridge
 134 
 135     define SetupAccessBridge
 136       # Parameter 1 Suffix
 137       # Parameter 2 Machine
 138       # Parameter 3 ACCESSBRIDGE_ARCH_ suffix
 139 
 140       $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1, \
 141           LIBRARY = JAWTAccessBridge$1, \
 142           OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 143           SRC := $(ACCESSBRIDGE_SRCDIR), \
 144           INCLUDE_FILES := JAWTAccessBridge.cpp, \
 145           LANG := C++, \
 146           OPTIMIZATION := LOW, \
 147           CFLAGS := $(CFLAGS_JDKLIB) \
 148               -DACCESSBRIDGE_ARCH_$3, \
 149           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
 150               winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
 151               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
 152               -subsystem:windows -machine:$2, \
 153           VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
 154           RC_FLAGS := $(RC_FLAGS) \
 155               -D "JDK_FNAME=JAWTAccessBridge$1.dll" \
 156               -D "JDK_INTERNAL_NAME=JAWTAccessBridge$1" \
 157               -D "JDK_FTYPE=0x02L", \
 158           OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \
 159           DEBUG_SYMBOLS := true)
 160 
 161       $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 162 
 163       $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
 164           LIBRARY = JavaAccessBridge$1, \
 165           OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 166           SRC := $(ACCESSBRIDGE_SRCDIR), \
 167           INCLUDE_FILES := AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \
 168               AccessBridgeJavaEntryPoints.cpp \
 169               AccessBridgeMessages.cpp JavaAccessBridge.cpp, \
 170           LANG := C++, \
 171           OPTIMIZATION := LOW, \
 172           CFLAGS := $(CFLAGS_JDKLIB) \
 173               -DACCESSBRIDGE_ARCH_$3, \
 174           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
 175               winspool.lib comdlg32.lib advapi32.lib shell32.lib \
 176               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
 177               -subsystem:windows -machine:$2, \
 178           VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
 179           RC_FLAGS := $(RC_FLAGS) \
 180               -D "JDK_FNAME=JavaAccessBridge$1.dll" \
 181               -D "JDK_INTERNAL_NAME=JavaAccessBridge$1" \
 182               -D "JDK_FTYPE=0x02L", \
 183           OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1, \
 184           DEBUG_SYMBOLS := true)
 185 
 186       $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1, \
 187           LIBRARY = WindowsAccessBridge$1, \
 188           OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 189           SRC := $(ACCESSBRIDGE_SRCDIR), \
 190           INCLUDE_FILES := AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \
 191               AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \
 192               WinAccessBridge.cpp AccessBridgeDebug.cpp \
 193               AccessBridgeEventHandler.cpp, \
 194           LANG := C++, \
 195           OPTIMIZATION := LOW, \
 196           CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
 197               -DACCESSBRIDGE_ARCH_$3, \
 198           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
 199               winspool.lib comdlg32.lib advapi32.lib shell32.lib \
 200               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
 201               -subsystem:windows -machine:$2 \
 202               -def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF, \
 203           VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
 204           RC_FLAGS := $(RC_FLAGS) \
 205               -D "JDK_FNAME=WindowsAccessBridge$1.dll" \
 206               -D "JDK_INTERNAL_NAME=WindowsAccessBridge$1" \
 207               -D "JDK_FTYPE=0x02L", \
 208           OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1, \
 209           DEBUG_SYMBOLS := true)
 210 
 211       BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \
 212           $$(BUILD_WINDOWSACCESSBRIDGE$1)
 213 
 214     endef
 215 
 216     ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
 217       $(eval $(call SetupAccessBridge,-32,I386,32))
 218       $(eval $(call SetupAccessBridge,,I386,LEGACY))
 219     else
 220       $(eval $(call SetupAccessBridge,-64,X64,64))
 221     endif
 222   endif
 223 endif