Removed
Link Here
|
1 |
# |
2 |
# $FreeBSD$ |
3 |
# bsd.openssl.mk - Support for OpenSSL based ports. |
4 |
# |
5 |
# Use of 'USE_OPENSSL=yes' includes this Makefile after bsd.ports.pre.mk |
6 |
# |
7 |
# The user/port can now set these options in the Makefiles. |
8 |
# |
9 |
# WITH_OPENSSL_BASE=yes - Use the version in the base system. |
10 |
# WITH_OPENSSL_PORT=yes - Use the OpenSSL port, even if base is up to date. |
11 |
# |
12 |
# USE_OPENSSL_RPATH=yes - Pass RFLAGS options in CFLAGS, |
13 |
# needed for ports who don't use LDFLAGS. |
14 |
# |
15 |
# Overrideable defaults: |
16 |
# |
17 |
# OPENSSL_SHLIBVER= 8 |
18 |
# OPENSSL_PORT= security/openssl |
19 |
# |
20 |
# The Makefile sets these variables: |
21 |
# OPENSSLBASE - "/usr" or ${LOCALBASE} |
22 |
# OPENSSLDIR - path to openssl |
23 |
# OPENSSLLIB - path to the libs |
24 |
# OPENSSLINC - path to the matching includes |
25 |
# OPENSSLRPATH - rpath for dynamic linker |
26 |
# |
27 |
# MAKE_ENV - extended with the variables above |
28 |
# CONFIGURE_ENV - extended with LDFLAGS |
29 |
# BUILD_DEPENDS - are added if needed |
30 |
# RUN_DEPENDS - are added if needed |
31 |
|
32 |
OpenSSL_Include_MAINTAINER= dinoex@FreeBSD.org |
33 |
|
34 |
.include "${PORTSDIR}/Mk/bsd.default-versions.mk" |
35 |
|
36 |
.if ${SSL_DEFAULT} == base |
37 |
OPENSSLBASE= /usr |
38 |
OPENSSLDIR?= /etc/ssl |
39 |
|
40 |
. if !exists(${DESTDIR}/usr/lib/libcrypto.so) |
41 |
check-depends:: |
42 |
@${ECHO_CMD} "Dependency error: This port requires the OpenSSL library, which is part of" |
43 |
@${ECHO_CMD} "the FreeBSD crypto distribution, but not installed on your" |
44 |
@${ECHO_CMD} "machine. Please see the \"OpenSSL\" section in the handbook" |
45 |
@${ECHO_CMD} "(at \"http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/openssl.html\", for instance)" |
46 |
@${ECHO_CMD} "for instructions on how to obtain and install the FreeBSD" |
47 |
@${ECHO_CMD} "OpenSSL distribution." |
48 |
@${FALSE} |
49 |
. endif |
50 |
. if exists(${LOCALBASE}/lib/libcrypto.so) |
51 |
check-depends:: |
52 |
@${ECHO_CMD} "Dependency error: This port wants the OpenSSL library from the FreeBSD" |
53 |
@${ECHO_CMD} "base system. You can't build against it, while a newer" |
54 |
@${ECHO_CMD} "version is installed by a port." |
55 |
@${ECHO_CMD} "Please deinstall the port, remove DEFAULT_VERSIONS=ssl=base or undefine WITH_OPENSSL_BASE." |
56 |
@${FALSE} |
57 |
. endif |
58 |
|
59 |
# OpenSSL in the base system may not include IDEA for patent licensing reasons. |
60 |
. if defined(MAKE_IDEA) && !defined(OPENSSL_IDEA) |
61 |
OPENSSL_IDEA= ${MAKE_IDEA} |
62 |
. else |
63 |
OPENSSL_IDEA?= NO |
64 |
. endif |
65 |
|
66 |
. if ${OPENSSL_IDEA} == "NO" |
67 |
# XXX This is a hack to work around the fact that /etc/make.conf clobbers |
68 |
# our CFLAGS. It might not be enough for all future ports. |
69 |
. if defined(HAS_CONFIGURE) |
70 |
CFLAGS+= -DNO_IDEA |
71 |
. else |
72 |
OPENSSL_CFLAGS+= -DNO_IDEA |
73 |
. endif |
74 |
MAKE_ARGS+= OPENSSL_CFLAGS="${OPENSSL_CFLAGS}" |
75 |
. endif |
76 |
|
77 |
.else # ${SSL_DEFAULT} != base |
78 |
|
79 |
OPENSSLBASE= ${LOCALBASE} |
80 |
|
81 |
OPENSSL_PORT= security/${SSL_DEFAULT} |
82 |
|
83 |
# Get OPENSSL_SHLIBVER from the port |
84 |
.sinclude <${PORTSDIR}/${OPENSSL_PORT}/version.mk> |
85 |
|
86 |
. if !defined(OPENSSL_SHLIBVER) |
87 |
.error You are using an unsupported SSL provider ${SSL_DEFAULT} |
88 |
. endif |
89 |
|
90 |
OPENSSLDIR?= ${OPENSSLBASE}/openssl |
91 |
BUILD_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} |
92 |
RUN_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} |
93 |
OPENSSLRPATH= ${LOCALBASE}/lib |
94 |
|
95 |
.endif |
96 |
|
97 |
OPENSSLLIB= ${OPENSSLBASE}/lib |
98 |
OPENSSLINC= ${OPENSSLBASE}/include |
99 |
|
100 |
MAKE_ENV+= OPENSSLBASE=${OPENSSLBASE} |
101 |
MAKE_ENV+= OPENSSLDIR=${OPENSSLDIR} |
102 |
MAKE_ENV+= OPENSSLINC=${OPENSSLINC} |
103 |
MAKE_ENV+= OPENSSLLIB=${OPENSSLLIB} |
104 |
|
105 |
.if defined(OPENSSLRPATH) |
106 |
. if defined(USE_OPENSSL_RPATH) |
107 |
CFLAGS+= -Wl,-rpath,${OPENSSLRPATH} |
108 |
. endif |
109 |
MAKE_ENV+= OPENSSLRPATH=${OPENSSLRPATH} |
110 |
OPENSSL_LDFLAGS+= -Wl,-rpath,${OPENSSLRPATH} |
111 |
.endif |
112 |
|
113 |
LDFLAGS+= ${OPENSSL_LDFLAGS} |
114 |
|
115 |
### crypto |
116 |
#RESTRICTED= "Contains cryptography." |