2003-04-03 13:24:31 -05:00
|
|
|
# makefile for use of: OpenSSH
|
|
|
|
# Date created: 31 May 2002
|
|
|
|
# Whom: dinoex
|
|
|
|
#
|
2007-08-06 06:39:24 -04:00
|
|
|
# $FreeBSD: /tmp/pcvs/ports/Mk/bsd.openssl.mk,v 1.36 2007-08-06 10:39:24 dinoex Exp $
|
2003-04-03 13:24:31 -05:00
|
|
|
#
|
2003-12-05 03:20:51 -05:00
|
|
|
# Use of 'USE_OPENSSL=yes' includes this Makefile after bsd.ports.pre.mk
|
2003-04-03 13:24:31 -05:00
|
|
|
#
|
|
|
|
# the user/port can now set this options in the makefiles.
|
|
|
|
#
|
2003-04-13 07:47:23 -04:00
|
|
|
# WITH_OPENSSL_BASE=yes - Use the version in the base system.
|
2006-10-07 04:15:48 -04:00
|
|
|
# WITH_OPENSSL_PORT=yes - Use the port, even if base is up to date
|
2003-04-13 07:47:23 -04:00
|
|
|
# WITH_OPENSSL_BETA=yes - Use a snapshot of recent openssl
|
2005-10-14 02:41:49 -04:00
|
|
|
# WITH_OPENSSL_STABLE=yes - Use an older openssl version
|
2003-04-03 13:24:31 -05:00
|
|
|
#
|
2006-10-07 04:15:48 -04:00
|
|
|
# USE_OPENSSL_RPATH=yes - Pass RFLAGS options in CFLAGS,
|
2003-08-30 03:26:04 -04:00
|
|
|
# needed for ports who don't use LDFLAGS
|
|
|
|
#
|
2003-04-16 10:49:26 -04:00
|
|
|
# Overrideable defaults:
|
|
|
|
#
|
|
|
|
# OPENSSL_SHLIBVER= 3
|
|
|
|
# OPENSSL_PORT= security/openssl
|
|
|
|
#
|
2003-04-03 13:24:31 -05:00
|
|
|
# The makefile sets this variables:
|
|
|
|
# OPENSSLBASE - "/usr" or ${LOCALBASE}
|
|
|
|
# OPENSSLDIR - path to openssl
|
|
|
|
# OPENSSLLIB - path to the libs
|
|
|
|
# OPENSSLINC - path to the matching includes
|
2003-08-30 03:26:04 -04:00
|
|
|
# OPENSSLRPATH - rpath for dynamic linker
|
2003-04-03 13:24:31 -05:00
|
|
|
#
|
|
|
|
# MAKE_ENV - extended with the variables above
|
2003-08-30 03:26:04 -04:00
|
|
|
# CONFIGURE_ENV - extended with LDFLAGS
|
2004-04-08 06:01:53 -04:00
|
|
|
# BUILD_DEPENDS - are added if needed
|
|
|
|
# RUN_DEPENDS - are added if needed
|
2003-04-03 13:24:31 -05:00
|
|
|
|
2003-08-27 06:30:40 -04:00
|
|
|
OpenSSL_Include_MAINTAINER= dinoex@FreeBSD.org
|
|
|
|
|
2003-04-13 07:47:23 -04:00
|
|
|
# honor obsolete options for a bit
|
|
|
|
.if defined(USE_OPENSSL_BASE) && !defined(WITH_OPENSSL_BASE)
|
|
|
|
WITH_OPENSSL_BASE=yes
|
|
|
|
.endif
|
|
|
|
.if defined(USE_OPENSSL_PORT) && !defined(WITH_OPENSSL_PORT)
|
|
|
|
WITH_OPENSSL_PORT=yes
|
|
|
|
.endif
|
2005-10-14 02:41:49 -04:00
|
|
|
.if defined(WITH_OPENSSL_097) && !defined(WITH_OPENSSL_STABLE)
|
|
|
|
WITH_OPENSSL_STABLE=yes
|
|
|
|
.endif
|
2003-04-13 07:47:23 -04:00
|
|
|
|
2005-07-28 01:08:45 -04:00
|
|
|
# if no preference was set, check for an installed base version
|
2003-04-03 13:24:31 -05:00
|
|
|
# but give an installed port preference over it.
|
2003-04-13 07:47:23 -04:00
|
|
|
.if !defined(WITH_OPENSSL_BASE) && \
|
|
|
|
!defined(WITH_OPENSSL_BETA) && \
|
|
|
|
!defined(WITH_OPENSSL_PORT) && \
|
2005-10-14 02:41:49 -04:00
|
|
|
!defined(WITH_OPENSSL_STABLE) && \
|
2006-04-30 17:21:11 -04:00
|
|
|
!defined(OPENSSL_OVERWRITE_BASE) && \
|
2003-05-07 16:08:00 -04:00
|
|
|
!exists(${LOCALBASE}/lib/libcrypto.so) && \
|
|
|
|
exists(/usr/include/openssl/opensslv.h)
|
2004-05-12 16:22:34 -04:00
|
|
|
WITH_OPENSSL_BASE=yes
|
2003-04-03 13:24:31 -05:00
|
|
|
.endif
|
|
|
|
|
2003-04-13 07:47:23 -04:00
|
|
|
.if defined(WITH_OPENSSL_BASE)
|
2007-08-04 07:37:24 -04:00
|
|
|
OPENSSLBASE= /usr
|
|
|
|
OPENSSLDIR= /etc/ssl
|
2003-04-03 13:24:31 -05:00
|
|
|
|
2007-08-06 06:39:24 -04:00
|
|
|
.if !exists(${DESTDIR}/usr/lib/libcrypto.so)
|
2004-01-20 04:14:10 -05:00
|
|
|
check-depends::
|
|
|
|
@${ECHO_CMD} "Dependency error: this port requires the OpenSSL library, which is part of"
|
2003-04-03 13:24:31 -05:00
|
|
|
@${ECHO_CMD} "the FreeBSD crypto distribution but not installed on your"
|
|
|
|
@${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} "for instructions on how to obtain and install the FreeBSD"
|
|
|
|
@${ECHO_CMD} "OpenSSL distribution."
|
|
|
|
@${FALSE}
|
|
|
|
.endif
|
|
|
|
.if exists(${LOCALBASE}/lib/libcrypto.so)
|
2004-01-20 04:14:10 -05:00
|
|
|
check-depends::
|
|
|
|
@${ECHO_CMD} "Dependency error: this port wants the OpenSSL library from the FreeBSD"
|
2003-04-03 13:24:31 -05:00
|
|
|
@${ECHO_CMD} "base system. You can't build against it, while a newer"
|
2004-01-20 04:14:10 -05:00
|
|
|
@${ECHO_CMD} "version is installed by a port."
|
2003-04-13 07:47:23 -04:00
|
|
|
@${ECHO_CMD} "Please deinstall the port or undefine WITH_OPENSSL_BASE."
|
2003-04-03 13:24:31 -05:00
|
|
|
@${FALSE}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# OpenSSL in the base system may not include IDEA for patent licensing reasons.
|
|
|
|
.if defined(MAKE_IDEA) && !defined(OPENSSL_IDEA)
|
|
|
|
OPENSSL_IDEA= ${MAKE_IDEA}
|
|
|
|
.else
|
|
|
|
OPENSSL_IDEA?= NO
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${OPENSSL_IDEA} == "NO"
|
|
|
|
# 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.
|
|
|
|
.if defined(HAS_CONFIGURE)
|
|
|
|
CFLAGS+= -DNO_IDEA
|
|
|
|
.else
|
|
|
|
OPENSSL_CFLAGS+= -DNO_IDEA
|
|
|
|
.endif
|
|
|
|
MAKE_ARGS+= OPENSSL_CFLAGS="${OPENSSL_CFLAGS}"
|
|
|
|
.endif
|
2007-08-04 07:37:24 -04:00
|
|
|
OPENSSLRPATH= /usr/lib:${LOCALBASE}/lib
|
2003-04-03 13:24:31 -05:00
|
|
|
|
|
|
|
.else
|
|
|
|
|
|
|
|
OPENSSLBASE= ${LOCALBASE}
|
2005-10-04 03:44:37 -04:00
|
|
|
.if defined(WITH_OPENSSL_BETA)
|
2003-04-16 10:49:26 -04:00
|
|
|
OPENSSL_PORT?= security/openssl-beta
|
2006-05-25 11:17:34 -04:00
|
|
|
.if ( ${OSVERSION} >= 600100 )
|
|
|
|
OPENSSL_SHLIBVER?= 5
|
|
|
|
.else
|
2005-10-14 02:41:49 -04:00
|
|
|
OPENSSL_SHLIBVER?= 4
|
2006-05-25 11:17:34 -04:00
|
|
|
.endif
|
2005-11-11 16:58:51 -05:00
|
|
|
.elif defined(WITH_OPENSSL_STABLE)
|
2005-10-14 02:41:49 -04:00
|
|
|
OPENSSL_PORT?= security/openssl-stable
|
2006-05-25 11:17:34 -04:00
|
|
|
.if ( ${OSVERSION} >= 600100 )
|
|
|
|
OPENSSL_SHLIBVER?= 4
|
2003-04-03 13:24:31 -05:00
|
|
|
.else
|
2005-11-11 16:58:51 -05:00
|
|
|
OPENSSL_SHLIBVER?= 3
|
|
|
|
.endif
|
2006-05-25 11:17:34 -04:00
|
|
|
.else
|
2006-10-07 04:15:48 -04:00
|
|
|
.if !defined(OPENSSL_PORT) && \
|
|
|
|
exists(${LOCALBASE}/lib/libcrypto.so)
|
|
|
|
# find installed port and use it for dependency
|
2007-08-06 06:39:24 -04:00
|
|
|
PKG_DBDIR?= ${DESTDIR}/var/db/pkg
|
2006-10-08 05:38:38 -04:00
|
|
|
OPENSSL_INSTALLED!= grep -l -r "^lib/libssl.so." "${PKG_DBDIR}" | \
|
2006-10-07 04:15:48 -04:00
|
|
|
while read contents; do \
|
|
|
|
sslprefix=`grep "^@cwd " "$${contents}" | ${HEAD} -n 1`; \
|
2007-08-04 07:37:24 -04:00
|
|
|
if test "$${sslprefix}" = "@cwd ${LOCALBASE}" ; then \
|
2006-10-07 04:15:48 -04:00
|
|
|
echo "$${contents}"; break; fi; done
|
|
|
|
OPENSSL_PORT!= grep "^@comment ORIGIN:" "${OPENSSL_INSTALLED}" | ${CUT} -d : -f 2
|
|
|
|
OPENSSL_SHLIBFILE!= grep "^lib/libssl.so." "${OPENSSL_INSTALLED}"
|
|
|
|
OPENSSL_SHLIBVER?= ${OPENSSL_SHLIBFILE:E}
|
|
|
|
.endif
|
2005-11-11 16:58:51 -05:00
|
|
|
OPENSSL_PORT?= security/openssl
|
2006-05-25 11:17:34 -04:00
|
|
|
.if ( ${OSVERSION} >= 600100 )
|
|
|
|
OPENSSL_SHLIBVER?= 5
|
|
|
|
.else
|
2005-11-11 16:58:51 -05:00
|
|
|
OPENSSL_SHLIBVER?= 4
|
2003-04-03 13:24:31 -05:00
|
|
|
.endif
|
2006-05-25 11:17:34 -04:00
|
|
|
.endif
|
2005-11-11 16:58:51 -05:00
|
|
|
|
|
|
|
|
2003-04-16 10:49:26 -04:00
|
|
|
OPENSSLDIR= ${OPENSSLBASE}/openssl
|
2004-04-08 01:17:37 -04:00
|
|
|
BUILD_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${PORTSDIR}/${OPENSSL_PORT}
|
|
|
|
RUN_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${PORTSDIR}/${OPENSSL_PORT}
|
2003-08-30 03:26:04 -04:00
|
|
|
OPENSSLRPATH= ${LOCALBASE}/lib
|
2003-04-03 13:24:31 -05:00
|
|
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
OPENSSLLIB= ${OPENSSLBASE}/lib
|
|
|
|
OPENSSLINC= ${OPENSSLBASE}/include
|
2003-08-30 03:26:04 -04:00
|
|
|
|
|
|
|
.if defined(USE_OPENSSL_RPATH)
|
|
|
|
CFLAGS+= -Wl,-rpath,${OPENSSLRPATH}
|
|
|
|
.endif
|
|
|
|
OPENSSL_LDFLAGS+= -rpath=${OPENSSLRPATH}
|
2003-04-03 13:24:31 -05:00
|
|
|
|
2003-08-30 23:28:27 -04:00
|
|
|
.if defined(LDFLAGS)
|
2003-04-16 10:49:26 -04:00
|
|
|
LDFLAGS+=${OPENSSL_LDFLAGS}
|
|
|
|
.else
|
|
|
|
LDFLAGS=${OPENSSL_LDFLAGS}
|
|
|
|
.endif
|
|
|
|
|
2003-08-30 03:26:04 -04:00
|
|
|
CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
|
|
|
|
MAKE_ENV+= LDFLAGS="${LDFLAGS}"
|
|
|
|
MAKE_ENV+= OPENSSLLIB=${OPENSSLLIB} OPENSSLINC=${OPENSSLINC} \
|
|
|
|
OPENSSLBASE=${OPENSSLBASE} OPENSSLDIR=${OPENSSLDIR}
|
|
|
|
|
2003-04-03 13:24:31 -05:00
|
|
|
### crypto
|
|
|
|
#RESTRICTED= "Contains cryptography."
|
|
|
|
|