looks at the environment variables, not at the locale.
+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
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)
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
+#include "xsetenv.h"
#define _(string) gettext (string)
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);
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"
#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);
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"
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
+#include "xsetenv.h"
#define _(string) gettext (string)
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);
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"
#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__
{
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");