[Moonlight-list] OpenSuse 11.2 & binutils-devel

Rolf Bjarne Kvinge rolflists at ya.com
Wed Nov 18 05:47:03 EST 2009


Hi,

With OpenSuse 11.2 there is a build problem if you have binutils-devel
installed:

In file included from /usr/include/demangle.h:33,
                 from debug.cpp:37:
/usr/include/libiberty.h:105: error: new declaration 'char* basename(const
char*)'
/usr/include/string.h:601: error: ambiguates old declaration 'const char*
basename(const char*)

I "fixed" it locally with the patch below, but it has one problem: it causes
g++ to give this warning for every cpp file:

../config.h:142:1: warning: "_GNU_SOURCE" redefined
<command-line>: warning: this is the location of the previous definition

I have no idea if this approach is the right one, somebody who knows more
about autoconf should probably have a look at it ;-) My final solution was
to uninstall binutils-devel.

Rolf

commit b71435f57a7cfdf87a5483b11541f869b503c329
Author: Rolf Bjarne Kvinge <RKvinge at novell.com>
Date:   Fri Nov 13 10:36:59 2009 +0100

    2009-11-13  Rolf Bjarne Kvinge  <RKvinge at novell.com>
    
        * configure.ac: Add a check for basename, so that HAVE_DECL_BASENAME
is
        set. libiberty.h defines basename unless HAVE_DECL_BASENAME is set,
and
        string.h also defines it (but only when __USE_GNU is defined, which
is
        either defined by default in g++, or in gcc if _GNU_SOURCE is
defined,
        which is the reason for defining _GNU_SOURCE - we need to make
basename
        defined with gcc too because the AC_CHECK_DECL check is executed
with
        gcc).

diff --git a/ChangeLog b/ChangeLog
index 94bba24..7b65cc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-11-13  Rolf Bjarne Kvinge  <RKvinge at novell.com>
+
+       * configure.ac: Add a check for basename, so that HAVE_DECL_BASENAME
is
+       set. libiberty.h defines basename unless HAVE_DECL_BASENAME is set,
and
+       string.h also defines it (but only when __USE_GNU is defined, which
is
+       either defined by default in g++, or in gcc if _GNU_SOURCE is
defined,
+       which is the reason for defining _GNU_SOURCE - we need to make
basename
+       defined with gcc too because the AC_CHECK_DECL check is executed
with
+       gcc).
+       
+       
 2009-11-04  Rolf Bjarne Kvinge  <RKvinge at novell.com>
 
        * configure.ac: Show if we were built with debug on or off.
diff --git a/configure.ac b/configure.ac
index 57d74c9..7bccf4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,9 +20,11 @@ PKG_PROG_PKG_CONFIG
 
 AC_DEFINE(__STDC_CONSTANT_MACROS, [], [To make avformat work with C++])
 AC_DEFINE(__STDC_LIMIT_MACROS, [], [To get limits of specified-width
integer types])
+AC_DEFINE(_GNU_SOURCE, [], [To make the basename decl check below actually
work])
 
 AC_SEARCH_LIBS(clock_gettime,rt)
 AC_CHECK_HEADERS(sys/time.h)
+AC_CHECK_DECLS([basename])
 
 changequote(,)dnl
 dnl LIBTOOL="${LIBTOOL} \$(shell echo \"\$(MFLAGS)\" | awk '/^[^ ]*s/ {
print \"--silent\" }')"



More information about the Moonlight-list mailing list