#!/bin/sh #this is a bash shell script to make a the cygwin32 libraries from linux #it is designed to hopefully :^) minimize disk space usage, by installing #the new libraries to your vfat drive where the native cygwin32 compiler lives set -axv #export all variables #echo change the following variables to fit your setup CROSS_PREFIX=dos/c/usr/H-i386-cygwin32 # !! NO slash here SRC_DIR=/dos/c/usr/src/cygwin32 if [ ! -f $SRC_DIR/CYGNUS ];then echo "please show me the source Luke :^)" exit 1; fi if [ ! -d /$CROSS_PREFIX ];then echo "please show me the destination Luke :^)" fi if [ x"$TMP" = x ];then [ -d /tmp ] || mkdir /tmp TMP=/tmp; fi cd $TMP mkdir -p lx32o tmp/$CROSS_PREFIX/ cd lx32o #make sure only the necesary dirs get built [ -d $SRC_DIR/znobuild ] || mkdir -p $SRC_DIR/znobuild if [ -d $SRC_DIR/byacc ];then pushd $SRC_DIR mv -f bash binutils byacc dejagnu diff dosrel expect fileutils\ findutils flex gas gawk gcc gdb gprof grep grez gzip ld less \ m4 make ncurses patch release sed send-pr \ shellutils sim tar tcl texinfo textutils time tk utils xiberty \ znobuild/ popd fi [ -f config.status ] || CC="gcc -b i386-cygwin32 -V cygnus-2.7.2-961023"\ CXX="gcc -b i386-cygwin32 -V cygnus-2.7.2-961023"\ PATH=/usr/i386-cygwin32/bin:$PATH $SRC_DIR/configure --prefix=/usr\ --srcdir=$SRC_DIR --host=i586-unknown-linux --target=i386-cygwin32 -v make CFLAGS="-O -g" LDFLAGS= make prefix=$TMP/tmp/$CROSS_PREFIX install cd $TMP/tmp/$CROSS_PREFIX/i386-cygwin32/lib mv cygwin.dll ../../bin ln -sf libc.a libg.a #this will fail on vfat but might remind us mv libstdc++.a libg++.a libiberty.a libc.a libg.a libm.a ../../lib i386-cygwin32-strip --strip-debug *.a #since these are mostly just dll stubs cd ../../lib mv libi386-cygwin32-bfd.a libbfd.a mv libi386-cygwin32-opcodes.a libopcodes.a mv *.a ../i386-cygwin32/lib/ cd ../bin for file in cygwin ps mount umount kill;do mv i386-cygwin32-$file $file.exe; done strip *.exe mv ../include ../man ../etc ../.. cd ../../include mv *.h readline ../H-i386-cygwin32/i386-cygwin32/include/ if [ "1" = "0" ];then #ncurses really dosen't like being built cross cd $TMP/lx32o [ -d ncurses ] || mkdir ncurses cd ncurses [ -f config.status ] || CC="gcc -b i386-cygwin32 -V cygnus-2.7.2-961023 -I/usr/i386-cygwin32/include "\ CXX="gcc -b i386-cygwin32 -V cygnus-2.7.2-961023 -I/usr/i386-cygwin32/include -I/dos/c/usr/include/g++"\ PATH=/usr/i386-cygwin32/bin:$PATH $SRC_DIR/ncurses/configure --prefix=/usr\ --target=i386-cygwin32 --enable-getcap --enable-termcap \ --program-suffix=.exe --enable-symlinks -v make includedir=/usr/i386-cygwin32/include make LDFLAGS= prefix=$TMP/tmp/$CROSS_PREFIX/.. install fi cd $TMP/tmp makepkg lx32.tgz;mv lx32.tgz .. # or put your binary package maker here cd $TMP if [ x"$1" = x--cleanup ];then rm -fr $TMP/tmp $TMP/lx32o; pushd $SRC_DIR mv -f znobuild/* . rmdir znobuild popd fi