From ad44a98126256123531e97e91ea7577f116bbe70 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 16 Feb 2009 13:08:06 +0100 Subject: [PATCH] configure.in: Improve checking for libstatgrab using pkg-config. --- configure.in | 58 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/configure.in b/configure.in index 2b4ab736..9a467d8f 100644 --- a/configure.in +++ b/configure.in @@ -2285,41 +2285,43 @@ with_libstatgrab_cflags="" with_libstatgrab_ldflags="" AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])], [ - if test "x$withval" != "xno" \ - && test "x$withval" != "xyes" - then - with_libstatgrab_cflags="-I$withval/include" - with_libstatgrab_ldflags="-L$withval/lib" - with_libstatgrab="yes" - else - with_libstatgrab="$withval" - fi -], + if test "x$withval" != "xno" \ + && test "x$withval" != "xyes" + then + with_libstatgrab_cflags="-I$withval/include" + with_libstatgrab_ldflags="-L$withval/lib -lstatgrab" + with_libstatgrab="yes" + with_libstatgrab_pkg_config="no" + else + with_libstatgrab="$withval" + with_libstatgrab_pkg_config="yes" + fi + ], [ - if test "x$ac_system" = "xunknown" - then - with_libstatgrab="yes" - else - with_libstatgrab="no" - fi + with_libstatgrab="yes" + with_libstatgrab_pkg_config="yes" ]) -with_libstatgrab_pkg_config="yes" + if test "x$with_libstatgrab" = "xyes" \ - && test "x$PKG_CONFIG" != "x" + && test "x$with_libstatgrab_pkg_config" = "xyes" then - AC_MSG_CHECKING([pkg-config for libstatgrab]) - temp_result="found" - $PKG_CONFIG --exists libstatgrab 2>/dev/null - if test "$?" != "0" + if test "x$PKG_CONFIG" != "x" then + AC_MSG_CHECKING([pkg-config for libstatgrab]) + temp_result="found" + $PKG_CONFIG --exists libstatgrab 2>/dev/null + if test "$?" != "0" + then + with_libstatgrab_pkg_config="no" + with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)" + temp_result="not found" + fi + AC_MSG_RESULT([$temp_result]) + else + AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.]) with_libstatgrab_pkg_config="no" - temp_result="not found" + with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab" fi - AC_MSG_RESULT([$temp_result]) -else - AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.]) - with_libstatgrab_pkg_config="no" - with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab" fi if test "x$with_libstatgrab" = "xyes" \ -- 2.11.0