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 |
# If no preference was set, check for an installed base version |
35 |
# but give an installed port preference over it. |
36 |
.if !defined(WITH_OPENSSL_BASE) && \ |
37 |
!defined(WITH_OPENSSL_PORT) && \ |
38 |
!exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so) && \ |
39 |
exists(${DESTDIR}/usr/include/openssl/opensslv.h) |
40 |
WITH_OPENSSL_BASE=yes |
41 |
.endif |
42 |
|
43 |
.if defined(WITH_OPENSSL_BASE) |
44 |
OPENSSLBASE= /usr |
45 |
OPENSSLDIR?= /etc/ssl |
46 |
|
47 |
.if !exists(${DESTDIR}/usr/lib/libcrypto.so) |
48 |
check-depends:: |
49 |
@${ECHO_CMD} "Dependency error: This port requires the OpenSSL library, which is part of" |
50 |
@${ECHO_CMD} "the FreeBSD crypto distribution, but not installed on your" |
51 |
@${ECHO_CMD} "machine. Please see the \"OpenSSL\" section in the handbook" |
52 |
@${ECHO_CMD} "(at \"http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/openssl.html\", for instance)" |
53 |
@${ECHO_CMD} "for instructions on how to obtain and install the FreeBSD" |
54 |
@${ECHO_CMD} "OpenSSL distribution." |
55 |
@${FALSE} |
56 |
.endif |
57 |
.if exists(${LOCALBASE}/lib/libcrypto.so) |
58 |
check-depends:: |
59 |
@${ECHO_CMD} "Dependency error: This port wants the OpenSSL library from the FreeBSD" |
60 |
@${ECHO_CMD} "base system. You can't build against it, while a newer" |
61 |
@${ECHO_CMD} "version is installed by a port." |
62 |
@${ECHO_CMD} "Please deinstall the port or undefine WITH_OPENSSL_BASE." |
63 |
@${FALSE} |
64 |
.endif |
65 |
|
66 |
# OpenSSL in the base system may not include IDEA for patent licensing reasons. |
67 |
.if defined(MAKE_IDEA) && !defined(OPENSSL_IDEA) |
68 |
OPENSSL_IDEA= ${MAKE_IDEA} |
69 |
.else |
70 |
OPENSSL_IDEA?= NO |
71 |
.endif |
72 |
|
73 |
.if ${OPENSSL_IDEA} == "NO" |
74 |
# XXX This is a hack to work around the fact that /etc/make.conf clobbers |
75 |
# our CFLAGS. It might not be enough for all future ports. |
76 |
.if defined(HAS_CONFIGURE) |
77 |
CFLAGS+= -DNO_IDEA |
78 |
.else |
79 |
OPENSSL_CFLAGS+= -DNO_IDEA |
80 |
.endif |
81 |
MAKE_ARGS+= OPENSSL_CFLAGS="${OPENSSL_CFLAGS}" |
82 |
.endif |
83 |
|
84 |
.else |
85 |
|
86 |
OPENSSLBASE= ${LOCALBASE} |
87 |
.if !defined(OPENSSL_PORT) && \ |
88 |
exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so) |
89 |
# find installed port and use it for dependency |
90 |
.if !defined(OPENSSL_INSTALLED) |
91 |
.if defined(DESTDIR) |
92 |
PKGARGS= -c ${DESTDIR} |
93 |
.else |
94 |
PKGARGS= |
95 |
.endif |
96 |
OPENSSL_INSTALLED!= ${PKG_BIN} ${PKGARGS} which -qo ${LOCALBASE}/lib/libcrypto.so || : |
97 |
.endif |
98 |
.if defined(OPENSSL_INSTALLED) && ${OPENSSL_INSTALLED} != "" |
99 |
OPENSSL_PORT= ${OPENSSL_INSTALLED} |
100 |
OPENSSL_SHLIBFILE!= ${PKG_INFO} -ql ${OPENSSL_INSTALLED} | ${GREP} "^`${PKG_QUERY} "%p" ${OPENSSL_INSTALLED}`/lib/libcrypto.so.[0-9]*$$" |
101 |
OPENSSL_SHLIBVER?= ${OPENSSL_SHLIBFILE:E} |
102 |
.endif |
103 |
.endif |
104 |
|
105 |
# LibreSSL specific SHLIBVER |
106 |
.if defined(OPENSSL_PORT) && ${OPENSSL_PORT} == security/libressl |
107 |
OPENSSL_SHLIBVER?= 35 |
108 |
.elif defined(OPENSSL_PORT) && ${OPENSSL_PORT} == security/libressl-devel |
109 |
OPENSSL_SHLIBVER?= 37 |
110 |
.endif |
111 |
|
112 |
# default |
113 |
OPENSSL_PORT?= security/openssl |
114 |
OPENSSL_SHLIBVER?= 8 |
115 |
|
116 |
OPENSSLDIR?= ${OPENSSLBASE}/openssl |
117 |
BUILD_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} |
118 |
RUN_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT} |
119 |
OPENSSLRPATH= ${LOCALBASE}/lib |
120 |
|
121 |
.endif |
122 |
|
123 |
OPENSSLLIB= ${OPENSSLBASE}/lib |
124 |
OPENSSLINC= ${OPENSSLBASE}/include |
125 |
|
126 |
MAKE_ENV+= OPENSSLBASE=${OPENSSLBASE} |
127 |
MAKE_ENV+= OPENSSLDIR=${OPENSSLDIR} |
128 |
MAKE_ENV+= OPENSSLINC=${OPENSSLINC} |
129 |
MAKE_ENV+= OPENSSLLIB=${OPENSSLLIB} |
130 |
|
131 |
.if defined(OPENSSLRPATH) |
132 |
.if defined(USE_OPENSSL_RPATH) |
133 |
CFLAGS+= -Wl,-rpath,${OPENSSLRPATH} |
134 |
.endif |
135 |
MAKE_ENV+= OPENSSLRPATH=${OPENSSLRPATH} |
136 |
OPENSSL_LDFLAGS+= -Wl,-rpath,${OPENSSLRPATH} |
137 |
.endif |
138 |
|
139 |
LDFLAGS+= ${OPENSSL_LDFLAGS} |
140 |
|
141 |
### crypto |
142 |
#RESTRICTED= "Contains cryptography." |