]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update from Andrew Zabolotny.
authorBruno Haible <bruno@clisp.org>
Fri, 15 Mar 2002 18:21:40 +0000 (18:21 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:07:51 +0000 (12:07 +0200)
ChangeLog
os2/Makefile
os2/README.OS2
os2/iconv/Makefile [new file with mode: 0644]
os2/iconv/iconv.c

index ec7ab9ae50fa90367cd2ab0a7215520e9857d947..d8ab86caa9c8d5dafada84ac93c90efb8c8a2f17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-03-15  Andrew Zabolotny  <zap@cobra.ru>
+
+       * os2/README.OS2: Update.
+       * os2/Makefile: Likewise.
+
 2002-03-12  Bruno Haible  <bruno@clisp.org>
 
        * gettext-0.11.1 released.
index 09d78e5a614e46847b7d65c8476955573586ebf5..cb31fb4b1135161f2c3ed2dcdde91b515ea56e03 100644 (file)
@@ -47,12 +47,14 @@ INST = emx/
 # Tools
 CC = gcc -c
 CFLAGS = -Wall -Zmt $(INCLUDE) $(DEFS)
-INCLUDE = -I. -I$(ROOT) -I$(ROOT)intl -I$(ROOT)src -I$(ROOT)lib
+INCLUDE = -I. -I$(ROOT) -I$(ROOT)intl -I$(ROOT)src -I$(ROOT)lib -I$(ROOT)libuniname
 DEFS = -DHAVE_CONFIG_H -DLIBDIR=\"/usr/lib\" \
   -DLOCALEDIR=\"/usr/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/share/locale\" \
+  -DGETTEXTDATADIR=\"/usr/share/gettext\" \
   -DPROJECTSDIR=\"/usr/share/gettext/projects\" \
   -DGETTEXTJAR=\"/usr/share/gettext/gettext.jar\"
 
+
 LD = gcc
 LDFLAGS = -Zmt -Zcrtdll
 LDFLAGS.SHARED = -Zmt -Zcrtdll -Zdll
@@ -113,7 +115,15 @@ LIB.SOURCES = $(addprefix $(ROOT)lib/, error.c stpcpy.c stpncpy.c mkdtemp.c getl
   $(shell sed $(ROOT)lib/Makefile.am -ne "/^libgettextlib_la_SOURCES =/,/[^\]$$/p"))))))
 LIB.OBJECTS = $(addprefix $(OUT),$(subst $(ROOT),,$(LIB.SOURCES:.c=.o)))
 
-OUTDIRS = $(OUT) $(sort $(dir $(INTL.OBJECTS) $(SRC.OBJECTS) $(LIB.OBJECTS) $(INSTALL.FILES)))
+LIBUNINAME.SOURCES = $(addprefix $(ROOT)libuniname/, \
+  $(subst libuniname_a_SOURCES = ,,\
+  $(subst \,,\
+  $(patsubst %.h,,\
+  $(shell sed $(ROOT)libuniname/Makefile.am -ne "/^libuniname_a_SOURCES =/,/^$$/p")))))
+LIBUNINAME.OBJECTS = $(addprefix $(OUT),$(subst $(ROOT),,$(LIBUNINAME.SOURCES:.c=.o)))
+
+OUTDIRS = $(OUT) $(sort $(dir $(INTL.OBJECTS) $(SRC.OBJECTS) $(LIB.OBJECTS) \
+  $(LIBUNINAME.OBJECTS) $(INSTALL.FILES)))
 
 INSTALL.FILES = $(addprefix $(INST)bin/,$(PROGRAMS)) \
   $(INST)lib/intl.a $(INST)lib/intl_s.a $(INST)include/libintl.h \
@@ -136,7 +146,7 @@ $(OUT)%.o: $(ROOT)%.c
 # 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)
+$(OUT)%.exe: $(OUT)src/%.o $(OUT)util.a $(OUT)uniname.a $(LINKINTL)
        $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
 ifeq ($(LXLITE),1)
        lxlite /b- $@
@@ -182,7 +192,7 @@ $(OUT)intl.def: $(INTL.OBJECTS)
        @echo DATA MULTIPLE NONSHARED>>$@
        @echo EXPORTS>>$@
        type backward.def>>$@
-       emxexp $^ >>$@
+       emxexp -u $^ >>$@
 
 $(OUT)intl$(INTLDLLVER).dll: $(INTL.OBJECTS) $(OUT)intl.def
        @echo *********************************************************
@@ -200,6 +210,9 @@ $(OUT)%.a: $(OUT)%.def
 $(OUT)util.a: $(SRC.OBJECTS) $(LIB.OBJECTS)
        $(AR) $(ARFLAGS) $@ $^
 
+$(OUT)uniname.a: $(LIBUNINAME.OBJECTS)
+       $(AR) $(ARFLAGS) $@ $^
+
 $(ROOT)src/po-gram-gen2.h: $(ROOT)src/po-gram-gen.h
        sed -e "s/[yY][yY]/po_gram_/g" $< > $@
 
index 2ba274bd68acf70bb12ed50eafb9acf98213fefb..80487e42cfd61a12d8b2cd11a35d26487310ba3f 100644 (file)
@@ -102,6 +102,10 @@ listed in the \language\codepage\ucstbl.lst file but the codepage files
 themselves are missing; I believe they are ommited from European OS/2's
 due to their large size.
 
+Also I have added "support" for the BIG5 codeset as an alias for IBM-950
+codepage. However, I'm not very sure about this; in any case OS/2 does not
+support (as far as I know) anything closer to BIG5.
+
 
 Additional API
 ==============
diff --git a/os2/iconv/Makefile b/os2/iconv/Makefile
new file mode 100644 (file)
index 0000000..268932e
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# OS/2 GNU Makefile for building libiconv with GNU Make and GNU C compiler
+#
+# This makefile will build iconv.dll, iconv.a (the import library for ICONV.DLL)
+# and iconv_s.a (static library).
+#
+# You will need the Unicode API add-on for EMX, which is included with latest
+# distributions of gcc for OS/2 (gcc 3.0 and later).
+#
+
+# Use CMD.EXE as shell since its way faster
+SHELL = $(COMSPEC)
+
+# Pack the DLL and executables with lxlite
+LXLITE = 1
+
+# Tools
+CC = gcc -c
+CFLAGS = -s -O2 -Wall -Zmt $(INCLUDE) $(DEFS)
+INCLUDE = -I.
+
+LD = gcc
+LDFLAGS.SHARED = -s -Zmt -Zcrtdll -Zdll
+LIBS = -lgcc
+
+AR = ar
+ARFLAGS = crs
+
+.SUFFIXES:
+.SUFFIXES: .o .a .def .dll
+
+.PHONY: all clean
+
+ICONV.VERSION = 0.0.1
+ICONV.OBJECTS = iconv.o
+
+# How to compile a .c file
+$(OUT)%.o: %.c
+       $(CC) $(CFLAGS) -o $@ $<
+
+# How to build an import library from a .DEF file
+$(OUT)%.a: $(OUT)%.def
+       emximp -o $@ $<
+
+all: iconv.dll iconv.a iconv_s.a
+
+clean:
+       rm -rf *.o iconv.dll iconv*.a iconv.def
+
+iconv_s.a: $(ICONV.OBJECTS)
+       $(AR) $(ARFLAGS) $@ $^
+
+$(OUT)iconv.def: $(ICONV.OBJECTS)
+       @echo LIBRARY ICONV INITINSTANCE TERMINSTANCE>$@
+       @echo DESCRIPTION "iconv API library version $(ICONV.VERSION)">>$@
+       @echo DATA MULTIPLE NONSHARED>>$@
+       @echo EXPORTS>>$@
+       emxexp $^ >>$@
+
+$(OUT)iconv.dll: $(ICONV.OBJECTS) $(OUT)iconv.def
+       $(LD) $(LDFLAGS.SHARED) -o $@ $^ $(LIBS)
+ifeq ($(LXLITE),1)
+       lxlite $@
+endif
index f26ab456db19cf5eb4c59ea66e2585c0a3bf0698..0ca50f3cf819367bf5be525569d28d61d595feab 100644 (file)
@@ -32,6 +32,8 @@ typedef struct _iconv_t
 #define _ICONV_T
 #include "iconv.h"
 
+#include <string.h>
+#include <malloc.h>
 #include <errno.h>
 #include <alloca.h>
 
@@ -41,14 +43,16 @@ cp_convert (const char *cp, UniChar *ucp)
 {
   size_t sl = 0;
 
-  if (!strcasecmp (cp, "EUC-JP"))
+  if (!stricmp (cp, "EUC-JP"))
     memcpy (ucp, L"IBM-954", 8*2);
-  else if (!strcasecmp (cp, "EUC-KR"))
+  else if (!stricmp (cp, "EUC-KR"))
     memcpy (ucp, L"IBM-970", 8*2);
-  else if (!strcasecmp (cp, "EUC-TW"))
+  else if (!stricmp (cp, "EUC-TW"))
     memcpy (ucp, L"IBM-964", 8*2);
-  else if (!strcasecmp (cp, "EUC-CN"))
+  else if (!stricmp (cp, "EUC-CN"))
     memcpy (ucp, L"IBM-1383", 9*2);
+  else if (!stricmp (cp, "BIG5"))
+    memcpy (ucp, L"IBM-950", 8*2);
   else
     {
       /* Transform CPXXX naming style to IBM-XXX style */
@@ -129,7 +133,7 @@ iconv (iconv_t conv,
     goto error;
   sl = ucs - orig_ucs;
   ucs = orig_ucs;
-  /* UniUconvFromUcs will stop at first NULL byte
+  /* UniUconvFromUcs will stop at first nul byte (huh? indeed?)
      while we want ALL the bytes converted.  */
 #if 1
   rc = UniUconvFromUcs (conv->to, &ucs, &sl, (void **)out, out_left, &nonid);