[p900] porting SDK UIQ 2.1 to Linux: rcomp utility

  • From: Alfonso Martone <a.martone@xxxxxxxxxxx>
  • To: p900@xxxxxxxxxxxxx
  • Date: Mon, 22 Dec 2003 00:47:31 +0100

I finally got compiled rcomp (Resource Compiler) under Linux,
creating my own Makefile (to not to use their braindamaged
makmake/abld/bldmake stuff). The rcomp executable is about 160k.

I got a compilation of the C++ sources without extra
warning messages, using "gcc -s -O2 -I. -Wno-deprecated".

A number of modifications in the source was needed, because
they didn't even remotely think about porting to platforms
different than DOS/Win:

- I couldn't generate bison/flex automata because specific
DOS yacc/lex parsers were required; I used their "derived"
directory sources and had (sigh!) to modify the automata

- some source files didn't end with a newline terminator;

- some DOS style filenames ("strstrea.h", "process.h") had
to be changed or emulated;

- some old C syntax ("const XYZ = 3;") needed conversion
("const int" etc);

- corrected some redefinitions of things for which we must
trust standard include files (e.g.: wchar_t) instead of
creating our ones (a common temptation of DOS environment);

- some bugs of DOS compilers were used (unsafe "private"
members, static/non-static functions, etc)

- some DOS only functions and constants were used (_ltoa,
_MAX_PATH, etc); I had to create extra source files to
emulate ltoa and spawn functions;

- some MAJOR modifications were (are still) needed because
wchar_t is 32bit in Unix environments, and only 16bit in
DOS (and rcomp original source supposes equivalence between
"short" and "wchar_t")...!

Well, some files (unicode_compressor.cpp, rcbinstr.cpp,
etc) still need some hard debugging.

Also, the rcomp needs the idcrc executable in the path;
I will work on its sources in next days.

Final considerations:

- rebuilding rcomp from scratch will save a lot of
debugging work. Their source just needs too many
modifications to get "portable" and "clean";

- this means that this "rcomp 7.01-Linux" is a "dead"
version (too hard to maintain);

- I hope to get to a decently functional version
("compiled" does not mean "without runtime errors");
anyways, the main issue is the wchar_t sizing (and
the great number of types used to deal with it:
I don't know why they used sometimes unsigned short,
some other wchar_t, some other const, etc).


Other related posts:

  • » [p900] porting SDK UIQ 2.1 to Linux: rcomp utility