diff options
author | Bruno Haible <bruno@clisp.org> | 2001-12-17 17:37:33 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-21 23:47:48 +0200 |
commit | 24f95f724fde0ababcae02d1094940c953156afd (patch) | |
tree | bc0c64b4edb83cd9ae19c9bf8353e8a4c1e62881 | |
parent | 036f69999b9510f137d7a3a59b5ba8e690e0807b (diff) | |
download | external_gettext-24f95f724fde0ababcae02d1094940c953156afd.zip external_gettext-24f95f724fde0ababcae02d1094940c953156afd.tar.gz external_gettext-24f95f724fde0ababcae02d1094940c953156afd.tar.bz2 |
New OS/2 support.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | acconfig.h | 5 | ||||
-rw-r--r-- | intl/ChangeLog | 13 | ||||
-rw-r--r-- | intl/Makefile.in | 4 | ||||
-rw-r--r-- | intl/dcigettext.c | 6 | ||||
-rw-r--r-- | intl/localcharset.c | 41 | ||||
-rw-r--r-- | intl/localealias.c | 5 | ||||
-rw-r--r-- | intl/os2.c | 97 | ||||
-rw-r--r-- | intl/osdep.c | 24 | ||||
-rw-r--r-- | lib/ChangeLog | 4 | ||||
-rw-r--r-- | lib/localcharset.c | 41 | ||||
-rw-r--r-- | os2/Makefile | 268 | ||||
-rw-r--r-- | os2/README.OS2 | 161 | ||||
-rw-r--r-- | os2/backward.def | 13 | ||||
-rw-r--r-- | os2/iconv/README | 2 | ||||
-rw-r--r-- | os2/iconv/iconv.c | 148 | ||||
-rw-r--r-- | os2/iconv/iconv.h | 43 | ||||
-rw-r--r-- | os2/os2compat.h | 77 |
19 files changed, 947 insertions, 16 deletions
@@ -1,3 +1,11 @@ +2001-12-15 Andrew Zabolotny <zap@cobra.ru> + Bruno Haible <bruno@clisp.org> + + * os2/*: New EMX support. + * Makefile.am (EXTRA_DIST): Remove old os2/ contents, add new os2/ + contents. + * acconfig.h: Add conditional include of os2/os2compat.h. + 2001-12-17 Bruno Haible <bruno@clisp.org> * configure.in: Change version number to 0.11-pre4. diff --git a/Makefile.am b/Makefile.am index 9c66aee..4ffc042 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,7 +31,8 @@ EXTRA_DIST = config.rpath BUGS DISCLAIM README.gemtext README-alpha \ djgpp/config.bat djgpp/config.in djgpp/config.sed \ djgpp/config.site djgpp/edtests.bat djgpp/fnchange.in \ djgpp/fnchange.lst djgpp/tscript.sed \ - os2/README.os2 os2/os2.diff + os2/README.OS2 os2/Makefile os2/os2compat.h os2/backward.def \ + os2/iconv/README os2/iconv/iconv.h os2/iconv/iconv.c ABOUT-NLS: $(srcdir)/doc/nls.texi $(srcdir)/doc/matrix.texi rm -f $(srcdir)/ABOUT-NLS \ @@ -44,3 +44,8 @@ it). It is used to wrap the msgid and msgstr strings, and also to wrap the file position (#:) comments. */ #define PAGE_WIDTH 79 + +/* Extra OS/2 (emx+gcc) defines. */ +#ifdef __EMX__ +# include "os2/os2compat.h" +#endif diff --git a/intl/ChangeLog b/intl/ChangeLog index ca18404..24f3758 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,16 @@ +2001-12-15 Andrew Zabolotny <zap@cobra.ru> + Bruno Haible <bruno@clisp.org> + + * osdep.c: New file. + * os2.c: New file. + * dcigettext.c (DCIGETTEXT): Add backward compatibility support for + OS/2. + * localcharset.c: Add OS/2 support. + * localealias.c (_nl_expand_alias): Initialize locale_alias_path once, + but not statically. + * Makefile.in (COMSRCS): Add osdep.c, os2.c. + (OBJECTS): Add osdep.$lo. + 2001-12-12 Bruno Haible <bruno@clisp.org> * libgettext.h [!ENABLE_NLS]: Cast all function results to diff --git a/intl/Makefile.in b/intl/Makefile.in index 0f798c6..813e368 100644 --- a/intl/Makefile.in +++ b/intl/Makefile.in @@ -65,11 +65,11 @@ SOURCES = $(COMSRCS) intl-compat.c COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \ -plural-exp.c localcharset.c localename.c +plural-exp.c localcharset.c localename.c osdep.c os2.c OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \ -plural.$lo plural-exp.$lo localcharset.$lo localename.$lo +plural.$lo plural-exp.$lo localcharset.$lo localename.$lo osdep.$lo GETTOBJS = intl-compat.$lo DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) diff --git a/intl/dcigettext.c b/intl/dcigettext.c index cf60caf..e627b75 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -423,6 +423,12 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) if (domainname == NULL) domainname = _nl_current_default_domain; + /* OS/2 specific: backward compatibility with older libintl versions */ +#ifdef LC_MESSAGES_COMPAT + if (category == LC_MESSAGES_COMPAT) + category = LC_MESSAGES; +#endif + #if defined HAVE_TSEARCH || defined _LIBC msgid_len = strlen (msgid1) + 1; diff --git a/intl/localcharset.c b/intl/localcharset.c index 54600cd..17365f1 100644 --- a/intl/localcharset.c +++ b/intl/localcharset.c @@ -42,7 +42,12 @@ # define WIN32 #endif -#ifndef WIN32 +#if defined __EMX__ +/* Assume EMX program runs on OS/2, even if compiled under DOS. */ +# define OS2 +#endif + +#if !(defined WIN32 || defined OS2) # if HAVE_LANGINFO_CODESET # include <langinfo.h> # else @@ -50,9 +55,12 @@ # include <locale.h> # endif # endif -#else /* WIN32 */ +#elif defined WIN32 # define WIN32_LEAN_AND_MEAN # include <windows.h> +#elif defined OS2 +# define INCL_DOS +# include <os2.h> #endif #ifndef DIRECTORY_SEPARATOR @@ -91,7 +99,7 @@ get_charset_aliases () cp = charset_aliases; if (cp == NULL) { -#ifndef WIN32 +#if !(defined WIN32 || defined OS2) FILE *fp; const char *dir = LIBDIR; const char *base = "charset.alias"; @@ -179,14 +187,20 @@ get_charset_aliases () if (file_name != NULL) free (file_name); -#else /* WIN32 */ +#else /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ +# if defined WIN32 cp = "CP936" "\0" "GBK" "\0" "CP1361" "\0" "JOHAB" "\0"; + +# elif defined OS2 + cp = ""; + +# endif #endif charset_aliases = cp; @@ -210,7 +224,7 @@ locale_charset () const char *codeset; const char *aliases; -#ifndef WIN32 +#if !(defined WIN32 || defined OS2) # if HAVE_LANGINFO_CODESET @@ -247,7 +261,7 @@ locale_charset () # endif -#else /* WIN32 */ +#elif WIN32 static char buf[2 + 10 + 1]; @@ -255,6 +269,21 @@ locale_charset () sprintf (buf, "CP%u", GetACP ()); codeset = buf; +#elif OS2 + + static char buf[2 + 10 + 1]; + ULONG cp[3]; + ULONG cplen; + + /* OS/2 has a function returning the locale's codepage as a number. */ + if (DosQueryCp (sizeof (cp), cp, &cplen)) + codeset = ""; + else + { + sprintf (buf, "CP%u", cp[0]); + codeset = buf; + } + #endif if (codeset == NULL) diff --git a/intl/localealias.c b/intl/localealias.c index ef17b38..456e41e 100644 --- a/intl/localealias.c +++ b/intl/localealias.c @@ -135,7 +135,7 @@ const char * _nl_expand_alias (name) const char *name; { - static const char *locale_alias_path = LOCALE_ALIAS_PATH; + static const char *locale_alias_path; struct alias_map *retval; const char *result = NULL; size_t added; @@ -144,6 +144,9 @@ _nl_expand_alias (name) __libc_lock_lock (lock); #endif + if (locale_alias_path == NULL) + locale_alias_path = LOCALE_ALIAS_PATH; + do { struct alias_map item; diff --git a/intl/os2.c b/intl/os2.c new file mode 100644 index 0000000..d1cd9c8 --- /dev/null +++ b/intl/os2.c @@ -0,0 +1,97 @@ +/* OS/2 compatibility functions. + Copyright (C) 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#define OS2_AWARE +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdlib.h> +#include <string.h> + +/* A version of getenv() that works from DLLs */ +extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); + +char * +_nl_getenv (const char *name) +{ + unsigned char *value; + if (DosScanEnv (name, &value)) + return NULL; + else + return value; +} + +char *_os2_libdir = NULL; +char *_os2_localealiaspath = NULL; +char *_os2_localedir = NULL; + +static __attribute__((constructor)) void +os2_initialize () +{ + char *root = getenv ("UNIXROOT"); + char *gnulocaledir = getenv ("GNULOCALEDIR"); + + _os2_libdir = gnulocaledir; + if (!_os2_libdir) + { + if (root) + { + size_t sl = strlen (root); + _os2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); + memcpy (_os2_libdir, root, sl); + memcpy (_os2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); + } + else + _os2_libdir = LIBDIR; + } + + _os2_localealiaspath = gnulocaledir; + if (!_os2_localealiaspath) + { + if (root) + { + size_t sl = strlen (root); + _os2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); + memcpy (_os2_localealiaspath, root, sl); + memcpy (_os2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); + } + else + _os2_localealiaspath = LOCALE_ALIAS_PATH; + } + + _os2_localedir = gnulocaledir; + if (!_os2_localedir) + { + if (root) + { + size_t sl = strlen (root); + _os2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); + memcpy (_os2_localedir, root, sl); + memcpy (_os2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); + } + else + _os2_localedir = LOCALEDIR; + } + + { + extern const char _nl_default_dirname__[]; + if (strlen (_os2_localedir) <= 1024) + strcpy (_nl_default_dirname__, _os2_localedir); + } +} diff --git a/intl/osdep.c b/intl/osdep.c new file mode 100644 index 0000000..c374c95 --- /dev/null +++ b/intl/osdep.c @@ -0,0 +1,24 @@ +/* OS dependent parts of libintl. + Copyright (C) 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#if defined __EMX__ +# include "os2.c" +#else +/* Avoid AIX compiler warning. */ +typedef int dummy; +#endif diff --git a/lib/ChangeLog b/lib/ChangeLog index 9071dc8..407122f 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2001-12-15 Bruno Haible <bruno@clisp.org> + + * localcharset.c: Add OS/2 support. + 2001-12-11 Bruno Haible <bruno@clisp.org> * argmatch.c: Include <stdlib.h>, to declare exit(). diff --git a/lib/localcharset.c b/lib/localcharset.c index 54600cd..17365f1 100644 --- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -42,7 +42,12 @@ # define WIN32 #endif -#ifndef WIN32 +#if defined __EMX__ +/* Assume EMX program runs on OS/2, even if compiled under DOS. */ +# define OS2 +#endif + +#if !(defined WIN32 || defined OS2) # if HAVE_LANGINFO_CODESET # include <langinfo.h> # else @@ -50,9 +55,12 @@ # include <locale.h> # endif # endif -#else /* WIN32 */ +#elif defined WIN32 # define WIN32_LEAN_AND_MEAN # include <windows.h> +#elif defined OS2 +# define INCL_DOS +# include <os2.h> #endif #ifndef DIRECTORY_SEPARATOR @@ -91,7 +99,7 @@ get_charset_aliases () cp = charset_aliases; if (cp == NULL) { -#ifndef WIN32 +#if !(defined WIN32 || defined OS2) FILE *fp; const char *dir = LIBDIR; const char *base = "charset.alias"; @@ -179,14 +187,20 @@ get_charset_aliases () if (file_name != NULL) free (file_name); -#else /* WIN32 */ +#else /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ +# if defined WIN32 cp = "CP936" "\0" "GBK" "\0" "CP1361" "\0" "JOHAB" "\0"; + +# elif defined OS2 + cp = ""; + +# endif #endif charset_aliases = cp; @@ -210,7 +224,7 @@ locale_charset () const char *codeset; const char *aliases; -#ifndef WIN32 +#if !(defined WIN32 || defined OS2) # if HAVE_LANGINFO_CODESET @@ -247,7 +261,7 @@ locale_charset () # endif -#else /* WIN32 */ +#elif WIN32 static char buf[2 + 10 + 1]; @@ -255,6 +269,21 @@ locale_charset () sprintf (buf, "CP%u", GetACP ()); codeset = buf; +#elif OS2 + + static char buf[2 + 10 + 1]; + ULONG cp[3]; + ULONG cplen; + + /* OS/2 has a function returning the locale's codepage as a number. */ + if (DosQueryCp (sizeof (cp), cp, &cplen)) + codeset = ""; + else + { + sprintf (buf, "CP%u", cp[0]); + codeset = buf; + } + #endif if (codeset == NULL) diff --git a/os2/Makefile b/os2/Makefile new file mode 100644 index 0000000..5c3d108 --- /dev/null +++ b/os2/Makefile @@ -0,0 +1,268 @@ +# OS/2 GNU Makefile for building gettext with GNU Make and GNU C compiler +# +# OS/2 still supports the regular configure/make building mechanism, but its +# way more clumsy, complicated and error prone. It is highly recommended to +# use this makefile instead, because : +# - this makefile builds an optimized static and dynamic version of the +# library +# - it is able to build both optimized and debug versions of the library +# without any reconfiguring +# - it is able to generate a complete OS/2 binary distribution (make distr) +# - besides its simply alot faster than configure generated makefiles +# +# The makefile is designed to be more or less gettext version independent, +# so it is likely to work with future versions of gettext as well. However, +# please inspect the pre-built config.h file (if you haven't built one with +# configure) so that VERSION macro contains the correct value. +# + +# Use CMD.EXE as shell since its way faster +SHELL = $(COMSPEC) +# An Unix-like shell (needed for running config.charset) +UNIXSHELL = sh.exe + +# Debug mode (1) or optimize mode (0) +DEBUG = 0 + +# The version of INTL.DLL (the name suffix) +INTLDLLVER = + +# Pack the DLL and executables with lxlite +LXLITE = 1 + +# Output directory +OUT = out/$(OUT.SUFFIX)/ +# Root package directory +ROOT = ../ +# The base directory for distribution archive (emx/ or usr/) +INST = emx/ +# A shortcut for emx/src/gettext-version/ +INSTSRC = $(INST)src/gettext-$(VERSION)/ + +# Tools +CC = gcc -c +CFLAGS = -Wall -Zmt $(INCLUDE) $(DEFS) +INCLUDE = -I. -I$(ROOT) -I$(ROOT)intl -I$(ROOT)src -I$(ROOT)lib +DEFS = -DHAVE_CONFIG_H -DLIBDIR=\"/usr/lib\" \ + -DLOCALEDIR=\"/usr/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/share/locale\" + +LD = gcc +LDFLAGS = -Zmt -Zcrtdll +LDFLAGS.SHARED = -Zmt -Zcrtdll -Zdll +LIBS = -liberty -lgcc + +AR = ar +ARFLAGS = crs + +MKDIR = mkdir.exe -p +COPY = cp -p + +LINKINTL = $(OUT)intl.a + +ifeq ($(DEBUG),0) + CFLAGS += -s -O2 + LDFLAGS += -s -Zexe + LDFLAGS.SHARED += -s + OUT.SUFFIX = release +else + CFLAGS += -g -Zomf + LDFLAGS += -g -Zexe -Zomf + LDFLAGS.SHARED += -g -Zomf + OUT.SUFFIX = debug + LXLITE := 0 + LINKINTL = $(OUT)intl_s.a +endif + +# The list of languages to be included in binary distribution +LINGUAS = cs da de el es fr gl id it nl nn no pl pt pt_BR ru sl sv tr +# The following languages don't work with OS/2 iconv: +#en@boldquot en@quot et ja ko zh + +VERSION = $(shell sed config.h -ne "/VERSION/{" -e "s/.*VERSION[ ]*//" -e 's/"//g' -e "p" -e "}") + +# Fetch the list of source files for libintl from intl/Makefile.in +INTL.SOURCES = $(addprefix $(ROOT)intl/,\ + $(subst $$lo,c,\ + $(subst @INTLOS2OBJS@,os2compat.c,\ + $(subst @INTLOBJS@,intl-compat.c,\ + $(subst OBJECTS = ,,\ + $(subst \,,\ + $(shell sed $(ROOT)intl/Makefile.in -ne "/^OBJECTS =/,/[^\]$$/p"))))))) +INTL.OBJECTS = $(addprefix $(OUT),$(subst $(ROOT),,$(INTL.SOURCES:.c=.o))) + +PROGRAMS = gettext ngettext msgcmp msgfmt msgmerge msgunfmt xgettext msgcomm +PROGRAMS.EXE = $(addprefix $(OUT),$(addsuffix .exe,$(PROGRAMS))) +SRC.SOURCES = $(filter-out $(addprefix $(ROOT)src/,$(addsuffix .c,$(PROGRAMS))),\ + $(wildcard $(ROOT)src/*.c)) +SRC.OBJECTS = $(addprefix $(OUT),$(subst $(ROOT),,$(SRC.SOURCES:.c=.o))) +LIB.SOURCES = $(addprefix $(ROOT)lib/,basename.c error.c stpcpy.c stpncpy.c \ + concatpath.c mbswidth.c fstrcmp.c hash.c printf-prs.c c-ctype.c linebreak.c \ + getline.c) +LIB.OBJECTS = $(addprefix $(OUT),$(subst $(ROOT),,$(LIB.SOURCES:.c=.o))) + +OUTDIRS = $(OUT) $(sort $(dir $(INTL.OBJECTS) $(SRC.OBJECTS) $(LIB.OBJECTS) $(INSTALL.FILES))) + +INSTALL.FILES = $(addprefix $(INST)bin/,$(addsuffix .exe,$(PROGRAMS))) \ + $(INST)lib/intl.a $(INST)lib/intl_s.a $(INST)dll/intl.dll $(INST)include/libintl.h \ + $(INST)share/locale/charset.alias $(INST)share/locale/locale.alias \ + $(INST)doc/gettext-$(VERSION)/README.OS2 \ + $(INST)doc/gettext-$(VERSION)/COPYING $(INST)doc/gettext-$(VERSION)/README \ + $(INST)include/iconv.h $(INST)include/langinfo.h \ + $(addsuffix /LC_MESSAGES/gettext.mo,$(addprefix $(INST)share/locale/,$(LINGUAS))) \ + $(INSTALL.DIFF) + +# The diff and source files which we want in binary distribution (do we?) +INSTALL.DIFF = $(INSTSRC)gettext-$(VERSION).diff \ + $(addprefix $(INSTSRC)os2/,$(wildcard *.c *.h *.def) Makefile README.OS2) \ + $(INSTSRC)intl/os2compat.c + +.SUFFIXES: +.SUFFIXES: .o .a .def .exe .dll .po .mo +.PRECIOUS: $(OUT)%.o + +.PHONY: all depend clean distr rmzip + +$(OUT)%.o: $(ROOT)%.c + $(CC) $(CFLAGS) -o $@ $< + +# To avoid playing with object file lists for every program we will build +# instead a library containing all the object files from src directory, and +# then link the library against the main program module, so that linker can +# pull all the required functions from there +$(OUT)%.exe: $(OUT)src/%.o $(OUT)util.a $(LINKINTL) + $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) +ifeq ($(LXLITE),1) + lxlite $@ +endif + +all: $(OUTDIRS) $(ROOT)src/po-gram-gen2.h $(ROOT)intl/libintl.h \ + $(OUT)intl.a $(OUT)intl_s.a $(OUT)intl$(INTLDLLVER).dll $(PROGRAMS.EXE) + +depend: $(INTL.SOURCES) $(SRC.SOURCES) + makedep $(INCLUDE) $(DEFS) -p $$(OUT) -r $^ + +clean: + rm -rf out emx + +distr: all rmzip gettext-os2-$(VERSION)-bin.zip + +rmzip: + rm -f gettext-os2-$(VERSION)-bin.zip + +$(OUTDIRS): + $(MKDIR) $(@:/=) + +$(OUT)intl_s.a: $(INTL.OBJECTS) + $(AR) $(ARFLAGS) $@ $^ + +$(OUT)intl.def: $(INTL.OBJECTS) + @echo LIBRARY INTL$(INTLDLLVER) INITINSTANCE TERMINSTANCE>$@ + @echo DESCRIPTION "GNU gettext internationalization library version $(VERSION)">>$@ + @echo DATA MULTIPLE NONSHARED>>$@ + @echo EXPORTS>>$@ + type backward.def>>$@ + emxexp $^ >>$@ + +$(OUT)intl$(INTLDLLVER).dll: $(INTL.OBJECTS) $(OUT)intl.def + @echo ********************************************************* + @echo *** YOU CAN SAFELY IGNORE WARNINGS FROM EMXBIND BELOW *** + @echo ********************************************************* + $(LD) $(LDFLAGS.SHARED) -o $@ $^ $(LIBS) +ifeq ($(LXLITE),1) + lxlite $@ +endif + +# Remove the ordinals from exports so that newer programs import by name +$(OUT)intl.a: $(OUT)intl.def + emximp -o $@ $< + +$(OUT)util.a: $(SRC.OBJECTS) $(LIB.OBJECTS) + $(AR) $(ARFLAGS) $@ $^ + +$(ROOT)src/po-gram-gen2.h: $(ROOT)src/po-gram-gen.h + sed -e "s/[yY][yY]/po_gram_/g" $< > $@ + +$(ROOT)intl/libintl.h: $(ROOT)intl/libgnuintl.h + $(COPY) $< $@ + +gettext-os2-$(VERSION)-bin.zip: $(INSTALL.FILES) + @rm -f $@ + zip -9XD $@ $^ + +# The following rules are for `make distr' target only + +$(INST)share/locale/charset.alias: $(ROOT)lib/config.charset + $(UNIXSHELL) $< i386-pc-os2-emx >$@ +$(INST)share/locale/locale.alias: $(ROOT)intl/locale.alias + $(COPY) $< $@ +$(INST)bin/% $(INST)lib/% $(INST)dll/%: $(OUT)% + $(COPY) $< $@ +$(INST)include/%: $(ROOT)intl/% + $(COPY) $< $@ +$(INST)doc/gettext-$(VERSION)/%: $(ROOT)% + $(COPY) $< $@ +$(INST)doc/gettext-$(VERSION)/% $(INSTSRC)% $(INSTSRC)os2/% $(INST)include/%: % + $(COPY) $< $@ +$(INSTSRC)%: $(ROOT)% + $(COPY) $< $@ +$(INST)share/locale/%/LC_MESSAGES/gettext.mo: $(ROOT)po/%.po + $(MKDIR) $(dir $@) + $(COMSPEC) /c "$(subst /,\\,set BEGINLIBPATH=$(OUT:/=) && \ + $(OUT)msgfmt.exe) --statistics --verbose -o $@ $<" + +# DO NOT DELETE this line -- makedep depends on it + +$(OUT)intl-compat.o: ../intl/libgnuintl.h ../intl/gettextP.h \ + ../intl/loadinfo.h ../intl/gettext.h +$(OUT)bindtextdom.o: ../intl/libgnuintl.h ../intl/gettextP.h \ + ../intl/loadinfo.h ../intl/gettext.h +$(OUT)dcgettext.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h ../intl/libgnuintl.h +$(OUT)dgettext.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h ../intl/libgnuintl.h +$(OUT)gettext.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h ../intl/libgnuintl.h +$(OUT)finddomain.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h ../intl/libgnuintl.h +$(OUT)loadmsgcat.o: ../intl/gettext.h ../intl/gettextP.h \ + ../intl/loadinfo.h +$(OUT)localealias.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h +$(OUT)textdomain.o: ../intl/libgnuintl.h ../intl/gettextP.h \ + ../intl/loadinfo.h ../intl/gettext.h +$(OUT)l10nflist.o: ../intl/loadinfo.h +$(OUT)explodename.o: ../intl/loadinfo.h +$(OUT)dcigettext.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h ../intl/libgnuintl.h ../intl/hash-string.h +$(OUT)dcngettext.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h ../intl/libgnuintl.h +$(OUT)dngettext.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h ../intl/libgnuintl.h +$(OUT)ngettext.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h ../intl/libgnuintl.h +$(OUT)plural.o: ../intl/gettextP.h ../intl/loadinfo.h \ + ../intl/gettext.h +$(OUT)os2compat.o: ../os2/iconv.c +$(OUT)dir-list.o: ../lib/system.h ../src/dir-list.h \ + ../src/str-list.h +$(OUT)message.o: ../lib/fstrcmp.h ../src/message.h ../src/str-list.h \ + ../src/pos.h ../lib/system.h +$(OUT)open-po.o: ../src/open-po.h ../src/dir-list.h ../lib/error.h \ + ../lib/system.h ../intl/libgettext.h +$(OUT)po-gram-gen.o: ../src/po-lex.h ../lib/error.h ../src/pos.h \ + ../src/po-gram.h ../lib/system.h ../intl/libgettext.h \ + ../src/po.h +$(OUT)po-hash-gen.o: ../src/po-hash.h ../src/po.h ../src/po-lex.h \ + ../lib/error.h ../src/pos.h +$(OUT)po-lex.o: ../intl/libgettext.h ../src/po-lex.h ../lib/error.h \ + ../src/pos.h ../src/open-po.h ../src/po-gram-gen2.h +$(OUT)po.o: ../src/po.h ../src/po-lex.h ../lib/error.h \ + ../src/pos.h ../src/po-hash.h ../lib/mbswidth.h \ + ../intl/libgettext.h +$(OUT)str-list.o: ../src/str-list.h +$(OUT)write-po.o: ../src/write-po.h ../src/message.h \ + ../src/str-list.h ../src/pos.h ../lib/c-ctype.h \ + ../lib/linebreak.h ../lib/error.h ../intl/libgettext.h +$(OUT)xget-lex.o: ../src/dir-list.h ../lib/error.h \ + ../intl/libgettext.h ../lib/hash.h ../src/str-list.h \ + ../src/xget-lex.h diff --git a/os2/README.OS2 b/os2/README.OS2 new file mode 100644 index 0000000..e3934b8 --- /dev/null +++ b/os2/README.OS2 @@ -0,0 +1,161 @@ + +Welcome! +======== + +This is the OS/2 port of GNU gettext 0.10.40 and possibly later versions. + + +Compatibility +============= + +The library has been compiled with -Zmt flag, but it doesn't matter as soon +as you use the EMX single-threaded runtime fix (emx-strt-fix-0.0.2.zip). + +The library is fully compatible with the previous port of gettext library +which is largely used especialy by XFree86 programs. All the old programs +that I have with gettext support run fine with the new version of the DLL. + + +Installation +============ + +If you set the GNULOCALEDIR environment variable to point to your +x:/xxx/share/locale directory, it will override any other setting. That is, +unpack the binary distribution over /emx, set GNULOCALEDIR=x:/emx/share/locale +(where x: is the drive letter of your EMX installation) and that's all. + +If you use the UNIXROOT environment variable, the default catalogue search +paths will be like on Unices, e.g. $(UNIXROOT)/usr/lib and +$(UNIXROOT)/usr/share/locale. GNULOCALEDIR always overrides this. + +Also this port supports character set conversions. This means that if your +.mo files were written using new gettext guidelines, e.g. they contain a +message like this: + +msgid "" +msgstr "Content-Type: text/plain; charset=koi8-r\n" + +the messages will be properly converted to your active codepage using OS/2 +Unicode API. For example, russian message catalog gettext.mo is in the +KOI8-R (codepage 878) encoding while OS/2 uses codepage 866. Now when you +run any of these tools it detects that the active OS/2 codepage is 866 and +performs the translation from CP878 -> CP866 for every message. + +If you want to override the character set used to output messages (for example +in XFree86 for Russian the KOI8-R encoding (codepage 878) is used) you can +set the OUTPUT_CHARSET environment variable like this: + +set OUTPUT_CHARSET=KOI8-R + +or (equivalent): + +set OUTPUT_CHARSET=CP878 + +or (same effect): + +set OUTPUT_CHARSET=IBM-878 + +Note that you don't need to set the OUTPUT_CHARSET initially; you may want to +set it just if you want to override the OS/2 active codepage (for example, +you can put it into your XFree86 startup script). + + +XFree86 setup +============= + +If you use XFree86 and the OS/2 default character set is different from the +XFree86 default character set (e.g. for Russain CP866 vs KOI8-R), you can add +the following (or similar) statement to your startx.cmd file (after the +commands dealing with HOME and X11SHELL): + +call VALUE 'OUTPUT_CHARSET', 'KOI8-R', env + +Otherwise you can get incorrect (wrong codepage) output from programs that +previously worked (e.g. GIMP 1.22). This is because earlier versions of gettext +didn't support character set translations. + + +Implementation remarks +====================== + +The codepage conversion code uses OS/2 Unicode API, thus it falls under the +limits that OS/2 Unicode API has. For example, OS/2 Unicode API does not +support the BIG5 Chinese character set nor ISO-8859-X where X > 9 (at least +with Warp4 with fixpack 14 that I have). Also libintl relies on a feature of +the GNU iconv which works differently in OS/2 Unicode API (well, someone may +call it even a bug in OS/2 API); as a results it is impossible to msgfmt any +.po files written in the UTF-8 character set; if someone is interested I can +explain the bug more detailed. + + +Additional API +============== + +This package provides additionaly the iconv() API that can be used by +developers for doing more feature-full Unix ports. The iconv() API is used +to convert text between various codepages. The intl.h header file contains +the prototypes and definitions needed for iconv(); if you configure software +with autoconf it possibly will find intl.h and set up the software accordingly. + +Also it provides an limited implementation of the nl_langinfo function which +is used for querying the active system codepage. Other software may find it +useful as well. + +All these functions are exported from INTL.DLL, thus if you use either iconv +or nl_langinfo you should link with it (-lintl). + + +Rebuilding the library +====================== + +The library is quite easy to rebuild. First of all, get and install the +original source code package, as of today it is gettext-0.10.40. Now copy +the contents of the src/gettext-$(VERSION)/ directory on top of the source +tree, e.g. intl/os2compat.c goes into the respective intl/ directory of the +original source package. As of today the support/ directory is missing from +the gettext source tree, thus you should just copy it recursively into the +root directory of the source code. + +Now apply the diff file, and resolve any conflicts (if you happen to compile +a newer version than the one the diff is supplied for). + +Now if you're a masochist you can go the clumsy configure/make Unix way, but +it is highly recommended to use an alternate way: go to support/os2 and just +run `make'. If you have all the required tools, it should painlessly compile. +Now if you want a binary distribution archive, do `make distr'. + +WARNING: Due to a bug in GNU Make 3.76.1 (at least in its OS/2 port) you will +have to do sometimes "make distr" twice to get a complete distribution archive; +if you see warnings from zip like these: + +zip warning: name not matched: emx/src/gettext-0.10.40/support/os2/iconv.h +zip warning: name not matched: emx/src/gettext-0.10.40/support/os2/langinfo.h + +it is best to interrupt zip and re-run make distr once more time. This happens +because make fails to execute two different rules that tells him to make two +different destination files from the same source file (e.g. iconv.h is copied +both to emx/src/gettext/support/os2 and to emx/include). + +If you want a debug version of library, you can do `make install DEBUG=1'. + +If you have no LxLite tool installed, do `make LXLITE=0' + +NB: For best results, it is highly recommended that you use at least emxbind.exe +and ld.exe from gcc 3.0.2 or later, since they contain a number of fixes that +will help you generate a more optimal DLL. + + +Contributors +============ + +Hung-Chi Chu <hcchu@r350.ee.ntu.edu.tw> + the original port of gettext (0.10.35) + +Jun SAWATAISHI <jsawa@attglobal.net> + some more work on it and submitted the patches to GNU team, although + they were not completely integrated. + +Andrew Zabolotny <zap@cobra.ru> + Succeeded to remove almost all OS/2-specific #ifdef's from mainstream + source code, wrote the dedicated OS/2 makefile, wrote the iconv wrapper + around OS/2 Unicode API, added support for locale translations. diff --git a/os2/backward.def b/os2/backward.def new file mode 100644 index 0000000..3183f9f --- /dev/null +++ b/os2/backward.def @@ -0,0 +1,13 @@ +; These exports are for backward compatibility with older ports +; of gettext for OS/2 that export everything by ordinals. + _$gettext=gettext @1 NONAME + _$gettext__=gettext__ @2 NONAME + _$dgettext=dgettext @3 NONAME + _$dgettext__=dgettext__ @4 NONAME + _$dcgettext=dcgettext @5 NONAME + _$dcgettext__=dcgettext__ @6 NONAME + _$textdomain=textdomain @7 NONAME + _$textdomain__=textdomain__ @8 NONAME + _$bindtextdomain=bindtextdomain @9 NONAME + _$bindtextdomain__=bindtextdomain__ @10 NONAME + _$_nl_msg_cat_cntr=_nl_msg_cat_cntr @11 NONAME diff --git a/os2/iconv/README b/os2/iconv/README new file mode 100644 index 0000000..2dc449c --- /dev/null +++ b/os2/iconv/README @@ -0,0 +1,2 @@ +This directory implements the POSIX iconv() function family, based on the +OS/2 Unicode API. It is independent of GNU gettext. diff --git a/os2/iconv/iconv.c b/os2/iconv/iconv.c new file mode 100644 index 0000000..b098a96 --- /dev/null +++ b/os2/iconv/iconv.c @@ -0,0 +1,148 @@ +/* OS/2 iconv() implementation through OS/2 Unicode API + Copyright (C) 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* + This file implements an iconv wrapper based on OS/2 Unicode API. +*/ + +#include <uconv.h> + +typedef struct _iconv_t +{ + UconvObject from; + UconvObject to; +} *iconv_t; + +/* Tell "iconv.h" to not define iconv_t by itself. */ +#define _ICONV_T +#include "iconv.h" + +#include <alloca.h> + +/* Convert an encoding name to te form understood by UniCreateUconvObject. */ +static inline void +cp_convert (const char *cp, UniChar *ucp) +{ + size_t sl = 0; + + /* Transform CPXXX naming style to IBM-XXX style */ + if ((cp[0] == 'C' || cp[0] == 'c') && (cp[1] == 'P' || cp[1] == 'p')) + { + ucp[sl++] = 'I'; + ucp[sl++] = 'B'; + ucp[sl++] = 'M'; + ucp[sl++] = '-'; + cp += 2; + } + + while (*cp != '\0') + ucp[sl++] = *cp++; + ucp[sl] = 0; +} + +iconv_t +iconv_open (const char *cp_to, const char *cp_from) +{ + UniChar *ucp; + iconv_t conv; + + conv = (iconv_t) malloc (sizeof (struct _iconv_t)); + if (conv == NULL) + { + errno = ENOMEM; + return (iconv_t)(-1); + } + + ucp = (UniChar *) alloca ((strlen (cp_from) + 2 + 1) * sizeof (UniChar)); + cp_convert (cp_from, ucp); + if (UniCreateUconvObject (ucp, &conv->from)) + { + free (conv); + errno = EINVAL; + return (iconv_t)(-1); + } + + ucp = (UniChar *) alloca ((strlen (cp_to) + 2 + 1) * sizeof (UniChar)); + cp_convert (cp_to, ucp); + if (UniCreateUconvObject (ucp, &conv->to)) + { + UniFreeUconvObject (conv->from); + free (conv); + errno = EINVAL; + return (iconv_t)(-1); + } + + return conv; +} + +size_t +iconv (iconv_t conv, + const char **in, size_t *in_left, + char **out, size_t *out_left) +{ + size_t bytes_converted = 0; + int rc; + size_t sl = *in_left, nonid; + UniChar *ucs = (UniChar *) alloca (sl * sizeof (UniChar)); + UniChar *orig_ucs = ucs; + + rc = UniUconvToUcs (conv->from, (void **)in, in_left, &ucs, &sl, &nonid); + if (rc) + goto error; + sl = ucs - orig_ucs; + ucs = orig_ucs; + /* Uh-oh, seems like a bug in UniUconvFromUcs, at least when + translating from KOI8-R to KOI8-R (null translation) */ +#if 0 + rc = UniUconvFromUcs (conv->to, &ucs, &sl, (void **)out, out_left, &nonid); + if (rc) + goto error; +#else + while (sl) + { + size_t usl = 0; + while (sl && (ucs[usl] != 0)) + usl++, sl--; + rc = UniUconvFromUcs (conv->to, &ucs, &usl, (void **)out, out_left, &nonid); + if (rc) + goto error; + if (sl && *out_left) + { + *(*out)++ = 0; + (*out_left)--; + ucs++; sl--; + } + } +#endif + return 0; + error: + errno = EILSEQ; + return (size_t)(-1); +} + +int +iconv_close (iconv_t conv) +{ + if (conv != (iconv_t)(-1)) + { + UniFreeUconvObject (conv->to); + UniFreeUconvObject (conv->from); + free (conv); + } + return 0; +} diff --git a/os2/iconv/iconv.h b/os2/iconv/iconv.h new file mode 100644 index 0000000..15e2fde --- /dev/null +++ b/os2/iconv/iconv.h @@ -0,0 +1,43 @@ +/* OS/2 iconv() implementation through OS/2 Unicode API + Copyright (C) 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef __ICONV_H__ +#define __ICONV_H__ + +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* FIXME: This belongs in <errno.h>. */ +#define EILSEQ 1729 + +#ifndef _ICONV_T +typedef void *iconv_t; +#endif + +extern iconv_t iconv_open (const char *, const char *); +extern size_t iconv (iconv_t, const char **, size_t *, char **, size_t *); +extern int iconv_close (iconv_t); + +#ifdef __cplusplus +} +#endif + +#endif /* __ICONV_H__ */ diff --git a/os2/os2compat.h b/os2/os2compat.h new file mode 100644 index 0000000..22ef1a2 --- /dev/null +++ b/os2/os2compat.h @@ -0,0 +1,77 @@ +/* OS/2 compatibility defines. + This file is intended to be included from config.h + Copyright (C) 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* When included from os2compat.h we need all the original definitions */ +#ifndef OS2_AWARE + +#undef LIBDIR +#define LIBDIR _os2_libdir +extern char *_os2_libdir; + +#undef LOCALEDIR +#define LOCALEDIR /* a 1024+1 bytes large buffer */ \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + +#undef LOCALE_ALIAS_PATH +#define LOCALE_ALIAS_PATH _os2_localealiaspath +extern char *_os2_localealiaspath; + +#endif + +#undef HAVE_STRCASECMP +#define HAVE_STRCASECMP 1 +#define strcasecmp stricmp +#define strncasecmp strnicmp + +/* We have our own getenv() which works even if library is compiled as DLL */ +#define getenv _nl_getenv + +/* Older versions of gettext used -1 as the value of LC_MESSAGES */ +#define LC_MESSAGES_COMPAT (-1) |