]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-6.6-buildid-locate-rpm.patch
- obsolete file
[packages/gdb.git] / gdb-6.6-buildid-locate-rpm.patch
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
5 @@ -33,6 +33,7 @@
6  #include "cli/cli-script.h"     /* for reset_command_nest_depth */
7  #include "main.h"
8  #include "gdbthread.h"
9 +#include "symfile.h"
10  
11  /* For dont_repeat() */
12  #include "gdbcmd.h"
13 @@ -193,6 +194,8 @@ cli_command_loop (void)
14        char *a_prompt;
15        char *gdb_prompt = get_prompt ();
16  
17 +      debug_flush_missing ();
18 +
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
21           the first prompt. */
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 ();
25  
26 +  debug_flush_missing ();
27 +
28    /* Each interpreter has its own rules on displaying the command
29       prompt.  */
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
35 @@ -55,6 +55,7 @@
36  #include "solib.h"
37  #include "remote.h"
38  #include "libbfd.h"
39 +#include "elf/external.h"
40  
41  #include <sys/types.h>
42  #include <fcntl.h>
43 @@ -63,6 +64,7 @@
44  #include <ctype.h>
45  #include <time.h>
46  #include <sys/time.h>
47 +#include <sys/param.h>
48  
49  
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
52    return retval;
53  }
54  
55 +#ifdef HAVE_LIBRPM
56 +
57 +#include <rpm/rpmlib.h>
58 +#include <rpm/rpmts.h>
59 +#include <rpm/rpmdb.h>
60 +#include <rpm/header.h>
61 +#ifdef DLOPEN_LIBRPM
62 +#include <dlfcn.h>
63 +#endif
64 +
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.  */
67 +
68 +static struct htab *missing_rpm_hash;
69 +
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).
73 +   */
74 +
75 +struct missing_rpm
76 +  {
77 +    struct missing_rpm *next;
78 +    char rpm[1];
79 +  };
80 +static struct missing_rpm *missing_rpm_list;
81 +static int missing_rpm_list_entries;
82 +
83 +/* Returns the count of newly added rpms.  */
84 +
85 +static int
86 +missing_rpm_enlist (const char *filename)
87 +{
88 +  static int rpm_init_done = 0;
89 +  rpmts ts;
90 +  rpmdbMatchIterator mi;
91 +  int count = 0;
92 +
93 +#ifdef DLOPEN_LIBRPM
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,
111 +                                                   rpmTag rpmtag,
112 +                                                   const void *keyp,
113 +                                                   size_t keylen);
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 */
123 +
124 +  if (filename == NULL)
125 +    return 0;
126 +
127 +  if (!rpm_init_done)
128 +    {
129 +      static int init_tried;
130 +
131 +      /* Already failed the initialization before?  */
132 +      if (init_tried)
133 +       return 0;
134 +      init_tried = 1;
135 +
136 +#ifdef DLOPEN_LIBRPM
137 +      {
138 +       void *h;
139 +
140 +       h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY);
141 +       if (!h)
142 +         {
143 +           warning (_("Unable to open \"%s\" (%s), "
144 +                     "missing debuginfos notifications will not be displayed"),
145 +                    DLOPEN_LIBRPM, dlerror ());
146 +           return 0;
147 +         }
148 +
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"))))
156 +         {
157 +           warning (_("Opened library \"%s\" is incompatible (%s), "
158 +                     "missing debuginfos notifications will not be displayed"),
159 +                    DLOPEN_LIBRPM, dlerror ());
160 +           if (dlclose (h))
161 +             warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM,
162 +                      dlerror ());
163 +           return 0;
164 +         }
165 +      }
166 +#endif /* DLOPEN_LIBRPM */
167 +
168 +      if (rpmReadConfigFiles_p (NULL, NULL) != 0)
169 +       {
170 +         warning (_("Error reading the rpm configuration files"));
171 +         return 0;
172 +       }
173 +
174 +      rpm_init_done = 1;
175 +    }
176 +
177 +  ts = rpmtsCreate_p ();
178 +
179 +  mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
180 +  if (mi != NULL)
181 +    {
182 +      for (;;)
183 +       {
184 +         Header h;
185 +         char *debuginfo, **slot, *s, *s2;
186 +         errmsg_t err;
187 +         size_t srcrpmlen = sizeof (".src.rpm") - 1;
188 +         size_t debuginfolen = sizeof ("-debuginfo") - 1;
189 +         rpmdbMatchIterator mi_debuginfo;
190 +
191 +         h = rpmdbNextIterator_p (mi);
192 +         if (h == NULL)
193 +           break;
194 +
195 +         /* Verify the debuginfo file is not already installed.  */
196 +
197 +         debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}",
198 +                                     &err);
199 +         if (!debuginfo)
200 +           {
201 +             warning (_("Error querying the rpm file `%s': %s"), filename,
202 +                      err);
203 +             continue;
204 +           }
205 +         /* s = `.src.rpm-debuginfo.%{arch}' */
206 +         s = strrchr (debuginfo, '-') - srcrpmlen;
207 +         s2 = NULL;
208 +         if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0)
209 +           {
210 +             /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */
211 +             s2 = memrchr (debuginfo, '-', s - debuginfo);
212 +           }
213 +         if (s2)
214 +           {
215 +             /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */
216 +             s2 = memrchr (debuginfo, '-', s2 - debuginfo);
217 +           }
218 +         if (!s2)
219 +           {
220 +             warning (_("Error querying the rpm file `%s': %s"), filename,
221 +                      debuginfo);
222 +             xfree (debuginfo);
223 +             continue;
224 +           }
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}' */
236 +
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);
240 +         xfree (debuginfo);
241 +         if (mi_debuginfo)
242 +           {
243 +             rpmdbFreeIterator_p (mi_debuginfo);
244 +             count = 0;
245 +             break;
246 +           }
247 +
248 +         /* The allocated memory gets utilized below for MISSING_RPM_HASH.  */
249 +         debuginfo = headerFormat_p (h,
250 +                                     "%{name}-%{version}-%{release}.%{arch}",
251 +                                     &err);
252 +         if (!debuginfo)
253 +           {
254 +             warning (_("Error querying the rpm file `%s': %s"), filename,
255 +                      err);
256 +             continue;
257 +           }
258 +
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.  */
271 +
272 +         if (missing_rpm_hash == NULL)
273 +           {
274 +             /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE
275 +                should not deallocate the entries.  */
276 +
277 +             missing_rpm_hash = htab_create_alloc (64, htab_hash_string,
278 +                              (int (*) (const void *, const void *)) streq,
279 +                                                   NULL, xcalloc, xfree);
280 +           }
281 +         slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT);
282 +         /* XCALLOC never returns NULL.  */
283 +         gdb_assert (slot != NULL);
284 +         if (*slot == NULL)
285 +           {
286 +             struct missing_rpm *missing_rpm;
287 +
288 +             *slot = debuginfo;
289 +
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++;
295 +           }
296 +         else
297 +           xfree (debuginfo);
298 +         count++;
299 +       }
300 +
301 +      rpmdbFreeIterator_p (mi);
302 +    }
303 +
304 +  rpmtsFree_p (ts);
305 +
306 +  return count;
307 +}
308 +
309 +static int
310 +missing_rpm_list_compar (const char *const *ap, const char *const *bp)
311 +{
312 +  return strcoll (*ap, *bp);
313 +}
314 +
315 +/* It returns a NULL-terminated array of strings needing to be FREEd.  It may
316 +   also return only NULL.  */
317 +
318 +static void
319 +missing_rpm_list_print (void)
320 +{
321 +  char **array, **array_iter;
322 +  struct missing_rpm *list_iter;
323 +  struct cleanup *cleanups;
324 +
325 +  if (missing_rpm_list_entries == 0)
326 +    return;
327 +
328 +  array = xmalloc (sizeof (*array) * missing_rpm_list_entries);
329 +  cleanups = make_cleanup (xfree, array);
330 +
331 +  array_iter = array;
332 +  for (list_iter = missing_rpm_list; list_iter != NULL;
333 +       list_iter = list_iter->next)
334 +    {
335 +      *array_iter++ = list_iter->rpm;
336 +    }
337 +  gdb_assert (array_iter == array + missing_rpm_list_entries);
338 +
339 +  qsort (array, missing_rpm_list_entries, sizeof (*array),
340 +        (int (*) (const void *, const void *)) missing_rpm_list_compar);
341 +
342 +  printf_unfiltered (_("Missing separate debuginfos, use: %s"),
343 +                    "debuginfo-install");
344 +  for (array_iter = array; array_iter < array + missing_rpm_list_entries;
345 +       array_iter++)
346 +    {
347 +      putchar_unfiltered (' ');
348 +      puts_unfiltered (*array_iter);
349 +    }
350 +  putchar_unfiltered ('\n');
351 +
352 +  while (missing_rpm_list != NULL)
353 +    {
354 +      list_iter = missing_rpm_list;
355 +      missing_rpm_list = list_iter->next;
356 +      xfree (list_iter);
357 +    }
358 +  missing_rpm_list_entries = 0;
359 +
360 +  do_cleanups (cleanups);
361 +}
362 +
363 +static void
364 +missing_rpm_change (void)
365 +{
366 +  debug_flush_missing ();
367 +
368 +  gdb_assert (missing_rpm_list == NULL);
369 +  if (missing_rpm_hash != NULL)
370 +    {
371 +      htab_delete (missing_rpm_hash);
372 +      missing_rpm_hash = NULL;
373 +    }
374 +}
375 +
376 +enum missing_exec
377 +  {
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
386 +  };
387 +static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED;
388 +
389 +#endif /* HAVE_LIBRPM */
390 +
391 +void
392 +debug_flush_missing (void)
393 +{
394 +#ifdef HAVE_LIBRPM
395 +  missing_rpm_list_print ();
396 +#endif
397 +}
398 +
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 ...
402     avoidance.  */
403  
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;
408      }
409 +#ifdef HAVE_LIBRPM
410 +  missing_exec = MISSING_EXEC_NOT_TRIED;
411 +#endif
412  }
413  
414  static void
415  debug_print_executable_changed (void)
416  {
417 +#ifdef HAVE_LIBRPM
418 +  missing_rpm_change ();
419 +#endif
420    missing_filepair_change ();
421  }
422  
423 @@ -1802,14 +2154,33 @@ debug_print_missing (const char *binary,
424      }
425    *slot = missing_filepair;
426  
427 -  /* We do not collect and flush these messages as each such message
428 -     already requires its own separate lines.  */
429 +#ifdef HAVE_LIBRPM
430 +  if (missing_exec == MISSING_EXEC_NOT_TRIED)
431 +    {
432 +      char *exec_filename;
433  
434 -  fprintf_unfiltered (gdb_stdlog,
435 -                     _("Missing separate debuginfo for %s\n"), binary);
436 -  if (debug != NULL)
437 -    fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
438 -                       debug);
439 +      exec_filename = get_exec_file (0);
440 +      if (exec_filename != NULL)
441 +       {
442 +         if (missing_rpm_enlist (exec_filename) == 0)
443 +           missing_exec = MISSING_EXEC_NOT_FOUND;
444 +         else
445 +           missing_exec = MISSING_EXEC_ENLISTED;
446 +       }
447 +    }
448 +  if (missing_exec != MISSING_EXEC_ENLISTED)
449 +    if (missing_rpm_enlist (binary) == 0 && missing_rpm_enlist (debug) == 0)
450 +#endif /* HAVE_LIBRPM */
451 +      {
452 +       /* We do not collect and flush these messages as each such message
453 +          already requires its own separate lines.  */
454 +
455 +       fprintf_unfiltered (gdb_stdlog,
456 +                           _("Missing separate debuginfo for %s\n"), binary);
457 +        if (debug != NULL)
458 +         fprintf_unfiltered (gdb_stdlog, _("Try to install package that provides `%s' file\n"),
459 +                             debug);
460 +      }
461  }
462  
463  static char *
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);
473  
474  /* From dwarf2read.c */
475  
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."
482         }
483      }
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"
487      gdb_expect 10 {
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 } {
492             }
493         }
494      }
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"
498      gdb_expect 10 {
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
504 @@ -30,6 +30,7 @@
505  #include "tui/tui.h"
506  #include "tui/tui-io.h"
507  #include "exceptions.h"
508 +#include "symfile.h"
509  
510  /* Set to 1 when the TUI mode must be activated when we first start
511     gdb.  */
512 @@ -128,6 +129,8 @@ tui_command_loop (void *data)
513        char *a_prompt;
514        char *gdb_prompt = get_prompt ();
515  
516 +      debug_flush_missing ();
517 +
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
525 @@ -11,6 +11,162 @@
526  # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
527  # PARTICULAR PURPOSE.
528  
529 +# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
530 +# 
531 +# Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
532 +#
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.
537 +#
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.
542 +#
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.
546 +#
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.
551 +
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])
560 +fi
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])
566 +       else
567 +               AC_MSG_RESULT([no])
568 +               PKG_CONFIG=""
569 +       fi
570 +               
571 +fi[]dnl
572 +])# PKG_PROG_PKG_CONFIG
573 +
574 +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
575 +#
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.
578 +#
579 +#
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
590 +  $3])dnl
591 +fi])
592 +
593 +
594 +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
595 +# ---------------------------------------------
596 +m4_define([_PKG_CONFIG],
597 +[if test -n "$$1"; then
598 +    pkg_cv_[]$1="$$1"
599 + elif test -n "$PKG_CONFIG"; then
600 +    PKG_CHECK_EXISTS([$3],
601 +                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
602 +                    [pkg_failed=yes])
603 + else
604 +    pkg_failed=untried
605 +fi[]dnl
606 +])# _PKG_CONFIG
607 +
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
614 +else
615 +        _pkg_short_errors_supported=no
616 +fi[]dnl
617 +])# _PKG_SHORT_ERRORS_SUPPORTED
618 +
619 +
620 +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
621 +# [ACTION-IF-NOT-FOUND])
622 +#
623 +#
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
627 +#
628 +#
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
634 +
635 +pkg_failed=no
636 +AC_MSG_CHECKING([for $1])
637 +
638 +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
639 +_PKG_CONFIG([$1][_LIBS], [libs], [$2])
640 +
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.])
644 +
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`
649 +        else 
650 +               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
651 +        fi
652 +       # Put the nasty error message in config.log where it belongs
653 +       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
654 +
655 +       ifelse([$4], , [AC_MSG_ERROR(dnl
656 +[Package requirements ($2) were not met:
657 +
658 +$$1_PKG_ERRORS
659 +
660 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
661 +installed software in a non-standard prefix.
662 +
663 +_PKG_TEXT
664 +])],
665 +               [AC_MSG_RESULT([no])
666 +                $4])
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
671 +path to pkg-config.
672 +
673 +_PKG_TEXT
674 +
675 +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
676 +               [$4])
677 +else
678 +       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
679 +       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
680 +        AC_MSG_RESULT([yes])
681 +       ifelse([$3], , :, [$3])
682 +fi[]dnl
683 +])# PKG_CHECK_MODULES
684 +
685  # Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
686  #
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)])
691  
692 +# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
693 +#
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.
697 +
698 +# serial 2
699 +
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
706 +  am__leading_dot=.
707 +else
708 +  am__leading_dot=_
709 +fi
710 +rmdir .tst 2>/dev/null
711 +AC_SUBST([am__leading_dot])])
712 +
713  # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
714  # From Jim Meyering
715  
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
728 @@ -38,6 +38,9 @@
729  /* Define to BFD's default target vector. */
730  #undef DEFAULT_BFD_VEC
731  
732 +/* librpm version specific library name to dlopen. */
733 +#undef DLOPEN_LIBRPM
734 +
735  /* Define to 1 if translation of program messages to the user's native
736     language is requested. */
737  #undef ENABLE_NLS
738 @@ -211,6 +214,9 @@
739  /* Define if Python 2.6 is being used. */
740  #undef HAVE_LIBPYTHON2_6
741  
742 +/* Define if librpm library is being used. */
743 +#undef HAVE_LIBRPM
744 +
745  /* Define if libunwind library is being used. */
746  #undef HAVE_LIBUNWIND
747  
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'
759  ac_pwd=`pwd`
760  
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
777  
778  #
779  # Report the --help message.
780 @@ -886,6 +898,8 @@ Optional Packages:
781                            [DATADIR/gdb]
782    --with-pythondir        install Python data files in this path
783                            [DATADIR/gdb/python]
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>
792    CPP         C preprocessor
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
796  
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.
809             :
810           else
811 -           rm -rf conftest.one conftest.two conftest.dir
812 -           echo one > conftest.one
813 -           echo two > conftest.two
814 -           mkdir conftest.dir
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
819 -           then
820 -             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
821 -             break 3
822 -           fi
823 +           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
824 +           break 3
825           fi
826         fi
827        done
828 @@ -6610,16 +6616,15 @@ case $as_dir/ in
829  esac
830  done
831  
832 -rm -rf conftest.one conftest.two conftest.dir
833  
834  fi
835    if test "${ac_cv_path_install+set}" = set; then
836      INSTALL=$ac_cv_path_install
837    else
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
846    fi
847  fi
848 @@ -7202,6 +7207,559 @@ _ACEOF
849  fi
850  
851  
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').
867 +
868 +
869 +# Check whether --with-rpm or --without-rpm was given.
870 +if test "${with_rpm+set}" = set; then
871 +  withval="$with_rpm"
872 +
873 +else
874 +  with_rpm="auto"
875 +fi;
876 +
877 +
878 +
879 +if test "x$with_rpm" != "xno"; then
880 +  if test "x$with_rpm" = "xyes"; then
881 +    LIBRPM="librpm.so"
882 +    RPM_REQUIRE=true
883 +    DLOPEN_REQUIRE=false
884 +  elif test "x$with_rpm" = "xauto"; then
885 +    LIBRPM="librpm.so"
886 +    RPM_REQUIRE=false
887 +    DLOPEN_REQUIRE=false
888 +  else
889 +    LIBRPM="$with_rpm"
890 +    RPM_REQUIRE=true
891 +    DLOPEN_REQUIRE=true
892 +  fi
893 +  LIBRPM_STRING='"'"$LIBRPM"'"'
894 +
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
898 +  save_LIBS="$LIBS"
899 +  LIBS="$LIBS -ldl"
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; }; }; }
908 +else
909 +  cat >conftest.$ac_ext <<_ACEOF
910 +/* confdefs.h.  */
911 +_ACEOF
912 +cat confdefs.h >>conftest.$ac_ext
913 +cat >>conftest.$ac_ext <<_ACEOF
914 +/* end confdefs.h.  */
915 +
916 +#include <rpm/rpmlib.h>
917 +#include <dlfcn.h>
918 +#include <errno.h>
919 +
920 +int
921 +main ()
922 +{
923 +
924 +    void *h;
925 +    const char *const *rpmverp;
926 +    FILE *f;
927 +
928 +    f = fopen ("conftest.out", "w");
929 +    if (!f)
930 +      {
931 +       fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
932 +                strerror (errno));
933 +       return 1;
934 +      }
935 +    h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
936 +    if (!h)
937 +      {
938 +       fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
939 +       return 1;
940 +      }
941 +    rpmverp = dlsym (h, "RPMVERSION");
942 +    if (!rpmverp)
943 +      {
944 +       fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
945 +       return 1;
946 +      }
947 +    fprintf (stderr, "RPMVERSION is: \"");
948 +    fprintf (stderr, "%s\"\n", *rpmverp);
949 +
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.  */
952 +
953 +    if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
954 +      {
955 +       fprintf (f, "%s\n", $LIBRPM_STRING);
956 +       return 0;
957 +      }
958 +    else
959 +      {
960 +       char *h2_name;
961 +       void *h2;
962 +       int major, minor;
963 +
964 +       if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
965 +         {
966 +           fprintf (stderr, "Unable to parse RPMVERSION.\n");
967 +           fprintf (f, "%s\n", $LIBRPM_STRING);
968 +           return 0;
969 +         }
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);
974 +       if (!h2)
975 +         {
976 +           fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
977 +           fprintf (f, "%s\n", $LIBRPM_STRING);
978 +           return 0;
979 +         }
980 +       if (h2 != h)
981 +         {
982 +           fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
983 +                    $LIBRPM_STRING, h2_name);
984 +           fprintf (f, "%s\n", $LIBRPM_STRING);
985 +           return 0;
986 +         }
987 +       /* Found the valid .so name with a specific version.  */
988 +       fprintf (f, "%s\n", h2_name);
989 +       return 0;
990 +      }
991 +
992 +  ;
993 +  return 0;
994 +}
995 +_ACEOF
996 +rm -f conftest$ac_exeext
997 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
998 +  (eval $ac_link) 2>&5
999 +  ac_status=$?
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
1004 +  ac_status=$?
1005 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
1006 +  (exit $ac_status); }; }; then
1007 +
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
1013 +    fi
1014 +
1015 +else
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
1019 +
1020 +fi
1021 +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
1022 +fi
1023 +  rm -f conftest.out
1024 +
1025 +
1026 +
1027 +  if $HAVE_DLOPEN_LIBRPM; then
1028 +
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
1035 +/* confdefs.h.  */
1036 +_ACEOF
1037 +cat confdefs.h >>conftest.$ac_ext
1038 +cat >>conftest.$ac_ext <<_ACEOF
1039 +/* end confdefs.h.  */
1040 +
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);
1054 +
1055 +int
1056 +main ()
1057 +{
1058 +
1059 +  ;
1060 +  return 0;
1061 +}
1062 +_ACEOF
1063 +rm -f conftest.$ac_objext
1064 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1065 +  (eval $ac_compile) 2>conftest.er1
1066 +  ac_status=$?
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
1076 +  ac_status=$?
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
1082 +  ac_status=$?
1083 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
1084 +  (exit $ac_status); }; }; then
1085 +
1086 +      LIBRPM_COMPAT=true
1087 +      echo "$as_me:$LINENO: result: yes" >&5
1088 +echo "${ECHO_T}yes" >&6
1089 +
1090 +else
1091 +  echo "$as_me: failed program was:" >&5
1092 +sed 's/^/| /' conftest.$ac_ext >&5
1093 +
1094 +
1095 +      LIBRPM_COMPAT=false
1096 +      echo "$as_me:$LINENO: result: no" >&5
1097 +echo "${ECHO_T}no" >&6
1098 +
1099 +fi
1100 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
1101 +    CFLAGS="$save_CFLAGS"
1102 +
1103 +    if ! $LIBRPM_COMPAT; then
1104 +      HAVE_DLOPEN_LIBRPM=false
1105 +    fi
1106 +  fi
1107 +
1108 +  if $HAVE_DLOPEN_LIBRPM; then
1109 +    DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"'
1110 +
1111 +cat >>confdefs.h <<_ACEOF
1112 +#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING
1113 +_ACEOF
1114 +
1115 +
1116 +cat >>confdefs.h <<\_ACEOF
1117 +#define HAVE_LIBRPM 1
1118 +_ACEOF
1119 +
1120 +  else
1121 +    echo "$as_me:$LINENO: result: no" >&5
1122 +echo "${ECHO_T}no" >&6
1123 +    LIBS="$save_LIBS"
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; }; }
1128 +    fi
1129 +
1130 +
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
1139 +else
1140 +  case $PKG_CONFIG in
1141 +  [\\/]* | ?:[\\/]*)
1142 +  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
1143 +  ;;
1144 +  *)
1145 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1146 +for as_dir in $PATH
1147 +do
1148 +  IFS=$as_save_IFS
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
1154 +    break 2
1155 +  fi
1156 +done
1157 +done
1158 +
1159 +  ;;
1160 +esac
1161 +fi
1162 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
1163 +
1164 +if test -n "$PKG_CONFIG"; then
1165 +  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
1166 +echo "${ECHO_T}$PKG_CONFIG" >&6
1167 +else
1168 +  echo "$as_me:$LINENO: result: no" >&5
1169 +echo "${ECHO_T}no" >&6
1170 +fi
1171 +
1172 +fi
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
1181 +else
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.
1185 +  ;;
1186 +  *)
1187 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1188 +for as_dir in $PATH
1189 +do
1190 +  IFS=$as_save_IFS
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
1196 +    break 2
1197 +  fi
1198 +done
1199 +done
1200 +
1201 +  ;;
1202 +esac
1203 +fi
1204 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
1205 +
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
1209 +else
1210 +  echo "$as_me:$LINENO: result: no" >&5
1211 +echo "${ECHO_T}no" >&6
1212 +fi
1213 +
1214 +  PKG_CONFIG=$ac_pt_PKG_CONFIG
1215 +else
1216 +  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
1217 +fi
1218 +
1219 +fi
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
1227 +       else
1228 +               echo "$as_me:$LINENO: result: no" >&5
1229 +echo "${ECHO_T}no" >&6
1230 +               PKG_CONFIG=""
1231 +       fi
1232 +
1233 +fi
1234 +
1235 +pkg_failed=no
1236 +echo "$as_me:$LINENO: checking for RPM" >&5
1237 +echo $ECHO_N "checking for RPM... $ECHO_C" >&6
1238 +
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
1245 +  ac_status=$?
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`
1249 +else
1250 +  pkg_failed=yes
1251 +fi
1252 + else
1253 +    pkg_failed=untried
1254 +fi
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
1261 +  ac_status=$?
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`
1265 +else
1266 +  pkg_failed=yes
1267 +fi
1268 + else
1269 +    pkg_failed=untried
1270 +fi
1271 +
1272 +
1273 +
1274 +if test $pkg_failed = yes; then
1275 +
1276 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1277 +        _pkg_short_errors_supported=yes
1278 +else
1279 +        _pkg_short_errors_supported=no
1280 +fi
1281 +        if test $_pkg_short_errors_supported = yes; then
1282 +               RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1`
1283 +        else
1284 +               RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1`
1285 +        fi
1286 +       # Put the nasty error message in config.log where it belongs
1287 +       echo "$RPM_PKG_ERRORS" >&5
1288 +
1289 +       echo "$as_me:$LINENO: result: no" >&5
1290 +echo "${ECHO_T}no" >&6
1291 +                HAVE_LIBRPM=false
1292 +elif test $pkg_failed = untried; then
1293 +       HAVE_LIBRPM=false
1294 +else
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
1299 +       HAVE_LIBRPM=true
1300 +fi
1301 +
1302 +    if $HAVE_LIBRPM; then
1303 +
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
1310 +/* confdefs.h.  */
1311 +_ACEOF
1312 +cat confdefs.h >>conftest.$ac_ext
1313 +cat >>conftest.$ac_ext <<_ACEOF
1314 +/* end confdefs.h.  */
1315 +
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);
1329 +
1330 +int
1331 +main ()
1332 +{
1333 +
1334 +  ;
1335 +  return 0;
1336 +}
1337 +_ACEOF
1338 +rm -f conftest.$ac_objext
1339 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1340 +  (eval $ac_compile) 2>conftest.er1
1341 +  ac_status=$?
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
1351 +  ac_status=$?
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
1357 +  ac_status=$?
1358 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
1359 +  (exit $ac_status); }; }; then
1360 +
1361 +      LIBRPM_COMPAT=true
1362 +      echo "$as_me:$LINENO: result: yes" >&5
1363 +echo "${ECHO_T}yes" >&6
1364 +
1365 +else
1366 +  echo "$as_me: failed program was:" >&5
1367 +sed 's/^/| /' conftest.$ac_ext >&5
1368 +
1369 +
1370 +      LIBRPM_COMPAT=false
1371 +      echo "$as_me:$LINENO: result: no" >&5
1372 +echo "${ECHO_T}no" >&6
1373 +
1374 +fi
1375 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
1376 +    CFLAGS="$save_CFLAGS"
1377 +
1378 +      if ! $LIBRPM_COMPAT; then
1379 +       HAVE_LIBRPM=false
1380 +       RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1381 +      fi
1382 +    fi
1383 +
1384 +    if $HAVE_LIBRPM; then
1385 +
1386 +cat >>confdefs.h <<\_ACEOF
1387 +#define HAVE_LIBRPM 1
1388 +_ACEOF
1389 +
1390 +      CFLAGS="$CFLAGS $RPM_CFLAGS"
1391 +      LIBS="$LIBS $RPM_LIBS"
1392 +    else
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; }; }
1397 +      else
1398 +       { echo "$as_me:$LINENO: WARNING: $RPM_PKG_ERRORS" >&5
1399 +echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;}
1400 +      fi
1401 +    fi
1402 +  fi
1403 +fi
1404 +
1405  
1406  
1407  
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.
1418             :
1419           else
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
1428 -           then
1429 -             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
1430 -             break 3
1431 -           fi
1432 +           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
1433 +           break 3
1434           fi
1435         fi
1436        done
1437 @@ -8677,16 +9224,15 @@ case $as_dir/ in
1438  esac
1439  done
1440  
1441 -rm -rf conftest.one conftest.two conftest.dir
1442  
1443  fi
1444    if test "${ac_cv_path_install+set}" = set; then
1445      INSTALL=$ac_cv_path_install
1446    else
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
1455    fi
1456  fi
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
1473  fi
1474  AC_SUBST(pythondir)
1475  
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').
1491 +
1492 +AC_ARG_WITH([rpm],
1493 +  [AS_HELP_STRING([--with-rpm],
1494 +                  [query rpm database for missing debuginfos [yes/no, def. auto=librpm.so]])], [], [with_rpm="auto"])
1495 +
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"
1501 +    RPM_REQUIRE=true
1502 +    DLOPEN_REQUIRE=false
1503 +  elif test "x$with_rpm" = "xauto"; then
1504 +    LIBRPM="librpm.so"
1505 +    RPM_REQUIRE=false
1506 +    DLOPEN_REQUIRE=false
1507 +  else
1508 +    LIBRPM="$with_rpm"
1509 +    RPM_REQUIRE=true
1510 +    DLOPEN_REQUIRE=true
1511 +  fi
1512 +  LIBRPM_STRING='"'"$LIBRPM"'"'
1513 +
1514 +  AC_MSG_CHECKING([specific librpm version])
1515 +  HAVE_DLOPEN_LIBRPM=false
1516 +  save_LIBS="$LIBS"
1517 +  LIBS="$LIBS -ldl"
1518 +  AC_RUN_IFELSE(AC_LANG_PROGRAM([[
1519 +#include <rpm/rpmlib.h>
1520 +#include <dlfcn.h>
1521 +#include <errno.h>
1522 +  ]], [[
1523 +    void *h;
1524 +    const char *const *rpmverp;
1525 +    FILE *f;
1526 +
1527 +    f = fopen ("conftest.out", "w");
1528 +    if (!f)
1529 +      {
1530 +       fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out",
1531 +                strerror (errno));
1532 +       return 1;
1533 +      }
1534 +    h = dlopen ($LIBRPM_STRING, RTLD_LAZY);
1535 +    if (!h)
1536 +      {
1537 +       fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ());
1538 +       return 1;
1539 +      }
1540 +    rpmverp = dlsym (h, "RPMVERSION");
1541 +    if (!rpmverp)
1542 +      {
1543 +       fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ());
1544 +       return 1;
1545 +      }
1546 +    fprintf (stderr, "RPMVERSION is: \"");
1547 +    fprintf (stderr, "%s\"\n", *rpmverp);
1548 +
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.  */
1551 +
1552 +    if (strcmp ("librpm.so", $LIBRPM_STRING) != 0)
1553 +      {
1554 +       fprintf (f, "%s\n", $LIBRPM_STRING);
1555 +       return 0;
1556 +      }
1557 +    else
1558 +      {
1559 +       char *h2_name;
1560 +       void *h2;
1561 +       int major, minor;
1562 +
1563 +       if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2)
1564 +         {
1565 +           fprintf (stderr, "Unable to parse RPMVERSION.\n");
1566 +           fprintf (f, "%s\n", $LIBRPM_STRING);
1567 +           return 0;
1568 +         }
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);
1573 +       if (!h2)
1574 +         {
1575 +           fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ());
1576 +           fprintf (f, "%s\n", $LIBRPM_STRING);
1577 +           return 0;
1578 +         }
1579 +       if (h2 != h)
1580 +         {
1581 +           fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n",
1582 +                    $LIBRPM_STRING, h2_name);
1583 +           fprintf (f, "%s\n", $LIBRPM_STRING);
1584 +           return 0;
1585 +         }
1586 +       /* Found the valid .so name with a specific version.  */
1587 +       fprintf (f, "%s\n", h2_name);
1588 +       return 0;
1589 +      }
1590 +  ]]), [
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)
1595 +    fi
1596 +  ])
1597 +  rm -f conftest.out
1598 +
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);
1618 +    ]]), [
1619 +      LIBRPM_COMPAT=true
1620 +      AC_MSG_RESULT(yes)
1621 +    ], [
1622 +      LIBRPM_COMPAT=false
1623 +      AC_MSG_RESULT(no)
1624 +    ])
1625 +    CFLAGS="$save_CFLAGS"
1626 +  ])
1627 +
1628 +  if $HAVE_DLOPEN_LIBRPM; then
1629 +    CHECK_LIBRPM_COMPAT
1630 +    if ! $LIBRPM_COMPAT; then
1631 +      HAVE_DLOPEN_LIBRPM=false
1632 +    fi
1633 +  fi
1634 +
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.])
1639 +  else
1640 +    AC_MSG_RESULT(no)
1641 +    LIBS="$save_LIBS"
1642 +    if $DLOPEN_REQUIRE; then
1643 +      AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.])
1644 +    fi
1645 +    PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false])
1646 +
1647 +    if $HAVE_LIBRPM; then
1648 +      CHECK_LIBRPM_COMPAT
1649 +      if ! $LIBRPM_COMPAT; then
1650 +       HAVE_LIBRPM=false
1651 +       RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB"
1652 +      fi
1653 +    fi
1654 +
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"
1659 +    else
1660 +      if $RPM_REQUIRE; then
1661 +       AC_MSG_ERROR($RPM_PKG_ERRORS)
1662 +      else
1663 +       AC_MSG_WARN($RPM_PKG_ERRORS)
1664 +      fi
1665 +    fi
1666 +  fi
1667 +fi
1668 +
1669  
1670  AC_CONFIG_SUBDIRS(doc testsuite)
1671  
This page took 0.176437 seconds and 3 git commands to generate.