]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/gcc/tianoCross-gcc-4.1
Add a script to build a mingw64 compiler.
[mirror_edk2.git] / Tools / gcc / tianoCross-gcc-4.1
index 898f69c89561a6e92451be4136a5f5554200b234..7dc8e41f9dcfa863d2e4750bdf67e7593d4195f2 100644 (file)
@@ -4,11 +4,15 @@
 # Get, build and install the latest cross-development tools and libraries
 #
 
+###
+### CYGWIN :: Make sure that cygwin is mouting its file systems in binmode.
+###
+
 #
 # Specify the architectures for which the tools are to be built
 # To build for single target: ARCHS="m68k"
 #
-ARCHS="${ARCHS:-i386}"
+ARCHS="${ARCHS:-x86_64}"
 
 # Let's be nice
 renice 10 -p $$
@@ -19,21 +23,22 @@ set -e
 #
 # Specify the versions
 #
-GCC=gcc-4.1.0
-# BINUTILS=binutils-2.16.1
-BINUTILS=binutils-2.16.91-20060119-1
+GCC=gcc-4.1.1
+BINUTILS=binutils-2.17
+BINUTILS=binutils-2.16.91-20060119-1
 CYGWIN_SNAP=20060403 # You may need to find a more recent one.
+export PATH=/bin:/usr/bin:/usr/local/bin
 
 #
 # Where to install
 #
-PREFIX="${PREFIX:-/opt/tiano/}"
+PREFIX="${PREFIX:-~/tiano/}"
 
 #
 # Where to get the GNU tools
 #
-BINUTILS_URL=http://superb.dl.sourceforge.net/sourceforge/mingw/${BINUTILS}-src.tar.gz
-GCC_URL=http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gcc/gcc-${GCC}/${GCC}.tar.bz2
+BINUTILS_URL=ftp://ftp.ibiblio.org/pub/mirrors/gnu/ftp/gnu/binutils/${BINUTILS}.tar.bz2
+GCC_URL=ftp://mirrors.kernel.org/gnu/gcc/$GCC/$GCC.tar.bz2
 CYG_LOC=http://cygwin.com/snapshots/cygwin-src-${CYGWIN_SNAP}.tar.bz2
 # export http_proxy=http://proxy.dp.intel.com:911
 # export ftp_proxy=http://proxy.dp.intel.com:911
@@ -41,8 +46,8 @@ CYG_LOC=http://cygwin.com/snapshots/cygwin-src-${CYGWIN_SNAP}.tar.bz2
 #
 # Uncomment one of the following depending upon which your system provides
 #
-GET_COMMAND="curl --remote-name"
-#GET_COMMAND="wget -nc --no-directories --retr-symlinks "
+#GET_COMMAND="curl --remote-name"
+GET_COMMAND="wget -nc --no-directories --retr-symlinks "
 
 #
 # Allow environment to override some programs
@@ -70,7 +75,7 @@ getSource() {
 #
 unpackSource() {
     (rm -rf "${BINUTILS}"
-    tar zxf "${BINUTILS}-src.tar.gz"
+    tar jxf "${BINUTILS}.tar.bz2"
     ) &
 
     (rm -rf "${GCC}"
@@ -93,7 +98,7 @@ CONF_SHELL="${CONF_SHELL:-/bin/bash}"
 build() {
     for arch in $ARCHS
     do (
-        export targ=${arch}-tiano-pe
+        export targ=${arch}-pc-mingw64
         export pref=${PREFIX}${targ}
         export PATH="${pref}/bin:$PATH"
 
@@ -101,15 +106,15 @@ build() {
         cd build-binutils-$targ
         "${CONF_SHELL}" "../${BINUTILS}/configure" \
             --disable-nls "--target=${targ}" "--prefix=${pref}"
-        ${MAKE} -j5 -w all
+        ${MAKE} -j4 -w all
         ${MAKE} -w install
-        ) >> ${targ}.log 2>&1
+        ) >> ${targ}.log 2>&1 &&
 
         (
             mkdir -p $pref/$targ/sys-include;
             cp -fr cygwin-snapshot-${CYGWIN_SNAP}-1/newlib/libc/include/* $pref/$targ/sys-include
             cp -fr cygwin-snapshot-${CYGWIN_SNAP}-1/winsup/cygwin/include/* $pref/$targ/sys-include
-        )
+        ) &&
 
         ( mkdir -p build-gcc-$targ
         cd build-gcc-$targ
@@ -117,7 +122,7 @@ build() {
             --with-gnu-as --with-gnu-ld --with-newlib --verbose \
             --disable-libssp \
             --disable-nls --enable-languages=c
-        ${MAKE} -j5 -w all
+        ${MAKE} -j1 -w all
         ${MAKE} -w install 
         ) >> ${targ}.log 2>&1
     ) &
@@ -133,6 +138,6 @@ build() {
 #
 # Comment out any activities you wish to omit
 #
-getSource
-unpackSource
+getSource
+unpackSource
 build