summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2010-02-25 15:22:14 -0500
committerFrank Ch. Eigler <fche@elastic.org>2010-02-25 15:23:51 -0500
commitbcfa72ed644f9644eaa3fa52e66449aedfe47974 (patch)
treea4e492fd26dce738ad27bdbd1369b611fa467b89
parent4bfb04268d548c4d711784de6b129aef2fc1577b (diff)
downloadsystemtap-steved-bcfa72ed644f9644eaa3fa52e66449aedfe47974.tar.gz
systemtap-steved-bcfa72ed644f9644eaa3fa52e66449aedfe47974.tar.xz
systemtap-steved-bcfa72ed644f9644eaa3fa52e66449aedfe47974.zip
PR11114: simplify librpm autoconf
* configure.ac: Check for -lrpm with simple AC_CHECK_LIB. * Makefile.am: Forget about @rpm_LIBS@
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in7
-rw-r--r--config.in5
-rwxr-xr-xconfigure456
-rw-r--r--configure.ac197
-rw-r--r--doc/Makefile.in3
-rw-r--r--doc/SystemTap_Tapset_Reference/Makefile.in3
-rw-r--r--doc/beginners/Makefile.in3
-rw-r--r--grapher/Makefile.in3
9 files changed, 49 insertions, 630 deletions
diff --git a/Makefile.am b/Makefile.am
index 3ff38def..cade1fee 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -57,7 +57,7 @@ stap_SOURCES = main.cxx \
tapset-perfmon.cxx tapset-mark.cxx tapset-itrace.cxx \
tapset-utrace.cxx task_finder.cxx dwflpp.cxx rpm_finder.cxx \
setupdwfl.cxx
-stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ @rpm_LIBS@
+stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@
stap_DEPENDENCIES =
endif
diff --git a/Makefile.in b/Makefile.in
index cfce72ca..5c832c2b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -91,7 +91,7 @@ DIST_COMMON = INSTALL NEWS README AUTHORS $(srcdir)/Makefile.in \
$(top_srcdir)/initscript/systemtap.in \
$(top_srcdir)/initscript/stap-server.in $(srcdir)/dtrace.1.in \
$(srcdir)/run-stap.in $(srcdir)/run-staprun.in \
- $(srcdir)/dtrace.in depcomp depcomp $(oldinclude_HEADERS)
+ $(srcdir)/dtrace.in depcomp $(oldinclude_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -326,8 +326,6 @@ PIELDFLAGS = @PIELDFLAGS@
PKG_CONFIG = @PKG_CONFIG@
PUBLICAN_BRAND = @PUBLICAN_BRAND@
RANLIB = @RANLIB@
-RPM_CFLAGS = @RPM_CFLAGS@
-RPM_LIBS = @RPM_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -382,7 +380,6 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
-rpm_LIBS = @rpm_LIBS@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sqlite3_LIBS = @sqlite3_LIBS@
@@ -423,7 +420,7 @@ oldinclude_HEADERS = includes/sys/sdt.h
@BUILD_TRANSLATOR_TRUE@ tapset-utrace.cxx task_finder.cxx dwflpp.cxx rpm_finder.cxx \
@BUILD_TRANSLATOR_TRUE@ setupdwfl.cxx
-@BUILD_TRANSLATOR_TRUE@stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ @rpm_LIBS@
+@BUILD_TRANSLATOR_TRUE@stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@
@BUILD_TRANSLATOR_TRUE@stap_DEPENDENCIES = $(am__append_17)
# Arrange for git_version.h to be regenerated at every "make".
diff --git a/config.in b/config.in
index e19c1acb..bbce7531 100644
--- a/config.in
+++ b/config.in
@@ -3,9 +3,6 @@
/* Configuration/build date */
#undef DATE
-/* librpm version specific library name to dlopen. */
-#undef DLOPEN_LIBRPM
-
/* make -P prologue-searching default */
#undef ENABLE_PROLOGUES
@@ -33,7 +30,7 @@
/* Define to 1 if you have the `pfm' library (-lpfm). */
#undef HAVE_LIBPFM
-/* Define if librpm library is being used. */
+/* Define to 1 if you have the `rpm' library (-lrpm). */
#undef HAVE_LIBRPM
/* Define to 1 if you have the `sqlite3' library (-lsqlite3). */
diff --git a/configure b/configure
index e032e262..d5890ac5 100755
--- a/configure
+++ b/configure
@@ -647,9 +647,6 @@ stap_LIBS
elfutils_abs_srcdir
BUILD_ELFUTILS_FALSE
BUILD_ELFUTILS_TRUE
-RPM_LIBS
-RPM_CFLAGS
-rpm_LIBS
BUILD_GRAPHER_FALSE
BUILD_GRAPHER_TRUE
CXXCPP
@@ -824,9 +821,7 @@ gtkmm_CFLAGS
gtkmm_LIBS
libglade_CFLAGS
libglade_LIBS
-CXXCPP
-RPM_CFLAGS
-RPM_LIBS'
+CXXCPP'
ac_subdirs_all='testsuite'
# Initialize some variables set by options.
@@ -1492,8 +1487,7 @@ Optional Packages:
--with-publican-brand=BRAND
building publican documentation guides using given
brand (defaults to "fedora").
- --with-rpm query rpm database for missing debuginfos [yes/no,
- def. auto=librpm.so]
+ --with-rpm query rpm database for missing debuginfos
--with-elfutils=DIRECTORY
find elfutils source code in DIRECTORY
@@ -1517,8 +1511,6 @@ Some influential environment variables:
libglade_LIBS
linker flags for libglade, overriding pkg-config
CXXCPP C++ preprocessor
- RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
- RPM_LIBS linker flags for RPM, 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.
@@ -8164,22 +8156,6 @@ fi
-# Integration with rpm library to support missing debuginfo suggestions.
-# --without-rpm: Disable any rpm support.
-# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
-# Even with runtime missing `libname.so' GDB will still other run correctly.
-# Missing `libname.so' during ./configure will abort the configuration.
-# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
-# minor version first such as `librpm-4.6.so' as minor version differences
-# mean API+ABI incompatibility. If the specific match versioned library name
-# could not be found still open dynamically at least `librpm.so'.
-# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
-# to find librpm for compilation-time linking by pkg-config. GDB binary will
-# be probably linked with the version specific library (as `librpm-4.6.so').
-# Failure to find librpm by pkg-config will abort the configuration.
-# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
-# cannot find librpm use to the rpmless compilation (like `--without-rpm').
-
# Check whether --with-rpm was given.
if test "${with_rpm+set}" = set; then
@@ -8188,127 +8164,38 @@ else
with_rpm="auto"
fi
+if test "$with_rpm" != "no"; then
-
-
-if test "x$with_rpm" != "xno"; then
- if test "x$with_rpm" = "xyes"; then
- LIBRPM="librpm.so"
- RPM_REQUIRE=true
- DLOPEN_REQUIRE=false
- elif test "x$with_rpm" = "xauto"; then
- LIBRPM="librpm.so"
- RPM_REQUIRE=false
- DLOPEN_REQUIRE=false
- else
- LIBRPM="$with_rpm"
- RPM_REQUIRE=true
- DLOPEN_REQUIRE=true
- fi
- LIBRPM_STRING='"'"$LIBRPM"'"'
-
- { $as_echo "$as_me:$LINENO: checking specific librpm version" >&5
-$as_echo_n "checking specific librpm version... " >&6; }
- HAVE_DLOPEN_LIBRPM=false
- save_LIBS="$LIBS"
- LIBS="$LIBS -ldl"
- if test "$cross_compiling" = yes; then
- { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }; }
+{ $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
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrpm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <rpm/rpmlib.h>
-#include <dlfcn.h>
-#include <errno.h>
-
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rpmtsInitIterator ();
int
main ()
{
-
- void *h;
- const char *const *rpmverp;
- FILE *f;
-
- f = fopen ("conftest.out", "w");
- if (!f)
- {
- fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
- strerror (errno));
- return 1;
- }
- h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
- if (!h)
- {
- fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
- return 1;
- }
- rpmverp = dlsym (h, "RPMVERSION");
- if (!rpmverp)
- {
- fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
- return 1;
- }
- fprintf (stderr, "RPMVERSION is: \"");
- fprintf (stderr, "%s\"\n", *rpmverp);
-
- /* Try to find the specific librpm version only for "librpm.so" as we do
- not know how to assemble the version string otherwise. */
-
- if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
- {
- fprintf (f, "%s\n", $LIBRPM_STRING);
- return 0;
- }
- else
- {
- char *h2_name;
- void *h2;
- int major, minor;
-
- if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
- {
- fprintf (stderr, "Unable to parse RPMVERSION.\n");
- fprintf (f, "%s\n", $LIBRPM_STRING);
- return 0;
- }
- /* Avoid the square brackets by malloc. */
- h2_name = malloc (64);
- sprintf (h2_name, "librpm-%d.%d.so", major, minor);
- h2 = dlopen (h2_name, RTLD_LAZY);
- if (!h2)
- {
- fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
- fprintf (f, "%s\n", $LIBRPM_STRING);
- return 0;
- }
- if (h2 != h)
- {
- fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
- $LIBRPM_STRING, h2_name);
- fprintf (f, "%s\n", $LIBRPM_STRING);
- return 0;
- }
- /* Found the valid .so name with a specific version. */
- fprintf (f, "%s\n", h2_name);
- return 0;
- }
-
+return rpmtsInitIterator ();
;
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
+rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -8316,89 +8203,7 @@ case "(($ac_try" in
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
- DLOPEN_LIBRPM="`cat conftest.out`"
- if test "x$DLOPEN_LIBRPM" != "x"; then
- HAVE_DLOPEN_LIBRPM=true
- { $as_echo "$as_me:$LINENO: result: $DLOPEN_LIBRPM" >&5
-$as_echo "$DLOPEN_LIBRPM" >&6; }
- fi
-
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
- rm -f conftest.out
-
-
-
-
- if $HAVE_DLOPEN_LIBRPM; then
-
- { $as_echo "$as_me:$LINENO: checking rpm library API compatibility" >&5
-$as_echo_n "checking rpm library API compatibility... " >&6; }
- # The compilation requires -Werror to verify anything.
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Werror"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Duplicate here the declarations to verify they match "symfile.c". */
-#include <rpm/rpmlib.h>
-#include <rpm/rpmts.h>
-#include <rpm/rpmdb.h>
-#include <rpm/header.h>
-extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-extern int rpmReadConfigFiles(const char * file, const char * target);
-extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-extern rpmts rpmtsCreate(void);
-extern rpmts rpmtsFree(rpmts ts);
-extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
- const void * keyp, size_t keylen);
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
@@ -8407,221 +8212,38 @@ $as_echo "$ac_try_echo") >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
-
- LIBRPM_COMPAT=true
- rpm_LIBS=-lrpm
- { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_rpm_rpmtsInitIterator=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
- LIBRPM_COMPAT=false
- rpm_LIBS=
- { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-
+ ac_cv_lib_rpm_rpmtsInitIterator=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
-
- if ! $LIBRPM_COMPAT; then
- HAVE_DLOPEN_LIBRPM=false
- fi
- fi
-
- if $HAVE_DLOPEN_LIBRPM; then
- DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
-
-cat >>confdefs.h <<_ACEOF
-#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBRPM 1
-_ACEOF
-
- else
- { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
- LIBS="$save_LIBS"
- if $DLOPEN_REQUIRE; then
- { { $as_echo "$as_me:$LINENO: error: Specific name $LIBRPM was requested but it could not be opened." >&5
-$as_echo "$as_me: error: Specific name $LIBRPM was requested but it could not be opened." >&2;}
- { (exit 1); exit 1; }; }
- fi
-
-pkg_failed=no
-{ $as_echo "$as_me:$LINENO: checking for RPM" >&5
-$as_echo_n "checking for RPM... " >&6; }
-
-if test -n "$RPM_CFLAGS"; then
- pkg_cv_RPM_CFLAGS="$RPM_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_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$RPM_LIBS"; then
- pkg_cv_RPM_LIBS="$RPM_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_RPM_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
- RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1`
- else
- RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$RPM_PKG_ERRORS" >&5
-
- { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
- HAVE_LIBRPM=false
-elif test $pkg_failed = untried; then
- HAVE_LIBRPM=false
-else
- RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
- RPM_LIBS=$pkg_cv_RPM_LIBS
- { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
- HAVE_LIBRPM=true
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-
- if $HAVE_LIBRPM; then
-
- { $as_echo "$as_me:$LINENO: checking rpm library API compatibility" >&5
-$as_echo_n "checking rpm library API compatibility... " >&6; }
- # The compilation requires -Werror to verify anything.
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Werror"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Duplicate here the declarations to verify they match "symfile.c". */
-#include <rpm/rpmlib.h>
-#include <rpm/rpmts.h>
-#include <rpm/rpmdb.h>
-#include <rpm/header.h>
-extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-extern int rpmReadConfigFiles(const char * file, const char * target);
-extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-extern rpmts rpmtsCreate(void);
-extern rpmts rpmtsFree(rpmts ts);
-extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
- const void * keyp, size_t keylen);
-
-int
-main ()
-{
-
- ;
- return 0;
-}
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_rpm_rpmtsInitIterator" >&5
+$as_echo "$ac_cv_lib_rpm_rpmtsInitIterator" >&6; }
+if test "x$ac_cv_lib_rpm_rpmtsInitIterator" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRPM 1
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
-
- LIBRPM_COMPAT=true
- rpm_LIBS=-lrpm
- { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
- LIBRPM_COMPAT=false
- rpm_LIBS=
- { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+ LIBS="-lrpm $LIBS"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
-
- if ! $LIBRPM_COMPAT; then
- HAVE_LIBRPM=false
- RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
- fi
- fi
-
- if $HAVE_LIBRPM; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBRPM 1
-_ACEOF
-
- CFLAGS="$CFLAGS $RPM_CFLAGS"
- LIBS="$LIBS $RPM_LIBS"
- else
- if $RPM_REQUIRE; then
- { { $as_echo "$as_me:$LINENO: error: $RPM_PKG_ERRORS" >&5
-$as_echo "$as_me: error: $RPM_PKG_ERRORS" >&2;}
+ if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then
+ { { $as_echo "$as_me:$LINENO: error: cannot find librpm" >&5
+$as_echo "$as_me: error: cannot find librpm" >&2;}
{ (exit 1); exit 1; }; }
- else
- { $as_echo "$as_me:$LINENO: WARNING: $RPM_PKG_ERRORS" >&5
-$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
- fi
- fi
fi
fi
diff --git a/configure.ac b/configure.ac
index 99895137..090d8dce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -372,199 +372,14 @@ dnl requirements are installed, enable the grapher.
AM_CONDITIONAL([BUILD_GRAPHER], [test "x${have_grapher_reqs}" == "xyes" -a x"$enable_grapher" != "xno"])
-# Integration with rpm library to support missing debuginfo suggestions.
-# --without-rpm: Disable any rpm support.
-# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
-# Even with runtime missing `libname.so' GDB will still other run correctly.
-# Missing `libname.so' during ./configure will abort the configuration.
-# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
-# minor version first such as `librpm-4.6.so' as minor version differences
-# mean API+ABI incompatibility. If the specific match versioned library name
-# could not be found still open dynamically at least `librpm.so'.
-# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
-# to find librpm for compilation-time linking by pkg-config. GDB binary will
-# be probably linked with the version specific library (as `librpm-4.6.so').
-# Failure to find librpm by pkg-config will abort the configuration.
-# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
-# cannot find librpm use to the rpmless compilation (like `--without-rpm').
-
+dnl Look for librpm.
AC_ARG_WITH([rpm],
[AS_HELP_STRING([--with-rpm],
- [query rpm database for missing debuginfos @<:@yes/no, def. auto=librpm.so@:>@])], [], [with_rpm="auto"])
-
-m4_pattern_allow([^AC_MSG_ERROR$])
-m4_pattern_allow([^AC_MSG_WARN$])
-if test "x$with_rpm" != "xno"; then
- if test "x$with_rpm" = "xyes"; then
- LIBRPM="librpm.so"
- RPM_REQUIRE=true
- DLOPEN_REQUIRE=false
- elif test "x$with_rpm" = "xauto"; then
- LIBRPM="librpm.so"
- RPM_REQUIRE=false
- DLOPEN_REQUIRE=false
- else
- LIBRPM="$with_rpm"
- RPM_REQUIRE=true
- DLOPEN_REQUIRE=true
- fi
- LIBRPM_STRING='"'"$LIBRPM"'"'
-
- AC_MSG_CHECKING([specific librpm version])
- HAVE_DLOPEN_LIBRPM=false
- save_LIBS="$LIBS"
- LIBS="$LIBS -ldl"
- AC_RUN_IFELSE(AC_LANG_PROGRAM([[
-#include <rpm/rpmlib.h>
-#include <dlfcn.h>
-#include <errno.h>
- ]], [[
- void *h;
- const char *const *rpmverp;
- FILE *f;
-
- f = fopen ("conftest.out", "w");
- if (!f)
- {
- fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
- strerror (errno));
- return 1;
- }
- h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
- if (!h)
- {
- fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
- return 1;
- }
- rpmverp = dlsym (h, "RPMVERSION");
- if (!rpmverp)
- {
- fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
- return 1;
- }
- fprintf (stderr, "RPMVERSION is: \"");
- fprintf (stderr, "%s\"\n", *rpmverp);
-
- /* Try to find the specific librpm version only for "librpm.so" as we do
- not know how to assemble the version string otherwise. */
-
- if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
- {
- fprintf (f, "%s\n", $LIBRPM_STRING);
- return 0;
- }
- else
- {
- char *h2_name;
- void *h2;
- int major, minor;
-
- if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
- {
- fprintf (stderr, "Unable to parse RPMVERSION.\n");
- fprintf (f, "%s\n", $LIBRPM_STRING);
- return 0;
- }
- /* Avoid the square brackets by malloc. */
- h2_name = malloc (64);
- sprintf (h2_name, "librpm-%d.%d.so", major, minor);
- h2 = dlopen (h2_name, RTLD_LAZY);
- if (!h2)
- {
- fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
- fprintf (f, "%s\n", $LIBRPM_STRING);
- return 0;
- }
- if (h2 != h)
- {
- fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
- $LIBRPM_STRING, h2_name);
- fprintf (f, "%s\n", $LIBRPM_STRING);
- return 0;
- }
- /* Found the valid .so name with a specific version. */
- fprintf (f, "%s\n", h2_name);
- return 0;
- }
- ]]), [
- DLOPEN_LIBRPM="`cat conftest.out`"
- if test "x$DLOPEN_LIBRPM" != "x"; then
- HAVE_DLOPEN_LIBRPM=true
- AC_MSG_RESULT($DLOPEN_LIBRPM)
- fi
- ])
- rm -f conftest.out
-
- m4_define([CHECK_LIBRPM_COMPAT], [
- AC_MSG_CHECKING([rpm library API compatibility])
- # The compilation requires -Werror to verify anything.
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Werror"
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
-/* Duplicate here the declarations to verify they match "symfile.c". */
-#include <rpm/rpmlib.h>
-#include <rpm/rpmts.h>
-#include <rpm/rpmdb.h>
-#include <rpm/header.h>
-extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
-extern int rpmReadConfigFiles(const char * file, const char * target);
-extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
-extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
-extern rpmts rpmtsCreate(void);
-extern rpmts rpmtsFree(rpmts ts);
-extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
- const void * keyp, size_t keylen);
- ]]), [
- LIBRPM_COMPAT=true
- rpm_LIBS=-lrpm
- AC_MSG_RESULT(yes)
- ], [
- LIBRPM_COMPAT=false
- rpm_LIBS=
- AC_MSG_RESULT(no)
- ])
- CFLAGS="$save_CFLAGS"
- ])
- AC_SUBST(rpm_LIBS)
-
- if $HAVE_DLOPEN_LIBRPM; then
- CHECK_LIBRPM_COMPAT
- if ! $LIBRPM_COMPAT; then
- HAVE_DLOPEN_LIBRPM=false
- fi
- fi
-
- if $HAVE_DLOPEN_LIBRPM; then
- DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
- AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
- AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
- else
- AC_MSG_RESULT(no)
- LIBS="$save_LIBS"
- if $DLOPEN_REQUIRE; then
- AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
- fi
- PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
-
- if $HAVE_LIBRPM; then
- CHECK_LIBRPM_COMPAT
- if ! $LIBRPM_COMPAT; then
- HAVE_LIBRPM=false
- RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
- fi
- fi
-
- if $HAVE_LIBRPM; then
- AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
- CFLAGS="$CFLAGS $RPM_CFLAGS"
- LIBS="$LIBS $RPM_LIBS"
- else
- if $RPM_REQUIRE; then
- AC_MSG_ERROR($RPM_PKG_ERRORS)
- else
- AC_MSG_WARN($RPM_PKG_ERRORS)
- fi
- fi
+ [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
+if test "$with_rpm" != "no"; then
+ AC_CHECK_LIB(rpm, rpmtsInitIterator)
+ if test "x$have_librpm" != "xyes" -a "$with_rpm" == "yes"; then
+ AC_MSG_ERROR([cannot find librpm])
fi
fi
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 41ef4172..fec9fa87 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -145,8 +145,6 @@ PIELDFLAGS = @PIELDFLAGS@
PKG_CONFIG = @PKG_CONFIG@
PUBLICAN_BRAND = @PUBLICAN_BRAND@
RANLIB = @RANLIB@
-RPM_CFLAGS = @RPM_CFLAGS@
-RPM_LIBS = @RPM_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -201,7 +199,6 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
-rpm_LIBS = @rpm_LIBS@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sqlite3_LIBS = @sqlite3_LIBS@
diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in
index e646224f..ee2a8fd5 100644
--- a/doc/SystemTap_Tapset_Reference/Makefile.in
+++ b/doc/SystemTap_Tapset_Reference/Makefile.in
@@ -127,8 +127,6 @@ PIELDFLAGS = @PIELDFLAGS@
PKG_CONFIG = @PKG_CONFIG@
PUBLICAN_BRAND = @PUBLICAN_BRAND@
RANLIB = @RANLIB@
-RPM_CFLAGS = @RPM_CFLAGS@
-RPM_LIBS = @RPM_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -183,7 +181,6 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
-rpm_LIBS = @rpm_LIBS@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sqlite3_LIBS = @sqlite3_LIBS@
diff --git a/doc/beginners/Makefile.in b/doc/beginners/Makefile.in
index 58cfb266..3ea60dd3 100644
--- a/doc/beginners/Makefile.in
+++ b/doc/beginners/Makefile.in
@@ -111,8 +111,6 @@ PIELDFLAGS = @PIELDFLAGS@
PKG_CONFIG = @PKG_CONFIG@
PUBLICAN_BRAND = @PUBLICAN_BRAND@
RANLIB = @RANLIB@
-RPM_CFLAGS = @RPM_CFLAGS@
-RPM_LIBS = @RPM_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -167,7 +165,6 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
-rpm_LIBS = @rpm_LIBS@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sqlite3_LIBS = @sqlite3_LIBS@
diff --git a/grapher/Makefile.in b/grapher/Makefile.in
index 35c83ac0..644a9b99 100644
--- a/grapher/Makefile.in
+++ b/grapher/Makefile.in
@@ -171,8 +171,6 @@ PIELDFLAGS = @PIELDFLAGS@
PKG_CONFIG = @PKG_CONFIG@
PUBLICAN_BRAND = @PUBLICAN_BRAND@
RANLIB = @RANLIB@
-RPM_CFLAGS = @RPM_CFLAGS@
-RPM_LIBS = @RPM_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -227,7 +225,6 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
-rpm_LIBS = @rpm_LIBS@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sqlite3_LIBS = @sqlite3_LIBS@