1 Index: gdb-7.1.90.20100806/gdb/event-top.c
2 ===================================================================
3 --- gdb-7.1.90.20100806.orig/gdb/event-top.c 2010-08-06 17:42:01.000000000 +0200
4 +++ gdb-7.1.90.20100806/gdb/event-top.c 2010-08-06 17:42:05.000000000 +0200
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-7.1.90.20100806/gdb/elfread.c
32 ===================================================================
33 --- gdb-7.1.90.20100806.orig/gdb/elfread.c 2010-08-06 17:42:01.000000000 +0200
34 +++ gdb-7.1.90.20100806/gdb/elfread.c 2010-08-06 18:11:49.000000000 +0200
39 +#include "elf/external.h"
41 extern void _initialize_elfread (void);
43 @@ -1371,8 +1372,357 @@ build_id_to_filename (struct build_id *b
49 +#include <rpm/rpmlib.h>
50 +#include <rpm/rpmts.h>
51 +#include <rpm/rpmdb.h>
52 +#include <rpm/header.h>
57 +/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
58 + and avoid their duplicities during a single inferior run. */
60 +static struct htab *missing_rpm_hash;
62 +/* This MISSING_RPM_LIST tracker is used to collect and print as a single line
63 + all the rpms right before the nearest GDB prompt. It gets cleared after
64 + each such print (it is questionable if we should clear it after the print).
69 + struct missing_rpm *next;
72 +static struct missing_rpm *missing_rpm_list;
73 +static int missing_rpm_list_entries;
75 +/* Returns the count of newly added rpms. */
78 +missing_rpm_enlist (const char *filename)
80 + static int rpm_init_done = 0;
82 + rpmdbMatchIterator mi;
86 + /* Duplicate here the declarations to verify they match. The same sanity
87 + check is present also in `configure.ac'. */
88 + extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
89 + static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg);
90 + extern int rpmReadConfigFiles(const char * file, const char * target);
91 + static int (*rpmReadConfigFiles_p) (const char * file, const char * target);
92 + extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
93 + static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi);
94 + extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
95 + static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi);
96 + extern rpmts rpmtsCreate(void);
97 + static rpmts (*rpmtsCreate_p) (void);
98 + extern rpmts rpmtsFree(rpmts ts);
99 + static rpmts (*rpmtsFree_p) (rpmts ts);
100 + extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
101 + const void * keyp, size_t keylen);
102 + static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts,
106 +#else /* !DLOPEN_LIBRPM */
107 +# define headerFormat_p headerFormat
108 +# define rpmReadConfigFiles_p rpmReadConfigFiles
109 +# define rpmdbFreeIterator_p rpmdbFreeIterator
110 +# define rpmdbNextIterator_p rpmdbNextIterator
111 +# define rpmtsCreate_p rpmtsCreate
112 +# define rpmtsFree_p rpmtsFree
113 +# define rpmtsInitIterator_p rpmtsInitIterator
114 +#endif /* !DLOPEN_LIBRPM */
116 + gdb_assert (filename != NULL);
117 + if (filename[0] != '/')
119 + warning (_("Ignoring non-absolute filename: <%s>"), filename);
123 + if (!rpm_init_done)
125 + static int init_tried;
127 + /* Already failed the initialization before? */
132 +#ifdef DLOPEN_LIBRPM
136 + h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
139 + warning (_("Unable to open \"%s\" (%s), "
140 + "missing debuginfos notifications will not be displayed"),
141 + DLOPEN_LIBRPM, dlerror ());
145 + if (!((headerFormat_p = dlsym (h, "headerFormat"))
146 + && (rpmReadConfigFiles_p = dlsym (h, "rpmReadConfigFiles"))
147 + && (rpmdbFreeIterator_p = dlsym (h, "rpmdbFreeIterator"))
148 + && (rpmdbNextIterator_p = dlsym (h, "rpmdbNextIterator"))
149 + && (rpmtsCreate_p = dlsym (h, "rpmtsCreate"))
150 + && (rpmtsFree_p = dlsym (h, "rpmtsFree"))
151 + && (rpmtsInitIterator_p = dlsym (h, "rpmtsInitIterator"))))
153 + warning (_("Opened library \"%s\" is incompatible (%s), "
154 + "missing debuginfos notifications will not be displayed"),
155 + DLOPEN_LIBRPM, dlerror ());
157 + warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
162 +#endif /* DLOPEN_LIBRPM */
164 + if (rpmReadConfigFiles_p (NULL, NULL) != 0)
166 + warning (_("Error reading the rpm configuration files"));
173 + ts = rpmtsCreate_p ();
175 + mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
181 + char *debuginfo, **slot, *s, *s2;
183 + size_t srcrpmlen = sizeof (".src.rpm") - 1;
184 + size_t debuginfolen = sizeof ("-debuginfo") - 1;
185 + rpmdbMatchIterator mi_debuginfo;
187 + h = rpmdbNextIterator_p (mi);
191 + /* Verify the debuginfo file is not already installed. */
193 + debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
197 + warning (_("Error querying the rpm file `%s': %s"), filename,
201 + /* s = `.src.rpm-debuginfo.%{arch}' */
202 + s = strrchr (debuginfo, '-') - srcrpmlen;
204 + if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
206 + /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
207 + s2 = memrchr (debuginfo, '-', s - debuginfo);
211 + /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
212 + s2 = memrchr (debuginfo, '-', s2 - debuginfo);
216 + warning (_("Error querying the rpm file `%s': %s"), filename,
221 + /* s = `.src.rpm-debuginfo.%{arch}' */
222 + /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
223 + memmove (s2 + debuginfolen, s2, s - s2);
224 + memcpy (s2, "-debuginfo", debuginfolen);
225 + /* s = `XXXX.%{arch}' */
226 + /* strlen ("XXXX") == srcrpmlen + debuginfolen */
227 + /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */
228 + /* strlen ("XX") == srcrpmlen */
229 + memmove (s + debuginfolen, s + srcrpmlen + debuginfolen,
230 + strlen (s + srcrpmlen + debuginfolen) + 1);
231 + /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
233 + /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
234 + /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
235 + mi_debuginfo = rpmtsInitIterator_p (ts, RPMDBI_LABEL, debuginfo, 0);
239 + rpmdbFreeIterator_p (mi_debuginfo);
244 + /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
245 + debuginfo = headerFormat_p (h,
246 + "%{name}-%{version}-%{release}.%{arch}",
250 + warning (_("Error querying the rpm file `%s': %s"), filename,
255 + /* Base package name for `debuginfo-install'. We do not use the
256 + `yum' command directly as the line
257 + yum --disablerepo='*' --enablerepo='*-debuginfo' \
258 + install NAME-debuginfo.ARCH
259 + would be more complicated than just:
260 + debuginfo-install NAME-VERSION-RELEASE.ARCH
261 + Do not supply the rpm base name (derived from .src.rpm name) as
262 + debuginfo-install is unable to install the debuginfo package if
263 + the base name PKG binary rpm is not installed while for example
264 + PKG-libs would be installed (RH Bug 467901).
265 + FUTURE: After multiple debuginfo versions simultaneously installed
266 + get supported the support for the VERSION-RELEASE tags handling
267 + may need an update. */
269 + if (missing_rpm_hash == NULL)
271 + /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
272 + should not deallocate the entries. */
274 + missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
275 + (int (*) (const void *, const void *)) streq,
276 + NULL, xcalloc, xfree);
278 + slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
279 + /* XCALLOC never returns NULL. */
280 + gdb_assert (slot != NULL);
283 + struct missing_rpm *missing_rpm;
287 + missing_rpm = xmalloc (sizeof (*missing_rpm) + strlen (debuginfo));
288 + strcpy (missing_rpm->rpm, debuginfo);
289 + missing_rpm->next = missing_rpm_list;
290 + missing_rpm_list = missing_rpm;
291 + missing_rpm_list_entries++;
298 + rpmdbFreeIterator_p (mi);
307 +missing_rpm_list_compar (const char *const *ap, const char *const *bp)
309 + return strcoll (*ap, *bp);
312 +/* It returns a NULL-terminated array of strings needing to be FREEd. It may
313 + also return only NULL. */
316 +missing_rpm_list_print (void)
318 + char **array, **array_iter;
319 + struct missing_rpm *list_iter;
320 + struct cleanup *cleanups;
322 + if (missing_rpm_list_entries == 0)
325 + array = xmalloc (sizeof (*array) * missing_rpm_list_entries);
326 + cleanups = make_cleanup (xfree, array);
328 + array_iter = array;
329 + for (list_iter = missing_rpm_list; list_iter != NULL;
330 + list_iter = list_iter->next)
332 + *array_iter++ = list_iter->rpm;
334 + gdb_assert (array_iter == array + missing_rpm_list_entries);
336 + qsort (array, missing_rpm_list_entries, sizeof (*array),
337 + (int (*) (const void *, const void *)) missing_rpm_list_compar);
339 + printf_unfiltered (_("Missing separate debuginfos, use: %s"),
340 + "debuginfo-install");
341 + for (array_iter = array; array_iter < array + missing_rpm_list_entries;
344 + putchar_unfiltered (' ');
345 + puts_unfiltered (*array_iter);
347 + putchar_unfiltered ('\n');
349 + while (missing_rpm_list != NULL)
351 + list_iter = missing_rpm_list;
352 + missing_rpm_list = list_iter->next;
355 + missing_rpm_list_entries = 0;
357 + do_cleanups (cleanups);
361 +missing_rpm_change (void)
363 + debug_flush_missing ();
365 + gdb_assert (missing_rpm_list == NULL);
366 + if (missing_rpm_hash != NULL)
368 + htab_delete (missing_rpm_hash);
369 + missing_rpm_hash = NULL;
375 + /* Init state. EXEC_BFD also still could be NULL. */
376 + MISSING_EXEC_NOT_TRIED,
377 + /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */
378 + MISSING_EXEC_NOT_FOUND,
379 + /* We found EXEC_BFD by RPM and we either have its symbols (either embedded
380 + or separate) or the main executable's RPM is now contained in
381 + MISSING_RPM_HASH. */
382 + MISSING_EXEC_ENLISTED
384 +static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
386 +#endif /* HAVE_LIBRPM */
389 +debug_flush_missing (void)
392 + missing_rpm_list_print ();
396 /* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
397 - Try to install the hash file ...
398 + yum --disablerepo='*' --enablerepo='*-debuginfo' install ...
401 struct missing_filepair
402 @@ -1426,11 +1776,17 @@ missing_filepair_change (void)
403 /* All their memory came just from missing_filepair_OBSTACK. */
404 missing_filepair_hash = NULL;
407 + missing_exec = MISSING_EXEC_NOT_TRIED;
412 debug_print_executable_changed (void)
415 + missing_rpm_change ();
417 missing_filepair_change ();
420 @@ -1497,14 +1853,35 @@ debug_print_missing (const char *binary,
422 *slot = missing_filepair;
424 - /* We do not collect and flush these messages as each such message
425 - already requires its own separate lines. */
427 + if (missing_exec == MISSING_EXEC_NOT_TRIED)
429 + char *exec_filename;
431 - fprintf_unfiltered (gdb_stdlog,
432 - _("Missing separate debuginfo for %s\n"), binary);
434 - fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
436 + exec_filename = get_exec_file (0);
437 + if (exec_filename != NULL)
439 + if (missing_rpm_enlist (exec_filename) == 0)
440 + missing_exec = MISSING_EXEC_NOT_FOUND;
442 + missing_exec = MISSING_EXEC_ENLISTED;
445 + if (missing_exec != MISSING_EXEC_ENLISTED)
446 + if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0)
447 + && (debug == NULL || missing_rpm_enlist (debug) == 0))
448 +#endif /* HAVE_LIBRPM */
450 + /* We do not collect and flush these messages as each such message
451 + already requires its own separate lines. */
453 + fprintf_unfiltered (gdb_stdlog,
454 + _("Missing separate debuginfo for %s\n"), binary);
456 + fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"),
457 + "yum --disablerepo='*' --enablerepo='*-debuginfo'"
458 + " install", debug);
463 Index: gdb-7.1.90.20100806/gdb/symfile.h
464 ===================================================================
465 --- gdb-7.1.90.20100806.orig/gdb/symfile.h 2010-08-06 17:42:01.000000000 +0200
466 +++ gdb-7.1.90.20100806/gdb/symfile.h 2010-08-06 17:42:05.000000000 +0200
467 @@ -577,6 +577,7 @@ extern struct build_id *build_id_addr_ge
468 extern char *build_id_to_filename (struct build_id *build_id,
469 char **link_return, int add_debug_suffix);
470 extern void debug_print_missing (const char *binary, const char *debug);
471 +extern void debug_flush_missing (void);
473 /* From dwarf2read.c */
475 Index: gdb-7.1.90.20100806/gdb/testsuite/lib/gdb.exp
476 ===================================================================
477 --- gdb-7.1.90.20100806.orig/gdb/testsuite/lib/gdb.exp 2010-08-06 17:42:01.000000000 +0200
478 +++ gdb-7.1.90.20100806/gdb/testsuite/lib/gdb.exp 2010-08-06 17:42:05.000000000 +0200
479 @@ -1359,7 +1359,7 @@ proc default_gdb_start { } {
480 warning "Couldn't set the width to 0."
483 - # Turn off the missing warnings as the testsuite does not expect it.
484 + # Turn off the missing RPMs warnings as the testsuite does not expect it.
485 send_gdb "set build-id-verbose 0\n"
487 -re "$gdb_prompt $" {
488 Index: gdb-7.1.90.20100806/gdb/testsuite/lib/mi-support.exp
489 ===================================================================
490 --- gdb-7.1.90.20100806.orig/gdb/testsuite/lib/mi-support.exp 2010-08-06 17:42:01.000000000 +0200
491 +++ gdb-7.1.90.20100806/gdb/testsuite/lib/mi-support.exp 2010-08-06 17:42:05.000000000 +0200
492 @@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } {
496 - # Turn off the missing warnings as the testsuite does not expect it.
497 + # Turn off the missing RPMs warnings as the testsuite does not expect it.
498 send_gdb "190-gdb-set build-id-verbose 0\n"
500 -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
501 Index: gdb-7.1.90.20100806/gdb/tui/tui-interp.c
502 ===================================================================
503 --- gdb-7.1.90.20100806.orig/gdb/tui/tui-interp.c 2010-08-06 17:42:01.000000000 +0200
504 +++ gdb-7.1.90.20100806/gdb/tui/tui-interp.c 2010-08-06 17:42:05.000000000 +0200
507 #include "tui/tui-io.h"
508 #include "exceptions.h"
509 +#include "symfile.h"
511 /* Set to 1 when the TUI mode must be activated when we first start
513 @@ -146,6 +147,8 @@ tui_command_loop (void *data)
515 char *gdb_prompt = get_prompt ();
517 + debug_flush_missing ();
519 /* Tell readline what the prompt to display is and what function
520 it will need to call after a whole line is read. This also
521 displays the first prompt. */
522 Index: gdb-7.1.90.20100806/gdb/aclocal.m4
523 ===================================================================
524 --- gdb-7.1.90.20100806.orig/gdb/aclocal.m4 2010-08-06 17:42:01.000000000 +0200
525 +++ gdb-7.1.90.20100806/gdb/aclocal.m4 2010-08-06 17:42:05.000000000 +0200
526 @@ -19,6 +19,162 @@ You have another version of autoconf. I
527 If you have problems, you may need to regenerate the build system entirely.
528 To do so, use the procedure documented by the package, typically `autoreconf'.])])
530 +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
532 +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
534 +# This program is free software; you can redistribute it and/or modify
535 +# it under the terms of the GNU General Public License as published by
536 +# the Free Software Foundation; either version 2 of the License, or
537 +# (at your option) any later version.
539 +# This program is distributed in the hope that it will be useful, but
540 +# WITHOUT ANY WARRANTY; without even the implied warranty of
541 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
542 +# General Public License for more details.
544 +# You should have received a copy of the GNU General Public License
545 +# along with this program; if not, write to the Free Software
546 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
548 +# As a special exception to the GNU General Public License, if you
549 +# distribute this file as part of a program that contains a
550 +# configuration script generated by Autoconf, you may include it under
551 +# the same distribution terms that you use for the rest of that program.
553 +# PKG_PROG_PKG_CONFIG([MIN-VERSION])
554 +# ----------------------------------
555 +AC_DEFUN([PKG_PROG_PKG_CONFIG],
556 +[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
557 +m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
558 +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
559 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
560 + AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
562 +if test -n "$PKG_CONFIG"; then
563 + _pkg_min_version=m4_default([$1], [0.9.0])
564 + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
565 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
566 + AC_MSG_RESULT([yes])
568 + AC_MSG_RESULT([no])
573 +])# PKG_PROG_PKG_CONFIG
575 +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
577 +# Check to see whether a particular set of modules exists. Similar
578 +# to PKG_CHECK_MODULES(), but does not set variables or print errors.
581 +# Similar to PKG_CHECK_MODULES, make sure that the first instance of
582 +# this or PKG_CHECK_MODULES is called, or make sure to call
583 +# PKG_CHECK_EXISTS manually
584 +# --------------------------------------------------------------
585 +AC_DEFUN([PKG_CHECK_EXISTS],
586 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
587 +if test -n "$PKG_CONFIG" && \
588 + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
589 + m4_ifval([$2], [$2], [:])
590 +m4_ifvaln([$3], [else
595 +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
596 +# ---------------------------------------------
597 +m4_define([_PKG_CONFIG],
598 +[if test -n "$$1"; then
600 + elif test -n "$PKG_CONFIG"; then
601 + PKG_CHECK_EXISTS([$3],
602 + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
609 +# _PKG_SHORT_ERRORS_SUPPORTED
610 +# -----------------------------
611 +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
612 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
613 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
614 + _pkg_short_errors_supported=yes
616 + _pkg_short_errors_supported=no
618 +])# _PKG_SHORT_ERRORS_SUPPORTED
621 +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
622 +# [ACTION-IF-NOT-FOUND])
625 +# Note that if there is a possibility the first call to
626 +# PKG_CHECK_MODULES might not happen, you should be sure to include an
627 +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
630 +# --------------------------------------------------------------
631 +AC_DEFUN([PKG_CHECK_MODULES],
632 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
633 +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
634 +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
637 +AC_MSG_CHECKING([for $1])
639 +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
640 +_PKG_CONFIG([$1][_LIBS], [libs], [$2])
642 +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
643 +and $1[]_LIBS to avoid the need to call pkg-config.
644 +See the pkg-config man page for more details.])
646 +if test $pkg_failed = yes; then
647 + _PKG_SHORT_ERRORS_SUPPORTED
648 + if test $_pkg_short_errors_supported = yes; then
649 + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
651 + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
653 + # Put the nasty error message in config.log where it belongs
654 + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
656 + ifelse([$4], , [AC_MSG_ERROR(dnl
657 +[Package requirements ($2) were not met:
661 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
662 +installed software in a non-standard prefix.
666 + [AC_MSG_RESULT([no])
668 +elif test $pkg_failed = untried; then
669 + ifelse([$4], , [AC_MSG_FAILURE(dnl
670 +[The pkg-config script could not be found or is too old. Make sure it
671 +is in your PATH or set the PKG_CONFIG environment variable to the full
676 +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
679 + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
680 + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
681 + AC_MSG_RESULT([yes])
682 + ifelse([$3], , :, [$3])
684 +])# PKG_CHECK_MODULES
686 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
688 # This file is free software; the Free Software Foundation
689 Index: gdb-7.1.90.20100806/gdb/config.in
690 ===================================================================
691 --- gdb-7.1.90.20100806.orig/gdb/config.in 2010-08-06 17:42:01.000000000 +0200
692 +++ gdb-7.1.90.20100806/gdb/config.in 2010-08-06 17:42:05.000000000 +0200
694 /* Define to BFD's default target vector. */
695 #undef DEFAULT_BFD_VEC
697 +/* librpm version specific library name to dlopen. */
698 +#undef DLOPEN_LIBRPM
700 /* Define to 1 if translation of program messages to the user's native
701 language is requested. */
704 /* Define if Python 2.7 is being used. */
705 #undef HAVE_LIBPYTHON2_7
707 +/* Define if librpm library is being used. */
710 /* Define if libunwind library is being used. */
711 #undef HAVE_LIBUNWIND
713 Index: gdb-7.1.90.20100806/gdb/configure
714 ===================================================================
715 --- gdb-7.1.90.20100806.orig/gdb/configure 2010-08-06 17:42:01.000000000 +0200
716 +++ gdb-7.1.90.20100806/gdb/configure 2010-08-06 17:42:05.000000000 +0200
717 @@ -679,6 +679,9 @@ REPORT_BUGS_TO
727 @@ -948,6 +951,7 @@ with_separate_debug_dir
729 with_relocated_sources
735 @@ -988,6 +992,9 @@ LDFLAGS
745 @@ -1653,6 +1660,8 @@ Optional Packages:
747 --with-pythondir install Python data files in this path
749 + --with-rpm query rpm database for missing debuginfos (yes/no,
750 + def. auto=librpm.so)
751 --with-libunwind use libunwind frame unwinding support
752 --with-curses use the curses library instead of the termcap
754 @@ -1688,6 +1697,9 @@ Some influential environment variables:
755 CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
756 you have headers in a nonstandard directory <include dir>
758 + PKG_CONFIG path to pkg-config utility
759 + RPM_CFLAGS C compiler flags for RPM, overriding pkg-config
760 + RPM_LIBS linker flags for RPM, overriding pkg-config
761 YACC The `Yet Another C Compiler' implementation to use. Defaults to
762 the first program found out of: `bison -y', `byacc', `yacc'.
763 YFLAGS The list of arguments that will be passed by default to $YACC.
764 @@ -7951,6 +7963,485 @@ _ACEOF
768 +# Integration with rpm library to support missing debuginfo suggestions.
769 +# --without-rpm: Disable any rpm support.
770 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
771 +# Even with runtime missing `libname.so' GDB will still other run correctly.
772 +# Missing `libname.so' during ./configure will abort the configuration.
773 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
774 +# minor version first such as `librpm-4.6.so' as minor version differences
775 +# mean API+ABI incompatibility. If the specific match versioned library name
776 +# could not be found still open dynamically at least `librpm.so'.
777 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
778 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
779 +# be probably linked with the version specific library (as `librpm-4.6.so').
780 +# Failure to find librpm by pkg-config will abort the configuration.
781 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
782 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
785 +# Check whether --with-rpm was given.
786 +if test "${with_rpm+set}" = set; then :
795 +if test "x$with_rpm" != "xno"; then
796 + if test "x$with_rpm" = "xyes"; then
799 + DLOPEN_REQUIRE=false
800 + elif test "x$with_rpm" = "xauto"; then
803 + DLOPEN_REQUIRE=false
807 + DLOPEN_REQUIRE=true
809 + LIBRPM_STRING='"'"$LIBRPM"'"'
811 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5
812 +$as_echo_n "checking specific librpm version... " >&6; }
813 + HAVE_DLOPEN_LIBRPM=false
816 + if test "$cross_compiling" = yes; then :
817 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
818 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
819 +as_fn_error "cannot run test program while cross compiling
820 +See \`config.log' for more details." "$LINENO" 5; }
822 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
823 +/* end confdefs.h. */
825 +#include <rpm/rpmlib.h>
834 + const char *const *rpmverp;
837 + f = fopen ("conftest.out", "w");
840 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
844 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
847 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
850 + rpmverp = dlsym (h, "RPMVERSION");
853 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
856 + fprintf (stderr, "RPMVERSION is: \"");
857 + fprintf (stderr, "%s\"\n", *rpmverp);
859 + /* Try to find the specific librpm version only for "librpm.so" as we do
860 + not know how to assemble the version string otherwise. */
862 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
864 + fprintf (f, "%s\n", $LIBRPM_STRING);
873 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
875 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
876 + fprintf (f, "%s\n", $LIBRPM_STRING);
879 + /* Avoid the square brackets by malloc. */
880 + h2_name = malloc (64);
881 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
882 + h2 = dlopen (h2_name, RTLD_LAZY);
885 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
886 + fprintf (f, "%s\n", $LIBRPM_STRING);
891 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
892 + $LIBRPM_STRING, h2_name);
893 + fprintf (f, "%s\n", $LIBRPM_STRING);
896 + /* Found the valid .so name with a specific version. */
897 + fprintf (f, "%s\n", h2_name);
905 +if ac_fn_c_try_run "$LINENO"; then :
907 + DLOPEN_LIBRPM="`cat conftest.out`"
908 + if test "x$DLOPEN_LIBRPM" != "x"; then
909 + HAVE_DLOPEN_LIBRPM=true
910 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5
911 +$as_echo "$DLOPEN_LIBRPM" >&6; }
915 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
916 + conftest.$ac_objext conftest.beam conftest.$ac_ext
923 + if $HAVE_DLOPEN_LIBRPM; then
925 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
926 +$as_echo_n "checking rpm library API compatibility... " >&6; }
927 + # The compilation requires -Werror to verify anything.
928 + save_CFLAGS="$CFLAGS"
929 + CFLAGS="$CFLAGS -Werror"
930 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
931 +/* end confdefs.h. */
933 +/* Duplicate here the declarations to verify they match "elfread.c". */
934 +#include <rpm/rpmlib.h>
935 +#include <rpm/rpmts.h>
936 +#include <rpm/rpmdb.h>
937 +#include <rpm/header.h>
938 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
939 +extern int rpmReadConfigFiles(const char * file, const char * target);
940 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
941 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
942 +extern rpmts rpmtsCreate(void);
943 +extern rpmts rpmtsFree(rpmts ts);
944 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
945 + const void * keyp, size_t keylen);
955 +if ac_fn_c_try_compile "$LINENO"; then :
958 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
959 +$as_echo "yes" >&6; }
963 + LIBRPM_COMPAT=false
964 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
965 +$as_echo "no" >&6; }
968 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
969 + CFLAGS="$save_CFLAGS"
971 + if ! $LIBRPM_COMPAT; then
972 + HAVE_DLOPEN_LIBRPM=false
976 + if $HAVE_DLOPEN_LIBRPM; then
977 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
979 +cat >>confdefs.h <<_ACEOF
980 +#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
984 +$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
987 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
988 +$as_echo "no" >&6; }
990 + if $DLOPEN_REQUIRE; then
991 + as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5
995 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
996 + if test -n "$ac_tool_prefix"; then
997 + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
998 +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
999 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1000 +$as_echo_n "checking for $ac_word... " >&6; }
1001 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
1002 + $as_echo_n "(cached) " >&6
1004 + case $PKG_CONFIG in
1005 + [\\/]* | ?:[\\/]*)
1006 + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
1009 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1010 +for as_dir in $PATH
1013 + test -z "$as_dir" && as_dir=.
1014 + for ac_exec_ext in '' $ac_executable_extensions; do
1015 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
1016 + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1017 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1027 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
1028 +if test -n "$PKG_CONFIG"; then
1029 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
1030 +$as_echo "$PKG_CONFIG" >&6; }
1032 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1033 +$as_echo "no" >&6; }
1038 +if test -z "$ac_cv_path_PKG_CONFIG"; then
1039 + ac_pt_PKG_CONFIG=$PKG_CONFIG
1040 + # Extract the first word of "pkg-config", so it can be a program name with args.
1041 +set dummy pkg-config; ac_word=$2
1042 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1043 +$as_echo_n "checking for $ac_word... " >&6; }
1044 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
1045 + $as_echo_n "(cached) " >&6
1047 + case $ac_pt_PKG_CONFIG in
1048 + [\\/]* | ?:[\\/]*)
1049 + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
1052 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1053 +for as_dir in $PATH
1056 + test -z "$as_dir" && as_dir=.
1057 + for ac_exec_ext in '' $ac_executable_extensions; do
1058 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
1059 + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
1060 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1070 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
1071 +if test -n "$ac_pt_PKG_CONFIG"; then
1072 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
1073 +$as_echo "$ac_pt_PKG_CONFIG" >&6; }
1075 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1076 +$as_echo "no" >&6; }
1079 + if test "x$ac_pt_PKG_CONFIG" = x; then
1082 + case $cross_compiling:$ac_tool_warned in
1084 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
1085 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
1086 +ac_tool_warned=yes ;;
1088 + PKG_CONFIG=$ac_pt_PKG_CONFIG
1091 + PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
1095 +if test -n "$PKG_CONFIG"; then
1096 + _pkg_min_version=0.9.0
1097 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
1098 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
1099 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1100 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1101 +$as_echo "yes" >&6; }
1103 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1104 +$as_echo "no" >&6; }
1111 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5
1112 +$as_echo_n "checking for RPM... " >&6; }
1114 +if test -n "$RPM_CFLAGS"; then
1115 + pkg_cv_RPM_CFLAGS="$RPM_CFLAGS"
1116 + elif test -n "$PKG_CONFIG"; then
1117 + if test -n "$PKG_CONFIG" && \
1118 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
1119 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1121 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1122 + test $ac_status = 0; }; then
1123 + pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null`
1128 + pkg_failed=untried
1130 +if test -n "$RPM_LIBS"; then
1131 + pkg_cv_RPM_LIBS="$RPM_LIBS"
1132 + elif test -n "$PKG_CONFIG"; then
1133 + if test -n "$PKG_CONFIG" && \
1134 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5
1135 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5
1137 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1138 + test $ac_status = 0; }; then
1139 + pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null`
1144 + pkg_failed=untried
1149 +if test $pkg_failed = yes; then
1151 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1152 + _pkg_short_errors_supported=yes
1154 + _pkg_short_errors_supported=no
1156 + if test $_pkg_short_errors_supported = yes; then
1157 + RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1`
1159 + RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1`
1161 + # Put the nasty error message in config.log where it belongs
1162 + echo "$RPM_PKG_ERRORS" >&5
1164 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1165 +$as_echo "no" >&6; }
1167 +elif test $pkg_failed = untried; then
1170 + RPM_CFLAGS=$pkg_cv_RPM_CFLAGS
1171 + RPM_LIBS=$pkg_cv_RPM_LIBS
1172 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1173 +$as_echo "yes" >&6; }
1177 + if $HAVE_LIBRPM; then
1179 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5
1180 +$as_echo_n "checking rpm library API compatibility... " >&6; }
1181 + # The compilation requires -Werror to verify anything.
1182 + save_CFLAGS="$CFLAGS"
1183 + CFLAGS="$CFLAGS -Werror"
1184 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1185 +/* end confdefs.h. */
1187 +/* Duplicate here the declarations to verify they match "elfread.c". */
1188 +#include <rpm/rpmlib.h>
1189 +#include <rpm/rpmts.h>
1190 +#include <rpm/rpmdb.h>
1191 +#include <rpm/header.h>
1192 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1193 +extern int rpmReadConfigFiles(const char * file, const char * target);
1194 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1195 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1196 +extern rpmts rpmtsCreate(void);
1197 +extern rpmts rpmtsFree(rpmts ts);
1198 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1199 + const void * keyp, size_t keylen);
1209 +if ac_fn_c_try_compile "$LINENO"; then :
1211 + LIBRPM_COMPAT=true
1212 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1213 +$as_echo "yes" >&6; }
1217 + LIBRPM_COMPAT=false
1218 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1219 +$as_echo "no" >&6; }
1222 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1223 + CFLAGS="$save_CFLAGS"
1225 + if ! $LIBRPM_COMPAT; then
1227 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1231 + if $HAVE_LIBRPM; then
1233 +$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h
1235 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1236 + LIBS="$LIBS $RPM_LIBS"
1238 + if $RPM_REQUIRE; then
1239 + as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5
1241 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5
1242 +$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
1250 Index: gdb-7.1.90.20100806/gdb/configure.ac
1251 ===================================================================
1252 --- gdb-7.1.90.20100806.orig/gdb/configure.ac 2010-08-06 17:42:01.000000000 +0200
1253 +++ gdb-7.1.90.20100806/gdb/configure.ac 2010-08-06 17:42:05.000000000 +0200
1254 @@ -152,6 +152,198 @@ else
1258 +# Integration with rpm library to support missing debuginfo suggestions.
1259 +# --without-rpm: Disable any rpm support.
1260 +# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
1261 +# Even with runtime missing `libname.so' GDB will still other run correctly.
1262 +# Missing `libname.so' during ./configure will abort the configuration.
1263 +# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific
1264 +# minor version first such as `librpm-4.6.so' as minor version differences
1265 +# mean API+ABI incompatibility. If the specific match versioned library name
1266 +# could not be found still open dynamically at least `librpm.so'.
1267 +# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try
1268 +# to find librpm for compilation-time linking by pkg-config. GDB binary will
1269 +# be probably linked with the version specific library (as `librpm-4.6.so').
1270 +# Failure to find librpm by pkg-config will abort the configuration.
1271 +# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config
1272 +# cannot find librpm use to the rpmless compilation (like `--without-rpm').
1275 + [AS_HELP_STRING([--with-rpm],
1276 + [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"])
1278 +m4_pattern_allow([^AC_MSG_ERROR$])
1279 +m4_pattern_allow([^AC_MSG_WARN$])
1280 +if test "x$with_rpm" != "xno"; then
1281 + if test "x$with_rpm" = "xyes"; then
1282 + LIBRPM="librpm.so"
1284 + DLOPEN_REQUIRE=false
1285 + elif test "x$with_rpm" = "xauto"; then
1286 + LIBRPM="librpm.so"
1288 + DLOPEN_REQUIRE=false
1290 + LIBRPM="$with_rpm"
1292 + DLOPEN_REQUIRE=true
1294 + LIBRPM_STRING='"'"$LIBRPM"'"'
1296 + AC_MSG_CHECKING([specific librpm version])
1297 + HAVE_DLOPEN_LIBRPM=false
1300 + AC_RUN_IFELSE(AC_LANG_PROGRAM([[
1301 +#include <rpm/rpmlib.h>
1306 + const char *const *rpmverp;
1309 + f = fopen ("conftest.out", "w");
1312 + fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
1313 + strerror (errno));
1316 + h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
1319 + fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
1322 + rpmverp = dlsym (h, "RPMVERSION");
1325 + fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
1328 + fprintf (stderr, "RPMVERSION is: \"");
1329 + fprintf (stderr, "%s\"\n", *rpmverp);
1331 + /* Try to find the specific librpm version only for "librpm.so" as we do
1332 + not know how to assemble the version string otherwise. */
1334 + if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
1336 + fprintf (f, "%s\n", $LIBRPM_STRING);
1345 + if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
1347 + fprintf (stderr, "Unable to parse RPMVERSION.\n");
1348 + fprintf (f, "%s\n", $LIBRPM_STRING);
1351 + /* Avoid the square brackets by malloc. */
1352 + h2_name = malloc (64);
1353 + sprintf (h2_name, "librpm-%d.%d.so", major, minor);
1354 + h2 = dlopen (h2_name, RTLD_LAZY);
1357 + fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
1358 + fprintf (f, "%s\n", $LIBRPM_STRING);
1363 + fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
1364 + $LIBRPM_STRING, h2_name);
1365 + fprintf (f, "%s\n", $LIBRPM_STRING);
1368 + /* Found the valid .so name with a specific version. */
1369 + fprintf (f, "%s\n", h2_name);
1373 + DLOPEN_LIBRPM="`cat conftest.out`"
1374 + if test "x$DLOPEN_LIBRPM" != "x"; then
1375 + HAVE_DLOPEN_LIBRPM=true
1376 + AC_MSG_RESULT($DLOPEN_LIBRPM)
1379 + rm -f conftest.out
1381 + m4_define([CHECK_LIBRPM_COMPAT], [
1382 + AC_MSG_CHECKING([rpm library API compatibility])
1383 + # The compilation requires -Werror to verify anything.
1384 + save_CFLAGS="$CFLAGS"
1385 + CFLAGS="$CFLAGS -Werror"
1386 + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
1387 +/* Duplicate here the declarations to verify they match "elfread.c". */
1388 +#include <rpm/rpmlib.h>
1389 +#include <rpm/rpmts.h>
1390 +#include <rpm/rpmdb.h>
1391 +#include <rpm/header.h>
1392 +extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
1393 +extern int rpmReadConfigFiles(const char * file, const char * target);
1394 +extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
1395 +extern Header rpmdbNextIterator(rpmdbMatchIterator mi);
1396 +extern rpmts rpmtsCreate(void);
1397 +extern rpmts rpmtsFree(rpmts ts);
1398 +extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
1399 + const void * keyp, size_t keylen);
1401 + LIBRPM_COMPAT=true
1402 + AC_MSG_RESULT(yes)
1404 + LIBRPM_COMPAT=false
1407 + CFLAGS="$save_CFLAGS"
1410 + if $HAVE_DLOPEN_LIBRPM; then
1411 + CHECK_LIBRPM_COMPAT
1412 + if ! $LIBRPM_COMPAT; then
1413 + HAVE_DLOPEN_LIBRPM=false
1417 + if $HAVE_DLOPEN_LIBRPM; then
1418 + DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
1419 + AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.])
1420 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1424 + if $DLOPEN_REQUIRE; then
1425 + AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
1427 + PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
1429 + if $HAVE_LIBRPM; then
1430 + CHECK_LIBRPM_COMPAT
1431 + if ! $LIBRPM_COMPAT; then
1433 + RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1437 + if $HAVE_LIBRPM; then
1438 + AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.])
1439 + CFLAGS="$CFLAGS $RPM_CFLAGS"
1440 + LIBS="$LIBS $RPM_LIBS"
1442 + if $RPM_REQUIRE; then
1443 + AC_MSG_ERROR($RPM_PKG_ERRORS)
1445 + AC_MSG_WARN($RPM_PKG_ERRORS)
1451 AC_CONFIG_SUBDIRS(doc testsuite)
1453 Index: gdb-7.1.90.20100806/gdb/acinclude.m4
1454 ===================================================================
1455 --- gdb-7.1.90.20100806.orig/gdb/acinclude.m4 2010-08-06 17:42:01.000000000 +0200
1456 +++ gdb-7.1.90.20100806/gdb/acinclude.m4 2010-08-06 17:42:05.000000000 +0200
1460 dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
1461 dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
1463 @@ -81,8 +83,6 @@ AC_MSG_RESULT(yes)
1464 # Foundation, Inc., 51 Franklin Street, Fifth Floor,
1465 # Boston, MA 02110-1301, USA.
1469 # @defmac AC_PROG_CC_STDC
1470 # @maindex PROG_CC_STDC