fix dbtest build
authorEric Sandeen <sandeen@redhat.com>
Tue, 30 Dec 2008 22:33:34 +0000 (23:33 +0100)
committerChristoph Hellwig <hch@brick.lst.de>
Tue, 30 Dec 2008 22:33:34 +0000 (23:33 +0100)
At least on my x86_64 RHEL5 box, if gdbm-devel is installed, then the
xfstests build fails with:

gcc dbtest.c -o dbtest -g -O2 -DDEBUG -I../include -DVERSION=\"1.0.0\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall  ../lib/.libs/libtest.a
dbtest.c: In function 'InitDbmLookup':
dbtest.c:147: warning: cast from pointer to integer of different size
dbtest.c:198: warning: cast from pointer to integer of different size
/tmp/ccuekqxe.o: In function `CleanupDbmLookup':
/root/cvs/xfs-cmds-build/xfstests/src/dbtest.c:304: undefined reference to `dbm_close'
/tmp/ccuekqxe.o: In function `DoDbmLookup':
/root/cvs/xfs-cmds-build/xfstests/src/dbtest.c:220: undefined reference to `dbm_fetch'
/root/cvs/xfs-cmds-build/xfstests/src/dbtest.c:264: undefined reference to `dbm_fetch'
/tmp/ccuekqxe.o: In function `InitDbmLookup':
/root/cvs/xfs-cmds-build/xfstests/src/dbtest.c:146: undefined reference to `dbm_open'
/root/cvs/xfs-cmds-build/xfstests/src/dbtest.c:179: undefined reference to `dbm_store'
/root/cvs/xfs-cmds-build/xfstests/src/dbtest.c:192: undefined reference to `dbm_close'
/root/cvs/xfs-cmds-build/xfstests/src/dbtest.c:197: undefined reference to `dbm_open'
collect2: ld returned 1 exit status
gmake[1]: *** [dbtest] Error 1
make: *** [default] Error 2

This patch fixes it for me, but my userspace-fu is weak; does this look ok?

Reviewed-by: Christoph Hellwig <hch@lst.de>
aclocal.m4

index c90451afc7f6cd64421cd33cab8e402da10326e8..52f1c7da0fbfe52a67fb96ca46adb1acad952d48 100644 (file)
@@ -197,8 +197,8 @@ AC_DEFUN([AC_PACKAGE_WANT_NDBM],
 
 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
   [ AC_CHECK_HEADERS([gdbm/ndbm.h], [ have_db=true ], [ have_db=false ])
 
 AC_DEFUN([AC_PACKAGE_WANT_GDBM],
   [ AC_CHECK_HEADERS([gdbm/ndbm.h], [ have_db=true ], [ have_db=false ])
-    if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm.a; then
-       libgdbm="${libexecdir}${libdirsuffix}/libgdbm.a"
+    if test $have_db = true; then
+       libgdbm="-lgdbm"
     fi
     AC_SUBST(libgdbm)
     AC_SUBST(have_db)
     fi
     AC_SUBST(libgdbm)
     AC_SUBST(have_db)