Porting to OS/2: Install WLINK and WRC

Some OS/2 tools such as linker and resource compiler have some limitations. Fortunately, replacements for them are provided. They are wl.exe(linker) and wrc.exe(resource compiler) from Open Watcom project.

wl.exe : http://home.earthlink.net/~steve53/OpenWatcom/wl_exe-20140527.zip
wrc.exe : http://www.warpcave.com/OpenWatcom/wrc-static-build-20140417a.zip

After downloading them, copy the executables from zip into any directory in your PATH. If you don't find any suitable place, then create directories x:\usr and x:\usr\bin. Copy them into x:\usr\bin. Of course you should add x:\usr\bin to your PATH env var.

How can we use them ? You should set some env vars. For wl.exe, you should call gccenv.cmd with WLINK parameter. Do like this.

  • x:\gcc\usr\bin\gccenv.cmd x:\gcc\usr WLINK

Then, gcc will use WLINK when linking OMF object files and libraries. OMF is IBM's object module format. -Zomf flag is required for this.

  • gcc -Zomf hello.c

Then, gcc uses wl.exe instead of ld.exe.

How about wrc.exe ? set EMXOMFLD_RC_TYPE and EMXOMFLD_RC env vars.


  • set EMXOMFLD_RC_TYPE=WRC
  • set EMXOMFLD_RC=wrc.exe

If you reproduce these steps whenever setting up environments for gcc, it will be very uncomfortable. So let's create a batch file called gccenv.cmd in x:\usr\bin.

1
2
3
4
5
@echo off
set GCCOPT=-pipe
x:\gcc\usr\bin\gccenv.cmd x:\gcc\usr WLINK
set EMXOMFLD_RC_TYPE=WRC
set EMXOMFLD_RC=wrc.exe


You can see a strange thing above. At line 2, GCCOPT appeared suddenly. It directs gcc to use pipe instead of temporary file when communicating with internal programs.

By this batch file, you can call gccenv.cmd anywhere and set WLINK and WRC.

댓글

이 블로그의 인기 게시물

토렌트: < 왕좌의 게임 > 시즌 1 ~ 시즌 8 완결편 마그넷

토렌트: NGC < 코스모스 > 우리말 더빙 전편(1편~13편) 마그넷

토렌트: < 스타워즈 > Ep.1 ~ Ep.6 마그넷