Skip to content

Commit bb46af0

Browse files
authored
Build the systemconf library on all platforms (#7)
Build the systemconf library on all platforms, simply returning JNI_FALSE if !LINUX Reviewed-by: @franferrax
1 parent 84266ee commit bb46af0

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

make/modules/java.base/Lib.gmk

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,17 @@ ifeq ($(USE_SYSCONF_NSS), true)
178178
LIBSYSTEMCONF_CXXFLAGS += $(NSS_CFLAGS) -DSYSCONF_NSS
179179
endif
180180

181-
ifeq ($(OPENJDK_BUILD_OS), linux)
182-
$(eval $(call SetupJdkLibrary, BUILD_LIBSYSTEMCONF, \
183-
NAME := systemconf, \
184-
OPTIMIZATION := LOW, \
185-
CFLAGS := $(CFLAGS_JDKLIB) $(LIBSYSTEMCONF_CFLAGS), \
186-
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBSYSTEMCONF_CXXFLAGS), \
187-
LDFLAGS := $(LDFLAGS_JDKLIB) \
188-
$(call SET_SHARED_LIBRARY_ORIGIN), \
189-
LIBS_unix := $(LIBDL) $(NSS_LIBS), \
190-
))
181+
$(eval $(call SetupJdkLibrary, BUILD_LIBSYSTEMCONF, \
182+
NAME := systemconf, \
183+
OPTIMIZATION := LOW, \
184+
CFLAGS := $(CFLAGS_JDKLIB) $(LIBSYSTEMCONF_CFLAGS), \
185+
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBSYSTEMCONF_CXXFLAGS), \
186+
LDFLAGS := $(LDFLAGS_JDKLIB) \
187+
$(call SET_SHARED_LIBRARY_ORIGIN), \
188+
LIBS_unix := $(LIBDL) $(NSS_LIBS), \
189+
))
191190

192-
TARGETS += $(BUILD_LIBSYSTEMCONF)
193-
endif
191+
TARGETS += $(BUILD_LIBSYSTEMCONF)
194192

195193
################################################################################
196194
# Create the symbols file for static builds.

src/java.base/linux/native/libsystemconf/systemconf.c renamed to src/java.base/share/native/libsystemconf/systemconf.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "jvm_md.h"
2929
#include <stdio.h>
3030

31+
#ifdef LINUX
32+
3133
#ifdef SYSCONF_NSS
3234
#include <nss3/pk11pub.h>
3335
#else
@@ -222,3 +224,13 @@ JNIEXPORT jboolean JNICALL Java_java_security_SystemConfigurator_getSystemFIPSEn
222224
return (fips_enabled == '1' ? JNI_TRUE : JNI_FALSE);
223225
}
224226
}
227+
228+
#else // !LINUX
229+
230+
JNIEXPORT jboolean JNICALL Java_java_security_SystemConfigurator_getSystemFIPSEnabled
231+
(JNIEnv *env, jclass cls)
232+
{
233+
return JNI_FALSE;
234+
}
235+
236+
#endif

0 commit comments

Comments
 (0)