The following commit has been merged in the master branch:
commit 899d7f050fbc17a84e78d1aa2739ffe281fc7e3c
Author: Guillem Jover <[email protected]>
Date:   Tue Sep 27 19:35:24 2011 +0200

    libcompat: Only include libintl.h on --disable-nls if using glibc >= 2
    
    On some systems like MacOS X, gettext's libintl.h redefines setlocale()
    to a replacement function from libintl, which will make the build fail
    if we end up including the header but not linking to libintl.
    
    This could happen when using --disable-nls to build C++ code and having
    the libintl.h header present with the setlocale() replacement function,
    but that header is only supposed to be included if building C++ code on
    a glibc system.
    
    Restore the logic before commit 8f8e9d9af75672ae051c2d3c11dd797b666b87b8,
    but explicitly check that we are not building on a uclibc system.

diff --git a/debian/changelog b/debian/changelog
index 6f055a2..3637d68 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ dpkg (1.16.2) UNRELEASED; urgency=low
   * Check for the presence of the strnlen declaration and correctly provide
     the compat one in case the systems lacks it.
   * Do not assume existence of paths on the build system in the test suite.
+  * Do not fail to link dselect on MacOS X when using --disable-nls.
 
   [ Updated man page translations ]
   * German (Helge Kreutzmann).
diff --git a/lib/compat/gettext.h b/lib/compat/gettext.h
index 2d654b7..5075c75 100644
--- a/lib/compat/gettext.h
+++ b/lib/compat/gettext.h
@@ -54,7 +54,7 @@
    it now, to make later inclusions of <libintl.h> a NOP.  */
 #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
 # include <cstdlib>
-# if HAVE_LIBINTL_H || _GLIBCXX_HAVE_LIBINTL_H
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
 #  include <libintl.h>
 # endif
 #endif

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to