Akira's Commentary


What is libiconv

In some UNIXes, there is 'iconv' library, as generic multi-lingual character code, encoding coversion. If you are handling UTF-8, UTF-16, it is nearly standard library for handling such code.

As I developed some program using 'iconv' library on OS/2, I ported free (LGPL) implementation of 'iconv' library, Mr. Bruno Haible's 'libiconv' into OS/2 (2). See this table for current supporting character set and encodings.

Porting

What I need is (manually) pre-configured Makefiles, include files, module definition file for building OS/2 DLL, and test scripts. No modifications on the source itself.

Here's list of additonal files. They are zipped to this archive.

FILES.os2list of addtional files
README.os2description for OS/2 port
Makefile.os2pre-configure'd Makefile
src/Makefile.os2
man/Makefile.os2
tests/Makefile.os2
include/iconv.h.os2pre-configured include files
src/config.h.os2
src/iconv.def.os2module defintion file for OS/2 DLL
tests/check-stateful.cmdtestscripts for OS/2
tests/check-stateless.cmd
tests/check-translit.cmd

Build

Requires EMX/GCC (I use 0.9d, fix03) and some GNU file utils, such as "cp", "rm", "diff", "cat", "uniq". If you want to use recursive make, then you need x11make.exe make.cmd, indir.cmd, found in XFree86/2 distribution.

First, get 'libiconv' from Bruno Haible's site, and expand it in some directory (2). Also unpack OS2 patches in same directory. It contains additnal files only, and does not overwrite existing files.

To build OS2 version, simply

make -f Makefile.os2 all

at top directory (or in "src" directory).

To install libiconv's header, library (DLL & IMP) and manuals,

make -f Makefile.os2 install instroot="X:\emx"

or, manually

in "include" directory
cp iconv.h X:\emx\include
in "src" directory
cp iconv.dll X:\emx\dll
cp iconv.a X:\emx\lib
cp iconv.lib X:\emx\lib
in "man" directory
cp iconv.3 iconv_close.3 iconv_open.3 X:\emx\man\man3

DLL was build with "-Zmt -Zcrtdll" options. So use libiconv, main program also compiled with "-Zmt -Zcrtdll" options (or short hands, "-Zmtd").

Main program should include "iconv.h". If main program compiled as ".o", link "iconv.a" import library. If main program complied with "-Zomf" (generate .obj), then link "iconv.lib" import library.

Binary Package

I also prepared OS/2 binaries here. It contains header, import libraries (.a and .lib) and DLL.