1# $FreeBSD$ 2 3.include <bsd.own.mk> 4 5# OpenSSL version used for manual page generation 6OPENSSL_VER= 1.0.2k 7OPENSSL_DATE= 2017-01-26 8 9LCRYPTO_SRC= ${SRCTOP}/crypto/openssl 10LCRYPTO_DOC= ${LCRYPTO_SRC}/doc 11 12CFLAGS+= -I${LCRYPTO_SRC} 13CFLAGS+= -DTERMIOS -DANSI_SOURCE 14CFLAGS+= -DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H 15 16.include <bsd.endian.mk> 17 18.if ${TARGET_ENDIANNESS} == 1234 19CFLAGS+=-DL_ENDIAN 20.elif ${TARGET_ENDIANNESS} == 4321 21CFLAGS+=-DB_ENDIAN 22.endif 23 24.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" 25ASM_${MACHINE_CPUARCH}= 26.elif ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" 27_ASM_AVX!= { \ 28 echo vzeroall | \ 29 ${CC} -x assembler -o /dev/null -c - 2> /dev/null; \ 30 } && echo yes || echo no 31.if ${_ASM_AVX} == yes 32ASM_${MACHINE_CPUARCH}= 33.endif 34.endif 35 36.if defined(ASM_aarch64) 37CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM 38.elif defined(ASM_amd64) 39CFLAGS+=-DOPENSSL_IA32_SSE2 40CFLAGS+=-DAES_ASM -DBSAES_ASM -DVPAES_ASM 41CFLAGS+=-DECP_NISTZ256_ASM 42CFLAGS+=-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m 43CFLAGS+=-DMD5_ASM 44CFLAGS+=-DGHASH_ASM 45CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM 46CFLAGS+=-DWHIRLPOOL_ASM 47.elif defined(ASM_arm) 48CFLAGS+=-DAES_ASM -DBSAES_ASM 49CFLAGS+=-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m 50CFLAGS+=-DGHASH_ASM 51CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM 52.elif defined(ASM_i386) 53CFLAGS+=-DOPENSSL_IA32_SSE2 54CFLAGS+=-DAES_ASM -DVPAES_ASM 55CFLAGS+=-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m 56CFLAGS+=-DMD5_ASM 57CFLAGS+=-DGHASH_ASM 58CFLAGS+=-DRMD160_ASM 59CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM 60CFLAGS+=-DWHIRLPOOL_ASM 61.endif 62 63MANDIR= ${SHAREDIR}/openssl/man/man 64 65.if defined(LIB) 66_docs= ${LIB} 67_skip= SSLeay_version des_modes 68_sec= 3 69.else 70_docs= apps 71_skip= config 72_sec= 1 73.endif 74 75man-update: 76.for manpage in ${MAN} 77 @(sec=${manpage:E}; \ 78 pod=${manpage:R}.pod; \ 79 cp ${LCRYPTO_DOC}/${_docs}/$$pod .; \ 80 pod2man --section=$$sec --release="${OPENSSL_VER}" \ 81 --date="${OPENSSL_DATE}" --center="OpenSSL" \ 82 $$pod > ${.CURDIR}/man/${manpage}; \ 83 rm -f $$pod; \ 84 ${ECHO} ${manpage}) 85.endfor 86 87man-makefile-update: 88 rm -f ${.CURDIR}/Makefile.man 89 echo '# $$'FreeBSD'$$' >> ${.CURDIR}/Makefile.man 90 echo '# DO NOT EDIT: generated from man-makefile-update target' >> \ 91 ${.CURDIR}/Makefile.man 92 for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \ 93 fn=`basename $$i .pod`; \ 94 if ! echo '${_skip}' | grep -qw "$$fn"; then \ 95 ${ECHO} "MAN+= $$fn.${_sec}" >> ${.CURDIR}/Makefile.man; \ 96 fi; \ 97 done 98 for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \ 99 fn=`basename $$i .pod`; \ 100 if ! echo '${_skip}' | grep -qw "$$fn"; then \ 101 perl ${LCRYPTO_SRC}/util/extract-names.pl < $$i | \ 102 awk "/^$$fn\$$/ { next; } \ 103 { print \"MLINKS+= $$fn.${_sec} \" \$$1 \".${_sec}\" }" >> \ 104 ${.CURDIR}/Makefile.man; \ 105 fi; \ 106 done 107