@@ -3,25 +3,20 @@ KMOD=libwolfssl
33SRCS =wolfkmod.c
44WOLFSSL_DIR =../
55
6- CFLAGS+ =-I/usr/include/sys
76CFLAGS+ =-I${WOLFSSL_DIR}
87CFLAGS+ =-DWOLFSSL_IGNORE_FILE_WARN -DHAVE_CONFIG_H
98CFLAGS+ =-DNO_MAIN_DRIVER
109# debug mode
1110CFLAGS+ =-DWOLFSSL_BSDKM_VERBOSE_DEBUG
1211CFLAGS+ =$(AM_CPPFLAGS ) $(CPPFLAGS ) $(AM_CFLAGS )
1312
14- # FreeBSD make does not support GNU make's patsubst and related.
15- # Just include everything under wolfcrypt/src/ except port, and let
16- # define flags filter the rest.
17- OBJS != find ${WOLFSSL_DIR}/wolfcrypt/src -path \
18- '${WOLFSSL_DIR}/wolfcrypt/src/port' -prune -o -name \
19- '*.c' -print | sed 's,\.c$$,.o,'
13+ # FreeBSD make does not support GNU make's patsubst and related. Filter
14+ # through sed instead.
15+ OBJS != echo ${src_libwolfssl_la_OBJECTS} | sed 's|src_libwolfssl_la-||g' | \
16+ sed 's|\.lo|.o|g' | sed 's|wolfcrypt/src/|${WOLFSSL_DIR}/wolfcrypt/src/|g'
2017
2118.if ${ENABLED_CRYPT_TESTS} == "yes"
2219 OBJS += ${WOLFSSL_DIR}/wolfcrypt/test/test.o
23- # freebsd kernel compiler insists fiducial line vars are unused.
24- CFLAGS+=-Wno-error =unused-const-variable
2520.else
2621 CFLAGS+ =-DNO_CRYPT_TEST
2722.endif
@@ -42,7 +37,10 @@ OBJS != find ${WOLFSSL_DIR}/wolfcrypt/src -path \
4237.endif
4338.include "${SYSDIR}/conf/kmod.mk"
4439
45- # Suppress wolfcrypt/src/misc.c drops const qualifier, and similar.
40+ # Smooth out a few inconsistencies between FreeBSD default compiler flags
41+ # in /usr/src/sys/conf/kern.mk, vs wolfssl harden flags in
42+ # m4/ax_harden_compiler_flags.m4. E.g. some FreeBSD header files shorten
43+ # 64 to 32 bit, and some wolfcrypt functions cast away const.
4644CFLAGS+ = -Wno-unused-function
4745CFLAGS+ = -Wno-cast-qual
4846CFLAGS+ = -Wno-error=cast-qual
0 commit comments