# $NetBSD: Makefile.openssl,v 1.20 2025/01/06 19:11:26 rillig Exp $ .ifndef _MAKEFILE_OPENSSL_INCLUDED _MAKEFILE_OPENSSL_INCLUDED=1 .include WARNS=3 # would require changing a lot of code CWARNFLAGS+= -Wno-error=cast-qual CWARNFLAGS+= -Wno-error=char-subscripts # XXX likely real ctype(3) missing cast bugs CWARNFLAGS+= -Wno-error=missing-field-initializers CWARNFLAGS+= -Wno-error=shadow CWARNFLAGS.gcc+= -Wno-error=discarded-qualifiers CWARNFLAGS.clang+= -Wno-error=ignored-qualifiers # OpenSSL extensively uses string literals as char *, which clang # (reasonably if not exactly rightly) objects to. CWARNFLAGS.clang+= -Wno-error=incompatible-pointer-types-discards-qualifiers # XXX: re-examine the below CWARNFLAGS.clang+= -Wno-empty-body -Wno-unused-value -Wno-parentheses CWARNFLAGS.clang+= -Wno-implicit-int-float-conversion # XXX: This warning seems to trigger incorrectly CWARNFLAGS.clang+= -Wno-atomic-alignment LINTFLAGS+= -X 117 # bitwise '>>' on signed value possibly nonportable LINTFLAGS+= -X 129 # expression has null effect LINTFLAGS+= -X 132 # conversion may lose accuracy LINTFLAGS+= -X 161 # constant in conditional context LINTFLAGS+= -X 220 # fallthrough on case statement LINTFLAGS+= -X 231 # argument unused in function LINTFLAGS+= -X 309 # (unsigned int)0x80000000 & (unsigned long)x LINTFLAGS+= -X 275 # cast discards 'const' from pointer LINTFLAGS+= -X 298 # argument conversion may lose accuracy .if ${HAVE_OPENSSL} <= 11 OSSL_ENGINESDIR=/usr/lib/openssl .else . if defined(MLIBDIR) OSSL_LIBDIR=/usr/lib/${MLIBDIR}/openssl . else OSSL_LIBDIR=/usr/lib/openssl . endif OSSL_ENGINESDIR=${OSSL_LIBDIR}/engines OSSL_MODULESDIR=${OSSL_LIBDIR}/modules .endif OPENSSLSRC= ${CRYPTODIST}/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/dist CPPFLAGS+= -DOPENSSLDIR=\"/etc/openssl\" CPPFLAGS+= -DENGINESDIR=\"${OSSL_ENGINESDIR}\" CPPFLAGS+= -DMODULESDIR=\"${OSSL_MODULESDIR}\" .endif