If you want to build PGCC/OS2 from scratch (if you're mad enough :-) here are the
instructions how to do it. Note that you either should be current with Unix-style
utilites (I mean the contents of ftp.leo.org/pub/comp/os/os2/leo/unix/..., for example)
or you should have enough time to learn them (its easy, believe me... despite what m$
propaganda says ;-)
However, if I've succeeded to scare you (;-) you can just download the binaries
(skip this entire paragraph to next separator line) and enjoy.
To configure PGCC sourcecode to compile for OS/2 you should have:
When you have everything listed above, you should:
$(PGCC)
diff.new/pgcc/ subdirectory
into the $(PGCC) subdirectory (recursively with all
subdirectories).
diff.new/pgcc/ directory.
If make tries to run 'autoconf' (which you most likely don't have), run 'touch configure', then re-run make. If make tries to launch 'autoheader' (which is a part of autoconf package too), touch cstamp-h.in then re-run make. These problems can show up because of inconsistency between time/date stamp of these files after applying patches.
When GCC compilation will be done, you should build a stage2 compiler. Stage1 compiler contains debug info so it is usable only for debugging purposes. A stage2 compiler is built using stage1 compiler (i.e. the compiler you already have -- with debugging info)
To build stage2 compiler using stage1 compiler (also a stage(n+1) compiler using stage(n) compiler) you should launch:
bash emx-nextstagein the $(PGCC)/gcc/ directory.
You can run emx-nextstage up to three times to make stage2 through stage4 compilers. Each successful stage tells you have a compiler that at least can build itself from scratch.
If you still have problems you should read the file $(PGCC)/INSTALL - it contains some general instructions on building pgcc. Keep in mind that they are for Unix, not for OS/2.
When you're done playing with stageN compilers, you can extract the final files to another directory, this way:
mkdir /new make install prefix=/new
This should create a bunch of subdirectories under /new and copy a lot of files into them; decide yourself which of those files do you need.
Now you should create the libgcc library. Take the gcc.a and gcc_p.a libraries: These are the GCC runtime libraries; with profiling and without profiling. You should use them to build ten (!) versions of gcc.a: single/multi-threaded, for C/C++, with/without profiling and dynamic versions. For this you should put them two into the emx/diff/libgcc directory, change the lines at the top of the make_gpp.cmd file in accordance to you setup, and run it. You will get ten g*.a files in st/ and mt/ directories: grab them. I've decided to split libgcc from EMX runtime DLLs since they changes with each version of gcc, and this makes EMX DLLs a mess.
After this you can go to pgcc/i386-ibm-os2/liberty,libio,libstdc++ directories and build stdc++ and libiberty libraries. Also if you want to build Fortran runtime libraries you should do it in pgcc/libf2c. I won't include detailed instructions since most likely you won't need to do it - its a whole mess.