summaryrefslogtreecommitdiff
path: root/tests/gettext
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-03-10 21:53:42 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-03-10 21:53:42 +0100
commitf5935479e83493555931caebf5e50763cba61d5d (patch)
tree443db324e4c6fbb75d8b60996a594e80c7411bc0 /tests/gettext
parentcdadda37b6b5cf3aaf923171d0faa1d41873770d (diff)
downloadwolfbones-f5935479e83493555931caebf5e50763cba61d5d.tar.gz
wolfbones-f5935479e83493555931caebf5e50763cba61d5d.tar.bz2
made gettext work on NetBSD
Diffstat (limited to 'tests/gettext')
-rw-r--r--tests/gettext/GNUmakefile22
-rw-r--r--tests/gettext/test_gettext.c5
-rw-r--r--tests/gettext/test_gettext_de.po (renamed from tests/gettext/test_gettext_de_CH.po)0
3 files changed, 19 insertions, 8 deletions
diff --git a/tests/gettext/GNUmakefile b/tests/gettext/GNUmakefile
index f26f122..a45094e 100644
--- a/tests/gettext/GNUmakefile
+++ b/tests/gettext/GNUmakefile
@@ -19,14 +19,14 @@ test_gettext: $(TOPDIR)/src/libwolf.a
# xgettext --flag=_:1:pass-c-format -d test_gettext -s -o test_gettext.pot test_gettext.c
#
# initial creation of the translation table:
-# msginit -l de_CH -o test_gettext_de_CH.po -i test_gettext.pot
+# msginit -l de -o test_gettext_de.po -i test_gettext.pot
#
# merge the changes into the translation tables keeping existing
# translations
-# msgmerge -s -U test_gettext_de_CH.po test_gettext.pot
+# msgmerge -s -U test_gettext_de.po test_gettext.pot
#
# compile message files into binary format:
-# msgfmt -c -v -o test_gettext_de_CH.mo test_gettext_de_CH.po
+# msgfmt -c -v -o test_gettext_de.mo test_gettext_de.po
#
# for running make sure (on ARCH at least, check out others):
# - edit /etc/locale.gen
@@ -35,17 +35,23 @@ test_gettext: $(TOPDIR)/src/libwolf.a
%.pot: %.c
xgettext --flag=_:1:pass-c-format -d test_gettext -s -o $@ $<
-test_gettext_de_CH.po: test_gettext.pot
+test_gettext_de.po: test_gettext.pot
msgmerge -s -U $@ -i $<
%.mo : %.po
msgfmt -c -o $@ $<
+
+# in older gcc (before 4.2.1) we can't switch off warnings selectivly with a
+# prage. So gettext misses a format attribute which results in a warning
+# test_gettext.c:81: warning: format not a string literal, argument types not checked
+test_gettext.o : test_gettext.c
+ $(CC) -c -g -o $@ $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS) $<
-local_test: test_gettext_de_CH.mo
+local_test: test_gettext_de.mo
@echo "Testing gettext.."
- @mkdir -p locale/de_CH/LC_MESSAGES
- @cp test_gettext_de_CH.mo locale/de_CH/LC_MESSAGES/test_gettext.mo
- @LANG=de_CH ./test_gettext >/dev/null 2>&1
+ @mkdir -p locale/de/LC_MESSAGES
+ @cp test_gettext_de.mo locale/de/LC_MESSAGES/test_gettext.mo
+ @LANG=de ./test_gettext >/dev/null 2>&1
local_all:
diff --git a/tests/gettext/test_gettext.c b/tests/gettext/test_gettext.c
index e344b2d..a42c6d8 100644
--- a/tests/gettext/test_gettext.c
+++ b/tests/gettext/test_gettext.c
@@ -17,8 +17,13 @@
#endif
#define _(X) gettext(X)
+#define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ )
+
/* since GCC 4.2.1 we can disable specific warnings as in other compilers, finally */
+#if GCC_VERSION >= 40201
+#error bla
#pragma GCC diagnostic warning "-Wformat"
+#endif
int main( void ) {
char *loc;
diff --git a/tests/gettext/test_gettext_de_CH.po b/tests/gettext/test_gettext_de.po
index 9fc103a..9fc103a 100644
--- a/tests/gettext/test_gettext_de_CH.po
+++ b/tests/gettext/test_gettext_de.po