]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Use xsetenv before setlocale, because on non-glibc systems the libintl
authorBruno Haible <bruno@clisp.org>
Wed, 9 Jan 2002 20:43:23 +0000 (20:43 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 22:39:50 +0000 (00:39 +0200)
looks at the environment variables, not at the locale.

tests/ChangeLog
tests/Makefile.am
tests/lang-c
tests/lang-c++
tests/lang-objc
tests/plural-1-prg.c

index 1e92aa4f46791a910874790eed4c6fa187fbfc2f..1ae0056b55b48726554cb831145c01a0784bccc6 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-09  Bruno Haible  <bruno@clisp.org>
+
+       * lang-c: Use xsetenv before setlocale.
+       * lang-c++: Likewise.
+       * lang-objc: Likewise.
+       * plural-1-prg.c: Likewise.
+       * Makefile.am (cake_LDADD): New variable.
+
 2002-01-08  Bruno Haible  <bruno@clisp.org>
 
        * msgattrib-*: Terminate the test immediately if the msg* program
index 234bbaed9759feb3eb5e1e170e8868fd76d3b0f0..3f9457f446b94f7ccac11357cdc7bbf58d2a5a57 100644 (file)
@@ -105,3 +105,4 @@ tstgettext_LDADD = ../lib/libgettextlib.la $(LDADD)
 tstngettext_SOURCES = tstngettext.c setlocale.c
 tstngettext_LDADD = ../lib/libgettextlib.la $(LDADD)
 cake_SOURCES = plural-1-prg.c setlocale.c
+cake_LDADD = ../lib/libgettextlib.la $(LDADD)
index 5196e960436d6cc5175799888e871ed7e208e811..6c17636e5b0a8ac9d3981fc4e00d1e2c8b195756 100755 (executable)
@@ -13,6 +13,7 @@ cat <<\EOF > prog.c
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include "xsetenv.h"
 #define _(string) gettext (string)
 
 int main (argc, argv)
@@ -21,7 +22,8 @@ int main (argc, argv)
 {
   int n = atoi (argv[2]);
 
-  if (setlocale (LC_ALL, argv[1]) == NULL)
+  xsetenv ("LC_ALL", argv[1], 1);
+  if (setlocale (LC_ALL, "") == NULL)
     {
       fprintf (stderr, "Couldn't set locale.\n");
       exit (77);
@@ -47,7 +49,7 @@ EOF
 top_builddir=..
 
 tmpfiles="$tmpfiles prog.${OBJEXT} prog${EXEEXT}"
-${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.c -I../intl ${INTLLIBS} \
+${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.c -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${INTLLIBS} \
   || exit 1
 
 tmpfiles="$tmpfiles prog.pot"
index e74f00ebf71451b3a3b7ff4cc9cef8dd1da91c4d..e05525cfc1e14ab1b3ac9c4d44897c315ea1693c 100755 (executable)
@@ -19,13 +19,15 @@ cat <<\EOF > prog.cc
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include "xsetenv.h"
 #define _(string) gettext (string)
 
 int main (int argc, char *argv[])
 {
   int n = atoi (argv[2]);
 
-  if (setlocale (LC_ALL, argv[1]) == NULL)
+  xsetenv ("LC_ALL", argv[1], 1);
+  if (setlocale (LC_ALL, "") == NULL)
     {
       cerr << "Couldn't set locale." << endl;
       exit (77);
@@ -48,7 +50,7 @@ EOF
 top_builddir=..
 
 tmpfiles="$tmpfiles prog.${OBJEXT} prog${EXEEXT}"
-${LIBTOOL} --quiet --mode=link ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.cc -I../intl ${INTLLIBS} \
+${LIBTOOL} --quiet --mode=link ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.cc -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${INTLLIBS} \
   || exit 1
 
 tmpfiles="$tmpfiles prog.pot"
index 3e5d296d372c9ab68786c1dfa755ad2942f51950..1dc3e05348b21a39bedb4d7ce1d1dc4299c4ccbf 100755 (executable)
@@ -27,6 +27,7 @@ cat <<\EOF > prog.m
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include "xsetenv.h"
 #define _(string) gettext (string)
 
 int main (argc, argv)
@@ -35,7 +36,8 @@ int main (argc, argv)
 {
   int n = atoi (argv[2]);
 
-  if (setlocale (LC_ALL, argv[1]) == NULL)
+  xsetenv ("LC_ALL", argv[1], 1);
+  if (setlocale (LC_ALL, "") == NULL)
     {
       fprintf (stderr, "Couldn't set locale.\n");
       exit (77);
@@ -61,7 +63,7 @@ EOF
 top_builddir=..
 
 tmpfiles="$tmpfiles prog.${OBJEXT} prog${EXEEXT}"
-${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.m -I../intl ${INTLLIBS} \
+${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.m -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${INTLLIBS} \
   || exit 1
 
 tmpfiles="$tmpfiles prog.pot"
index 9642c1767cbc2ebf3bf54ad51f95fccfa1d7e9a8..fa5d0a250199ab83affcac5c5e737de7c6c2bd01 100644 (file)
@@ -7,6 +7,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <locale.h>
+#include "xsetenv.h"
 
 /* Make sure we use the included libintl, not the system's one. */
 #define textdomain textdomain__
@@ -21,7 +22,8 @@ int main (argc, argv)
 {
   int n = atoi (argv[2]);
 
-  if (setlocale (LC_ALL, argv[1]) == NULL)
+  xsetenv ("LC_ALL", argv[1], 1);
+  if (setlocale (LC_ALL, "") == NULL)
     return 1;
 
   textdomain ("cake");