Upgrade to OpenSSL 0.9.8h.
[dragonfly.git] / secure / lib / libcrypto / Makefile.inc
1 # $FreeBSD: src/secure/lib/libcrypto/Makefile.inc,v 1.7.2.11 2003/02/20 15:07:32 nectar Exp $
2 # $DragonFly: src/secure/lib/libcrypto/Makefile.inc,v 1.17 2008/09/06 20:42:53 pavalos Exp $
3
4 OSSLVERSION=    0.9.8h
5 LCRYPTO_SRC=    ${.CURDIR}/../../../crypto/openssl-0.9
6 LCRYPTO_DOC=    ${LCRYPTO_SRC}/doc
7
8 CFLAGS+=        -DTERMIOS -DANSI_SOURCE
9 CFLAGS+=        -I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto \
10                 -I${LCRYPTO_SRC}/crypto/engine -I${.OBJDIR}
11
12 CFLAGS+=        -DOPENSSL_NO_GMP
13 CFLAGS+=        -DOPENSSL_NO_CMS
14
15 .if !defined(WANT_IDEA)
16 CFLAGS+=        -DOPENSSL_NO_IDEA
17 .else
18 _idea_h=        idea/idea.h
19 .endif
20
21 .if ${MACHINE_ARCH} == "i386"
22 CFLAGS+= -DL_ENDIAN
23 .endif
24
25 CRYTPO_HDRS=    \
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 \
39         camellia/camellia.h \
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 \
48         ecdh/ecdh.h \
49         ecdsa/ecdsa.h \
50         engine/eng_int.h engine/engine.h \
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 \
64         pqueue/pqueue.h pqueue/pq_compat.h \
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 \
70         store/store.h \
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
76 SSL_HDRS=       \
77         dtls1.h kssl.h ssl.h ssl2.h ssl23.h ssl3.h tls1.h
78
79 HDRS+=  ${CRYTPO_HDRS:S,^,crypto/,} \
80         ${SSL_HDRS:S,^,ssl/,}
81
82 SRCS+=          buildinf.h openssl/opensslconf.h openssl/evp.h
83 CLEANFILES+=    buildinf.h openssl/opensslconf.h openssl/evp.h
84 CLEANDIRS+=     openssl
85
86 buildinf.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
94 openssl/opensslconf.h: openssl/.dummy ../../lib/libcrypto/opensslconf-${MACHINE_ARCH}.h
95         cp ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
96
97 openssl/evp.h: openssl/.dummy ${LCRYPTO_SRC}/crypto/evp/evp.h
98 .if !defined(WANT_IDEA)
99         sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC:Nopenssl/.dummy} > ${.TARGET}
100 .else
101         ${INSTALL} -C -m 444 ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
102 .endif
103
104 SRCS+=  ${HDRS:T:S;^;openssl/;}
105 .for h in ${HDRS:S,^,${LCRYPTO_SRC}/,}
106 openssl/${h:T}: openssl/.dummy ${h}
107         ${INSTALL} -C -m 444 ${h} openssl
108 .endfor
109
110 # mkdir the required directory as its own target, so multiple
111 # mkdir commands do not race against each other.
112 #
113 openssl/.dummy:
114         mkdir -p openssl
115         if [ ! -f ${.TARGET} ]; then touch ${.TARGET}; fi
116
117 MANDIR= ${SHAREDIR}/openssl/man/man
118
119 .if defined(LIB)
120 _docs=  ${LIB}
121 _sec=   3
122 .else
123 _docs=  apps
124 _sec=   1
125 .endif
126
127 man-update:
128 .for manpage in ${MAN}
129         @(sec=${manpage:E}; \
130         pod=${manpage:R}.pod; \
131         cp ${LCRYPTO_DOC}/${_docs}/$$pod .; \
132         pod2man --section=$$sec --release="${OSSLVERSION}" --center="OpenSSL" \
133           $$pod > ${.CURDIR}/man/${manpage}; \
134         rm $$pod; \
135         ${ECHO} ${manpage})
136 .endfor
137
138 man-makefile-update:
139         rm -f ${.CURDIR}/Makefile.man
140         echo '# $$''DragonFly$$' >> ${.CURDIR}/Makefile.man
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`; \
145                 sec=`perl ${LCRYPTO_SRC}/util/extract-section.pl < $$i`; \
146                 sec=$${sec:-${_sec}}; \
147                 ${ECHO} "MAN+= $$fn.$$sec" >> ${.CURDIR}/Makefile.man; \
148                 perl ${LCRYPTO_SRC}/util/extract-names.pl < $$i | \
149                   sed -Ee "/^$$fn\$$/d;s/^(.*)/MLINKS+= $$fn.$$sec \1.$$sec/" >> \
150                     ${.CURDIR}/Makefile.man; \
151         done