rev 54093 : 8257858: [macOS]: Remove JNF dependency from libosxsecurity/KeystoreImpl.m
8257860: [macOS]: Remove JNF dependency from libosxkrb5/SCDynamicStoreConfig.m

   1 #
   2 # Copyright (c) 2011, 2019, 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 include LibCommon.gmk
  27 
  28 # Hook to include the corresponding custom file, if present.
  29 $(eval $(call IncludeCustomExtension, lib/Lib-java.base.gmk))
  30 
  31 # Prepare the find cache.
  32 $(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native))
  33 
  34 ################################################################################
  35 # Create all the core libraries
  36 
  37 include CoreLibraries.gmk
  38 
  39 ################################################################################
  40 # Create the network library
  41 
  42 $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
  43     NAME := net, \
  44     OPTIMIZATION := LOW, \
  45     CFLAGS := $(CFLAGS_JDKLIB), \
  46     DISABLED_WARNINGS_gcc := format-nonliteral, \
  47     DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \
  48     DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \
  49     DISABLED_WARNINGS_solstudio := E_ARG_INCOMPATIBLE_WITH_ARG_L, \
  50     LDFLAGS := $(LDFLAGS_JDKLIB) \
  51         $(call SET_SHARED_LIBRARY_ORIGIN), \
  52     LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll, \
  53     LIBS_unix := -ljvm -ljava, \
  54     LIBS_linux := $(LIBDL) -lpthread, \
  55     LIBS_solaris := -lnsl -lsocket $(LIBDL), \
  56     LIBS_aix := $(LIBDL),\
  57     LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \
  58         delayimp.lib $(WIN_JAVA_LIB) advapi32.lib, \
  59     LIBS_macosx := -framework CoreFoundation -framework CoreServices, \
  60 ))
  61 
  62 $(BUILD_LIBNET): $(BUILD_LIBJAVA)
  63 
  64 TARGETS += $(BUILD_LIBNET)
  65 
  66 ################################################################################
  67 # Create the nio library
  68 
  69 $(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
  70     NAME := nio, \
  71     OPTIMIZATION := HIGH, \
  72     WARNINGS_AS_ERRORS_xlc := false, \
  73     CFLAGS := $(CFLAGS_JDKLIB), \
  74     EXTRA_HEADER_DIRS := \
  75         libnio/ch \
  76         libnio/fs \
  77         libnet, \
  78     LDFLAGS := $(LDFLAGS_JDKLIB) \
  79         $(call SET_SHARED_LIBRARY_ORIGIN), \
  80     LIBS_unix := -ljava -lnet, \
  81     LIBS_linux := -lpthread $(LIBDL), \
  82     LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \
  83         -lsendfile, \
  84     LIBS_aix := $(LIBDL), \
  85     LIBS_macosx := \
  86         -framework CoreFoundation -framework CoreServices, \
  87     LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \
  88         $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \
  89         advapi32.lib, \
  90 ))
  91 
  92 TARGETS += $(BUILD_LIBNIO)
  93 
  94 $(BUILD_LIBNIO): $(BUILD_LIBNET)
  95 
  96 ################################################################################
  97 # Create the macosx security library
  98 
  99 ifeq ($(OPENJDK_TARGET_OS), macosx)
 100   # JavaNativeFoundation framework not supported in static builds
 101   ifneq ($(STATIC_BUILD), true)
 102 
 103     $(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
 104         NAME := osxsecurity, \
 105         OPTIMIZATION := LOW, \
 106         CFLAGS := $(CFLAGS_JDKLIB), \
 107         DISABLED_WARNINGS_clang := deprecated-declarations, \
 108         LDFLAGS := $(LDFLAGS_JDKLIB) \
 109             -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
 110             $(call SET_SHARED_LIBRARY_ORIGIN), \
 111         LIBS := \
 112             -lobjc \
 113             -framework JavaNativeFoundation \
 114             -framework CoreServices \
 115             -framework Security \

 116             $(JDKLIB_LIBS), \
 117     ))
 118 
 119     $(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA)
 120 
 121     TARGETS += $(BUILD_LIBOSXSECURITY)
 122 
 123   endif
 124 endif
 125 
 126 ################################################################################
 127 # Create the jsig library
 128 
 129 ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
 130   ifeq ($(STATIC_BUILD), false)
 131 
 132     LIBJSIG_MAPFILE := $(wildcard $(TOPDIR)/make/mapfiles/libjsig/mapfile-vers-$(OPENJDK_TARGET_OS))
 133 
 134     ifeq ($(OPENJDK_TARGET_OS), linux)
 135       # FIXME: This is probably not what we want to do, but keep it now for compatibility.
 136       LIBJSIG_CFLAGS := $(EXPORT_ALL_SYMBOLS)
 137     endif
 138 
 139     $(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
 140         NAME := jsig, \
 141         OPTIMIZATION := LOW, \
 142         CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \
 143         LDFLAGS := $(LDFLAGS_JDKLIB) \
 144             $(call SET_SHARED_LIBRARY_ORIGIN), \
 145         LIBS_linux := $(LIBDL), \
 146         LIBS_solaris := $(LIBDL), \
 147         LIBS_aix := $(LIBDL), \
 148         MAPFILE := $(LIBJSIG_MAPFILE), \
 149     ))
 150 
 151     TARGETS += $(BUILD_LIBJSIG)
 152 
 153     ############################################################################
 154     # Create symlinks to libjsig in each JVM variant sub dir
 155     ifneq ($(STATIC_LIBS), true)
 156       LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
 157 
 158       # $1 variant subdir
 159       define CreateSymlinks
 160         # Always symlink from libdir/variant/libjsig.so -> ../libjsig.so.
 161         $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \
 162             $(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
 163                 $$(call MakeDir, $$(@D))
 164                 $(RM) $$@
 165                 $(LN) -s ../$$(@F) $$@
 166 
 167         TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig)
 168       endef
 169 
 170       # The subdir is the same as the variant for client and minimal, for all
 171       # others it's server.
 172       VARIANT_SUBDIRS := $(filter client minimal, $(JVM_VARIANTS)) \
 173           $(if $(filter-out client minimal, $(JVM_VARIANTS)), server)
 174       $(foreach v, $(VARIANT_SUBDIRS), $(eval $(call CreateSymlinks,$v)))
 175     endif
 176     ############################################################################
 177 
 178   endif
 179 endif
 180 
 181 ################################################################################
 182 # Create the symbols file for static builds.
 183 
 184 ifeq ($(STATIC_BUILD), true)
 185   JAVA_BASE_EXPORT_SYMBOLS_SRC := \
 186       $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli/$(LIBRARY_PREFIX)jli.symbols \
 187       $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \
 188       $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)net.symbols \
 189       $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)nio.symbols \
 190       $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)verify.symbols \
 191       $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)zip.symbols \
 192       $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jimage.symbols \
 193       $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server/$(LIBRARY_PREFIX)jvm.symbols \
 194       #
 195 
 196   JAVA_BASE_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/java.base.symbols
 197 
 198   $(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC)
 199         $(call LogInfo, Generating java.base.symbols file)
 200         $(CAT) $^ > $@
 201 
 202   # The individual symbol files is generated when the respective lib is built
 203   $(JAVA_BASE_EXPORT_SYMBOLS_SRC): $(BUILD_LIBJLI) $(BUILD_LIBJAVA) \
 204       $(BUILD_LIBNET) $(BUILD_LIBNIO) $(BUILD_LIBVERIFY) $(BUILD_LIBZIP) \
 205       $(BUILD_LIBJIMAGE)
 206 
 207   TARGETS += $(JAVA_BASE_EXPORT_SYMBOL_FILE)
 208 endif
--- EOF ---