Installation instructions for GNU gcc compiler for OS/9 Doug Neuhauser UC Berkeley Seismological Laboratory doug@seismo.berkeley.edu Updated 1997/08/02 The OS/2 GCC software can be acquired from one of the following archives: ftp://os9archive.rtsi.com/OS9/OSK/GCC/BIN or ftp://quake.geo.berkeley.edu/pub/quanterra/gcc The files that you need are: gcc_2.5.8_cmds.lzh - command for gcc2 gclib.lzh - libraries for gcc2 README.GCC.UCB - this README file (only from Berkeley) Use BINARY mode in ftp to copy the .lzh files. You need to build the libraries (using the makefile in gclib) since they build a new libraries from parts of the OS9 library, which is copyrighted and can not be distributed as part of this distribution. I suggest that you put the entire gcc distribution in its own directory, e.g. /h0/GNU. That way, it is clear what files are part of the gcc distribution, and can easily be moved to another system or deleted from this system. 1. makdir /h0/GNU 2. chd /h0/GNU 3. Copy the following files into this directory gcc_2.5.8_cmds.lzh - command for gcc2 gclib.lzh - libraries for gcc2 4. lharc -x gcc_2.5.8_cmds.lzh creates directories DEFS DEFS/GCC2 DEFS/GCC2/SYS GNU GNU/CMDS LIB 5. attr -e -pe /h0/GNU/GNU/CMDS/* 6. lharc -x gclib.lzh creates the following directories: GNU GNU/GCLIB GNU/GCLIB/LIBGCC GNU/GCLIB/GCLIB000 GNU/GCLIB/GCLIB020 GNU/GCLIB/GCLIB881 GNU/GCLIB/LIBIO000 GNU/GCLIB/LIBIO020 GNU/GCLIB/LIBIO881 DEFS DEFS/GCC2 7. chd /h0/GNU/GNU/GCLIB 8. copy makefile.distr makefile.distr.0 9. edit makefile.dist (with your favorite editor) and do the following: a. Add the following line after the line "STDLIB = /dd/LIB" GCCLIB = /h0/GNU/LIB b. Change the last line from copy gclib???.l -rw=$(STDLIB) to copy gclib???.l -rw=$(GCCLIB) 10. make -fmakefile.distr 11. You may now delete /h0/GNU/gcc_2.5.8_cmds.lzh /h0/GNU/gclib.lzh If you want to save more space, you may also delete the directory: /h0/GNU/GNU/GCLIB You now have the gcc compiler and preprocessor, include files, and libraries contained completely within the directory /h0/GNU. The GNU gcc program name is "gcc2". Add the following pathname to your PATH variable /h0/GNU/GNU/CMDS eg: setenv PATH /h0/CMDS:/h0/GNU/GNU/CMDS Set the following variables: setenv GCCDEF /h0/GNU/DEFS/GCC2 setenv GCCLIB /h0/GNU/LIB ======================================================================== From GNU/readme.gcc2: Environment variables: The cccp2 preprocessors's search order for include files -------------------------------------------------------- <-I from commandline> or (C only) or (C++ only) /DD/DEFS/GPP2 (gpp2 only) /DD/DEFS/GCC2 /DD/DEFS The environment variable GCCDEF is only used, if C_INCLUDE_PATH is not set. If several directories are specified in these environment variables, they must be separated by colons. The gcc2 compiler's search rules for libraries ---------------------------------------------- If a library is specified using the '-l' syntax, gcc2 will search for the following files in the following order: / /.l (only searched if does not contain a dot '.') /lib.l (only searched if does not contain a dot '.') is one of the following names (order of usage) : -L (in the same order as they appear in the command line) /dd/LIB /h0/LIB /dd/GNULIB /h0/GNULIB If is not found using the above rules, gcc2 passes -l= to the linker; otherwise, the complete path name of the library file is composed and passed to the linker.