Skip to content

Commit

Permalink
8200468: Port the native GSS-API bridge to Windows
Browse files Browse the repository at this point in the history
Reviewed-by: andrew
Backport-of: 0b6fbf50d24438117c33fa1a7d3633b792c99983
  • Loading branch information
Alexey Bakhtin committed Jul 3, 2023
1 parent 6244292 commit 0944384
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 160 deletions.
36 changes: 16 additions & 20 deletions jdk/make/lib/SecurityLibraries.gmk
Expand Up @@ -94,27 +94,23 @@ BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC)

##########################################################################################

ifneq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \
LIBRARY := j2gss, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \
LANG := C, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2gss/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX := $(LIBDL), \
LDFLAGS_SUFFIX_solaris := -lc, \
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2gss, \
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
$(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \
LIBRARY := j2gss, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper, \
LANG := C, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2gss/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX := $(LIBDL), \
LDFLAGS_SUFFIX_solaris := -lc, \
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2gss, \
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))

BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
endif
BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)

##########################################################################################

Expand Down
12 changes: 3 additions & 9 deletions jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -46,14 +46,8 @@ public class GSSManagerImpl extends GSSManager {
USE_NATIVE =
AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
public Boolean run() {
String osname = System.getProperty("os.name");
if (osname.startsWith("SunOS") ||
osname.contains("OS X") ||
osname.startsWith("Linux")) {
return new Boolean(System.getProperty
(USE_NATIVE_PROP));
}
return Boolean.FALSE;
return Boolean.valueOf(System.getProperty
(USE_NATIVE_PROP));
}
});

Expand Down

1 comment on commit 0944384

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.