4 # Get, build and install the latest cross-development tools and libraries
8 ### CYGWIN :: Make sure that cygwin is mouting its file systems in binmode.
12 # Specify the architectures for which the tools are to be built
13 # To build for single target: ARCHS="m68k"
15 ARCHS="${ARCHS:-i386}"
20 # If any thing goes wrong, we'll bail out.
24 # Specify the versions
27 BINUTILS=binutils-2.16.1
28 # BINUTILS=binutils-2.16.91-20060119-1
29 CYGWIN_SNAP=20060403 # You may need to find a more recent one.
30 export PATH=/bin:/usr/bin
35 PREFIX="${PREFIX:-/opt/tiano/}"
38 # Where to get the GNU tools
40 # BINUTILS_URL=http://superb.dl.sourceforge.net/sourceforge/mingw/${BINUTILS}-src.tar.gz
41 BINUTILS_URL=ftp://ftp.ibiblio.org/pub/mirrors/gnu/ftp/gnu/binutils/${BINUTILS}.tar.bz2
42 # GCC_URL=http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gcc/gcc-${GCC}/${GCC}.tar.bz2
43 GCC_URL=ftp://mirrors.kernel.org/gnu/gcc/$GCC/$GCC.tar.bz2
44 CYG_LOC=http://cygwin.com/snapshots/cygwin-src-${CYGWIN_SNAP}.tar.bz2
45 # export http_proxy=http://proxy.dp.intel.com:911
46 # export ftp_proxy=http://proxy.dp.intel.com:911
49 # Uncomment one of the following depending upon which your system provides
51 #GET_COMMAND="curl --remote-name"
52 GET_COMMAND="wget -nc --no-directories --retr-symlinks "
55 # Allow environment to override some programs
59 SHELL="${SHELL:-/bin/sh}"
64 # If you don't have curl on your machine, try using
65 # wget --passive-ftp --no-directories --retr-symlinks <<url>>
66 # If that doesn't work, try without the --passive-ftp option.
69 ${GET_COMMAND} "${BINUTILS_URL}" &
70 ${GET_COMMAND} "${GCC_URL}" &
71 ${GET_COMMAND} "${CYG_LOC}" &
80 tar jxf "${BINUTILS}.tar.bz2"
84 tar jxf "${GCC}.tar.bz2"
87 (rm -rf cygwin-snapshot-${CYGWIN_SNAP}-1/
88 tar jxf cygwin-src-${CYGWIN_SNAP}.tar.bz2
94 CONF_SHELL="${CONF_SHELL:-/bin/bash}"
95 # CONF_SHELL="${CONF_SHELL:-echo}"
103 export targ=${arch}-tiano-pe
104 export pref=${PREFIX}${targ}
105 export PATH="${pref}/bin:$PATH"
107 ( mkdir -p build-binutils-$targ
108 cd build-binutils-$targ
109 "${CONF_SHELL}" "../${BINUTILS}/configure" \
110 --disable-nls "--target=${targ}" "--prefix=${pref}"
113 ) >> ${targ}.log 2>&1 &&
116 mkdir -p $pref/$targ/sys-include;
117 cp -fr cygwin-snapshot-${CYGWIN_SNAP}-1/newlib/libc/include/* $pref/$targ/sys-include
118 cp -fr cygwin-snapshot-${CYGWIN_SNAP}-1/winsup/cygwin/include/* $pref/$targ/sys-include
121 ( mkdir -p build-gcc-$targ
123 "${CONF_SHELL}" "../${GCC}/configure" "--target=${targ}" "--prefix=${pref}" \
124 --with-gnu-as --with-gnu-ld --with-newlib --verbose \
126 --disable-nls --enable-languages=c
129 ) >> ${targ}.log 2>&1
141 # Comment out any activities you wish to omit