SecurityLibraries.gmk revision 8845:4be14673b9bf
1253732Speter# 2253732Speter# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 3253732Speter# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4253732Speter# 5253732Speter# This code is free software; you can redistribute it and/or modify it 6253732Speter# under the terms of the GNU General Public License version 2 only, as 7253732Speter# published by the Free Software Foundation. Oracle designates this 8253732Speter# particular file as subject to the "Classpath" exception as provided 9253732Speter# by Oracle in the LICENSE file that accompanied this code. 10253732Speter# 11253732Speter# This code is distributed in the hope that it will be useful, but WITHOUT 12253732Speter# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13253732Speter# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14253732Speter# version 2 for more details (a copy is included in the LICENSE file that 15253732Speter# accompanied this code). 16253732Speter# 17253732Speter# You should have received a copy of the GNU General Public License version 18253732Speter# 2 along with this work; if not, write to the Free Software Foundation, 19253732Speter# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20253732Speter# 21253732Speter# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22253732Speter# or visit www.oracle.com if you need additional information or have any 23253732Speter# questions. 24253732Speter# 25253732Speter 26253732SpeterLIBJAAS_MAPFILE := 27253732Speterifneq ($(OPENJDK_TARGET_OS), solaris) 28253732Speter LIBJAAS_EXCLUDE_FILES := Solaris.c 29253732Speterelse 30253732Speter # only on solaris...wonder why 31253732Speter LIBJAAS_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjaas/mapfile-vers 32253732Speterendif 33253732Speter 34253732SpeterLIBJAAS_NAME := jaas_unix 35253732Speterifeq ($(OPENJDK_TARGET_OS), windows) 36253732Speter LIBJAAS_NAME := jaas_nt 37253732Speterendif 38253732Speter 39253732Speter$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \ 40253732Speter LIBRARY := $(LIBJAAS_NAME), \ 41253732Speter OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 42253732Speter SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/security/auth/module, \ 43253732Speter LANG := C, \ 44253732Speter OPTIMIZATION := LOW, \ 45253732Speter CFLAGS := $(CFLAGS_JDKLIB), \ 46253732Speter MAPFILE := $(LIBJAAS_MAPFILE), \ 47253732Speter LDFLAGS := $(filter-out -ljava, $(LDFLAGS_JDKLIB)) \ 48253732Speter $(call SET_SHARED_LIBRARY_ORIGIN), \ 49253732Speter LDFLAGS_windows := netapi32.lib user32.lib mpr.lib advapi32.lib, \ 50253732Speter LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX), \ 51253732Speter LDFLAGS_SUFFIX_solaris := -lc, \ 52253732Speter EXCLUDE_FILES := $(LIBJAAS_EXCLUDE_FILES), \ 53253732Speter VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ 54253732Speter RC_FLAGS := $(RC_FLAGS) \ 55253732Speter -D "JDK_FNAME=$(LIBJAAS_NAME).dll" \ 56253732Speter -D "JDK_INTERNAL_NAME=$(LIBJAAS_NAME)" \ 57253732Speter -D "JDK_FTYPE=0x2L", \ 58253732Speter OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjaas, \ 59253732Speter DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 60253732Speter 61253732Speter$(BUILD_LIBJAAS): $(BUILD_LIBJAVA) 62253732Speter 63253732SpeterBUILD_LIBRARIES += $(BUILD_LIBJAAS) 64253732Speter 65253732Speter########################################################################################## 66253732Speter 67253732Speter$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \ 68253732Speter LIBRARY := j2pcsc, \ 69253732Speter OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 70253732Speter SRC := $(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \ 71253732Speter $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio, \ 72253732Speter LANG := C, \ 73253732Speter CFLAGS_posix := -D__sun_jdk, \ 74253732Speter OPTIMIZATION := LOW, \ 75253732Speter CFLAGS := $(CFLAGS_JDKLIB) \ 76253732Speter -I$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \ 77253732Speter -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio \ 78253732Speter -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio/MUSCLE, \ 79253732Speter MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pcsc/mapfile-vers, \ 80253732Speter LDFLAGS := $(LDFLAGS_JDKLIB) \ 81253732Speter $(call SET_SHARED_LIBRARY_ORIGIN), \ 82253732Speter LDFLAGS_SUFFIX_posix := $(LIBDL), \ 83253732Speter LDFLAGS_SUFFIX_windows := winscard.lib, \ 84253732Speter LDFLAGS_SUFFIX_solaris := -lc, \ 85253732Speter VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ 86253732Speter RC_FLAGS := $(RC_FLAGS) \ 87253732Speter -D "JDK_FNAME=j2pcsc.dll" \ 88253732Speter -D "JDK_INTERNAL_NAME=j2pcsc" \ 89253732Speter -D "JDK_FTYPE=0x2L", \ 90253732Speter OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2pcsc, \ 91253732Speter DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 92253732Speter 93253732SpeterBUILD_LIBRARIES += $(BUILD_LIBJ2PCSC) 94253732Speter 95253732Speter########################################################################################## 96253732Speter 97253732Speterifneq ($(OPENJDK_TARGET_OS), windows) 98253732Speter $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \ 99253732Speter LIBRARY := j2gss, \ 100253732Speter OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 101253732Speter SRC := $(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \ 102253732Speter $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \ 103253732Speter LANG := C, \ 104253732Speter OPTIMIZATION := LOW, \ 105253732Speter CFLAGS := $(CFLAGS_JDKLIB) \ 106253732Speter -I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \ 107253732Speter -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \ 108253732Speter MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2gss/mapfile-vers, \ 109253732Speter LDFLAGS := $(LDFLAGS_JDKLIB) \ 110253732Speter $(call SET_SHARED_LIBRARY_ORIGIN), \ 111253732Speter LDFLAGS_SUFFIX := $(LIBDL), \ 112253732Speter LDFLAGS_SUFFIX_solaris := -lc, \ 113253732Speter OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2gss, \ 114253732Speter DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 115253732Speter 116253732Speter BUILD_LIBRARIES += $(BUILD_LIBJ2GSS) 117253732Speterendif 118253732Speter 119253732Speter########################################################################################## 120253732Speter 121253732Speterifneq ($(BUILD_CRYPTO), no) 122253732Speter BUILD_LIBKRB5_NAME := 123253732Speter ifeq ($(OPENJDK_TARGET_OS), windows) 124253732Speter BUILD_LIBKRB5_NAME := w2k_lsa_auth 125253732Speter BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5 126253732Speter BUILD_LIBKRB5_LIBS := advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \ 127253732Speter gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \ 128253732Speter ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib 129253732Speter else ifeq ($(OPENJDK_TARGET_OS), macosx) 130253732Speter BUILD_LIBKRB5_NAME := osxkrb5 131253732Speter BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/share/native/sun/security/krb5 132253732Speter BUILD_LIBKRB5_LIBS := -framework Kerberos 133253732Speter endif 134253732Speter 135253732Speter ifneq ($(BUILD_LIBKRB5_NAME), ) 136253732Speter $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5, \ 137253732Speter LIBRARY := $(BUILD_LIBKRB5_NAME), \ 138253732Speter OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 139253732Speter SRC := $(BUILD_LIBKRB5_SRC), \ 140253732Speter LANG := C, \ 141253732Speter OPTIMIZATION := LOW, \ 142253732Speter CFLAGS := $(CFLAGS_JDKLIB) \ 143253732Speter -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \ 144253732Speter -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5, \ 145253732Speter LDFLAGS := $(LDFLAGS_JDKLIB) \ 146253732Speter $(call SET_SHARED_LIBRARY_ORIGIN), \ 147253732Speter LDFLAGS_SUFFIX := $(BUILD_LIBKRB5_LIBS), \ 148253732Speter VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ 149253732Speter RC_FLAGS := $(RC_FLAGS) \ 150253732Speter -D "JDK_FNAME=$(BUILD_LIBKRB5_NAME).dll" \ 151253732Speter -D "JDK_INTERNAL_NAME=$(BUILD_LIBKRB5_NAME)" \ 152253732Speter -D "JDK_FTYPE=0x2L", \ 153253732Speter OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkrb5, \ 154253732Speter DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 155253732Speter 156253732Speter BUILD_LIBRARIES += $(BUILD_LIBKRB5) 157253732Speter endif 158253732Speterendif 159253732Speter 160253732Speter########################################################################################## 161253732Speter 162253732Speterifeq ($(OPENJDK_TARGET_OS), windows) 163253732Speter 164253732Speter $(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI, \ 165253732Speter LIBRARY := sunmscapi, \ 166253732Speter OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 167253732Speter SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi, \ 168253732Speter LANG := C++, \ 169253732Speter OPTIMIZATION := LOW, \ 170253732Speter CFLAGS := $(CFLAGS_JDKLIB) \ 171253732Speter -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi, \ 172253732Speter LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ 173253732Speter $(call SET_SHARED_LIBRARY_ORIGIN), \ 174253732Speter LDFLAGS_SUFFIX := Crypt32.Lib advapi32.lib, \ 175253732Speter VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ 176253732Speter RC_FLAGS := $(RC_FLAGS) \ 177253732Speter -D "JDK_FNAME=sunmscapi.dll" \ 178253732Speter -D "JDK_INTERNAL_NAME=sunmscapi" \ 179253732Speter -D "JDK_FTYPE=0x2L", \ 180253732Speter OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunmscapi, \ 181253732Speter DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 182253732Speter 183253732Speter BUILD_LIBRARIES += $(BUILD_LIBSUNMSCAPI) 184253732Speterendif 185253732Speter 186253732Speter########################################################################################## 187253732Speter 188253732Speter$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \ 189253732Speter LIBRARY := j2pkcs11, \ 190253732Speter OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 191253732Speter SRC := $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \ 192253732Speter $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \ 193253732Speter $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \ 194253732Speter $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \ 195253732Speter LANG := C, \ 196253732Speter OPTIMIZATION := LOW, \ 197253732Speter CFLAGS := $(CFLAGS_JDKLIB) \ 198253732Speter -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \ 199253732Speter -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \ 200253732Speter -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \ 201253732Speter -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \ 202253732Speter MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2pkcs11/mapfile-vers, \ 203253732Speter LDFLAGS := $(LDFLAGS_JDKLIB) \ 204253732Speter $(call SET_SHARED_LIBRARY_ORIGIN), \ 205253732Speter LDFLAGS_SUFFIX_posix := $(LIBDL), \ 206253732Speter LDFLAGS_SUFFIX_solaris := -lc, \ 207253732Speter VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ 208253732Speter RC_FLAGS := $(RC_FLAGS) \ 209253732Speter -D "JDK_FNAME=j2pkcs11.dll" \ 210253732Speter -D "JDK_INTERNAL_NAME=j2pkcs11" \ 211253732Speter -D "JDK_FTYPE=0x2L", \ 212253732Speter OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2pkcs11, \ 213253732Speter DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 214253732Speter 215253732SpeterBUILD_LIBRARIES += $(BUILD_LIBJ2PKCS11) 216253732Speter 217253732Speter########################################################################################## 218253732Speter 219253732Speterifeq ($(ENABLE_INTREE_EC), yes) 220253732Speter 221253732Speter BUILD_LIBSUNEC_FLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/security/ec \ 222253732Speter -I$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl 223253732Speter 224253732Speter # 225253732Speter # On sol-sparc...all libraries are compiled with -xregs=no%appl 226253732Speter # (set in CFLAGS_REQUIRED_sparc) 227253732Speter # 228253732Speter # except!!! libsunec.so 229253732Speter # 230253732Speter ECC_JNI_SOLSPARC_FILTER := 231253732Speter ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) 232253732Speter ECC_JNI_SOLSPARC_FILTER := -xregs=no%appl 233253732Speter endif 234253732Speter 235253732Speter $(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC, \ 236253732Speter LIBRARY := sunec, \ 237253732Speter OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 238253732Speter SRC := $(JDK_TOPDIR)/src/share/native/sun/security/ec \ 239253732Speter $(JDK_TOPDIR)/src/share/native/sun/security/ec/impl, \ 240253732Speter LANG := C++, \ 241253732Speter OPTIMIZATION := LOW, \ 242253732Speter CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \ 243253732Speter $(BUILD_LIBSUNEC_FLAGS) \ 244253732Speter -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \ 245253732Speter CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \ 246253732Speter $(BUILD_LIBSUNEC_FLAGS), \ 247253732Speter MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsunec/mapfile-vers, \ 248253732Speter LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ 249253732Speter LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \ 250253732Speter LDFLAGS_SUFFIX := $(LIBCXX), \ 251253732Speter LDFLAGS_SUFFIX_linux := -lc, \ 252253732Speter LDFLAGS_SUFFIX_solaris := -lc, \ 253253732Speter VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ 254253732Speter RC_FLAGS := $(RC_FLAGS) \ 255253732Speter -D "JDK_FNAME=sunec.dll" \ 256253732Speter -D "JDK_INTERNAL_NAME=sunec" \ 257253732Speter -D "JDK_FTYPE=0x2L", \ 258253732Speter OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunec, \ 259253732Speter DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 260253732Speter 261253732Speter BUILD_LIBRARIES += $(BUILD_LIBSUNEC) 262253732Speterendif 263253732Speter 264253732Speter########################################################################################## 265253732Speter 266253732Speterifeq ($(OPENJDK_TARGET_OS), solaris) 267253732Speter ifndef OPENJDK 268253732Speter 269253732Speter $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO, \ 270253732Speter LIBRARY := j2ucrypto, \ 271253732Speter OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ 272253732Speter SRC := $(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto, \ 273253732Speter LANG := C, \ 274253732Speter OPTIMIZATION := LOW, \ 275253732Speter CFLAGS := $(CFLAGS_JDKLIB) \ 276253732Speter -I$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto, \ 277253732Speter MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2ucrypto/mapfile-vers, \ 278253732Speter LDFLAGS := $(LDFLAGS_JDKLIB), \ 279253732Speter LDFLAGS_SUFFIX := $(LIBDL), \ 280253732Speter LDFLAGS_SUFFIX_solaris := -lc, \ 281253732Speter OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2ucrypto, \ 282253732Speter DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) 283253732Speter 284253732Speter $(BUILD_LIBJ2UCRYPTO): $(BUILD_LIBJAVA) 285253732Speter 286253732Speter BUILD_LIBRARIES += $(BUILD_LIBJ2UCRYPTO) 287253732Speter 288253732Speter endif 289253732Speterendif 290253732Speter