Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/bsd.openssl.mk
Show All 25 Lines | |||||
# | # | ||||
# MAKE_ENV - extended with the variables above | # MAKE_ENV - extended with the variables above | ||||
# CONFIGURE_ENV - extended with LDFLAGS | # CONFIGURE_ENV - extended with LDFLAGS | ||||
# BUILD_DEPENDS - are added if needed | # BUILD_DEPENDS - are added if needed | ||||
# RUN_DEPENDS - are added if needed | # RUN_DEPENDS - are added if needed | ||||
OpenSSL_Include_MAINTAINER= dinoex@FreeBSD.org | OpenSSL_Include_MAINTAINER= dinoex@FreeBSD.org | ||||
# If no preference was set, check for an installed base version | .include "${PORTSDIR}/Mk/bsd.default-versions.mk" | ||||
# 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 | |||||
.if defined(WITH_OPENSSL_BASE) | .if ${SSL_DEFAULT} == base | ||||
OPENSSLBASE= /usr | OPENSSLBASE= /usr | ||||
OPENSSLDIR?= /etc/ssl | OPENSSLDIR?= /etc/ssl | ||||
. if !exists(${DESTDIR}/usr/lib/libcrypto.so) | . if !exists(${DESTDIR}/usr/lib/libcrypto.so) | ||||
check-depends:: | check-depends:: | ||||
@${ECHO_CMD} "Dependency error: This port requires the OpenSSL library, which is part of" | @${ECHO_CMD} "Dependency error: This port requires the OpenSSL library, which is part of" | ||||
@${ECHO_CMD} "the FreeBSD crypto distribution, but not installed on your" | @${ECHO_CMD} "the FreeBSD crypto distribution, but not installed on your" | ||||
@${ECHO_CMD} "machine. Please see the \"OpenSSL\" section in the handbook" | @${ECHO_CMD} "machine. Please see the \"OpenSSL\" section in the handbook" | ||||
@${ECHO_CMD} "(at \"http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/openssl.html\", for instance)" | @${ECHO_CMD} "(at \"http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/openssl.html\", for instance)" | ||||
@${ECHO_CMD} "for instructions on how to obtain and install the FreeBSD" | @${ECHO_CMD} "for instructions on how to obtain and install the FreeBSD" | ||||
@${ECHO_CMD} "OpenSSL distribution." | @${ECHO_CMD} "OpenSSL distribution." | ||||
@${FALSE} | @${FALSE} | ||||
. endif | . endif | ||||
. if exists(${LOCALBASE}/lib/libcrypto.so) | . if exists(${LOCALBASE}/lib/libcrypto.so) | ||||
check-depends:: | check-depends:: | ||||
@${ECHO_CMD} "Dependency error: This port wants the OpenSSL library from the FreeBSD" | @${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} "base system. You can't build against it, while a newer" | ||||
@${ECHO_CMD} "version is installed by a port." | @${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} | @${FALSE} | ||||
. endif | . endif | ||||
# OpenSSL in the base system may not include IDEA for patent licensing reasons. | # OpenSSL in the base system may not include IDEA for patent licensing reasons. | ||||
. if defined(MAKE_IDEA) && !defined(OPENSSL_IDEA) | . if defined(MAKE_IDEA) && !defined(OPENSSL_IDEA) | ||||
OPENSSL_IDEA= ${MAKE_IDEA} | OPENSSL_IDEA= ${MAKE_IDEA} | ||||
. else | . else | ||||
OPENSSL_IDEA?= NO | OPENSSL_IDEA?= NO | ||||
. endif | . endif | ||||
. if ${OPENSSL_IDEA} == "NO" | . if ${OPENSSL_IDEA} == "NO" | ||||
# XXX This is a hack to work around the fact that /etc/make.conf clobbers | # XXX This is a hack to work around the fact that /etc/make.conf clobbers | ||||
# our CFLAGS. It might not be enough for all future ports. | # our CFLAGS. It might not be enough for all future ports. | ||||
. if defined(HAS_CONFIGURE) | . if defined(HAS_CONFIGURE) | ||||
CFLAGS+= -DNO_IDEA | CFLAGS+= -DNO_IDEA | ||||
. else | . else | ||||
OPENSSL_CFLAGS+= -DNO_IDEA | OPENSSL_CFLAGS+= -DNO_IDEA | ||||
. endif | . endif | ||||
MAKE_ARGS+= OPENSSL_CFLAGS="${OPENSSL_CFLAGS}" | MAKE_ARGS+= OPENSSL_CFLAGS="${OPENSSL_CFLAGS}" | ||||
. endif | . endif | ||||
.else # !defined(WITH_OPENSSL_BASE) | .else # ${SSL_DEFAULT} != base | ||||
OPENSSLBASE= ${LOCALBASE} | 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 | OPENSSL_PORT= security/${SSL_DEFAULT} | ||||
. 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 | |||||
# default | # Get OPENSSL_SHLIBVER from the port | ||||
OPENSSL_PORT?= security/openssl | .sinclude <${PORTSDIR}/${OPENSSL_PORT}/version.mk> | ||||
OPENSSL_SHLIBVER?= 8 | |||||
. if !defined(OPENSSL_SHLIBVER) | |||||
.error You are using an unsupported SSL provider ${SSL_DEFAULT} | |||||
. endif | |||||
OPENSSLDIR?= ${OPENSSLBASE}/openssl | OPENSSLDIR?= ${OPENSSLBASE}/openssl | ||||
BUILD_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} | BUILD_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} | ||||
RUN_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} | RUN_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} | ||||
OPENSSLRPATH= ${LOCALBASE}/lib | OPENSSLRPATH= ${LOCALBASE}/lib | ||||
.endif | .endif | ||||
Show All 20 Lines |