Upgrade to OpenSSL 0.9.8h.
[dragonfly.git] / secure / lib / libcrypto / Makefile.inc
CommitLineData
984263bc 1# $FreeBSD: src/secure/lib/libcrypto/Makefile.inc,v 1.7.2.11 2003/02/20 15:07:32 nectar Exp $
aac4ff6f 2# $DragonFly: src/secure/lib/libcrypto/Makefile.inc,v 1.17 2008/09/06 20:42:53 pavalos Exp $
984263bc 3
aac4ff6f 4OSSLVERSION= 0.9.8h
a561f9ff
SS
5LCRYPTO_SRC= ${.CURDIR}/../../../crypto/openssl-0.9
6LCRYPTO_DOC= ${LCRYPTO_SRC}/doc
984263bc
MD
7
8CFLAGS+= -DTERMIOS -DANSI_SOURCE
9CFLAGS+= -I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto \
10 -I${LCRYPTO_SRC}/crypto/engine -I${.OBJDIR}
11
aac4ff6f
PA
12CFLAGS+= -DOPENSSL_NO_GMP
13CFLAGS+= -DOPENSSL_NO_CMS
14
cecff5c1 15.if !defined(WANT_IDEA)
984263bc
MD
16CFLAGS+= -DOPENSSL_NO_IDEA
17.else
18_idea_h= idea/idea.h
19.endif
20
21.if ${MACHINE_ARCH} == "i386"
22CFLAGS+= -DL_ENDIAN
984263bc
MD
23.endif
24
c6e28a8e 25CRYTPO_HDRS= \
984263bc
MD
26 ../e_os.h ../e_os2.h \
27 crypto.h \
28 ebcdic.h \
29 opensslv.h \
30 ossl_typ.h \
31 symhacks.h \
32 tmdiff.h \
33 aes/aes.h aes/aes_locl.h \
34 asn1/asn1.h asn1/asn1_mac.h asn1/asn1t.h \
35 bio/bio.h \
36 bf/blowfish.h \
37 bn/bn.h \
38 buffer/buffer.h \
3a1cbc76 39 camellia/camellia.h \
984263bc
MD
40 cast/cast.h \
41 comp/comp.h \
42 conf/conf.h conf/conf_api.h \
43 des/des.h des/des_old.h \
44 dh/dh.h \
45 dsa/dsa.h \
46 dso/dso.h \
47 ec/ec.h \
a561f9ff
SS
48 ecdh/ecdh.h \
49 ecdsa/ecdsa.h \
50 engine/eng_int.h engine/engine.h \
984263bc
MD
51 err/err.h \
52 hmac/hmac.h \
53 ${_idea_h} \
54 krb5/krb5_asn.h \
55 lhash/lhash.h \
56 md2/md2.h \
57 md4/md4.h \
58 md5/md5.h \
59 mdc2/mdc2.h \
60 ocsp/ocsp.h \
61 objects/objects.h objects/obj_mac.h \
62 pem/pem.h pem/pem2.h \
63 pkcs12/pkcs12.h pkcs7/pkcs7.h \
a561f9ff 64 pqueue/pqueue.h pqueue/pq_compat.h \
984263bc
MD
65 rand/rand.h \
66 rc2/rc2.h rc4/rc4.h rc5/rc5.h \
67 ripemd/ripemd.h \
68 rsa/rsa.h \
69 stack/stack.h stack/safestack.h \
a561f9ff 70 store/store.h \
984263bc
MD
71 sha/sha.h \
72 txt_db/txt_db.h \
73 ui/ui.h ui/ui_compat.h ui/ui_locl.h \
74 x509/x509.h x509/x509_vfy.h x509v3/x509v3.h
75
c6e28a8e
SS
76SSL_HDRS= \
77 dtls1.h kssl.h ssl.h ssl2.h ssl23.h ssl3.h tls1.h
78
79HDRS+= ${CRYTPO_HDRS:S,^,crypto/,} \
80 ${SSL_HDRS:S,^,ssl/,}
81
984263bc
MD
82SRCS+= buildinf.h openssl/opensslconf.h openssl/evp.h
83CLEANFILES+= buildinf.h openssl/opensslconf.h openssl/evp.h
84CLEANDIRS+= openssl
85
86buildinf.h:
87 ( echo "#ifndef MK1MF_BUILD"; \
88 echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
89 echo " #define CFLAGS \"$(CC)\""; \
90 echo " #define PLATFORM \"`uname -s`-`uname -m`\""; \
91 echo " #define DATE \"`LC_ALL=C date`\""; \
92 echo "#endif" ) > ${.TARGET}
93
7aa968aa
MD
94openssl/opensslconf.h: openssl/.dummy ../../lib/libcrypto/opensslconf-${MACHINE_ARCH}.h
95 cp ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
984263bc 96
7aa968aa 97openssl/evp.h: openssl/.dummy ${LCRYPTO_SRC}/crypto/evp/evp.h
cecff5c1 98.if !defined(WANT_IDEA)
7aa968aa 99 sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC:Nopenssl/.dummy} > ${.TARGET}
984263bc 100.else
7aa968aa 101 ${INSTALL} -C -m 444 ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
984263bc
MD
102.endif
103
104SRCS+= ${HDRS:T:S;^;openssl/;}
c6e28a8e 105.for h in ${HDRS:S,^,${LCRYPTO_SRC}/,}
7aa968aa 106openssl/${h:T}: openssl/.dummy ${h}
984263bc
MD
107 ${INSTALL} -C -m 444 ${h} openssl
108.endfor
109
7aa968aa
MD
110# mkdir the required directory as its own target, so multiple
111# mkdir commands do not race against each other.
06bff654 112#
7aa968aa 113openssl/.dummy:
06bff654 114 mkdir -p openssl
7aa968aa 115 if [ ! -f ${.TARGET} ]; then touch ${.TARGET}; fi
06bff654 116
984263bc
MD
117MANDIR= ${SHAREDIR}/openssl/man/man
118
119.if defined(LIB)
120_docs= ${LIB}
984263bc
MD
121_sec= 3
122.else
123_docs= apps
984263bc
MD
124_sec= 1
125.endif
126
127man-update:
128.for manpage in ${MAN}
129 @(sec=${manpage:E}; \
130 pod=${manpage:R}.pod; \
131 cp ${LCRYPTO_DOC}/${_docs}/$$pod .; \
65b98162 132 pod2man --section=$$sec --release="${OSSLVERSION}" --center="OpenSSL" \
984263bc
MD
133 $$pod > ${.CURDIR}/man/${manpage}; \
134 rm $$pod; \
135 ${ECHO} ${manpage})
136.endfor
137
138man-makefile-update:
139 rm -f ${.CURDIR}/Makefile.man
a561f9ff 140 echo '# $$''DragonFly$$' >> ${.CURDIR}/Makefile.man
984263bc
MD
141 echo '# DO NOT EDIT: generated from man-makefile-update target' >> \
142 ${.CURDIR}/Makefile.man
143 for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \
144 fn=`basename $$i .pod`; \
a561f9ff
SS
145 sec=`perl ${LCRYPTO_SRC}/util/extract-section.pl < $$i`; \
146 sec=$${sec:-${_sec}}; \
147 ${ECHO} "MAN+= $$fn.$$sec" >> ${.CURDIR}/Makefile.man; \
984263bc 148 perl ${LCRYPTO_SRC}/util/extract-names.pl < $$i | \
a561f9ff
SS
149 sed -Ee "/^$$fn\$$/d;s/^(.*)/MLINKS+= $$fn.$$sec \1.$$sec/" >> \
150 ${.CURDIR}/Makefile.man; \
984263bc 151 done