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_headers_icons, \
  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/com/apple/eio \
  93       $(JDK_TOPDIR)/src/macosx/native/apple/security
  94 
  95   $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \
  96       LIBRARY := osx, \
  97       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  98       SRC := $(LIBOSX_DIRS), \
  99       LANG := C, \
 100       OPTIMIZATION := LOW, \
 101       CFLAGS := $(CFLAGS_JDKLIB) \
 102           $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \
 103           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
 104       LDFLAGS := $(LDFLAGS_JDKLIB) \
 105           $(call SET_SHARED_LIBRARY_ORIGIN), \
 106       LDFLAGS_SUFFIX_macosx := \
 107           -losxapp \
 108           -framework Cocoa \
 109           -framework ApplicationServices \
 110           -framework JavaNativeFoundation \
 111           -framework JavaRuntimeSupport \
 112           -framework Security \
 113           -framework SystemConfiguration \
 114           $(LDFLAGS_JDKLIB_SUFFIX), \
 115       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosx, \
 116       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 117 
 118   BUILD_LIBRARIES += $(BUILD_LIBOSX)
 119 
 120   $(BUILD_LIBOSX): $(BUILD_LIBOSXAPP)
 121 
 122   $(BUILD_LIBOSX): $(BUILD_LIBJAVA)
 123 
 124 endif
 125 
 126 ##########################################################################################
 127 
 128 ifndef OPENJDK
 129   ifeq ($(OPENJDK_TARGET_OS), windows)
 130 
 131     ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
 132 
 133     define SetupAccessBridge
 134       # Parameter 1 Suffix
 135       # Parameter 2 Machine
 136       # Parameter 3 ACCESSBRIDGE_ARCH_ suffix and name of directory where gensrc headers
 137       #             are found.
 138 
 139       $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1, \
 140           LIBRARY = JAWTAccessBridge$1, \
 141           OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 142           SRC := $(ACCESSBRIDGE_SRCDIR), \
 143           INCLUDE_FILES := JAWTAccessBridge.cpp, \
 144           LANG := C++, \
 145           OPTIMIZATION := LOW, \
 146           CFLAGS := $(CFLAGS_JDKLIB) \
 147               -DACCESSBRIDGE_ARCH_$3 \
 148               -I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$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               -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF, \
 154           VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
 155           RC_FLAGS := $(RC_FLAGS) \
 156               -D "JDK_FNAME=JAWTAccessBridge$1.dll" \
 157               -D "JDK_INTERNAL_NAME=JAWTAccessBridge$1" \
 158               -D "JDK_FTYPE=0x02L", \
 159           OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \
 160           DEBUG_SYMBOLS := true)
 161 
 162       $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 163 
 164       $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
 165           LIBRARY = JavaAccessBridge$1, \
 166           OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 167           SRC := $(ACCESSBRIDGE_SRCDIR), \
 168           INCLUDE_FILES := AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \
 169               AccessBridgeJavaEntryPoints.cpp \
 170               AccessBridgeMessages.cpp JavaAccessBridge.cpp, \
 171           LANG := C++, \
 172           OPTIMIZATION := LOW, \
 173           CFLAGS := $(CFLAGS_JDKLIB) \
 174               -DACCESSBRIDGE_ARCH_$3 \
 175               -I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
 176           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
 177               winspool.lib comdlg32.lib advapi32.lib shell32.lib \
 178               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
 179               -subsystem:windows -machine:$2 \
 180               -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF, \
 181           VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
 182           RC_FLAGS := $(RC_FLAGS) \
 183               -D "JDK_FNAME=JavaAccessBridge$1.dll" \
 184               -D "JDK_INTERNAL_NAME=JavaAccessBridge$1" \
 185               -D "JDK_FTYPE=0x02L", \
 186           OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1, \
 187           DEBUG_SYMBOLS := true)
 188 
 189       $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1, \
 190           LIBRARY = WindowsAccessBridge$1, \
 191           OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
 192           SRC := $(ACCESSBRIDGE_SRCDIR), \
 193           INCLUDE_FILES := AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \
 194               AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \
 195               WinAccessBridge.cpp AccessBridgeDebug.cpp \
 196               AccessBridgeEventHandler.cpp, \
 197           LANG := C++, \
 198           OPTIMIZATION := LOW, \
 199           CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
 200               -DACCESSBRIDGE_ARCH_$3 \
 201               -I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
 202           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
 203               winspool.lib comdlg32.lib advapi32.lib shell32.lib \
 204               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
 205               -subsystem:windows -machine:$2 \
 206               -def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF, \
 207           VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
 208           RC_FLAGS := $(RC_FLAGS) \
 209               -D "JDK_FNAME=WindowsAccessBridge$1.dll" \
 210               -D "JDK_INTERNAL_NAME=WindowsAccessBridge$1" \
 211               -D "JDK_FTYPE=0x02L", \
 212           OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1, \
 213           DEBUG_SYMBOLS := true)
 214 
 215       BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \
 216           $$(BUILD_WINDOWSACCESSBRIDGE$1)
 217 
 218     endef
 219 
 220     ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
 221       $(eval $(call SetupAccessBridge,-32,I386,32))
 222       $(eval $(call SetupAccessBridge,,I386,legacy))
 223     else
 224       $(eval $(call SetupAccessBridge,-64,X64,64))
 225     endif
 226   endif
 227 endif