diff options
author | Stan Cox <scox@redhat.com> | 2010-02-26 14:58:57 -0500 |
---|---|---|
committer | Stan Cox <scox@redhat.com> | 2010-02-26 14:58:57 -0500 |
commit | be709d4c778321de3efc4aadd18af6033ebb932f (patch) | |
tree | a0c467bbde41d71a0cacb8b35b97310d62b46620 | |
parent | 57a56e00067b4546bb0da15fb00653ee0341f5af (diff) | |
download | systemtap-steved-be709d4c778321de3efc4aadd18af6033ebb932f.tar.gz systemtap-steved-be709d4c778321de3efc4aadd18af6033ebb932f.tar.xz systemtap-steved-be709d4c778321de3efc4aadd18af6033ebb932f.zip |
Add package check for librpm
* configure (have_librpm): Define.
* configure.ac: Regenerate.
-rwxr-xr-x | configure | 76 | ||||
-rw-r--r-- | configure.ac | 2 |
2 files changed, 77 insertions, 1 deletions
@@ -647,6 +647,8 @@ stap_LIBS elfutils_abs_srcdir BUILD_ELFUTILS_FALSE BUILD_ELFUTILS_TRUE +librpm_LIBS +librpm_CFLAGS BUILD_GRAPHER_FALSE BUILD_GRAPHER_TRUE CXXCPP @@ -821,7 +823,9 @@ gtkmm_CFLAGS gtkmm_LIBS libglade_CFLAGS libglade_LIBS -CXXCPP' +CXXCPP +librpm_CFLAGS +librpm_LIBS' ac_subdirs_all='testsuite' # Initialize some variables set by options. @@ -1511,6 +1515,9 @@ Some influential environment variables: libglade_LIBS linker flags for libglade, overriding pkg-config CXXCPP C++ preprocessor + librpm_CFLAGS + C compiler flags for librpm, overriding pkg-config + librpm_LIBS linker flags for librpm, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -8166,6 +8173,73 @@ fi if test "$with_rpm" != "no"; then +pkg_failed=no +{ $as_echo "$as_me:$LINENO: checking for librpm" >&5 +$as_echo_n "checking for librpm... " >&6; } + +if test -n "$librpm_CFLAGS"; then + pkg_cv_librpm_CFLAGS="$librpm_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"rpm\"") >&5 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_librpm_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$librpm_LIBS"; then + pkg_cv_librpm_LIBS="$librpm_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"rpm\"") >&5 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_librpm_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + librpm_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1` + else + librpm_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$librpm_PKG_ERRORS" >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + have_librpm="no" +elif test $pkg_failed = untried; then + have_librpm="no" +else + librpm_CFLAGS=$pkg_cv_librpm_CFLAGS + librpm_LIBS=$pkg_cv_librpm_LIBS + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + have_librpm="yes" +fi + { $as_echo "$as_me:$LINENO: checking for rpmtsInitIterator in -lrpm" >&5 $as_echo_n "checking for rpmtsInitIterator in -lrpm... " >&6; } if test "${ac_cv_lib_rpm_rpmtsInitIterator+set}" = set; then diff --git a/configure.ac b/configure.ac index 090d8dce..d13255d6 100644 --- a/configure.ac +++ b/configure.ac @@ -377,6 +377,8 @@ AC_ARG_WITH([rpm], [AS_HELP_STRING([--with-rpm], [query rpm database for missing debuginfos])], [], [with_rpm="auto"]) if test "$with_rpm" != "no"; then + PKG_CHECK_MODULES([librpm], [rpm], + have_librpm="yes", have_librpm="no") AC_CHECK_LIB(rpm, rpmtsInitIterator) if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then AC_MSG_ERROR([cannot find librpm]) |