Installing Khepera cross compiler under Win98 ============================================= (this has *not* been tested under Win95 or NT) These instructions are for building the cross-compiler from SOURCE code. Required files: ------------------------ - the Cygwin Beta 20.1 full binary executable (full.exe) a download site can be found at http://sourceware.cygnus.com/cygwin/ look under the /latest/ subdirectory - an updated cygwin DLL from the most recent snapshot directory (same site) at the time of writing it was cygwin1-19990115.dll - GNU binutils 2.9.1 source code (binutils-2.9.1.tar.gz) can be found at ftp://prep.ai.mit.edu/pub/gnu/binutils/ - EGCS 1.1.1 source code (egcs-1.1.1.tar.gz) a download site can be found at http://egcs.cygnus.com/ - an EGCS patch for Win32 called egcs-1_1_1-x86-win32-patches.zip that can be found at ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygb20/egcs-1.1.1/patches/ - K-Team libraries: Khepera khepack5 libraries (khepack5.tar.gz) available from K-team on diskette - khepack_include.tar.gz, a patched version of the include subdirectory to replace the one included with khepack5 - two K-Team specific system files: libkhe.a ukhecrt0.o NOTE on extraction: although WinZip does extract .tar.gz files fine, it will *not* create empty directories that exist in the archive. This can cause problems if a program is expecting an empty directory to exist. To be safe, once cygwin is installed, you can move the .tar.gz file to the desired directory, and then run: % tar -xzf file.tar.gz NOTE on time/disk requirements. The files required for installation total around 30MB, so allow lots of time for download. Disk space after installation totals 263MB (564MB physical with FAT16) but you can delete 98MB (140MB physical) if you delete the two build directories: build-binutils and build-egcs. If you can change your C:\ drive to a FAT32 partition, do so! If you want to install to a drive other than C:\, you will have to play with the Cygwin "mount" utility to map logical DOS drives to NFS-style paths. This has not been tested, but should be possible. Although total compilation time is only around 3 hours, there are a lot of little things to do between each stage (like applying patches) that are tedious. Allow a full day to get this running. NOTE on editing files. All distribution files are in UNIX format. Do *not* use Notepad to edit, because it doesn't recognize this and the formatting will be all bizarre. Use Wordpad or another editor. Saving the files in DOS format (as WordPad does) does not seem to harm anything. Instructions: ------------- - create C:\tmp and C:\bin directories (required by Cygwin) - run Cygwin package, and install it under the default C:\cygnus (if you try another directory name you may have problems later) - back up existing C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\cygwin1.dll and replace it with the new DLL (renamed to cygwin1.dll) - in the same directory: back up sh.exe copy bash.exe to sh.exe copy both bash.exe and the new sh.exe to the c:\bin directory This is necessary due to a bug in the "light Bourne shell" - run Cygwin using the "Cygwin B20" Start menu shortcut under "Cygnus Solutions" If you get an "insufficient environment space" message, add the following to your config.sys and reboot: shell=c:\command.com /e:4096 /p - make the final directory for the cross-compiler. Here we assume C:\gcc - go into C:\cygnus and make a directory called build-binutils - extract binutils tarfile into the C:\cygnus directory from the command line, you can use "tar -xzf tarfile.tar.gz" You are now ready to begin building the cross-compiler estimated compilation times are for a 200MHz Pentium MMX with 64MB RAM. % cd build-binutils % ../binutils-2.9.1/configure --target=m68k-none-aout --prefix=/gcc -v (12min) % make (15 min) % make install (5 min) - now add /gcc/bin to the path. Either: at the command line in Cygwin: export PATH=$PATH:/gcc/bin or (better) edit C:\cygnus\cygwin-b20\cygnus.bat and add the line: SET PATH=c:\gcc\bin;%PATH% then exit bash and restart - building the compiler itself is a bit more involved. In C:\cygnus, create a directory called build-egcs - extract egcs-1.1.1 tarfile into the C:\cygnus directory - extract khepack_include.tar.gz to /gcc/m68k-none-aout/ Do *not* use the standard khepack5 include directory--it is missing many files, and there are many others that need to be patched. This new tarfile has them all fixed. - Open egcs Win32 patch zip file, and extract only *one* file: egcs-1.1.1-x86-win32.diff to the c:\cygnus\egcs-1.1.1\ directory - now apply the patch from the /cygnus/egcs-1.1.1/ directory: % patch -p1 -s < egcs-1.1.1-x86-win32.diff - do your own "patch" for EGCS. Add the line: #include "sys/time.h" to the top of C:\Cygnus\egcs-1.1.1\libf2c\libU77\dtime_.c *and* etime_.c - now run the configure script: % cd /cygnus/build-egcs % ../egcs-1.1.1/configure --target=m68k-none-aout --prefix=/gcc -v (10 min) - copy ukhecrt.o to /cygnus/build-egcs/gcc/crt0.o - Now start the make % make cross (1h8min) - When this make dies with an [Error 2] or something, copy the file libkhe.a to /cygnus/build-egcs/gcc/libgcc.a (you can't do this before, as it is clobbered by the make process) - Run make again to pick up from where you left off % make cross (1h15) Now you are ready for the final "make install". But first... - you have to patch the makefile to avoid making info files (they die). Edit /build-egcs/gcc/Makefile and remove install-man and install-info from the make, as shown below: install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \ lang.install-normal install-driver # install-man install-info lang.install-normal install-driver - now you can finish the make % make install (20min) Test to see if this works: - extract khepack5 or k76pack tarfile into any directory (here we assume c:\k-team) - go into C:\k-team\khepack5\examples edit the Makefile to set your path (cross_gnu_prefix=/k-team), then % make all - the compiler should run without problems, creating a series of .s37 binary files in the bin/ subdirectory. If you get an error "could not open output file bin/test.s37", you may have used WinZip to extract the khepack archive, which will not create empty directories. Simply create the directories bin/ obj/ lib/ from the commandline (e.g. % mkdir bin) and then run "make all" again.