aboutsummaryrefslogtreecommitdiff
path: root/secure/lib/libcrypto/Makefile.inc
blob: 5b25f4c236b514d9a27076ba8bbb427b9d8075e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# $FreeBSD$

LCRYPTO_SRC=	${.CURDIR}/../../../crypto/openssl/crypto
CFLAGS+= -DTERMIOS -DANSI_SOURCE -I${LCRYPTO_SRC} -I${.OBJDIR}
.if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
CFLAGS+= -DNO_IDEA
.endif

.if ${MACHINE_ARCH} == "i386"
CFLAGS+= -DL_ENDIAN 
.if !defined(NOPERL)
CFLAGS+= -DSHA1_ASM -DBN_ASM -DMD5_ASM -DRMD160_ASM
.endif
.elif ${MACHINE_ARCH} == "alpha"
# no ENDIAN stuff defined for alpha (64-bit)
.endif

WITH_RSA?= YES

HDRS=	asn1/asn1.h asn1/asn1_mac.h bio/bio.h bf/blowfish.h bn/bn.h \
	buffer/buffer.h cast/cast.h comp/comp.h conf/conf.h crypto.h \
	des/des.h dh/dh.h dsa/dsa.h ../e_os.h ../e_os2.h ebcdic.h \
	err/err.h hmac/hmac.h lhash/lhash.h md2/md2.h \
	md5/md5.h mdc2/mdc2.h objects/objects.h opensslv.h pem/pem.h \
	pem/pem2.h pkcs12/pkcs12.h pkcs7/pkcs7.h rand/rand.h rc2/rc2.h \
	rc4/rc4.h rc5/rc5.h ripemd/ripemd.h rsa/rsa.h stack/safestack.h \
	sha/sha.h stack/stack.h tmdiff.h txt_db/txt_db.h x509/x509.h \
	x509/x509_vfy.h x509v3/x509v3.h symhacks.h objects/obj_mac.h \
	md4/md4.h dso/dso.h conf/conf_api.h

.if defined(MAKE_IDEA) && ${MAKE_IDEA} == YES
HDRS+= idea/idea.h
.endif

.for h in ${HDRS}
CRYPTO_HDRS+= ${LCRYPTO_SRC}/${h}
.endfor

SRCS+=		buildinf.h openssl/opensslconf.h openssl/evp.h
CLEANFILES+=	buildinf.h openssl/opensslconf.h openssl/evp.h
CLEANDIRS+=	openssl

buildinf.h:
	( echo "#ifndef MK1MF_BUILD"; \
	echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
	echo "  #define CFLAGS \"$(CC)\""; \
	echo "  #define PLATFORM \"`uname -s`-`uname -m`\""; \
	echo "  #define DATE \"`LC_ALL=C date`\""; \
	echo "#endif" ) > ${.TARGET}

#	XXX:  The openssl/ dependencies are not correct, in that a change in
#	any of ${CRYPTO_HDRS} ${EXTRA_HDRS} will no repopulate openssl/.
#	This deficiency will be fixed in a later commit.

.ORDER:	openssl/opensslconf.h openssl/evp.h

openssl/opensslconf.h:  ../libcrypto/opensslconf-${MACHINE_ARCH}.h
	mkdir -p openssl
	cp ${.OODATE} ${.TARGET}
	${INSTALL} ${COPY} -m 444 ${CRYPTO_HDRS} ${EXTRA_HDRS} openssl

openssl/evp.h: ${LCRYPTO_SRC}/evp/evp.h
.if !defined(MAKE_IDEA) || ${MAKE_IDEA} != YES
	sed '/^#ifndef NO_IDEA$$/,/^#endif$$/d' ${.OODATE} > ${.TARGET}
.else
	${INSTALL} ${COPY} -m 444 ${.OODATE} ${.TARGET}
.endif