re-enable test 010
RFC PATCH 1/1 re-enable test 010
The dbtest program required for testcase 010 hasn't been build for ages due to various crufty autofoo magic. The patch below just builds it unconditionally for Linux as all distros should have the ndbm compat bits for libgdbm in the same place.
Index: xfstests/src/Makefile
===================================================================
RCS file: /cvs/xfs-cmds/xfstests/src/Makefile,v
retrieving revision 1.43
src/Makefile +2 -10
@@ -15,7 +15,7 @@ TARGETS = dirstress fill fill2 getpagesi LINUX_TARGETS = loggen xfsctl bstat t_mtab getdevicesize \ preallo_rw_pattern_reader preallo_rw_pattern_writer ftrunc trunc \ fs_perms testx looptest locktest unwritten_mmap \ - bulkstat_unlink_test bulkstat_unlink_test_modified + bulkstat_unlink_test bulkstat_unlink_test_modified dbtest t_immutable IRIX_TARGETS = open_unlink
@@ -27,14 +27,6 @@ ifeq ($(PKG_PLATFORM),irix) TARGETS += $(IRIX_TARGETS) endif -ifeq ($(HAVE_DB), true) -TARGETS += dbtest -endif - -ifeq ($(PKG_PLATFORM),linux) -TARGETS += t_immutable -endif - CFILES = $(TARGETS:=.c) LDIRT = $(TARGETS)
@@ -50,7 +42,7 @@ truncfile: truncfile.o $(LIBTEST) $(LINKTEST) $(LIBTEST) $(LDLIBS) dbtest: dbtest.o $(LIBTEST) - $(LINKTEST) $(LIBTEST) $(LIBGDBM) $(LDLIBS) + $(LINKTEST) $(LIBTEST) -lgdbm_compat $(LDLIBS) nametest: nametest.o $(LIBTEST) $(LINKTEST) $(LIBTEST) $(LDLIBS)
Index: xfstests/src/dbtest.c
===================================================================
RCS file: /cvs/xfs-cmds/xfstests/src/dbtest.c,v
retrieving revision 1.6
src/dbtest.c +1 -14
@@ -17,20 +17,7 @@*/ #include "global.h" - -#ifdef HAVE_GDBM_NDBM_H -#include <gdbm/ndbm.h> -#else -#ifdef HAVE_GDBM_H -#include <gdbm.h> -#else -#ifdef HAVE_NDBM_H -#include <ndbm.h> -#else -bozo! -#endif -#endif -#endif +#include <gdbm-ndbm.h> /* #define WorkDir "/xfs" */
Quoted 7 lines · Christoph Hellwig
The dbtest program required for testcase 010 hasn't been build for ages due to various crufty autofoo magic. The patch below just builds it unconditionally for Linux as all distros should have the ndbm compat bits for libgdbm in the same place.
Signed-off-by Christoph Hellwig <[email protected]>
I'd rather we fixed the autofoo magic rather than just chop it out, Gdbm isn't always packaged the same way.
Currently on Suse (gdbm-devel) it doesnt build, with your patch we get build errors. On Rhel (unknown package) it builds fine as is but would break with your patch.
I've been trying to figure out the autotools foo required to fix this, we'll need to add your include/lib layout into the mix too.
Anyone know autotools?
Don
..
gcc -g -O2 -DDEBUG -I../include -DVERSION=\"1.0.0\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -c -o dbtest.o dbtest.c dbtest.c:20:23: error: gdbm-ndbm.h: No such file or directory
donaldd@molten ~/isms/xfs-cmds/xfstests
$ rpm -ql gdbm-devel /usr/include/dbm.h /usr/include/gdbm.h /usr/include/ndbm.h /usr/lib64/libgdbm.a /usr/lib64/libgdbm.la /usr/lib64/libgdbm.so /usr/lib64/libgdbm_compat.a /usr/lib64/libgdbm_compat.la /usr/lib64/libgdbm_compat.so /usr/lib64/libndbm.a /usr/lib64/libndbm.so /usr/share/info/gdbm.info.gz /usr/share/man/man3/gdbm.3.gz
Quoted 70 lines
Index: xfstests/src/Makefile
===================================================================
RCS file: /cvs/xfs-cmds/xfstests/src/Makefile,v
retrieving revision 1.43
diff -u -p -r1.43Makefilesrc/Makefile +2
-10@@ -15,7 +15,7 @@ TARGETS = dirstress fill fill2 getpagesi LINUX_TARGETS = loggen xfsctl bstat t_mtab getdevicesize \ preallo_rw_pattern_reader preallo_rw_pattern_writer ftrunc trunc \ fs_perms testx looptest locktest unwritten_mmap \ - bulkstat_unlink_test bulkstat_unlink_test_modified + bulkstat_unlink_test bulkstat_unlink_test_modified dbtest t_immutable IRIX_TARGETS = open_unlink@@ -27,14 +27,6 @@ ifeq ($(PKG_PLATFORM),irix) TARGETS += $(IRIX_TARGETS) endif -ifeq ($(HAVE_DB), true) -TARGETS += dbtest -endif - -ifeq ($(PKG_PLATFORM),linux) -TARGETS += t_immutable -endif - CFILES = $(TARGETS:=.c) LDIRT = $(TARGETS)@@ -50,7 +42,7 @@ truncfile: truncfile.o $(LIBTEST) $(LINKTEST) $(LIBTEST) $(LDLIBS) dbtest: dbtest.o $(LIBTEST) - $(LINKTEST) $(LIBTEST) $(LIBGDBM) $(LDLIBS) + $(LINKTEST) $(LIBTEST) -lgdbm_compat $(LDLIBS) nametest: nametest.o $(LIBTEST) $(LINKTEST) $(LIBTEST) $(LDLIBS)Index:
xfstests/src/dbtest.c
===================================================================
RCS file: /cvs/xfs-cmds/xfstests/src/dbtest.c,v
retrieving revision 1.6
diff -u -p -r1.6dbtest.csrc/dbtest.c +1
-14@@ -17,20 +17,7 @@*/ #include "global.h" - -#ifdef HAVE_GDBM_NDBM_H -#include <gdbm/ndbm.h> -#else -#ifdef HAVE_GDBM_H -#include <gdbm.h> -#else -#ifdef HAVE_NDBM_H -#include <ndbm.h> -#else -bozo! -#endif -#endif -#endif +#include <gdbm-ndbm.h> /* #define WorkDir "/xfs" */