Skip to content

Commit 173c7cb

Browse files
authored
Merge pull request #490 from keithc-ca/openssl
Improve OpenSSL build integration
2 parents db072c7 + c1042c6 commit 173c7cb

File tree

4 files changed

+23
-25
lines changed

4 files changed

+23
-25
lines changed

closed/autoconf/custom-hook.m4

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -623,29 +623,27 @@ AC_DEFUN([CONFIGURE_OPENSSL],
623623
[Use either fetched | system | <path to openssl version 1.0.2 or later>])])
624624
AC_ARG_ENABLE(openssl-bundling, [AS_HELP_STRING([--enable-openssl-bundling],
625625
[enable bundling of the openssl crypto library with the jdk build])])
626-
WITH_OPENSSL=yes
627-
if test "x$with_openssl" = x; then
628-
# User doesn't want to build with OpenSSL. No need to build openssl libraries
629-
WITH_OPENSSL=no
626+
BUILD_OPENSSL=false
627+
OPENSSL_BUNDLE_LIB_PATH=
628+
WITH_OPENSSL=true
629+
if test "x$with_openssl" = x || test "x$with_openssl" = xno ; then
630+
# User doesn't want to build with OpenSSL. No need to build openssl libraries.
631+
WITH_OPENSSL=false
630632
else
631633
AC_MSG_CHECKING([for OPENSSL])
632-
BUNDLE_OPENSSL="$enable_openssl_bundling"
633-
BUILD_OPENSSL=no
634634
# If not specified, default is to not bundle openssl
635-
if test "x$BUNDLE_OPENSSL" = x; then
636-
BUNDLE_OPENSSL=no
635+
if test "x$enable_openssl_bundling" != xyes ; then
636+
enable_openssl_bundling=no
637637
fi
638638
# Process --with-openssl=fetched
639639
if test "x$with_openssl" = xfetched ; then
640640
if test -d "$TOPDIR/openssl" ; then
641641
OPENSSL_DIR="$TOPDIR/openssl"
642642
OPENSSL_CFLAGS="-I${OPENSSL_DIR}/include"
643-
if test "x$BUNDLE_OPENSSL" != x ; then
644-
if ! test -s "$OPENSSL_DIR/${LIBRARY_PREFIX}crypto${SHARED_LIBRARY_SUFFIX}" ; then
645-
BUILD_OPENSSL=yes
646-
fi
643+
if ! test -s "$OPENSSL_DIR/${LIBRARY_PREFIX}crypto${SHARED_LIBRARY_SUFFIX}" ; then
644+
BUILD_OPENSSL=true
647645
fi
648-
if test "x$BUNDLE_OPENSSL" = xyes ; then
646+
if test "x$enable_openssl_bundling" = xyes ; then
649647
OPENSSL_BUNDLE_LIB_PATH="${OPENSSL_DIR}"
650648
fi
651649
AC_MSG_RESULT([yes])
@@ -673,9 +671,9 @@ AC_DEFUN([CONFIGURE_OPENSSL],
673671
AC_MSG_ERROR([Unable to find openssl 1.0.2(and above) installed on System. Please use other options for '--with-openssl'])
674672
fi
675673
# The crypto library bundling option is not available when --with-openssl=system.
676-
if test "x$BUNDLE_OPENSSL" = xyes ; then
674+
if test "x$enable_openssl_bundling" = xyes ; then
677675
AC_MSG_RESULT([no])
678-
printf "The option --enable_openssl_bundling is not available with --with-openssl=system. Use option fetched or openssl-custom-path to bundle crypto library\n"
676+
printf "The option --enable-openssl-bundling is not available with --with-openssl=system. Use option fetched or openssl-custom-path to bundle crypto library\n"
679677
AC_MSG_ERROR([Cannot continue])
680678
fi
681679
# Process --with-openssl=/custom/path/where/openssl/is/present
@@ -687,7 +685,7 @@ AC_DEFUN([CONFIGURE_OPENSSL],
687685
if test -s "$OPENSSL_DIR/include/openssl/evp.h" ; then
688686
OPENSSL_CFLAGS="-I${OPENSSL_DIR}/include"
689687
if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin ; then
690-
if test "x$BUNDLE_OPENSSL" = xyes ; then
688+
if test "x$enable_openssl_bundling" = xyes ; then
691689
if test -d "$OPENSSL_DIR/bin" ; then
692690
OPENSSL_BUNDLE_LIB_PATH="${OPENSSL_DIR}/bin"
693691
else
@@ -697,7 +695,7 @@ AC_DEFUN([CONFIGURE_OPENSSL],
697695
else
698696
if test -s "$OPENSSL_DIR/lib/${LIBRARY_PREFIX}crypto${SHARED_LIBRARY_SUFFIX}" ; then
699697
OPENSSL_CFLAGS="-I${OPENSSL_DIR}/include"
700-
if test "x$BUNDLE_OPENSSL" = xyes ; then
698+
if test "x$enable_openssl_bundling" = xyes ; then
701699
# On Mac OSX, create local copy of the crypto library to update @rpath
702700
# as the default is /usr/local/lib.
703701
if test "x$OPENJDK_BUILD_OS" = xmacosx ; then
@@ -713,7 +711,7 @@ AC_DEFUN([CONFIGURE_OPENSSL],
713711
fi
714712
elif test -s "$OPENSSL_DIR/${LIBRARY_PREFIX}crypto${SHARED_LIBRARY_SUFFIX}" ; then
715713
OPENSSL_CFLAGS="-I${OPENSSL_DIR}/include"
716-
if test "x$BUNDLE_OPENSSL" = xyes ; then
714+
if test "x$enable_openssl_bundling" = xyes ; then
717715
# On Mac OSX, create local copy of the crypto library to update @rpath
718716
# as the default is /usr/local/lib.
719717
if test "x$OPENJDK_BUILD_OS" = xmacosx ; then
@@ -738,7 +736,7 @@ AC_DEFUN([CONFIGURE_OPENSSL],
738736
fi
739737
740738
AC_MSG_CHECKING([if we should bundle openssl])
741-
AC_MSG_RESULT([$BUNDLE_OPENSSL])
739+
AC_MSG_RESULT([$enable_openssl_bundling])
742740
fi
743741
744742
AC_SUBST(OPENSSL_BUNDLE_LIB_PATH)

closed/custom/Main.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# (c) Copyright IBM Corp. 2017, 2023 All Rights Reserved
2+
# (c) Copyright IBM Corp. 2017, 2025 All Rights Reserved
33
# ===========================================================================
44
# This code is free software; you can redistribute it and/or modify it
55
# under the terms of the GNU General Public License version 2 only, as
@@ -44,7 +44,7 @@ OPENJ9_MAKE := $(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/closed/OpenJ9.gmk
4444
create-main-targets-include java.base-gensrc : generate-j9jcl-sources
4545

4646
j9vm-build : buildtools-langtools
47-
ifeq ($(BUILD_OPENSSL),yes)
47+
ifeq ($(BUILD_OPENSSL), true)
4848
@+$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/closed/openssl.gmk
4949
endif # BUILD_OPENSSL
5050
@+$(OPENJ9_MAKE) build-j9

closed/custom/modules/java.base/Lib.gmk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# (c) Copyright IBM Corp. 2018, 2023 All Rights Reserved
2+
# (c) Copyright IBM Corp. 2018, 2025 All Rights Reserved
33
# ===========================================================================
44
# This code is free software; you can redistribute it and/or modify it
55
# under the terms of the GNU General Public License version 2 only, as
@@ -18,8 +18,8 @@
1818
# 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
1919
# ===========================================================================
2020

21-
# Create the Java Native crypto library
22-
ifeq ($(WITH_OPENSSL), yes)
21+
ifeq ($(WITH_OPENSSL), true)
22+
# Create the Java Native crypto library.
2323
$(eval $(call SetupJdkLibrary, BUILD_JNCRYPTO, \
2424
NAME := jncrypto, \
2525
OPTIMIZATION := LOW, \

closed/openssl.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ build_openssl :
110110
@$(ECHO) Compiling OpenSSL in $(OPENSSL_DIR) for $(OPENSSL_TARGET)$(if $(OPENSSL_CONFIG_CFLAGS), with additional CFLAGS $(OPENSSL_CONFIG_CFLAGS))
111111
( $(OPENSSL_CONFIG_SETUP) $(CD) $(OPENSSL_DIR) && $(PERL) Configure $(OPENSSL_CONFIG_CFLAGS) $(OPENSSL_TARGET) shared )
112112
$(OPENSSL_PATCH)
113-
( $(OPENSSL_MAKE_SETUP) $(CD) $(OPENSSL_DIR) && $(OPENSSL_MAKE) )
113+
+ ( $(OPENSSL_MAKE_SETUP) $(CD) $(OPENSSL_DIR) && $(OPENSSL_MAKE) )
114114

115115
.PHONY : build_openssl

0 commit comments

Comments
 (0)