1 Index: gdb-6.8.50.20090302/gdb/event-top.c
2 ===================================================================
3 --- gdb-6.8.50.20090302.orig/gdb/event-top.c 2009-03-07 17:13:33.000000000 +0100
4 +++ gdb-6.8.50.20090302/gdb/event-top.c 2009-03-07 17:25:06.000000000 +0100
6 #include "cli/cli-script.h" /* for reset_command_nest_depth */
11 /* For dont_repeat() */
13 @@ -193,6 +194,8 @@ cli_command_loop (void)
15 char *gdb_prompt = get_prompt ();
17 + debug_flush_missing ();
19 /* Tell readline what the prompt to display is and what function it
20 will need to call after a whole line is read. This also displays
22 @@ -264,6 +267,8 @@ display_gdb_prompt (char *new_prompt)
23 /* Reset the nesting depth used when trace-commands is set. */
24 reset_command_nest_depth ();
26 + debug_flush_missing ();
28 /* Each interpreter has its own rules on displaying the command
30 if (!current_interp_display_prompt_p ())
31 Index: gdb-6.8.50.20090302/gdb/symfile.c
32 ===================================================================
33 --- gdb-6.8.50.20090302.orig/gdb/symfile.c 2009-03-07 17:22:21.000000000 +0100
34 +++ gdb-6.8.50.20090302/gdb/symfile.c 2009-03-07 17:26:47.000000000 +0100
39 +#include "elf/external.h"
41 #include <sys/types.h>
47 +#include <sys/param.h>
50 int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
51 @@ -1684,8 +1686,352 @@ build_id_to_filename (struct build_id *b
57 +#include <rpm/rpmlib.h>
58 +#include <rpm/rpmts.h>
59 +#include <rpm/rpmdb.h>
60 +#include <rpm/header.h>
65 +/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
66 + and avoid their duplicities during a single inferior run. */
68 +static struct htab *missing_rpm_hash;
70 +/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
71 + all the rpms right before the nearest GDB prompt. It gets cleared after
72 + each such print (it is questionable if we should clear it after the print).
77 + struct missing_rpm *next;
80 +static struct missing_rpm *missing_rpm_list;
81 +static int missing_rpm_list_entries;
83 +/* Returns the count of newly added rpms. */
86 +missing_rpm_enlist (const char *filename)
88 + static int rpm_init_done = 0;
90 + rpmdbMatchIterator mi;
94 + /* Duplicate here the declarations to verify they match. The same sanity
95 + check is present also in `configure.ac'. */
96 + extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
97 + static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
98 + extern int rpmReadConfigFiles(const char * file, const char * target);
99 + static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
100 + extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
101 + static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
102 + extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
103 + static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
104 + extern rpmts rpmtsCreate(void);
105 + static rpmts (*rpmtsCreate_p) (void);
106 + extern rpmts rpmtsFree(rpmts ts);
107 + static rpmts (*rpmtsFree_p) (rpmts ts);
108 + extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
109 + const void * keyp, size_t keylen);
110 + static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
114 +#else /* !DLOPEN_LIBRPM */
115 +# define headerFormat_p headerFormat
116 +# define rpmReadConfigFiles_p rpmReadConfigFiles
117 +# define rpmdbFreeIterator_p rpmdbFreeIterator
118 +# define rpmdbNextIterator_p rpmdbNextIterator
119 +# define rpmtsCreate_p rpmtsCreate
120 +# define rpmtsFree_p rpmtsFree
121 +# define rpmtsInitIterator_p rpmtsInitIterator
122 +#endif /* !DLOPEN_LIBRPM */
124 + if (filename == NULL)
127 + if (!rpm_init_done)
129 + static int init_tried;
131 + /* Already failed the initialization before? */
136 +#ifdef DLOPEN_LIBRPM
140 + h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
143 + warning (_("Unable to open \"%s\" (%s), "
144 + "missing debuginfos notifications will not be displayed"),
145 + DLOPEN_LIBRPM, dlerror ());
149 + if (!((headerFormat_p = dlsym (h, "headerFormat"))
150 + && (rpmReadConfigFiles_p = dlsym (h, "rpmReadConfigFiles"))
151 + && (rpmdbFreeIterator_p = dlsym (h, "rpmdbFreeIterator"))
152 + && (rpmdbNextIterator_p = dlsym (h, "rpmdbNextIterator"))
153 + && (rpmtsCreate_p = dlsym (h, "rpmtsCreate"))
154 + && (rpmtsFree_p = dlsym (h, "rpmtsFree"))
155 + && (rpmtsInitIterator_p = dlsym (h, "rpmtsInitIterator"))))
157 + warning (_("Opened library \"%s\" is incompatible (%s), "
158 + "missing debuginfos notifications will not be displayed"),
159 + DLOPEN_LIBRPM, dlerror ());
161 + warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
166 +#endif /* DLOPEN_LIBRPM */
168 + if (rpmReadConfigFiles_p (NULL, NULL) != 0)
170 + warning (_("Error reading the rpm configuration files"));
177 + ts = rpmtsCreate_p ();
179 + mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
185 + char *debuginfo, **slot, *s, *s2;
187 + size_t srcrpmlen = sizeof (".src.rpm") - 1;
188 + size_t debuginfolen = sizeof ("-debuginfo") - 1;
189 + rpmdbMatchIterator mi_debuginfo;
191 + h = rpmdbNextIterator_p (mi);
195 + /* Verify the debuginfo file is not already installed. */
197 + debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
201 + warning (_("Error querying the rpm file `%s': %s"), filename,
205 + /* s = `.src.rpm-debuginfo.%{arch}' */
206 + s = strrchr (debuginfo, '-') - srcrpmlen;
208 + if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
210 + /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
211 + s2 = memrchr (debuginfo, '-', s - debuginfo);
215 + /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
216 + s2 = memrchr (debuginfo, '-', s2 - debuginfo);
220 + warning (_("Error querying the rpm file `%s': %s"), filename,
225 + /* s = `.src.rpm-debuginfo.%{arch}' */
226 + /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
227 + memmove (s2 + debuginfolen, s2, s - s2);
228 + memcpy (s2, "-debuginfo", debuginfolen);
229 + /* s = `XXXX.%{arch}' */
230 + /* strlen ("XXXX") == srcrpmlen + debuginfolen */
231 + /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
232 + /* strlen ("XX") == srcrpmlen */
233 + memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
234 + strlen (s + srcrpmlen + debuginfolen) + 1);
235 + /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
237 + /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
238 + /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
239 + mi_debuginfo = rpmtsInitIterator_p (ts, RPMDBI_LABEL, debuginfo, 0);
243 + rpmdbFreeIterator_p (mi_debuginfo);
248 + /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
249 + debuginfo = headerFormat_p (h,
250 + "%{name}-%{version}-%{release}.%{arch}",
254 + warning (_("Error querying the rpm file `%s': %s"), filename,
259 + /* Base package name for `debuginfo-install'. We do not use the
260 + `yum' command directly as the line
261 + yum --enablerepo='*-debuginfo' install NAME-debuginfo.ARCH
262 + would be more complicated than just:
263 + debuginfo-install NAME-VERSION-RELEASE.ARCH
264 + Do not supply the rpm base name (derived from .src.rpm name) as
265 + debuginfo-install is unable to install the debuginfo package if
266 + the base name PKG binary rpm is not installed while for example
267 + PKG-libs would be installed (RH Bug 467901).
268 + FUTURE: After multiple debuginfo versions simultaneously installed
269 + get supported the support for the VERSION-RELEASE tags handling
270 + may need an update. */
272 + if (missing_rpm_hash == NULL)
274 + /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
275 + should not deallocate the entries. */
277 + missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
278 + (int (*) (const void *, const void *)) streq,
279 + NULL, xcalloc, xfree);
281 + slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
282 + /* XCALLOC never returns NULL. */
283 + gdb_assert (slot != NULL);
286 + struct missing_rpm *missing_rpm;
290 + missing_rpm = xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
291 + strcpy (missing_rpm->rpm, debuginfo);
292 + missing_rpm->next = missing_rpm_list;
293 + missing_rpm_list = missing_rpm;
294 + missing_rpm_list_entries++;
301 + rpmdbFreeIterator_p (mi);
310 +missing_rpm_list_compar (const char *const *ap, const char *const *bp)
312 + return strcoll (*ap, *bp);
315 +/* It returns a NULL-terminated array of strings needing to be FREEd. It may
316 + also return only NULL. */
319 +missing_rpm_list_print (void)
321 + char **array, **array_iter;
322 + struct missing_rpm *list_iter;
323 + struct cleanup *cleanups;
325 + if (missing_rpm_list_entries == 0)
328 + array = xmalloc (sizeof (*array) * missing_rpm_list_entries);
329 + cleanups = make_cleanup (xfree, array);
331 + array_iter = array;
332 + for (list_iter = missing_rpm_list; list_iter != NULL;
333 + list_iter = list_iter->next)
335 + *array_iter++ = list_iter->rpm;
337 + gdb_assert (array_iter == array + missing_rpm_list_entries);
339 + qsort (array, missing_rpm_list_entries, sizeof (*array),
340 + (int (*) (const void *, const void *)) missing_rpm_list_compar);
342 + printf_unfiltered (_("Missing separate debuginfos, use: %s"),
343 + "debuginfo-install");
344 + for (array_iter = array; array_iter < array + missing_rpm_list_entries;
347 + putchar_unfiltered (' ');
348 + puts_unfiltered (*array_iter);
350 + putchar_unfiltered ('\n');
352 + while (missing_rpm_list != NULL)
354 + list_iter = missing_rpm_list;
355 + missing_rpm_list = list_iter->next;
358 + missing_rpm_list_entries = 0;
360 + do_cleanups (cleanups);
364 +missing_rpm_change (void)
366 + debug_flush_missing ();
368 + gdb_assert (missing_rpm_list == NULL);
369 + if (missing_rpm_hash != NULL)
371 + htab_delete (missing_rpm_hash);
372 + missing_rpm_hash = NULL;
378 + /* Init state. EXEC_BFD also still could be NULL. */
379 + MISSING_EXEC_NOT_TRIED,
380 + /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
381 + MISSING_EXEC_NOT_FOUND,
382 + /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
383 + or separate) or the main executable's RPM is now contained in
384 + MISSING_RPM_HASH. */
385 + MISSING_EXEC_ENLISTED
387 +static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
389 +#endif /* HAVE_LIBRPM */
392 +debug_flush_missing (void)
395 + missing_rpm_list_print ();
399 /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
400 - Try to install the hash file ...
401 + yum --enablerepo='*-debuginfo' install ...
404 struct missing_filepair
405 @@ -1739,11 +2085,17 @@ missing_filepair_change (void)
406 /* All their memory came just from missing_filepair_OBSTACK. */
407 missing_filepair_hash = NULL;
410 + missing_exec = MISSING_EXEC_NOT_TRIED;
415 debug_print_executable_changed (void)
418 + missing_rpm_change ();
420 missing_filepair_change ();
423 @@ -1802,14 +2154,33 @@ debug_print_missing (const char *binary,
425 *slot = missing_filepair;
427 - /* We do not collect and flush these messages as each such message
428 - already requires its own separate lines. */
430 + if (missing_exec == MISSING_EXEC_NOT_TRIED)
432 + char *exec_filename;
434 - fprintf_unfiltered (gdb_stdlog,
435 - _("Missing separate debuginfo for %s\n"), binary);
437 - fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
439 + exec_filename = get_exec_file (0);
440 + if (exec_filename != NULL)
442 + if (missing_rpm_enlist (exec_filename) == 0)
443 + missing_exec = MISSING_EXEC_NOT_FOUND;
445 + missing_exec = MISSING_EXEC_ENLISTED;
448 + if (missing_exec != MISSING_EXEC_ENLISTED)
449 + if (missing_rpm_enlist (binary) == 0 && missing_rpm_enlist (debug) == 0)
450 +#endif /* HAVE_LIBRPM */
452 + /* We do not collect and flush these messages as each such message
453 + already requires its own separate lines. */
455 + fprintf_unfiltered (gdb_stdlog,
456 + _("Missing separate debuginfo for %s\n"), binary);
458 + fprintf_unfiltered (gdb_stdlog, _("Try to install package that provides `%s' file\n"),
464 Index: gdb-6.8.50.20090302/gdb/symfile.h
465 ===================================================================
466 --- gdb-6.8.50.20090302.orig/gdb/symfile.h 2009-03-07 17:13:33.000000000 +0100
467 +++ gdb-6.8.50.20090302/gdb/symfile.h 2009-03-07 17:25:06.000000000 +0100
468 @@ -378,6 +378,7 @@ extern struct build_id *build_id_addr_ge
469 extern char *build_id_to_filename (struct build_id *build_id,
470 char **link_return, int add_debug_suffix);
471 extern void debug_print_missing (const char *binary, const char *debug);
472 +extern void debug_flush_missing (void);
474 /* From dwarf2read.c */
476 Index: gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp
477 ===================================================================
478 --- gdb-6.8.50.20090302.orig/gdb/testsuite/lib/gdb.exp 2009-03-07 17:13:33.000000000 +0100
479 +++ gdb-6.8.50.20090302/gdb/testsuite/lib/gdb.exp 2009-03-07 17:25:06.000000000 +0100
480 @@ -1230,7 +1230,7 @@ proc default_gdb_start { } {
481 warning "Couldn't set the width to 0."
484 - # Turn off the missing warnings as the testsuite does not expect it.
485 + # Turn off the missing RPMs warnings as the testsuite does not expect it.
486 send_gdb "set build-id-verbose 0\n"
488 -re "$gdb_prompt $" {
489 --- ./gdb/testsuite/lib/mi-support.exp 2009-03-22 16:37:58.000000000 +0100
490 +++ ./gdb/testsuite/lib/mi-support.exp 2009-03-22 16:37:12.000000000 +0100
491 @@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } {
495 - # Turn off the missing warnings as the testsuite does not expect it.
496 + # Turn off the missing RPMs warnings as the testsuite does not expect it.
497 send_gdb "190-gdb-set build-id-verbose 0\n"
499 -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
500 Index: gdb-6.8.50.20090302/gdb/tui/tui-interp.c
501 ===================================================================
502 --- gdb-6.8.50.20090302.orig/gdb/tui/tui-interp.c 2009-03-07 17:13:33.000000000 +0100
503 +++ gdb-6.8.50.20090302/gdb/tui/tui-interp.c 2009-03-07 17:25:06.000000000 +0100
506 #include "tui/tui-io.h"
507 #include "exceptions.h"
508 +#include "symfile.h"
510 /* Set to 1 when the TUI mode must be activated when we first start
512 @@ -128,6 +129,8 @@ tui_command_loop (void *data)
514 char *gdb_prompt = get_prompt ();
516 + debug_flush_missing ();
518 /* Tell readline what the prompt to display is and what function
519 it will need to call after a whole line is read. This also
520 displays the first prompt. */
521 Index: gdb-6.8.50.20090302/gdb/aclocal.m4
522 ===================================================================
523 --- gdb-6.8.50.20090302.orig/gdb/aclocal.m4 2009-03-07 17:13:33.000000000 +0100
524 +++ gdb-6.8.50.20090302/gdb/aclocal.m4 2009-03-07 17:25:06.000000000 +0100
526 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
527 # PARTICULAR PURPOSE.
529 +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
531 +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
533 +# This program is free software; you can redistribute it and/or modify
534 +# it under the terms of the GNU General Public License as published by
535 +# the Free Software Foundation; either version 2 of the License, or
536 +# (at your option) any later version.
538 +# This program is distributed in the hope that it will be useful, but
539 +# WITHOUT ANY WARRANTY; without even the implied warranty of
540 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
541 +# General Public License for more details.
543 +# You should have received a copy of the GNU General Public License
544 +# along with this program; if not, write to the Free Software
545 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
547 +# As a special exception to the GNU General Public License, if you
548 +# distribute this file as part of a program that contains a
549 +# configuration script generated by Autoconf, you may include it under
550 +# the same distribution terms that you use for the rest of that program.
552 +# PKG_PROG_PKG_CONFIG([MIN-VERSION])
553 +# ----------------------------------
554 +AC_DEFUN([PKG_PROG_PKG_CONFIG],
555 +[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
556 +m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
557 +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
558 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
559 + AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
561 +if test -n "$PKG_CONFIG"; then
562 + _pkg_min_version=m4_default([$1], [0.9.0])
563 + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
564 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
565 + AC_MSG_RESULT([yes])
567 + AC_MSG_RESULT([no])
572 +])# PKG_PROG_PKG_CONFIG
574 +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
576 +# Check to see whether a particular set of modules exists. Similar
577 +# to PKG_CHECK_MODULES(), but does not set variables or print errors.
580 +# Similar to PKG_CHECK_MODULES, make sure that the first instance of
581 +# this or PKG_CHECK_MODULES is called, or make sure to call
582 +# PKG_CHECK_EXISTS manually
583 +# --------------------------------------------------------------
584 +AC_DEFUN([PKG_CHECK_EXISTS],
585 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
586 +if test -n "$PKG_CONFIG" && \
587 + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
588 + m4_ifval([$2], [$2], [:])
589 +m4_ifvaln([$3], [else
594 +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
595 +# ---------------------------------------------
596 +m4_define([_PKG_CONFIG],
597 +[if test -n "$$1"; then
599 + elif test -n "$PKG_CONFIG"; then
600 + PKG_CHECK_EXISTS([$3],
601 + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
608 +# _PKG_SHORT_ERRORS_SUPPORTED
609 +# -----------------------------
610 +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
611 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
612 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
613 + _pkg_short_errors_supported=yes
615 + _pkg_short_errors_supported=no
617 +])# _PKG_SHORT_ERRORS_SUPPORTED
620 +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
621 +# [ACTION-IF-NOT-FOUND])
624 +# Note that if there is a possibility the first call to
625 +# PKG_CHECK_MODULES might not happen, you should be sure to include an
626 +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
629 +# --------------------------------------------------------------
630 +AC_DEFUN([PKG_CHECK_MODULES],
631 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
632 +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
633 +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
636 +AC_MSG_CHECKING([for $1])
638 +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
639 +_PKG_CONFIG([$1][_LIBS], [libs], [$2])
641 +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
642 +and $1[]_LIBS to avoid the need to call pkg-config.
643 +See the pkg-config man page for more details.])
645 +if test $pkg_failed = yes; then
646 + _PKG_SHORT_ERRORS_SUPPORTED
647 + if test $_pkg_short_errors_supported = yes; then
648 + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
650 + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
652 + # Put the nasty error message in config.log where it belongs
653 + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
655 + ifelse([$4], , [AC_MSG_ERROR(dnl
656 +[Package requirements ($2) were not met:
660 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
661 +installed software in a non-standard prefix.
665 + [AC_MSG_RESULT([no])
667 +elif test $pkg_failed = untried; then
668 + ifelse([$4], , [AC_MSG_FAILURE(dnl
669 +[The pkg-config script could not be found or is too old. Make sure it
670 +is in your PATH or set the PKG_CONFIG environment variable to the full
675 +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
678 + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
679 + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
680 + AC_MSG_RESULT([yes])
681 + ifelse([$3], , :, [$3])
683 +])# PKG_CHECK_MODULES
685 # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
687 # This file is free software; the Free Software Foundation
688 @@ -468,6 +624,27 @@ AC_DEFUN([AM_PROG_INSTALL_SH],
689 install_sh=${install_sh-"$am_aux_dir/install-sh"}
690 AC_SUBST(install_sh)])
692 +# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
694 +# This file is free software; the Free Software Foundation
695 +# gives unlimited permission to copy and/or distribute it,
696 +# with or without modifications, as long as this notice is preserved.
700 +# Check whether the underlying file-system supports filenames
701 +# with a leading dot. For instance MS-DOS doesn't.
702 +AC_DEFUN([AM_SET_LEADING_DOT],
703 +[rm -rf .tst 2>/dev/null
704 +mkdir .tst 2>/dev/null
705 +if test -d .tst; then
710 +rmdir .tst 2>/dev/null
711 +AC_SUBST([am__leading_dot])])
713 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
716 @@ -868,7 +1045,4 @@ m4_include([gnulib/m4/onceonly_2_57.m4])
717 m4_include([gnulib/m4/stdint.m4])
718 m4_include([gnulib/m4/string_h.m4])
719 m4_include([gnulib/m4/wchar.m4])
720 -m4_include([../config/extensions.m4])
721 -m4_include([../config/lead-dot.m4])
722 -m4_include([../config/proginstall.m4])
723 m4_include([acinclude.m4])
724 Index: gdb-6.8.50.20090302/gdb/config.in
725 ===================================================================
726 --- gdb-6.8.50.20090302.orig/gdb/config.in 2009-03-07 17:13:33.000000000 +0100
727 +++ gdb-6.8.50.20090302/gdb/config.in 2009-03-07 17:25:06.000000000 +0100
729 /* Define to BFD's default target vector. */
730 #undef DEFAULT_BFD_VEC
732 +/* librpm version specific library name to dlopen. */
733 +#undef DLOPEN_LIBRPM
735 /* Define to 1 if translation of program messages to the user's native
736 language is requested. */
739 /* Define if Python 2.6 is being used. */
740 #undef HAVE_LIBPYTHON2_6
742 +/* Define if librpm library is being used. */
745 /* Define if libunwind library is being used. */
746 #undef HAVE_LIBUNWIND
748 Index: gdb-6.8.50.20090302/gdb/configure
749 ===================================================================
750 --- gdb-6.8.50.20090302.orig/gdb/configure 2009-03-07 17:13:33.000000000 +0100
751 +++ gdb-6.8.50.20090302/gdb/configure 2009-03-07 17:25:06.000000000 +0100
752 @@ -314,7 +314,7 @@ ac_subdirs_all="$ac_subdirs_all doc test
753 ac_subdirs_all="$ac_subdirs_all gdbtk"
754 ac_subdirs_all="$ac_subdirs_all multi-ice"
755 ac_subdirs_all="$ac_subdirs_all gdbserver"
756 -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE GDB_DATADIR_PATH pythondir subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG LIBICONV LIBICONV_INCLUDE LIBICONV_LIBDIR READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS'
757 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE GDB_DATADIR_PATH pythondir PKG_CONFIG ac_pt_PKG_CONFIG RPM_CFLAGS RPM_LIBS subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG LIBICONV LIBICONV_INCLUDE LIBICONV_LIBDIR READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS'
758 ac_subst_files='host_makefile_frag'
761 @@ -776,6 +776,18 @@ ac_env_CPP_set=${CPP+set}
762 ac_env_CPP_value=$CPP
763 ac_cv_env_CPP_set=${CPP+set}
764 ac_cv_env_CPP_value=$CPP
765 +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
766 +ac_env_PKG_CONFIG_value=$PKG_CONFIG
767 +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
768 +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG
769 +ac_env_RPM_CFLAGS_set=${RPM_CFLAGS+set}
770 +ac_env_RPM_CFLAGS_value=$RPM_CFLAGS
771 +ac_cv_env_RPM_CFLAGS_set=${RPM_CFLAGS+set}
772 +ac_cv_env_RPM_CFLAGS_value=$RPM_CFLAGS
773 +ac_env_RPM_LIBS_set=${RPM_LIBS+set}
774 +ac_env_RPM_LIBS_value=$RPM_LIBS
775 +ac_cv_env_RPM_LIBS_set=${RPM_LIBS+set}
776 +ac_cv_env_RPM_LIBS_value=$RPM_LIBS
779 # Report the --help message.
780 @@ -886,6 +898,8 @@ Optional Packages:
782 --with-pythondir install Python data files in this path
784 + --with-rpm query rpm database for missing debuginfos
785 + [yes/no,], [def.], [auto=librpm.so]
786 --with-libunwind Use libunwind frame unwinding support
787 --with-pkgversion=PKG Use PKG in the version string in place of "GDB"
788 --with-bugurl=URL Direct users to URL to report a bug
789 @@ -913,6 +927,9 @@ Some influential environment variables:
790 CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
791 headers in a nonstandard directory <include dir>
793 + PKG_CONFIG path to pkg-config utility
794 + RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
795 + RPM_LIBS linker flags for RPM, overriding pkg-config
797 Use these variables to override the choices made by `configure' or to help
798 it to find libraries and programs with nonstandard names/locations.
799 @@ -6556,7 +6573,6 @@ am__api_version="1.9"
800 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
801 # OS/2's system install, which has a completely different semantic
802 # ./install, which can be erroneously created by make from ./install.sh.
803 -# Reject install programs that cannot install multiple files.
804 echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
805 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
806 if test -z "$INSTALL"; then
807 @@ -6590,18 +6606,8 @@ case $as_dir/ in
808 # program-specific install script used by HP pwplus--don't use.
811 - rm -rf conftest.one conftest.two conftest.dir
812 - echo one > conftest.one
813 - echo two > conftest.two
815 - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
816 - test -s conftest.one && test -s conftest.two &&
817 - test -s conftest.dir/conftest.one &&
818 - test -s conftest.dir/conftest.two
820 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
823 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
828 @@ -6610,16 +6616,15 @@ case $as_dir/ in
832 -rm -rf conftest.one conftest.two conftest.dir
835 if test "${ac_cv_path_install+set}" = set; then
836 INSTALL=$ac_cv_path_install
838 - # As a last resort, use the slow shell script. Don't cache a
839 - # value for INSTALL within a source directory, because that will
840 + # As a last resort, use the slow shell script. We don't cache a
841 + # path for INSTALL within a source directory, because that will
842 # break other packages using the cache if that directory is
843 - # removed, or if the value is a relative name.
844 + # removed, or if the path is relative.
845 INSTALL=$ac_install_sh
848 @@ -7202,6 +7207,559 @@ _ACEOF
852 +# Integration with rpm library to support missing debuginfo suggestions.
853 +# --without-rpm: Disable any rpm support.
854 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
855 +# Even with runtime missing `libname.so' GDB will still other run correctly.
856 +# Missing `libname.so' during ./configure will abort the configuration.
857 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
858 +# minor version first such as `librpm-4.6.so' as minor version differences
859 +# mean API+ABI incompatibility. If the specific match versioned library name
860 +# could not be found still open dynamically at least `librpm.so'.
861 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
862 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
863 +# be probably linked with the version specific library (as `librpm-4.6.so').
864 +# Failure to find librpm by pkg-config will abort the configuration.
865 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
866 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
869 +# Check whether --with-rpm or --without-rpm was given.
870 +if test "${with_rpm+set}" = set; then
871 + withval="$with_rpm"
879 +if test "x$with_rpm" != "xno"; then
880 + if test "x$with_rpm" = "xyes"; then
883 + DLOPEN_REQUIRE=false
884 + elif test "x$with_rpm" = "xauto"; then
887 + DLOPEN_REQUIRE=false
891 + DLOPEN_REQUIRE=true
893 + LIBRPM_STRING='"'"$LIBRPM"'"'
895 + echo "$as_me:$LINENO: checking specific librpm version" >&5
896 +echo $ECHO_N "checking specific librpm version... $ECHO_C" >&6
897 + HAVE_DLOPEN_LIBRPM=false
900 + if test "$cross_compiling" = yes; then
901 + { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
902 +echo "$as_me: error: in \`$ac_pwd':" >&2;}
903 +{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
904 +See \`config.log' for more details." >&5
905 +echo "$as_me: error: cannot run test program while cross compiling
906 +See \`config.log' for more details." >&2;}
907 + { (exit 1); exit 1; }; }; }
909 + cat >conftest.$ac_ext <<_ACEOF
912 +cat confdefs.h >>conftest.$ac_ext
913 +cat >>conftest.$ac_ext <<_ACEOF
914 +/* end confdefs.h. */
916 +#include <rpm/rpmlib.h>
925 + const char *const *rpmverp;
928 + f = fopen ("conftest.out", "w");
931 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
935 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
938 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
941 + rpmverp = dlsym (h, "RPMVERSION");
944 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
947 + fprintf (stderr, "RPMVERSION is: \"");
948 + fprintf (stderr, "%s\"\n", *rpmverp);
950 + /* Try to find the specific librpm version only for "librpm.so" as we do
951 + not know how to assemble the version string otherwise. */
953 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
955 + fprintf (f, "%s\n", $LIBRPM_STRING);
964 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
966 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
967 + fprintf (f, "%s\n", $LIBRPM_STRING);
970 + /* Avoid the square brackets by malloc. */
971 + h2_name = malloc (64);
972 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
973 + h2 = dlopen (h2_name, RTLD_LAZY);
976 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
977 + fprintf (f, "%s\n", $LIBRPM_STRING);
982 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
983 + $LIBRPM_STRING, h2_name);
984 + fprintf (f, "%s\n", $LIBRPM_STRING);
987 + /* Found the valid .so name with a specific version. */
988 + fprintf (f, "%s\n", h2_name);
996 +rm -f conftest$ac_exeext
997 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
998 + (eval $ac_link) 2>&5
1000 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1001 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
1002 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1003 + (eval $ac_try) 2>&5
1005 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1006 + (exit $ac_status); }; }; then
1008 + DLOPEN_LIBRPM="`cat conftest.out`"
1009 + if test "x$DLOPEN_LIBRPM" != "x"; then
1010 + HAVE_DLOPEN_LIBRPM=true
1011 + echo "$as_me:$LINENO: result: $DLOPEN_LIBRPM" >&5
1012 +echo "${ECHO_T}$DLOPEN_LIBRPM" >&6
1016 + echo "$as_me: program exited with status $ac_status" >&5
1017 +echo "$as_me: failed program was:" >&5
1018 +sed 's/^/| /' conftest.$ac_ext >&5
1021 +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
1023 + rm -f conftest.out
1027 + if $HAVE_DLOPEN_LIBRPM; then
1029 + echo "$as_me:$LINENO: checking rpm library API compatibility" >&5
1030 +echo $ECHO_N "checking rpm library API compatibility... $ECHO_C" >&6
1031 + # The compilation requires -Werror to verify anything.
1032 + save_CFLAGS="$CFLAGS"
1033 + CFLAGS="$CFLAGS -Werror"
1034 + cat >conftest.$ac_ext <<_ACEOF
1037 +cat confdefs.h >>conftest.$ac_ext
1038 +cat >>conftest.$ac_ext <<_ACEOF
1039 +/* end confdefs.h. */
1041 +/* Duplicate here the declarations to verify they match "symfile.c". */
1042 +#include <rpm/rpmlib.h>
1043 +#include <rpm/rpmts.h>
1044 +#include <rpm/rpmdb.h>
1045 +#include <rpm/header.h>
1046 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1047 +extern int rpmReadConfigFiles(const char * file, const char * target);
1048 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1049 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1050 +extern rpmts rpmtsCreate(void);
1051 +extern rpmts rpmtsFree(rpmts ts);
1052 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1053 + const void * keyp, size_t keylen);
1063 +rm -f conftest.$ac_objext
1064 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1065 + (eval $ac_compile) 2>conftest.er1
1067 + grep -v '^ *+' conftest.er1 >conftest.err
1068 + rm -f conftest.er1
1069 + cat conftest.err >&5
1070 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1071 + (exit $ac_status); } &&
1072 + { ac_try='test -z "$ac_c_werror_flag"
1073 + || test ! -s conftest.err'
1074 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1075 + (eval $ac_try) 2>&5
1077 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1078 + (exit $ac_status); }; } &&
1079 + { ac_try='test -s conftest.$ac_objext'
1080 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1081 + (eval $ac_try) 2>&5
1083 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1084 + (exit $ac_status); }; }; then
1086 + LIBRPM_COMPAT=true
1087 + echo "$as_me:$LINENO: result: yes" >&5
1088 +echo "${ECHO_T}yes" >&6
1091 + echo "$as_me: failed program was:" >&5
1092 +sed 's/^/| /' conftest.$ac_ext >&5
1095 + LIBRPM_COMPAT=false
1096 + echo "$as_me:$LINENO: result: no" >&5
1097 +echo "${ECHO_T}no" >&6
1100 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
1101 + CFLAGS="$save_CFLAGS"
1103 + if ! $LIBRPM_COMPAT; then
1104 + HAVE_DLOPEN_LIBRPM=false
1108 + if $HAVE_DLOPEN_LIBRPM; then
1109 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
1111 +cat >>confdefs.h <<_ACEOF
1112 +#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
1116 +cat >>confdefs.h <<\_ACEOF
1117 +#define HAVE_LIBRPM 1
1121 + echo "$as_me:$LINENO: result: no" >&5
1122 +echo "${ECHO_T}no" >&6
1124 + if $DLOPEN_REQUIRE; then
1125 + { { echo "$as_me:$LINENO: error: Specific name $LIBRPM was requested but it could not be opened." >&5
1126 +echo "$as_me: error: Specific name $LIBRPM was requested but it could not be opened." >&2;}
1127 + { (exit 1); exit 1; }; }
1131 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1132 + if test -n "$ac_tool_prefix"; then
1133 + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
1134 +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
1135 +echo "$as_me:$LINENO: checking for $ac_word" >&5
1136 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1137 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
1138 + echo $ECHO_N "(cached) $ECHO_C" >&6
1140 + case $PKG_CONFIG in
1141 + [\\/]* | ?:[\\/]*)
1142 + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
1145 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1146 +for as_dir in $PATH
1149 + test -z "$as_dir" && as_dir=.
1150 + for ac_exec_ext in '' $ac_executable_extensions; do
1151 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1152 + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1153 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1162 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
1164 +if test -n "$PKG_CONFIG"; then
1165 + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
1166 +echo "${ECHO_T}$PKG_CONFIG" >&6
1168 + echo "$as_me:$LINENO: result: no" >&5
1169 +echo "${ECHO_T}no" >&6
1173 +if test -z "$ac_cv_path_PKG_CONFIG"; then
1174 + ac_pt_PKG_CONFIG=$PKG_CONFIG
1175 + # Extract the first word of "pkg-config", so it can be a program name with args.
1176 +set dummy pkg-config; ac_word=$2
1177 +echo "$as_me:$LINENO: checking for $ac_word" >&5
1178 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1179 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
1180 + echo $ECHO_N "(cached) $ECHO_C" >&6
1182 + case $ac_pt_PKG_CONFIG in
1183 + [\\/]* | ?:[\\/]*)
1184 + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
1187 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1188 +for as_dir in $PATH
1191 + test -z "$as_dir" && as_dir=.
1192 + for ac_exec_ext in '' $ac_executable_extensions; do
1193 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1194 + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1195 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
1204 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
1206 +if test -n "$ac_pt_PKG_CONFIG"; then
1207 + echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
1208 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
1210 + echo "$as_me:$LINENO: result: no" >&5
1211 +echo "${ECHO_T}no" >&6
1214 + PKG_CONFIG=$ac_pt_PKG_CONFIG
1216 + PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
1220 +if test -n "$PKG_CONFIG"; then
1221 + _pkg_min_version=0.9.0
1222 + echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
1223 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
1224 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1225 + echo "$as_me:$LINENO: result: yes" >&5
1226 +echo "${ECHO_T}yes" >&6
1228 + echo "$as_me:$LINENO: result: no" >&5
1229 +echo "${ECHO_T}no" >&6
1236 +echo "$as_me:$LINENO: checking for RPM" >&5
1237 +echo $ECHO_N "checking for RPM... $ECHO_C" >&6
1239 +if test -n "$RPM_CFLAGS"; then
1240 + pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
1241 + elif test -n "$PKG_CONFIG"; then
1242 + if test -n "$PKG_CONFIG" && \
1243 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"rpm\"") >&5
1244 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1246 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1247 + (exit $ac_status); }; then
1248 + pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
1253 + pkg_failed=untried
1255 +if test -n "$RPM_LIBS"; then
1256 + pkg_cv_RPM_LIBS="$RPM_LIBS"
1257 + elif test -n "$PKG_CONFIG"; then
1258 + if test -n "$PKG_CONFIG" && \
1259 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"rpm\"") >&5
1260 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1262 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1263 + (exit $ac_status); }; then
1264 + pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
1269 + pkg_failed=untried
1274 +if test $pkg_failed = yes; then
1276 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1277 + _pkg_short_errors_supported=yes
1279 + _pkg_short_errors_supported=no
1281 + if test $_pkg_short_errors_supported = yes; then
1282 + RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1`
1284 + RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1`
1286 + # Put the nasty error message in config.log where it belongs
1287 + echo "$RPM_PKG_ERRORS" >&5
1289 + echo "$as_me:$LINENO: result: no" >&5
1290 +echo "${ECHO_T}no" >&6
1292 +elif test $pkg_failed = untried; then
1295 + RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
1296 + RPM_LIBS=$pkg_cv_RPM_LIBS
1297 + echo "$as_me:$LINENO: result: yes" >&5
1298 +echo "${ECHO_T}yes" >&6
1302 + if $HAVE_LIBRPM; then
1304 + echo "$as_me:$LINENO: checking rpm library API compatibility" >&5
1305 +echo $ECHO_N "checking rpm library API compatibility... $ECHO_C" >&6
1306 + # The compilation requires -Werror to verify anything.
1307 + save_CFLAGS="$CFLAGS"
1308 + CFLAGS="$CFLAGS -Werror"
1309 + cat >conftest.$ac_ext <<_ACEOF
1312 +cat confdefs.h >>conftest.$ac_ext
1313 +cat >>conftest.$ac_ext <<_ACEOF
1314 +/* end confdefs.h. */
1316 +/* Duplicate here the declarations to verify they match "symfile.c". */
1317 +#include <rpm/rpmlib.h>
1318 +#include <rpm/rpmts.h>
1319 +#include <rpm/rpmdb.h>
1320 +#include <rpm/header.h>
1321 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1322 +extern int rpmReadConfigFiles(const char * file, const char * target);
1323 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1324 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1325 +extern rpmts rpmtsCreate(void);
1326 +extern rpmts rpmtsFree(rpmts ts);
1327 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1328 + const void * keyp, size_t keylen);
1338 +rm -f conftest.$ac_objext
1339 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1340 + (eval $ac_compile) 2>conftest.er1
1342 + grep -v '^ *+' conftest.er1 >conftest.err
1343 + rm -f conftest.er1
1344 + cat conftest.err >&5
1345 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1346 + (exit $ac_status); } &&
1347 + { ac_try='test -z "$ac_c_werror_flag"
1348 + || test ! -s conftest.err'
1349 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1350 + (eval $ac_try) 2>&5
1352 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1353 + (exit $ac_status); }; } &&
1354 + { ac_try='test -s conftest.$ac_objext'
1355 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1356 + (eval $ac_try) 2>&5
1358 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
1359 + (exit $ac_status); }; }; then
1361 + LIBRPM_COMPAT=true
1362 + echo "$as_me:$LINENO: result: yes" >&5
1363 +echo "${ECHO_T}yes" >&6
1366 + echo "$as_me: failed program was:" >&5
1367 +sed 's/^/| /' conftest.$ac_ext >&5
1370 + LIBRPM_COMPAT=false
1371 + echo "$as_me:$LINENO: result: no" >&5
1372 +echo "${ECHO_T}no" >&6
1375 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
1376 + CFLAGS="$save_CFLAGS"
1378 + if ! $LIBRPM_COMPAT; then
1380 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1384 + if $HAVE_LIBRPM; then
1386 +cat >>confdefs.h <<\_ACEOF
1387 +#define HAVE_LIBRPM 1
1390 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1391 + LIBS="$LIBS $RPM_LIBS"
1393 + if $RPM_REQUIRE; then
1394 + { { echo "$as_me:$LINENO: error: $RPM_PKG_ERRORS" >&5
1395 +echo "$as_me: error: $RPM_PKG_ERRORS" >&2;}
1396 + { (exit 1); exit 1; }; }
1398 + { echo "$as_me:$LINENO: WARNING: $RPM_PKG_ERRORS" >&5
1399 +echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
1408 @@ -8623,7 +9181,6 @@ done
1409 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1410 # OS/2's system install, which has a completely different semantic
1411 # ./install, which can be erroneously created by make from ./install.sh.
1412 -# Reject install programs that cannot install multiple files.
1413 echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
1414 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
1415 if test -z "$INSTALL"; then
1416 @@ -8657,18 +9214,8 @@ case $as_dir/ in
1417 # program-specific install script used by HP pwplus--don't use.
1420 - rm -rf conftest.one conftest.two conftest.dir
1421 - echo one > conftest.one
1422 - echo two > conftest.two
1423 - mkdir conftest.dir
1424 - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
1425 - test -s conftest.one && test -s conftest.two &&
1426 - test -s conftest.dir/conftest.one &&
1427 - test -s conftest.dir/conftest.two
1429 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
1432 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
1437 @@ -8677,16 +9224,15 @@ case $as_dir/ in
1441 -rm -rf conftest.one conftest.two conftest.dir
1444 if test "${ac_cv_path_install+set}" = set; then
1445 INSTALL=$ac_cv_path_install
1447 - # As a last resort, use the slow shell script. Don't cache a
1448 - # value for INSTALL within a source directory, because that will
1449 + # As a last resort, use the slow shell script. We don't cache a
1450 + # path for INSTALL within a source directory, because that will
1451 # break other packages using the cache if that directory is
1452 - # removed, or if the value is a relative name.
1453 + # removed, or if the path is relative.
1454 INSTALL=$ac_install_sh
1457 @@ -22270,6 +22816,10 @@ s,@am__fastdepCC_TRUE@,$am__fastdepCC_TR
1458 s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
1459 s,@GDB_DATADIR_PATH@,$GDB_DATADIR_PATH,;t t
1460 s,@pythondir@,$pythondir,;t t
1461 +s,@PKG_CONFIG@,$PKG_CONFIG,;t t
1462 +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
1463 +s,@RPM_CFLAGS@,$RPM_CFLAGS,;t t
1464 +s,@RPM_LIBS@,$RPM_LIBS,;t t
1465 s,@subdirs@,$subdirs,;t t
1466 s,@TARGET_OBS@,$TARGET_OBS,;t t
1467 s,@PKGVERSION@,$PKGVERSION,;t t
1468 Index: gdb-6.8.50.20090302/gdb/configure.ac
1469 ===================================================================
1470 --- gdb-6.8.50.20090302.orig/gdb/configure.ac 2009-03-07 17:13:33.000000000 +0100
1471 +++ gdb-6.8.50.20090302/gdb/configure.ac 2009-03-07 17:25:06.000000000 +0100
1472 @@ -162,6 +162,199 @@ else
1476 +# Integration with rpm library to support missing debuginfo suggestions.
1477 +# --without-rpm: Disable any rpm support.
1478 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
1479 +# Even with runtime missing `libname.so' GDB will still other run correctly.
1480 +# Missing `libname.so' during ./configure will abort the configuration.
1481 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
1482 +# minor version first such as `librpm-4.6.so' as minor version differences
1483 +# mean API+ABI incompatibility. If the specific match versioned library name
1484 +# could not be found still open dynamically at least `librpm.so'.
1485 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
1486 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
1487 +# be probably linked with the version specific library (as `librpm-4.6.so').
1488 +# Failure to find librpm by pkg-config will abort the configuration.
1489 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
1490 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
1493 + [AS_HELP_STRING([--with-rpm],
1494 + [query rpm database for missing debuginfos [yes/no, def. auto=librpm.so]])], [], [with_rpm="auto"])
1496 +m4_pattern_allow([^AC_MSG_ERROR$])
1497 +m4_pattern_allow([^AC_MSG_WARN$])
1498 +if test "x$with_rpm" != "xno"; then
1499 + if test "x$with_rpm" = "xyes"; then
1500 + LIBRPM="librpm.so"
1502 + DLOPEN_REQUIRE=false
1503 + elif test "x$with_rpm" = "xauto"; then
1504 + LIBRPM="librpm.so"
1506 + DLOPEN_REQUIRE=false
1508 + LIBRPM="$with_rpm"
1510 + DLOPEN_REQUIRE=true
1512 + LIBRPM_STRING='"'"$LIBRPM"'"'
1514 + AC_MSG_CHECKING([specific librpm version])
1515 + HAVE_DLOPEN_LIBRPM=false
1518 + AC_RUN_IFELSE(AC_LANG_PROGRAM([[
1519 +#include <rpm/rpmlib.h>
1524 + const char *const *rpmverp;
1527 + f = fopen ("conftest.out", "w");
1530 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
1531 + strerror (errno));
1534 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
1537 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
1540 + rpmverp = dlsym (h, "RPMVERSION");
1543 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
1546 + fprintf (stderr, "RPMVERSION is: \"");
1547 + fprintf (stderr, "%s\"\n", *rpmverp);
1549 + /* Try to find the specific librpm version only for "librpm.so" as we do
1550 + not know how to assemble the version string otherwise. */
1552 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
1554 + fprintf (f, "%s\n", $LIBRPM_STRING);
1563 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
1565 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
1566 + fprintf (f, "%s\n", $LIBRPM_STRING);
1569 + /* Avoid the square brackets by malloc. */
1570 + h2_name = malloc (64);
1571 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
1572 + h2 = dlopen (h2_name, RTLD_LAZY);
1575 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
1576 + fprintf (f, "%s\n", $LIBRPM_STRING);
1581 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
1582 + $LIBRPM_STRING, h2_name);
1583 + fprintf (f, "%s\n", $LIBRPM_STRING);
1586 + /* Found the valid .so name with a specific version. */
1587 + fprintf (f, "%s\n", h2_name);
1591 + DLOPEN_LIBRPM="`cat conftest.out`"
1592 + if test "x$DLOPEN_LIBRPM" != "x"; then
1593 + HAVE_DLOPEN_LIBRPM=true
1594 + AC_MSG_RESULT($DLOPEN_LIBRPM)
1597 + rm -f conftest.out
1599 + m4_define([CHECK_LIBRPM_COMPAT], [
1600 + AC_MSG_CHECKING([rpm library API compatibility])
1601 + # The compilation requires -Werror to verify anything.
1602 + save_CFLAGS="$CFLAGS"
1603 + CFLAGS="$CFLAGS -Werror"
1604 + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
1605 +/* Duplicate here the declarations to verify they match "symfile.c". */
1606 +#include <rpm/rpmlib.h>
1607 +#include <rpm/rpmts.h>
1608 +#include <rpm/rpmdb.h>
1609 +#include <rpm/header.h>
1610 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1611 +extern int rpmReadConfigFiles(const char * file, const char * target);
1612 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1613 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1614 +extern rpmts rpmtsCreate(void);
1615 +extern rpmts rpmtsFree(rpmts ts);
1616 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1617 + const void * keyp, size_t keylen);
1619 + LIBRPM_COMPAT=true
1620 + AC_MSG_RESULT(yes)
1622 + LIBRPM_COMPAT=false
1625 + CFLAGS="$save_CFLAGS"
1628 + if $HAVE_DLOPEN_LIBRPM; then
1629 + CHECK_LIBRPM_COMPAT
1630 + if ! $LIBRPM_COMPAT; then
1631 + HAVE_DLOPEN_LIBRPM=false
1635 + if $HAVE_DLOPEN_LIBRPM; then
1636 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
1637 + AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
1638 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1642 + if $DLOPEN_REQUIRE; then
1643 + AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
1645 + PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
1647 + if $HAVE_LIBRPM; then
1648 + CHECK_LIBRPM_COMPAT
1649 + if ! $LIBRPM_COMPAT; then
1651 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1655 + if $HAVE_LIBRPM; then
1656 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1657 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1658 + LIBS="$LIBS $RPM_LIBS"
1660 + if $RPM_REQUIRE; then
1661 + AC_MSG_ERROR($RPM_PKG_ERRORS)
1663 + AC_MSG_WARN($RPM_PKG_ERRORS)
1670 AC_CONFIG_SUBDIRS(doc testsuite)