1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00
freebsd-ports/Mk/bsd.openssl.mk

166 lines
5.1 KiB
Makefile
Raw Normal View History

#
2012-09-19 15:33:09 +00:00
# $FreeBSD$
2012-09-12 04:30:41 +00:00
# bsd.openssl.mk - Support for OpenSSL based ports.
#
# Use of 'USE_OPENSSL=yes' includes this Makefile after bsd.ports.pre.mk
#
# the user/port can now set this options in the makefiles.
#
# WITH_OPENSSL_BASE=yes - Use the version in the base system.
# WITH_OPENSSL_PORT=yes - Use the port, even if base is up to date
2012-09-19 15:33:09 +00:00
# WITH_OPENSSL_HACK7=yes - Use not the version in the base system on FreeBSD 7.x
#
# USE_OPENSSL_RPATH=yes - Pass RFLAGS options in CFLAGS,
# needed for ports who don't use LDFLAGS
#
# Overrideable defaults:
#
# OPENSSL_SHLIBVER= 3
# OPENSSL_PORT= security/openssl
#
# The makefile sets this variables:
# OPENSSLBASE - "/usr" or ${LOCALBASE}
# OPENSSLDIR - path to openssl
# OPENSSLLIB - path to the libs
# OPENSSLINC - path to the matching includes
# OPENSSLRPATH - rpath for dynamic linker
#
# MAKE_ENV - extended with the variables above
# CONFIGURE_ENV - extended with LDFLAGS
# BUILD_DEPENDS - are added if needed
# RUN_DEPENDS - are added if needed
2003-08-27 10:30:40 +00:00
OpenSSL_Include_MAINTAINER= dinoex@FreeBSD.org
# 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
2012-09-19 15:33:09 +00:00
.if defined(WITH_OPENSSL_HACK7)
.if ${OSVERSION} < 800000
# the openssl in base of FreeBSD 7.x is too old
WITH_OPENSSL_PORT?= yes
.endif
.endif
2005-07-28 05:08:45 +00:00
# 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)
2004-05-12 20:22:34 +00:00
WITH_OPENSSL_BASE=yes
.endif
.if defined(WITH_OPENSSL_BASE)
OPENSSLBASE= /usr
OPENSSLDIR= /etc/ssl
2007-08-06 10:39:24 +00:00
.if !exists(${DESTDIR}/usr/lib/libcrypto.so)
Here come the patches! * Add ghostscript knobs [1] * Add per-port persistent build options with a menu-driven front-end [2] * Allow porters to override the message generated when do-configure fails [3] * Add patch to obviate many pkg-plist files [4] * Fix the PKG_DBDIR comment [5] * Make ports framework more robust with regard to make index [6] * Add new command macros to bsd.port.mk [7] * Remove direct command use from bsd.port.mk [8] * Make the ports system respect WITHOUT_CPU_CFLAGS [9] * Break the SDL code out into bsd.sdl.mk [10] * Add working support for USE_SIZE [11] * Fix RANDOMIZE_MASTER_SITES on -CURRENT [12] * Convert some spaces to tabs [13] * Add new physcial categories accessibility and x11-themes [14] * Speed up GNU configure scripts [15] * Remove "//" from MLINKS items in PLISTs and fix make -s install and make -s deinstall [16] * Be more specific about looking for files in distinfo [17] * Add new run-autotools target, and resort configure targets [18] * Make CONFLICTS compare prefix for installed packages and PREFIX [19] * Change directory to ${.CURDIR} before running certain make commands [20] * When INSTALL_AS_USER is set, run ldconfig with failures ignored [21] * Speed up the security check phase [22] * Fix some corner cases in the PORTDOCS code [23] * Add a new DEPRECATED macro [24] * Make INDEX breakage more informative [25] Look for a full write-up to follow on ports@ and ports-developers@. PR: 36112 [1] 59909 [4] 61351 [6] 59058 [7] 59058 [8] 59493 [9] 55494 [10] 59058 [11] 59315 [12] 59058 [13] 59811 [15] 59058 [16] 59058 [17] 60882 [18] 58149 [19] 59058 [20] 61133 [21] 55331 [22] 59070 [23] 59362 [24] 59626 [25] Submitted by: linimon [1] eivind [2] marcus [3] trevor [4] gerald [5] linimon [6] eik [7] eik [8] jeh [9] edwin [10] eik [11] Sergey Matveychuk <sem@ciam.ru> [12] eik [13] trevor gnome [14] adamw [15] eik [16] eik [17] edwin [18] clement [19] eik [20] edwin lev [21] Eugene M. Kim <ab@astralblue.com> [22] eik [23] linimon [24] eik [25]
2004-01-20 09:14:10 +00:00
check-depends::
@${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} "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)
Here come the patches! * Add ghostscript knobs [1] * Add per-port persistent build options with a menu-driven front-end [2] * Allow porters to override the message generated when do-configure fails [3] * Add patch to obviate many pkg-plist files [4] * Fix the PKG_DBDIR comment [5] * Make ports framework more robust with regard to make index [6] * Add new command macros to bsd.port.mk [7] * Remove direct command use from bsd.port.mk [8] * Make the ports system respect WITHOUT_CPU_CFLAGS [9] * Break the SDL code out into bsd.sdl.mk [10] * Add working support for USE_SIZE [11] * Fix RANDOMIZE_MASTER_SITES on -CURRENT [12] * Convert some spaces to tabs [13] * Add new physcial categories accessibility and x11-themes [14] * Speed up GNU configure scripts [15] * Remove "//" from MLINKS items in PLISTs and fix make -s install and make -s deinstall [16] * Be more specific about looking for files in distinfo [17] * Add new run-autotools target, and resort configure targets [18] * Make CONFLICTS compare prefix for installed packages and PREFIX [19] * Change directory to ${.CURDIR} before running certain make commands [20] * When INSTALL_AS_USER is set, run ldconfig with failures ignored [21] * Speed up the security check phase [22] * Fix some corner cases in the PORTDOCS code [23] * Add a new DEPRECATED macro [24] * Make INDEX breakage more informative [25] Look for a full write-up to follow on ports@ and ports-developers@. PR: 36112 [1] 59909 [4] 61351 [6] 59058 [7] 59058 [8] 59493 [9] 55494 [10] 59058 [11] 59315 [12] 59058 [13] 59811 [15] 59058 [16] 59058 [17] 60882 [18] 58149 [19] 59058 [20] 61133 [21] 55331 [22] 59070 [23] 59362 [24] 59626 [25] Submitted by: linimon [1] eivind [2] marcus [3] trevor [4] gerald [5] linimon [6] eik [7] eik [8] jeh [9] edwin [10] eik [11] Sergey Matveychuk <sem@ciam.ru> [12] eik [13] trevor gnome [14] adamw [15] eik [16] eik [17] edwin [18] clement [19] eik [20] edwin lev [21] Eugene M. Kim <ab@astralblue.com> [22] eik [23] linimon [24] eik [25]
2004-01-20 09:14:10 +00:00
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"
Here come the patches! * Add ghostscript knobs [1] * Add per-port persistent build options with a menu-driven front-end [2] * Allow porters to override the message generated when do-configure fails [3] * Add patch to obviate many pkg-plist files [4] * Fix the PKG_DBDIR comment [5] * Make ports framework more robust with regard to make index [6] * Add new command macros to bsd.port.mk [7] * Remove direct command use from bsd.port.mk [8] * Make the ports system respect WITHOUT_CPU_CFLAGS [9] * Break the SDL code out into bsd.sdl.mk [10] * Add working support for USE_SIZE [11] * Fix RANDOMIZE_MASTER_SITES on -CURRENT [12] * Convert some spaces to tabs [13] * Add new physcial categories accessibility and x11-themes [14] * Speed up GNU configure scripts [15] * Remove "//" from MLINKS items in PLISTs and fix make -s install and make -s deinstall [16] * Be more specific about looking for files in distinfo [17] * Add new run-autotools target, and resort configure targets [18] * Make CONFLICTS compare prefix for installed packages and PREFIX [19] * Change directory to ${.CURDIR} before running certain make commands [20] * When INSTALL_AS_USER is set, run ldconfig with failures ignored [21] * Speed up the security check phase [22] * Fix some corner cases in the PORTDOCS code [23] * Add a new DEPRECATED macro [24] * Make INDEX breakage more informative [25] Look for a full write-up to follow on ports@ and ports-developers@. PR: 36112 [1] 59909 [4] 61351 [6] 59058 [7] 59058 [8] 59493 [9] 55494 [10] 59058 [11] 59315 [12] 59058 [13] 59811 [15] 59058 [16] 59058 [17] 60882 [18] 58149 [19] 59058 [20] 61133 [21] 55331 [22] 59070 [23] 59362 [24] 59626 [25] Submitted by: linimon [1] eivind [2] marcus [3] trevor [4] gerald [5] linimon [6] eik [7] eik [8] jeh [9] edwin [10] eik [11] Sergey Matveychuk <sem@ciam.ru> [12] eik [13] trevor gnome [14] adamw [15] eik [16] eik [17] edwin [18] clement [19] eik [20] edwin lev [21] Eugene M. Kim <ab@astralblue.com> [22] eik [23] linimon [24] eik [25]
2004-01-20 09:14:10 +00:00
@${ECHO_CMD} "version is installed by a port."
@${ECHO_CMD} "Please deinstall the port or undefine WITH_OPENSSL_BASE."
@${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
OPENSSLRPATH= /usr/lib:${LOCALBASE}/lib
.else
OPENSSLBASE= ${LOCALBASE}
.if !defined(OPENSSL_PORT) && \
exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so)
# find installed port and use it for dependency
2007-08-06 10:39:24 +00:00
PKG_DBDIR?= ${DESTDIR}/var/db/pkg
.if !defined(OPENSSL_INSTALLED)
.if defined(WITH_PKGNG)
.if defined(DESTDIR)
PKGARGS= -c ${DESTDIR}
.else
PKGARGS=
.endif
OPENSSL_INSTALLED!= ${PKG_BIN} ${PKGARGS} which -qo ${LOCALBASE}/lib/libcrypto.so || :
.else
2008-08-27 06:19:39 +00:00
OPENSSL_INSTALLED!= find "${PKG_DBDIR}/" -type f -name "+CONTENTS" -print0 | \
xargs -0 grep -l "^lib/libssl.so." | \
while read contents; do \
sslprefix=`grep "^@cwd " "$${contents}" | ${HEAD} -n 1`; \
if test "$${sslprefix}" = "@cwd ${LOCALBASE}" ; then \
echo "$${contents}"; break; fi; done
.endif
.endif
.if defined(OPENSSL_INSTALLED) && ${OPENSSL_INSTALLED} != ""
.if defined(WITH_PKGNG)
OPENSSL_PORT= ${OPENSSL_INSTALLED}
OPENSSL_SHLIBFILE!= ${PKG_INFO} -ql ${OPENSSL_INSTALLED} | grep "^`pkg query "%p" ${OPENSSL_INSTALLED}`/lib/libssl.so."
.else
OPENSSL_PORT!= grep "^@comment ORIGIN:" "${OPENSSL_INSTALLED}" | ${CUT} -d : -f 2
OPENSSL_SHLIBFILE!= grep "^lib/libssl.so." "${OPENSSL_INSTALLED}"
.endif
OPENSSL_SHLIBVER?= ${OPENSSL_SHLIBFILE:E}
.else
# PKG_DBDIR was not found, default
OPENSSL_PORT?= security/openssl
2012-04-15 07:31:52 +00:00
OPENSSL_SHLIBVER?= 8
.endif
2009-07-21 17:51:43 +00:00
.endif
2005-11-11 21:58:51 +00:00
OPENSSL_PORT?= security/openssl
2012-04-15 07:31:52 +00:00
OPENSSL_SHLIBVER?= 8
2005-11-11 21:58:51 +00:00
OPENSSLDIR= ${OPENSSLBASE}/openssl
BUILD_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${PORTSDIR}/${OPENSSL_PORT}
RUN_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${PORTSDIR}/${OPENSSL_PORT}
OPENSSLRPATH= ${LOCALBASE}/lib
.endif
OPENSSLLIB= ${OPENSSLBASE}/lib
OPENSSLINC= ${OPENSSLBASE}/include
.if defined(USE_OPENSSL_RPATH)
CFLAGS+= -Wl,-rpath,${OPENSSLRPATH}
.endif
OPENSSL_LDFLAGS+= -Wl,-rpath=${OPENSSLRPATH}
LDFLAGS+=${OPENSSL_LDFLAGS}
MAKE_ENV+= OPENSSLLIB=${OPENSSLLIB} OPENSSLINC=${OPENSSLINC} \
OPENSSLBASE=${OPENSSLBASE} OPENSSLDIR=${OPENSSLDIR}
### crypto
#RESTRICTED= "Contains cryptography."