Created
May 3, 2023 00:49
-
-
Save ngie-eign/8f4aca0f4138592abb1bcf27a0b9cb2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From e631931b019a3266e0b8587a9cec9d4a97a149eb Mon Sep 17 00:00:00 2001 | |
From: Enji Cooper <ngie@FreeBSD.org> | |
Date: Tue, 2 May 2023 17:37:54 -0700 | |
Subject: [PATCH] Mk/Uses/ssl.mk: support non-standard --prefix | |
The code prior to this change made a number of assumptions around how | |
OpenSSL was installed from ports -- in particular, it assumed that | |
${PREFIX} was always ${LOCALBASE}. This particular change permits the | |
maintainer/end-user to specify a non-standard --prefix, making it | |
possible for projects that require security/openssl* to customize where | |
the library is installed to. | |
Sponsored-by: Dell, Inc | |
--- | |
Mk/Uses/ssl.mk | 17 +++++++++++++---- | |
1 file changed, 13 insertions(+), 4 deletions(-) | |
diff --git a/Mk/Uses/ssl.mk b/Mk/Uses/ssl.mk | |
index bec40d7bc99a..7f528decddc7 100644 | |
--- a/Mk/Uses/ssl.mk | |
+++ b/Mk/Uses/ssl.mk | |
@@ -96,17 +96,26 @@ OPENSSL_PORT= security/${SSL_DEFAULT} | |
. endif | |
OPENSSLDIR?= ${OPENSSLBASE}/openssl | |
+OPENSSLLIB= ${OPENSSLBASE}/lib | |
+OPENSSLRPATH?= ${OPENSSLLIB} | |
+ | |
. if defined(_SSL_BUILD_DEP) | |
-BUILD_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} | |
+BUILD_DEPENDS+= ${OPENSSLLIB}/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} | |
. endif | |
. if defined(_SSL_RUN_DEP) | |
-RUN_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} | |
+RUN_DEPENDS+= ${OPENSSLLIB}/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} | |
+. endif | |
+ | |
+ # Allow downstream consumers to customize where security/openssl* gets | |
+ # installed to while ensuring that redundant paths don't end up in | |
+ # CPPFLAGS, LDFLAGS, etc. | |
+. if ${OPENSSLBASE} != ${LOCALBASE} | |
+CPPFLAGS+= -I${OPENSSLINC} | |
+OPENSSL_LDFLAGS+= -L${OPENSSLLIB} | |
. endif | |
-OPENSSLRPATH= ${LOCALBASE}/lib | |
. endif | |
-OPENSSLLIB= ${OPENSSLBASE}/lib | |
OPENSSLINC= ${OPENSSLBASE}/include | |
MAKE_ENV+= OPENSSLBASE=${OPENSSLBASE} | |
-- | |
2.40.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment