aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2016-06-16 21:22:58 +0800
committermat <mat@FreeBSD.org>2016-06-16 21:22:58 +0800
commit56be8553fe553c4526347278fbdd90ec4156eb14 (patch)
tree92ed59a35542efac0144515d49a9237c6f9b3fb7 /Mk
parent704833a8a2f2565c3e7db684e85c759a2113dc3f (diff)
downloadfreebsd-ports-gnome-56be8553fe553c4526347278fbdd90ec4156eb14.tar.gz
freebsd-ports-gnome-56be8553fe553c4526347278fbdd90ec4156eb14.tar.zst
freebsd-ports-gnome-56be8553fe553c4526347278fbdd90ec4156eb14.zip
Add DEFAULT_VERSIONS=ssl=XXX
Move the openssl detection routine to bsd.default-version.mk. Add warnings telling people to not use WITH_OPENSSL_PORT or WITH_OPENSSL_BASE. To ease maintainability, change the way the different ssl libraries version numbers are checked. PR: 210149 Submitted by: mat Exp-run by: antoine Sponsored by: The FreeBSD Foundation, Absolight Differential Revision: https://reviews.freebsd.org/D6577
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.default-versions.mk41
-rw-r--r--Mk/bsd.openssl.mk50
2 files changed, 52 insertions, 39 deletions
diff --git a/Mk/bsd.default-versions.mk b/Mk/bsd.default-versions.mk
index aa39c5c17b64..f81e97617768 100644
--- a/Mk/bsd.default-versions.mk
+++ b/Mk/bsd.default-versions.mk
@@ -61,6 +61,47 @@ PYTHON2_DEFAULT?= 2.7
PYTHON3_DEFAULT?= 3.4
# Possible values: 2.0, 2.1, 2.2, 2.3
RUBY_DEFAULT?= 2.2
+# Possible values: base, openssl, openssl-devel, libressl, libressl-devel
+.if !defined(SSL_DEFAULT)
+# If no preference was set, check for an installed base version
+# but give an installed port preference over it.
+. if defined(WITH_OPENSSL_PORT)
+. if defined(OPENSSL_PORT)
+SSL_DEFAULT:=${OPENSSL_PORT:T}
+WARNING+= "Using WITH_OPENSSL_PORT and OPENSSL_PORT in make.conf is deprecated, replace them with DEFAULT_VERSIONS+=ssl=${SSL_DEFAULT}"
+. else
+SSL_DEFAULT=openssl
+WARNING+= "Using WITH_OPENSSL_PORT in make.conf is deprecated, replace it with DEFAULT_VERSIONS+=ssl=openssl"
+. endif
+. elif defined(WITH_OPENSSL_BASE)
+SSL_DEFAULT=base
+WARNING+= "USing WITH_OPENSSL_BASE in make.conf is deprecated, replace it with DEFAULT_VERSIONS+=ssl=base"
+. elif !defined(WITH_OPENSSL_BASE) && \
+ !defined(WITH_OPENSSL_PORT) && \
+ !defined(SSL_DEFAULT) && \
+ !exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so) && \
+ exists(${DESTDIR}/usr/include/openssl/opensslv.h)
+SSL_DEFAULT= base
+. else
+. if exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so)
+# find installed port and use it for dependency
+. if !defined(OPENSSL_INSTALLED)
+. if defined(DESTDIR)
+PKGARGS= -c ${DESTDIR}
+. else
+PKGARGS=
+. endif
+OPENSSL_INSTALLED!= ${PKG_BIN} ${PKGARGS} which -qo ${LOCALBASE}/lib/libcrypto.so || :
+. endif
+. if defined(OPENSSL_INSTALLED) && !empty(OPENSSL_INSTALLED)
+SSL_DEFAULT:= ${OPENSSL_INSTALLED:T}
+WARNING+= "You have ${OPENSSL_INSTALLED} installed but do not have DEFAULT_VERSIONS+=ssl=${SSL_DEFAULT} set"
+. endif
+. endif
+. endif
+# Make sure we have a default in the end
+SSL_DEFAULT?= base
+.endif
# Possible values: 8.4, 8.5, 8.6
TCLTK_DEFAULT?= 8.6
diff --git a/Mk/bsd.openssl.mk b/Mk/bsd.openssl.mk
index 8f4a98cd6e7b..9476d758bbc7 100644
--- a/Mk/bsd.openssl.mk
+++ b/Mk/bsd.openssl.mk
@@ -31,16 +31,9 @@
OpenSSL_Include_MAINTAINER= dinoex@FreeBSD.org
-# If no preference was set, check for an installed base version
-# but give an installed port preference over it.
-.if !defined(WITH_OPENSSL_BASE) && \
- !defined(WITH_OPENSSL_PORT) && \
- !exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so) && \
- exists(${DESTDIR}/usr/include/openssl/opensslv.h)
-WITH_OPENSSL_BASE=yes
-.endif
+.include "${PORTSDIR}/Mk/bsd.default-versions.mk"
-.if defined(WITH_OPENSSL_BASE)
+.if ${SSL_DEFAULT} == base
OPENSSLBASE= /usr
OPENSSLDIR?= /etc/ssl
@@ -59,7 +52,7 @@ check-depends::
@${ECHO_CMD} "Dependency error: This port wants the OpenSSL library from the FreeBSD"
@${ECHO_CMD} "base system. You can't build against it, while a newer"
@${ECHO_CMD} "version is installed by a port."
- @${ECHO_CMD} "Please deinstall the port or undefine WITH_OPENSSL_BASE."
+ @${ECHO_CMD} "Please deinstall the port, remove DEFAULT_VERSIONS=ssl=base or undefine WITH_OPENSSL_BASE."
@${FALSE}
. endif
@@ -81,39 +74,18 @@ OPENSSL_CFLAGS+= -DNO_IDEA
MAKE_ARGS+= OPENSSL_CFLAGS="${OPENSSL_CFLAGS}"
. endif
-.else # !defined(WITH_OPENSSL_BASE)
+.else # ${SSL_DEFAULT} != base
OPENSSLBASE= ${LOCALBASE}
-. if !defined(OPENSSL_PORT) && \
- exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so)
-# find installed port and use it for dependency
-. if !defined(OPENSSL_INSTALLED)
-. if defined(DESTDIR)
-PKGARGS= -c ${DESTDIR}
-. else
-PKGARGS=
-. endif
-OPENSSL_INSTALLED!= ${PKG_BIN} ${PKGARGS} which -qo ${LOCALBASE}/lib/libcrypto.so || :
-. endif
-. if defined(OPENSSL_INSTALLED) && ${OPENSSL_INSTALLED} != ""
-OPENSSL_PORT= ${OPENSSL_INSTALLED}
-OPENSSL_SHLIBFILE!= ${PKG_INFO} -ql ${OPENSSL_INSTALLED} | ${GREP} "^`${PKG_QUERY} "%p" ${OPENSSL_INSTALLED}`/lib/libcrypto.so.[0-9]*$$"
-OPENSSL_SHLIBVER?= ${OPENSSL_SHLIBFILE:E}
-. endif
-. endif
-# LibreSSL and OpenSSL-BETA specific SHLIBVER
-. if defined(OPENSSL_PORT) && ${OPENSSL_PORT} == security/libressl
-OPENSSL_SHLIBVER?= 37
-. elif defined(OPENSSL_PORT) && ${OPENSSL_PORT} == security/libressl-devel
-OPENSSL_SHLIBVER?= 38
-. elif defined(OPENSSL_PORT) && ${OPENSSL_PORT} == security/openssl-devel
-OPENSSL_SHLIBVER?= 9
-. endif
+OPENSSL_PORT= security/${SSL_DEFAULT}
+
+# Get OPENSSL_SHLIBVER from the port
+.sinclude <${PORTSDIR}/${OPENSSL_PORT}/version.mk>
-# default
-OPENSSL_PORT?= security/openssl
-OPENSSL_SHLIBVER?= 8
+. if !defined(OPENSSL_SHLIBVER)
+.error You are using an unsupported SSL provider ${SSL_DEFAULT}
+. endif
OPENSSLDIR?= ${OPENSSLBASE}/openssl
BUILD_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT}