commit 6710d4a880b10d9e3f08255a194a8186ec764caf Author: Raphael Manfredi Date: Wed Sep 4 19:54:04 2013 +0200 Make sure we can compile with recent versions of the BFD library. diff --git a/Configure b/Configure index a596c81..351a4a0 100755 --- a/Configure +++ b/Configure @@ -18,7 +18,7 @@ # $Id: gtk-gnutella-1.0.0-bdf.patch,v 1.1 2013/09/10 16:01:13 graaff Exp $ # -# Generated on Sat Aug 31 16:12:14 CEST 2013 [metaconfig 3.5-170] +# Generated on Wed Sep 4 19:50:17 CEST 2013 [metaconfig 3.5-171] cat >c1$$ <&2 + -V) echo "$me generated by metaconfig 3.5-171." >&2 exit 0;; --) break;; -*) echo "$me: unknown option $1" >&2; shift; error=true;; @@ -4870,6 +4870,8 @@ eval $trylink : see whether the bfd library is available $cat >try.c < int main(void) { diff --git a/config_h.SH b/config_h.SH index b872de0..1e9f49d 100644 --- a/config_h.SH +++ b/config_h.SH @@ -160,9 +160,11 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un #$d_bcopy HAS_BCOPY /**/ /* HAS_BFD_LIBRARY: - * This symbol, if defined, indicates that the bfd library is available + * This symbol, if defined, indicates that the BFD library is available * to inspect symbols and debugging information. You can safely include - * the file when this symbol is defined. + * the file when this symbol is defined, making sure to define + * the PACKAGE and PACKAGE_VERSION symbols, just in case we're facing + * binutils 2.23 or higher. */ #$d_bfd_lib HAS_BFD_LIBRARY /**/ diff --git a/src/lib/bfd_util.c b/src/lib/bfd_util.c index 52b10ef..2fc9997 100644 --- a/src/lib/bfd_util.c +++ b/src/lib/bfd_util.c @@ -53,8 +53,28 @@ #include "common.h" #ifdef HAS_BFD_LIBRARY +/* + * Starting with binutils 2.23, we need to define two symbols to be able + * to compile with . It is a shame to have to go through contorsions + * like that, but the BFD folks wish to keep their library unsuitable for + * the general use. + * + * See https://sourceware.org/bugzilla/show_bug.cgi?id=15920 + * + * Their mindset being what it is, let's be smarter and adapt. There is no + * way we are going to bloat our source tree by including a version of the BFD + * sources, just to workaround a library design bug! + * --RAM, 2013-09-94 + * + * There's no need to define the PACKAGE symbol: since it is present in a + * comment, that metaconfig symbol will be automatically defined in config.h. + */ +#define PACKAGE_VERSION /* PACKAGE is already a metaconfig symbol */ + #include -#endif + +#undef PACKAGE_VERSION +#endif /* HAS_BFD_LIBRARY */ #include "bfd_util.h" #include "concat.h" diff --git a/src/lib/mingw32.c b/src/lib/mingw32.c index 943a8bc..bf9ca91 100644 --- a/src/lib/mingw32.c +++ b/src/lib/mingw32.c @@ -53,7 +53,6 @@ #include /* For _kbhit() */ #include /* For backtrace() emulation */ #include /* For GetBestRoute() */ -#include /* For access to debugging information */ #include #include