diff --git a/include/Makefile.am b/include/Makefile.am index ba02142dfab..0e997deaf17 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -26,6 +26,8 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H) endif if CONFIG_KERNEL +if BUILD_LINUX kerneldir = @prefix@/src/zfs-$(VERSION)/include kernel_HEADERS = $(COMMON_H) endif +endif diff --git a/include/os/freebsd/linux/Makefile.am b/include/os/freebsd/linux/Makefile.am index df902b87a15..00cff7f5dc6 100644 --- a/include/os/freebsd/linux/Makefile.am +++ b/include/os/freebsd/linux/Makefile.am @@ -2,7 +2,4 @@ KERNEL_H = \ compiler.h \ types.h -if CONFIG_KERNEL -kerneldir = @prefix@/src/zfs-$(VERSION)/include/linux -kernel_HEADERS = $(KERNEL_H) -endif +noinst_HEADERS = $(KERNEL_H) diff --git a/include/os/freebsd/spl/acl/Makefile.am b/include/os/freebsd/spl/acl/Makefile.am index 3028ebabecb..5c0698d02ea 100644 --- a/include/os/freebsd/spl/acl/Makefile.am +++ b/include/os/freebsd/spl/acl/Makefile.am @@ -1,7 +1,4 @@ KERNEL_H = \ acl_common.h -if CONFIG_KERNEL -kerneldir = @prefix@/src/zfs-$(VERSION)/include/spl/acl -kernel_HEADERS = $(KERNEL_H) -endif +noinst_HEADERS = $(KERNEL_H) diff --git a/include/os/freebsd/spl/rpc/Makefile.am b/include/os/freebsd/spl/rpc/Makefile.am index 13d804fce9b..f6faf4b188b 100644 --- a/include/os/freebsd/spl/rpc/Makefile.am +++ b/include/os/freebsd/spl/rpc/Makefile.am @@ -1,7 +1,4 @@ KERNEL_H = \ xdr.h -if CONFIG_KERNEL -kerneldir = @prefix@/src/zfs-$(VERSION)/include/spl/rpc -kernel_HEADERS = $(KERNEL_H) -endif +noinst_HEADERS = $(KERNEL_H) diff --git a/include/os/freebsd/spl/sys/Makefile.am b/include/os/freebsd/spl/sys/Makefile.am index c95c9d65a71..7803d1af302 100644 --- a/include/os/freebsd/spl/sys/Makefile.am +++ b/include/os/freebsd/spl/sys/Makefile.am @@ -69,7 +69,4 @@ KERNEL_H = \ zmod.h \ zone.h -if CONFIG_KERNEL -kerneldir = @prefix@/src/zfs-$(VERSION)/include/spl/sys -kernel_HEADERS = $(KERNEL_H) -endif +noinst_HEADERS = $(KERNEL_H) diff --git a/include/os/freebsd/zfs/sys/Makefile.am b/include/os/freebsd/zfs/sys/Makefile.am index 8a1f8b31358..a8cfa39f354 100644 --- a/include/os/freebsd/zfs/sys/Makefile.am +++ b/include/os/freebsd/zfs/sys/Makefile.am @@ -11,7 +11,4 @@ KERNEL_H = \ zfs_znode_impl.h \ zpl.h -if CONFIG_KERNEL -kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys -kernel_HEADERS = $(KERNEL_H) -endif +noinst_HEADERS = $(KERNEL_H) diff --git a/include/os/linux/kernel/linux/Makefile.am b/include/os/linux/kernel/linux/Makefile.am index 86b253304d5..6ff0df506d9 100644 --- a/include/os/linux/kernel/linux/Makefile.am +++ b/include/os/linux/kernel/linux/Makefile.am @@ -15,6 +15,8 @@ KERNEL_H = \ compiler_compat.h if CONFIG_KERNEL +if BUILD_LINUX kerneldir = @prefix@/src/zfs-$(VERSION)/include/linux kernel_HEADERS = $(KERNEL_H) endif +endif diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am index 3d7bd191bf0..ce781aa4cff 100644 --- a/include/sys/Makefile.am +++ b/include/sys/Makefile.am @@ -139,6 +139,8 @@ libzfs_HEADERS = $(COMMON_H) endif if CONFIG_KERNEL +if BUILD_LINUX kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys kernel_HEADERS = $(COMMON_H) $(KERNEL_H) endif +endif diff --git a/include/sys/crypto/Makefile.am b/include/sys/crypto/Makefile.am index 79a5adfae61..eb31f6a4574 100644 --- a/include/sys/crypto/Makefile.am +++ b/include/sys/crypto/Makefile.am @@ -9,6 +9,8 @@ libzfs_HEADERS = $(COMMON_H) endif if CONFIG_KERNEL +if BUILD_LINUX kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/crypto kernel_HEADERS = $(COMMON_H) endif +endif diff --git a/include/sys/fm/Makefile.am b/include/sys/fm/Makefile.am index fd735e1878c..7c6c3d49b6e 100644 --- a/include/sys/fm/Makefile.am +++ b/include/sys/fm/Makefile.am @@ -10,6 +10,8 @@ libzfs_HEADERS = $(COMMON_H) endif if CONFIG_KERNEL +if BUILD_LINUX kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm kernel_HEADERS = $(COMMON_H) endif +endif diff --git a/include/sys/fm/fs/Makefile.am b/include/sys/fm/fs/Makefile.am index 7f33a1532d4..a662753a9e9 100644 --- a/include/sys/fm/fs/Makefile.am +++ b/include/sys/fm/fs/Makefile.am @@ -7,6 +7,8 @@ libzfs_HEADERS = $(COMMON_H) endif if CONFIG_KERNEL +if BUILD_LINUX kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm/fs kernel_HEADERS = $(COMMON_H) endif +endif diff --git a/include/sys/fs/Makefile.am b/include/sys/fs/Makefile.am index 35174578654..6a93053c8e2 100644 --- a/include/sys/fs/Makefile.am +++ b/include/sys/fs/Makefile.am @@ -7,6 +7,8 @@ libzfs_HEADERS = $(COMMON_H) endif if CONFIG_KERNEL +if BUILD_LINUX kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fs kernel_HEADERS = $(COMMON_H) endif +endif diff --git a/include/sys/lua/Makefile.am b/include/sys/lua/Makefile.am index e9d1185a499..8b4dafaa8cf 100644 --- a/include/sys/lua/Makefile.am +++ b/include/sys/lua/Makefile.am @@ -10,6 +10,8 @@ libzfs_HEADERS = $(COMMON_H) endif if CONFIG_KERNEL +if BUILD_LINUX kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/lua kernel_HEADERS = $(COMMON_H) endif +endif diff --git a/include/sys/sysevent/Makefile.am b/include/sys/sysevent/Makefile.am index 18949913ee8..64e53763951 100644 --- a/include/sys/sysevent/Makefile.am +++ b/include/sys/sysevent/Makefile.am @@ -8,6 +8,8 @@ libzfs_HEADERS = $(COMMON_H) endif if CONFIG_KERNEL +if BUILD_LINUX kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/sysevent kernel_HEADERS = $(COMMON_H) endif +endif