aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.openssl.mk
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2003-04-16 22:49:26 +0800
committerdinoex <dinoex@FreeBSD.org>2003-04-16 22:49:26 +0800
commit4585e21ae5f66d70c189f04cde2159ae496fd309 (patch)
tree097bbe19caf7e3f453163015ea0d5c4009e409f8 /Mk/bsd.openssl.mk
parent62f46a100feb176bee5df01a7839b12fc67513e0 (diff)
downloadfreebsd-ports-gnome-4585e21ae5f66d70c189f04cde2159ae496fd309.tar.gz
freebsd-ports-gnome-4585e21ae5f66d70c189f04cde2159ae496fd309.tar.zst
freebsd-ports-gnome-4585e21ae5f66d70c189f04cde2159ae496fd309.zip
- new Overrideable defaults: OPENSSL_SHLIBVER and OPENSSL_PORT
- set CFLAGS and LDFLAGS to link the correct libs
Diffstat (limited to 'Mk/bsd.openssl.mk')
-rw-r--r--Mk/bsd.openssl.mk37
1 files changed, 23 insertions, 14 deletions
diff --git a/Mk/bsd.openssl.mk b/Mk/bsd.openssl.mk
index 6a2ada2f8a84..6fc881d01785 100644
--- a/Mk/bsd.openssl.mk
+++ b/Mk/bsd.openssl.mk
@@ -2,7 +2,7 @@
# Date created: 31 May 2002
# Whom: dinoex
#
-# $FreeBSD: /tmp/pcvs/ports/Mk/bsd.openssl.mk,v 1.3 2003-04-13 11:47:23 dinoex Exp $
+# $FreeBSD: /tmp/pcvs/ports/Mk/bsd.openssl.mk,v 1.4 2003-04-16 14:49:26 dinoex Exp $
#
# this substitutes USE_OPENSSL=yes
# just include this makefile after bsd.ports.pre.mk
@@ -13,6 +13,11 @@
# WITH_OPENSSL_PORT=yes - Use the port, even if base if up to date
# WITH_OPENSSL_BETA=yes - Use a snapshot of recent openssl
#
+# Overrideable defaults:
+#
+# OPENSSL_SHLIBVER= 3
+# OPENSSL_PORT= security/openssl
+#
# The makefile sets this variables:
# OPENSSLBASE - "/usr" or ${LOCALBASE}
# OPENSSLDIR - path to openssl
@@ -37,14 +42,12 @@ WITH_OPENSSL_PORT=yes
!defined(WITH_OPENSSL_PORT) && \
!exists(${LOCALBASE}/lib/libcrypto.so)
# Security: version in base must be 0.9.7a
-.if exists(/usr/lib/libcrypto.so.3)
OPENSSLVER!= ${AWK} '/OPENSSL_VERSION_NUMBER/ { print $$3 }' \
/usr/include/openssl/opensslv.h
-.if ${OPENSSLVER} == 0x0090702fL
+.if ${OPENSSLVER} == 0x0090701fL || ${OPENSSLVER} == 0x0090702fL
WITH_OPENSSL_BASE=yes
.endif
.endif
-.endif
.if defined(WITH_OPENSSL_BASE)
OPENSSLBASE= /usr
@@ -86,23 +89,23 @@ OPENSSL_CFLAGS+= -DNO_IDEA
.endif
MAKE_ARGS+= OPENSSL_CFLAGS="${OPENSSL_CFLAGS}"
.endif
+CFLAGS+= -Wl,-rpath,/usr/lib:${LOCALBASE}/lib
+OPENSSL_LDFLAGS+= -rpath=/usr/lib:${LOCALBASE}/lib
.else
-.if exists(/usr/lib/libcrypto.so.2) && !exists(/usr/lib/libcrypto.so.3)
-SHLIBVER= 3
-.else
-SHLIBVER= 4
-.endif
-
OPENSSLBASE= ${LOCALBASE}
.if defined(WITH_OPENSSL_BETA)
-OPENSSLDIR= ${OPENSSLBASE}/openssl
-LIB_DEPENDS+= crypto.${SHLIBVER}:${PORTSDIR}/security/openssl-beta
+OPENSSL_SHLIBVER?= 4
+OPENSSL_PORT?= security/openssl-beta
.else
-OPENSSLDIR= ${OPENSSLBASE}/openssl
-LIB_DEPENDS+= crypto.${SHLIBVER}:${PORTSDIR}/security/openssl
+OPENSSL_SHLIBVER?= 3
+OPENSSL_PORT?= security/openssl
.endif
+OPENSSLDIR= ${OPENSSLBASE}/openssl
+LIB_DEPENDS+= crypto.${OPENSSL_SHLIBVER}:${PORTSDIR}/${OPENSSL_PORT}
+CFLAGS+= -Wl,-rpath,${LOCALBASE}/lib
+OPENSSL_LDFLAGS+= -rpath=${LOCALBASE}/lib
.endif
@@ -111,6 +114,12 @@ OPENSSLINC= ${OPENSSLBASE}/include
MAKE_ENV+= OPENSSLLIB=${OPENSSLLIB} OPENSSLINC=${OPENSSLINC} \
OPENSSLBASE=${OPENSSLBASE} OPENSSLDIR=${OPENSSLDIR}
+.if defined(LDFLAGS) && !empty(LDFLAGS)
+LDFLAGS+=${OPENSSL_LDFLAGS}
+.else
+LDFLAGS=${OPENSSL_LDFLAGS}
+.endif
+
### crypto
#RESTRICTED= "Contains cryptography."