From: Adam Heath Date: Sat, 20 Sep 2003 22:45:13 +0000 (+0000) Subject: Fix (non-)detection of setlocale. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77adfd088684299647c04da1da492e98db30e6c2;p=dpkg Fix (non-)detection of setlocale. --- diff --git a/ChangeLog b/ChangeLog index b1e6f11d..2b9997fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Sep 20 17:44:40 CDT 2003 Adam Heath + + * configure.in, include/dpkg.h.in: Fix (non-)detection of setlocale. + Fri Sep 19 20:02:19 CDT 2003 Adam Heath * debian/changelog: Set date/time for 1.10.15 release. diff --git a/configure.in b/configure.in index f729bccd..66103500 100644 --- a/configure.in +++ b/configure.in @@ -135,6 +135,18 @@ dnl gettext ALL_LINGUAS="ca cs da de en es fr gl it nl ja pl pt_BR ru sv" AM_GNU_GETTEXT([external]) AM_PO_SUBDIRS +if test "x$HAVE_LOCALE_H" = "x"; then + AC_MSG_CHECKING([whether setlocale() is available]) + HAVE_SETLOCALE='' + AC_TRY_COMPILE([#include ],[ setlocale(0, "bar");], HAVE_SETLOCALE=1; + AC_DEFINE(HAVE_SETLOCALE,1,[Define if setlocale is available.]) + ) + if test "x$HAVE_SETLOCALE" = x; then + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(yes) + fi +fi dnl Other stuff @@ -422,9 +434,33 @@ void unsetenv(const char *x); #ifndef BUILDOLDPKGFORMAT #define BUILDOLDPKGFORMAT 0 #endif + +/* Take care of NLS matters. */ + +#if HAVE_LOCALE_H +# include +#endif +#if !HAVE_SETLOCALE +# define setlocale(Category, Locale) /* empty */ +#endif + +#if ENABLE_NLS +# include +# define _(Text) gettext (Text) +# define N_(Text) Text +#else +# undef bindtextdomain +# define bindtextdomain(Domain, Directory) /* empty */ +# undef textdomain +# define textdomain(Domain) /* empty */ +# define _(Text) Text +# define N_(Text) Text +# define gettext(Text) Text +#endif + ]) -AC_OUTPUT( +AC_OUTPUT( po/Makefile.in Makefile.conf Makefile include/Makefile @@ -446,5 +482,4 @@ scripts/Makefile main/Makefile dselect/Makefile methods/Makefile -utils/Makefile -po/Makefile.in) +utils/Makefile) diff --git a/debian/changelog b/debian/changelog index 94c24134..c97b7262 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,7 @@ dpkg (1.10.16) unstable; urgency=low + * Fix configure to set HAVE_SETLOCALE. Closes: #211816 + -- Adam Heath UNRELEASED dpkg (1.10.15) unstable; urgency=low diff --git a/include/dpkg.h.in b/include/dpkg.h.in index d424a65d..67a5df4d 100644 --- a/include/dpkg.h.in +++ b/include/dpkg.h.in @@ -139,29 +139,6 @@ #define TARBLKSZ 512 -/* Take care of NLS matters. */ - -#if HAVE_LOCALE_H -# include -#endif -#if !HAVE_SETLOCALE -# define setlocale(Category, Locale) /* empty */ -#endif - -#if ENABLE_NLS -# include -# define _(Text) gettext (Text) -# define N_(Text) Text -#else -# undef bindtextdomain -# define bindtextdomain(Domain, Directory) /* empty */ -# undef textdomain -# define textdomain(Domain) /* empty */ -# define _(Text) Text -# define N_(Text) Text -# define gettext(Text) Text -#endif - extern const char thisname[]; /* defined separately in each program */ extern const char printforhelp[];