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