Skip to content

Commit 2842f5c

Browse files
authored
Merge pull request #174 from keithc-ca/ccache_and_openssl36
(0.36.0) Fix problem building openssl when ccache is enabled
2 parents 5ba431e + 718dc5b commit 2842f5c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

closed/openssl.gmk

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# (c) Copyright IBM Corp. 2018, 2022 All Rights Reserved
2+
# (c) Copyright IBM Corp. 2018, 2023 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
@@ -88,12 +88,18 @@ ifeq (,$(OPENSSL_TARGET))
8888
$(error Unsupported platform $(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU))
8989
endif # OPENSSL_TARGET
9090

91+
ifneq (,$(CCACHE))
92+
# If ccache is enabled and the environment contains either CC or CXX, their
93+
# values (as defined in this make) are propagated to the instance of make
94+
# which will build openssl causing it to fail. Instead, pass along CC and
95+
# CXX without the ccache wrapper.
96+
OPENSSL_MAKE += CC=$(ac_cv_prog_CC) CXX=$(ac_cv_prog_CXX)
97+
endif # CCACHE
98+
9199
build_openssl :
92-
ifeq ($(BUILD_OPENSSL), yes)
93100
@$(ECHO) Compiling OpenSSL in $(OPENSSL_DIR) for $(OPENSSL_TARGET)
94101
( $(OPENSSL_CONFIG_SETUP) $(CD) $(OPENSSL_DIR) && $(PERL) Configure $(OPENSSL_TARGET) shared )
95102
$(OPENSSL_PATCH)
96103
( $(OPENSSL_MAKE_SETUP) $(CD) $(OPENSSL_DIR) && $(OPENSSL_MAKE) )
97-
endif # BUILD_OPENSSL
98104

99105
.PHONY : build_openssl

0 commit comments

Comments
 (0)