Forráskód Böngészése

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.
Guillem Jover 15 éve
szülő
commit
899d7f050f
2 módosított fájl, 2 hozzáadás és 1 törlés
  1. 1 0
      debian/changelog
  2. 1 1
      lib/compat/gettext.h

+ 1 - 0
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).

+ 1 - 1
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