Whamcloud - gitweb
LU-18687 compat: move include and simplify lustre_compat 94/58694/13
authorTimothy Day <timday@amazon.com>
Sat, 5 Apr 2025 21:53:45 +0000 (17:53 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 7 May 2025 21:11:39 +0000 (21:11 +0000)
Move the headers to the top-level. This will simplify the
comiler command-line, isolate autotools dependencies to the
headers, and allow for lustre_compat to use plain Makefiles
(similar to Linux).

Test-Parameters: trivial
Fixes: 74faf91f44 ("LU-18687 compat: move xarray to lustre_compat")
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I851fa183c14a2661bb1eca91d94b7d757f9e575a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58694
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
17 files changed:
autoMakefile.am
config/lustre-build.m4
config/lustre-toolchain.m4
include/lustre_compat/linux/generic-radix-tree.h [moved from lustre_compat/include/lustre_compat/linux/generic-radix-tree.h with 100% similarity]
include/lustre_compat/linux/glob.h [moved from lustre_compat/include/lustre_compat/linux/glob.h with 100% similarity]
include/lustre_compat/linux/xarray.h [moved from lustre_compat/include/lustre_compat/linux/xarray.h with 100% similarity]
libcfs/libcfs/Makefile.in
lustre_compat/autoMakefile.am [deleted file]
lustre_compat/include/.gitignore [deleted file]
lustre_compat/include/Makefile.am [deleted file]
lustre_compat/include/lustre_compat/.gitignore [deleted file]
lustre_compat/include/lustre_compat/Makefile.am [deleted file]
lustre_compat/include/lustre_compat/linux/.gitignore [deleted file]
lustre_compat/include/lustre_compat/linux/Makefile.am [deleted file]
lustre_compat/lib/Makefile [moved from lustre_compat/Makefile.in with 64% similarity]
lustre_compat/lib/Makefile.in [deleted file]
lustre_compat/lib/autoMakefile.am [deleted file]

index 3e88adb..543db02 100644 (file)
@@ -14,7 +14,6 @@ SUBDIRS := @LDISKFS_SUBDIR@ \
        . \
        @LUSTREIOKIT_SUBDIR@ \
        Documentation \
-       lustre_compat \
        libcfs \
        lnet \
        lustre
@@ -22,7 +21,6 @@ SUBDIRS := @LDISKFS_SUBDIR@ \
 DIST_SUBDIRS := ldiskfs \
        lustre-iokit \
        Documentation \
-       lustre_compat \
        libcfs \
        lnet \
        lustre \
@@ -177,6 +175,10 @@ undef.h: config.h.in
        grep -v config.h.in config.h.in > $@
 
 dist-hook: undef.h
+       find include/ -type f \( -name "*.h" \) \
+               -exec cp --parents {} $(distdir) \;
+       find lustre_compat/ -type f \( -name "*.c" -o -iname "Makefile" \) \
+               -exec cp --parents {} $(distdir) \;
        find $(distdir) -name .deps -o \
                        -name CVS -o \
                        -name .svn -o \
index 2217315..08a79ff 100644 (file)
@@ -439,23 +439,6 @@ AC_DEFUN([LB_CONFIG_FILES], [
 ])
 
 #
-# LB_COMPAT_CONFIG_FILES
-#
-# build-specific config files (lustre_compat)
-#
-AC_DEFUN([LB_COMPAT_CONFIG_FILES], [
-       AC_CONFIG_FILES(
-               lustre_compat/Makefile
-               lustre_compat/lib/Makefile
-               lustre_compat/autoMakefile
-               lustre_compat/lib/autoMakefile
-               lustre_compat/include/Makefile
-               lustre_compat/include/lustre_compat/Makefile
-               lustre_compat/include/lustre_compat/linux/Makefile
-       )
-])
-
-#
 # LB_CONFIG_SERVERS
 #
 AC_DEFUN([LB_CONFIG_SERVERS], [
@@ -715,7 +698,6 @@ LB_CONFIG_HEADERS
 LPLUG_CONFIGURE
 LIBCFS_CONFIG_FILES
 LB_CONFIG_FILES
-LB_COMPAT_CONFIG_FILES
 LN_CONFIG_FILES
 LC_CONFIG_FILES
 LPLUG_CONFIG_FILES
index 1e9f710..1550365 100644 (file)
@@ -97,7 +97,7 @@ CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
 AC_SUBST(CCASFLAGS)
 
 # everyone builds against lnet and lustre kernel headers
-EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/libcfs/include -I$PWD/libcfs/include/libcfs -I$PWD/lnet/include/uapi -I$PWD/lnet/include -I$PWD/lustre/include/uapi -I$PWD/lustre/include -I$PWD/lustre_compat/include"
+EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/libcfs/include -I$PWD/libcfs/include/libcfs -I$PWD/lnet/include/uapi -I$PWD/lnet/include -I$PWD/lustre/include/uapi -I$PWD/lustre/include -I$PWD/include"
 AC_SUBST(EXTRA_KCFLAGS)
 ]) # LTC_PROG_CC
 
index 81c6cc6..59d7e56 100644 (file)
@@ -9,7 +9,7 @@ MODULES = libcfs
 COMPAT := @top_srcdir@/lustre_compat/lib/
 
 libcfs_dir := $(dir $(lastword $(MAKEFILE_LIST)))
--include $(libcfs_dir)/../../lustre_compat/lib/Makefile
+include $(libcfs_dir)/../../lustre_compat/lib/Makefile
 
 libcfs-linux-objs := linux-prim.o
 libcfs-linux-objs += linux-hash.o
@@ -17,6 +17,8 @@ libcfs-linux-objs += linux-wait.o
 
 libcfs-compat-objs += $(patsubst %,$(COMPAT)%,$(compat_objs))
 
+EXTRA_DIST = $(libcfs-compat-objs:.o=.c)
+
 libcfs-crypto-objs := crypto.o fname.o hkdf.o hooks.o keyring.o
 libcfs-crypto-objs += keysetup.o keysetup_v1.o policy.o
 
diff --git a/lustre_compat/autoMakefile.am b/lustre_compat/autoMakefile.am
deleted file mode 100644 (file)
index 5d9eb34..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-#
-# This file is part of Lustre, http://www.lustre.org/
-#
-
-SUBDIRS = lib include
diff --git a/lustre_compat/include/.gitignore b/lustre_compat/include/.gitignore
deleted file mode 100644 (file)
index 10a7e8d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/Makefile.in
diff --git a/lustre_compat/include/Makefile.am b/lustre_compat/include/Makefile.am
deleted file mode 100644 (file)
index 8303353..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-#
-# This file is part of Lustre, http://www.lustre.org/
-#
-
-SUBDIRS = lustre_compat
-DIST_SUBDIRS = lustre_compat
diff --git a/lustre_compat/include/lustre_compat/.gitignore b/lustre_compat/include/lustre_compat/.gitignore
deleted file mode 100644 (file)
index 10a7e8d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/Makefile.in
diff --git a/lustre_compat/include/lustre_compat/Makefile.am b/lustre_compat/include/lustre_compat/Makefile.am
deleted file mode 100644 (file)
index d21ce25..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-#
-# This file is part of Lustre, http://www.lustre.org/
-#
-
-SUBDIRS = linux
-DIST_SUBDIRS = linux
diff --git a/lustre_compat/include/lustre_compat/linux/.gitignore b/lustre_compat/include/lustre_compat/linux/.gitignore
deleted file mode 100644 (file)
index 10a7e8d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/Makefile.in
diff --git a/lustre_compat/include/lustre_compat/linux/Makefile.am b/lustre_compat/include/lustre_compat/linux/Makefile.am
deleted file mode 100644 (file)
index da9f069..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-#
-# This file is part of Lustre, http://www.lustre.org/
-#
-
-EXTRA_DIST = xarray.h glob.h generic-radix-tree.h
similarity index 64%
rename from lustre_compat/Makefile.in
rename to lustre_compat/lib/Makefile
index dadff32..6a36e8b 100644 (file)
@@ -4,6 +4,4 @@
 # This file is part of Lustre, http://www.lustre.org/
 #
 
-obj-m += lib/
-
-@INCLUDE_RULES@
+compat_objs := xarray.o glob.o generic-radix-tree.o
diff --git a/lustre_compat/lib/Makefile.in b/lustre_compat/lib/Makefile.in
deleted file mode 100644 (file)
index baf5240..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-#
-# This file is part of Lustre, http://www.lustre.org/
-#
-
-compat_objs := xarray.o glob.o generic-radix-tree.o
-
-EXTRA_DIST = $(compat_objs:.o=.c)
-
-ifneq "$(MODULES)" "libcfs"
-@INCLUDE_RULES@
-endif
diff --git a/lustre_compat/lib/autoMakefile.am b/lustre_compat/lib/autoMakefile.am
deleted file mode 100644 (file)
index 3b1a5dc..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-#
-# This file is part of Lustre, http://www.lustre.org/
-#
-
-MOSTLYCLEANFILES := @MOSTLYCLEANFILES@