Only in new/intl: gnuintl.def
Only in new/intl: Makefile.os2
diff -cbr orig/intl/bindtextdom.c new/intl/bindtextdom.c
*** orig/intl/bindtextdom.c	Sat Jul 06 03:52:36 1996
--- new/intl/bindtextdom.c	Sun Jul 28 12:46:06 1996
***************
*** 46,52 ****
  /* @@ end of prolog @@ */
  
  /* Contains the default location of the message catalogs.  */
! extern const char _nl_default_dirname[];
  
  /* List with bindings of specific domains.  */
  extern struct binding *_nl_domain_bindings;
--- 46,52 ----
  /* @@ end of prolog @@ */
  
  /* Contains the default location of the message catalogs.  */
! extern const char *_nl_default_dirname;
  
  /* List with bindings of specific domains.  */
  extern struct binding *_nl_domain_bindings;
***************
*** 70,75 ****
--- 70,78 ----
       const char *dirname;
  {
    struct binding *binding;
+ 
+   if (_nl_default_dirname == NULL)
+     _nl_default_dirname = GNULOCALEDIR;
  
    /* Some sanity checks.  */
    if (domainname == NULL || domainname[0] == '\0')
diff -cbr orig/intl/dcgettext.c new/intl/dcgettext.c
*** orig/intl/dcgettext.c	Sat Jul 06 03:52:36 1996
--- new/intl/dcgettext.c	Sun Jul 28 12:46:06 1996
***************
*** 151,157 ****
  const char *_nl_current_default_domain = _nl_default_default_domain;
  
  /* Contains the default location of the message catalogs.  */
! const char _nl_default_dirname[] = GNULOCALEDIR;
  
  /* List with bindings of specific domains created by bindtextdomain()
     calls.  */
--- 151,157 ----
  const char *_nl_current_default_domain = _nl_default_default_domain;
  
  /* Contains the default location of the message catalogs.  */
! const char *_nl_default_dirname = NULL;
  
  /* List with bindings of specific domains created by bindtextdomain()
     calls.  */
***************
*** 200,205 ****
--- 200,208 ----
  # define alloca(size) (malloc (size))
  #endif	/* have alloca */
  
+ #ifdef OS2
+ #undef dcgettext__
+ #endif
  
  /* Names for the libintl functions are a problem.  They must not clash
     with existing names and they should follow ANSI C.  But this source
***************
*** 235,240 ****
--- 238,246 ----
    if (msgid == NULL)
      return NULL;
  
+   if (_nl_default_dirname == NULL)
+     _nl_default_dirname = GNULOCALEDIR;
+ 
    /* If DOMAINNAME is NULL, we are interested in the default domain.  If
       CATEGORY is not LC_MESSAGES this might not make much sense but the
       defintion left this undefined.  */
***************
*** 258,264 ****
--- 264,275 ----
  
    if (binding == NULL)
      dirname = (char *) _nl_default_dirname;
+ #ifdef OS2
+   else if (binding->dirname[0] == '/' || 
+ 	   isalpha(binding->dirname[0]) && binding->dirname[1] == ':')
+ #else
    else if (binding->dirname[0] == '/')
+ #endif
      dirname = binding->dirname;
    else
      {
***************
*** 384,389 ****
--- 395,425 ----
      }
    /* NOTREACHED */
  }
+ 
+ #ifdef OS2
+ 
+ /* quick hack to at least translate german umlauts from Latin-1 to
+    Codepage 850/437 - needs to be extended to other NLS characters */
+ 
+ static char *cp850  = "\x84\x94\x81\x8E\x99\x9A\xE1";
+ static char *latin1 = "\xE4\xF6\xFC\xC4\xD6\xDC\xDF";
+ 
+ char *dcgettext__2 (const char *domainname, const char *msgid, int category)
+ {
+   char *msg = DCGETTEXT ( domainname, msgid, category), *ptr = msg;
+   int len = strlen (msg), pos;
+ 
+   while ((pos = strcspn(ptr, latin1)) < len)
+   {
+     ptr[pos] = cp850[strchr(latin1, ptr[pos]) - latin1];
+     ptr += pos + 1;
+     len -= pos + 1;
+   }
+ 
+   return msg;
+ }
+ 
+ #endif
  
  #ifdef _LIBC
  /* Alias for function name in GNU C Library.  */
diff -cbr orig/intl/gettext.h new/intl/gettext.h
*** orig/intl/gettext.h	Sat Jul 06 03:52:38 1996
--- new/intl/gettext.h	Sun Jul 28 13:29:58 1996
***************
*** 25,30 ****
--- 25,39 ----
  # include <limits.h>
  #endif
  
+ #ifdef OS2
+ #define PATH_SEPARATOR ';'
+ #define GNULOCALEDIR __checkenv("GNULOCALEDIR","/lib/glocale")
+ #define LOCALE_ALIAS_PATH __strcat(GNULOCALEDIR,";.")
+ extern char *__checkenv(), *__strcat();
+ #else
+ #define PATH_SEPARATOR ':'
+ #endif
+ 
  /* @@ end of prolog @@ */
  
  /* The magic number of the GNU message catalog format.  */
diff -cbr orig/intl/intl-compat.c new/intl/intl-compat.c
*** orig/intl/intl-compat.c	Sat Jul 06 03:52:38 1996
--- new/intl/intl-compat.c	Sun Jul 28 12:46:08 1996
***************
*** 74,76 ****
--- 74,101 ----
  {
    return textdomain__ (domainname);
  }
+ 
+ #ifdef OS2
+ 
+ char *getenv();
+ void *malloc();
+ 
+ char *__checkenv(char *envvar, char *defval)
+ {
+   char *envval = getenv(envvar);
+   return envval ? envval : defval;
+ }
+ 
+ char *__strcat(char *str1, char *str2)
+ {
+   int len = strlen(str1) + strlen(str2) + 1;
+   char *str = malloc(len);
+   if (str)
+   {
+     strcpy(str, str1);
+     strcat(str, str2);
+   }
+   return str;
+ }
+ 
+ #endif
diff -cbr orig/intl/libgettext.h new/intl/libgettext.h
*** orig/intl/libgettext.h	Sat Jul 06 03:52:38 1996
--- new/intl/libgettext.h	Sun Jul 28 12:46:08 1996
***************
*** 36,41 ****
--- 36,47 ----
  # include <locale.h>
  #endif
  
+ #ifdef OS2
+ #define LOCALEDIR __checkenv("LOCALEDIR","/lib/locale")
+ #define GNULOCALEDIR __checkenv("GNULOCALEDIR","/lib/glocale")
+ extern char *__checkenv();
+ #define dcgettext__ dcgettext__2
+ #endif
  
  #ifdef __cplusplus
  extern "C" {
diff -cbr orig/intl/localealias.c new/intl/localealias.c
*** orig/intl/localealias.c	Sat Jul 06 03:52:40 1996
--- new/intl/localealias.c	Sun Jul 28 12:46:10 1996
***************
*** 137,146 ****
  _nl_expand_alias (name)
      const char *name;
  {
!   static const char *locale_alias_path = LOCALE_ALIAS_PATH;
    struct alias_map *retval;
    size_t added;
  
    do
      {
        struct alias_map item;
--- 137,149 ----
  _nl_expand_alias (name)
      const char *name;
  {
!   static const char *locale_alias_path = NULL;
    struct alias_map *retval;
    size_t added;
  
+   if (locale_alias_path == NULL)
+     locale_alias_path = LOCALE_ALIAS_PATH;
+ 
    do
      {
        struct alias_map item;
***************
*** 166,176 ****
  	{
  	  const char *start;
  
! 	  while (locale_alias_path[0] == ':')
  	    ++locale_alias_path;
  	  start = locale_alias_path;
  
! 	  while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
  	    ++locale_alias_path;
  
  	  if (start < locale_alias_path)
--- 169,179 ----
  	{
  	  const char *start;
  
! 	  while (locale_alias_path[0] == PATH_SEPARATOR)
  	    ++locale_alias_path;
  	  start = locale_alias_path;
  
! 	  while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR)
  	    ++locale_alias_path;
  
  	  if (start < locale_alias_path)

