1 #
   2 # Copyright (c) 2011, 2015, 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 ################################################################################
  29 
  30 ifneq ($(OPENJDK_TARGET_OS), windows)
  31   LIBJ2GSS_SRC := $(TOPDIR)/src/java.security.jgss/share/native/libj2gss \
  32       $(TOPDIR)/src/java.security.jgss/$(OPENJDK_TARGET_OS_TYPE)/native/libj2gss \
  33       #
  34 
  35   $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \
  36       LIBRARY := j2gss, \
  37       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  38       SRC := $(LIBJ2GSS_SRC), \
  39       OPTIMIZATION := LOW, \
  40       CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2GSS_SRC)) \
  41           $(LIBJAVA_HEADER_FLAGS) \
  42           -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
  43       MAPFILE := $(TOPDIR)/make/mapfiles/libj2gss/mapfile-vers, \
  44       LDFLAGS := $(LDFLAGS_JDKLIB) \
  45           $(call SET_SHARED_LIBRARY_ORIGIN), \
  46       LIBS := $(LIBDL), \
  47       LIBS_solaris := -lc, \
  48       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2gss, \
  49   ))
  50 
  51   TARGETS += $(BUILD_LIBJ2GSS)
  52 endif
  53 
  54 ################################################################################
  55 
  56 ifneq ($(BUILD_CRYPTO), false)
  57   BUILD_LIBKRB5_NAME :=
  58   ifeq ($(OPENJDK_TARGET_OS), windows)
  59     BUILD_LIBKRB5_NAME := w2k_lsa_auth
  60     BUILD_LIBKRB5_SRC := $(TOPDIR)/src/java.security.jgss/$(OPENJDK_TARGET_OS_TYPE)/native/libw2k_lsa_auth
  61     BUILD_LIBKRB5_LIBS := advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
  62         gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \
  63         ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib
  64   else ifeq ($(OPENJDK_TARGET_OS), macosx)
  65     BUILD_LIBKRB5_NAME := osxkrb5
  66     BUILD_LIBKRB5_SRC := $(TOPDIR)/src/java.security.jgss/macosx/native/libosxkrb5
  67     BUILD_LIBKRB5_LIBS := \
  68         -framework JavaNativeFoundation \
  69         -framework Cocoa \
  70         -framework SystemConfiguration \
  71         -framework Kerberos
  72   endif
  73 
  74   ifneq ($(BUILD_LIBKRB5_NAME), )
  75     # libosxkrb5 needs to call deprecated krb5 APIs so that java
  76     # can use the native credentials cache.
  77     $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5, \
  78         LIBRARY := $(BUILD_LIBKRB5_NAME), \
  79         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  80         SRC := $(BUILD_LIBKRB5_SRC), \
  81         OPTIMIZATION := LOW, \
  82         CFLAGS := $(CFLAGS_JDKLIB) \
  83             $(addprefix -I, $(BUILD_LIBKRB5_SRC)) \
  84             -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
  85         DISABLED_WARNINGS_clang := deprecated-declarations, \
  86         LDFLAGS := $(LDFLAGS_JDKLIB) \
  87             $(call SET_SHARED_LIBRARY_ORIGIN), \
  88         LIBS := $(BUILD_LIBKRB5_LIBS), \
  89         VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
  90         RC_FLAGS := $(RC_FLAGS) \
  91             -D "JDK_FNAME=$(BUILD_LIBKRB5_NAME).dll" \
  92             -D "JDK_INTERNAL_NAME=$(BUILD_LIBKRB5_NAME)" \
  93             -D "JDK_FTYPE=0x2L", \
  94         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libkrb5, \
  95     ))
  96 
  97     TARGETS += $(BUILD_LIBKRB5)
  98   endif
  99 endif
 100 
 101 ################################################################################