Building a GNU environment ========================== 1. Get all relevant software - download from any GNU mirror site the following files: binutils-2.8.1, bison-1.25, cvs-1.9, flex-2.5.4, gcc-2.8.0, gdb-4.16, glibc-2.0.6, gzip-1.2.4, less-332, libg++-2.8.0, libstdc++-2.8.0, make-3.75, ncurses_1.9.9g, termcap-1.3, texinfo-3.11 - extract via gzip and tar into separate subdirectories 3. Configure gcc build - read INSTALL! - set PATH so `/usr/bin' precedes `/usr/ucb' - ignore directions about moving g++ source tree to below current directory, g++ is now part of normal build - disable current gcc (so broken, it breaks build) - run ./configure in gcc source directory with the following flags: ./configure --with-stabs // We'll be using gdb 4. Build and install compilers: - build stage1 gcc with system cc: make clean // Just in case make LANGUAGES=c // More languages later make stage1 - build stage2 gcc with stage1 gcc: make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2" // Makes all languages make stage2 - build stage3 gcc with stage2 gcc: make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" - compare stage2 and stage3 compilers: make compare // Any differences are SERIOUS - up to now, you can have been making the compilers in any user directory to perform the full install, you must alter all references in the Makefile you have been using (you actually built it in the configure step above) to now refer to your desired target directory cp Makefile Makefile.prev // Save previous vi Makefile // Make your changes prefix=/usr/local // Line 210 - install the compiler driver, the compiler's passes and run-time support: make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" 9. Build C++ environment - SET SHELL VARIABLE (VERY IMPORTANT) (PUT IT IN YOUR .myprofile, TOO!) CC=gcc - create a ranlib utility (see: man ranlib) (We get a real one later, but this will do for now) consisting of the following sh script: # /bin/sh if [ $# = "0" ]; then echo "usage: ranlib [-t] ..." elif [ $1 = "-t" ]; then shift ar -h $* else ar -qs $* fi - build libstdc++-2.8.0 ./configure --with-stabs make make install 10. Extract and build the 'texinfo' package first, it allows you to read GNU's own 'info' documentation format. This is an extremely crap interface, but it's all they give you. Make termcap-1.3 first: ./configure make make install Then texinfo-3.11: ./configure make make install mkdir /usr/local/share/texmf/tex/texinfo/ cp ./doc/texinfo.tex /usr/local/share/texmf/tex/texinfo mkdir /usr/local/share/texmf/tex/generic/dvips/ cp ./doc/epsf.tex /usr/local/share/texmf/tex/generic/dvips 11. Build: gdb-4.16 binutils-2.8.1 less-332 bison-1.25 flex-2.5.4 ./configure // Not permitted to update make // termcap.h in /usr/include make install If makeinfo coredumps in the installation of the termcap library (and it very likely will!), make sure you have set CC=gcc, and go back to 10. This should not happen the second time. I think there is some sort of nasty interdependency happening here. 12. Build the the rest of the C++ libraries and the C++ STL. You now have more than enough tools to get the STL properly extracted using only GNU tools. This is probably important. Build: libg++-2.8.0 ./configure make make install 14. Build gmake. I recommend using the system make for almost everything you need to do, but, for some external packages (like POSIX threads, for instance) we need GNU make. Unfortunately, there appears to be a bug in the makefile of make-3.76.1, so install make-3.75. It also needs some hand carving: - in the file "make-3.75/glob/glob.h", delete the #ifdef on line 55 and its corresponding #endif - in the Makefile, edit line 209. The expression "--infodir" should be "--info-dir" - now build as normal 15. More builds: cvs-1.9 ncurses_1.9.9g // Overwrites earlier termcap.lib gzip-1.2.4 // Edit Makefile: prefix=/usr/local perl groff time sh-utils tar 16. GMP - Multiple precision arithmetic library: gmp-2.0.2 ./configure make make check make install 16. Renames: In /usr/local/bin, rename: make gmake nm gnm tar gtar We want to be able to tell which of these we are using at all times. Notes: We don't need to build any extra support for threads; DEC OSF1 UNIX uses the standard POSIX 1003.1c-1995 threads interface, which uses the header file .