stans: Narrow the scope of includes and other flags

CFLAGS+= here affects *ALL* libsa files being built. However, this is
only needed for zfs.c, so define it only for this. Also, use the defines
from defs.mk. Move all the zfs.c include hacks together. Also, move the
-Wformat -Wall warnings that were added to CFLAGS+= to the individual
files instead for the same reason.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2022-07-08 09:42:34 -06:00
parent 0e5ac0ad03
commit 451ac17a50

View File

@ -30,6 +30,7 @@ ZFS_EARLY= -I${ZFSOSINC} \
.for i in ${ZFS_SRC} ${ZSTD_SRC}
CFLAGS.$i+= -include ${ZFSOSINC}/spl/sys/ccompile.h
CFLAGS.$i+= -Wformat -Wall
.endfor
CFLAGS_EARLY.list.c+= ${ZFS_EARLY}
@ -39,7 +40,9 @@ CFLAGS_EARLY.zstd_shim.c+= ${ZFS_EARLY}
# the zfs code that need to be unified.
CFLAGS.nvlist.c+= -I${ZFSOSINC}/spl
CFLAGS.zfs.c+= -I${ZFSOSINC}/spl \
-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 \
-I${ZFSOSINC}/zfs \
-I${OZFS}/include
#
# ZSTD coding style has some issues, so suppress clang's warnings. Also, zstd's
@ -53,9 +56,3 @@ CFLAGS.zstd_shim.c+= -DIN_BASE -DIN_LIBSA -I${OZFS}/include
# Do not unroll skein loops, reduce code size
CFLAGS.skein_block.c+= -DSKEIN_LOOP=111
CFLAGS+= -I${SYSDIR}/contrib/openzfs/include
CFLAGS+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs
CFLAGS.zfs.c+= -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4
CFLAGS+= -Wformat -Wall