Porting to OS/2: Install GCC

Currently, gcc is distributed in 3 ways.

First is by its official project site.


Second is by Paul Smedley, who is a maintainer of the latest gcc for OS/2.


Third is by rpm/yum package manager.


The most convenient way is by rpm/yum. So if possible, I recommend to use this. But, like me, if it's difficult to use rpm/yum due to some reasons such as library conflicts, use second way. Especially, Paul Smedley's build environment(http://os2ports.smedley.id.au/index.php?page=BuildEnvDVD) has most of the things needed in order to port to OS/2. Finally, if you are hard core users, let's start on the ground with me. ^^

At first, you should choose a drive to install gcc and other tools. I recommend to choose a drive other than a boot drive. Then download kLIBC 0.6.5 / GCC 3.3.5 csd5 from klibc site(ftp://ftp.netlabs.org/pub/gcc/GCC-3.3.5-csd5.zip).

Unzip it on your drive root, or on any directory where you want to install if you don't like to corrupt a root directory like me. Assume that you installed it on a root directory. Then you can confirm that gcc335 is installed in x:\gcc, where x: is your drive on which gcc is.

Now, let's check if it was installed correctly. Create hello.c on somewhere.

1
2
3
4
5
6
7
8
9
// hello.c
#include <stdio.h>

int main( void )
{
    printf("Hello, word!!!\n");

    return 0;
}


Then setup environments for gcc by calling gccenv.cmd

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

And, compile and link it.

  • gcc hello.c

Then you can get hello.exe. And execute it, and see its message. ^^

Next time, let's install other useful tools.

// ----- 2014/09/06
Current gccenv.cmd has a bug. Use a fixed version.

// -----

댓글

이 블로그의 인기 게시물

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

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

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