From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH] xfstests: detect gdbm library correctly
Date: Wed, 16 Nov 2011 07:56:37 +1100 [thread overview]
Message-ID: <1321390597-9222-1-git-send-email-david@fromorbit.com> (raw)
From: Dave Chinner <dchinner@redhat.com>
Debian unstable has move the location of the gdbm libraries as part
of it's multi-arch conversion. The libraries are now only found by
the configured library search path in /etc/ld.conf.d, so change the
autoconf macros to test and find the libraries by link tests rather
than hard coding library paths when a header is found.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
m4/package_gdbmdev.m4 | 41 ++++++++++++++++++++++++++++++++++++-----
1 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/m4/package_gdbmdev.m4 b/m4/package_gdbmdev.m4
index 6580fba..c07f75d 100644
--- a/m4/package_gdbmdev.m4
+++ b/m4/package_gdbmdev.m4
@@ -1,19 +1,50 @@
AC_DEFUN([AC_PACKAGE_WANT_NDBM],
[ AC_CHECK_HEADERS(ndbm.h, [ have_db=true ], [ have_db=false ])
+ found=false
libgdbm=""
+
+ if test $have_db = true; then
+ AC_CHECK_LIB(ndbm,dbm_open,found=true,found=false)
+ AC_CHECK_LIB(ndbm,dbm_fetch,,found=false)
+ AC_CHECK_LIB(ndbm,dbm_store,,found=false)
+ AC_CHECK_LIB(ndbm,dbm_close,,found=false)
+
+ if test $found = true; then
+ libgdbm="$ndbm"
+ fi
+ fi
+
AC_SUBST(libgdbm)
AC_SUBST(have_db)
])
AC_DEFUN([AC_PACKAGE_WANT_GDBM],
[ AC_CHECK_HEADERS([gdbm/ndbm.h, gdbm-ndbm.h], [ have_db=true ], [ have_db=false ])
+ found=false
libgdbm=""
- if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm_compat.a; then
- libgdbm="${libexecdir}${libdirsuffix}/libgdbm_compat.a"
- fi
- if test $have_db = true -a -f ${libexecdir}${libdirsuffix}/libgdbm.a; then
- libgdbm="${libgdbm} ${libexecdir}${libdirsuffix}/libgdbm.a"
+
+ if test $have_db = true; then
+ AC_CHECK_LIB(gdbm,dbm_open,found=true,found=false)
+ AC_CHECK_LIB(gdbm,dbm_fetch,,found=false)
+ AC_CHECK_LIB(gdbm,dbm_store,,found=false)
+ AC_CHECK_LIB(gdbm,dbm_close,,found=false)
+
+ if test $found = true; then
+ libgdbm="${libgdbm} -lgdbm"
+ fi
+
+ found="no"
+ AC_CHECK_LIB(gdbm_compat,dbm_open,found=true,found=false)
+ AC_CHECK_LIB(gdbm_compat,dbm_fetch,,found=false)
+ AC_CHECK_LIB(gdbm_compat,dbm_store,,found=false)
+ AC_CHECK_LIB(gdbm_compat,dbm_close,,found="no")
+
+ if test $found = true ; then
+ libgdbm="${libgdbm} -lgdbm_compat"
+ fi
fi
+
AC_SUBST(libgdbm)
AC_SUBST(have_db)
])
+
--
1.7.5.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
reply other threads:[~2011-11-15 20:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1321390597-9222-1-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox