Add the gcc cross compile build scripts.
authorbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 26 Apr 2006 23:04:39 +0000 (23:04 +0000)
committerbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 26 Apr 2006 23:04:39 +0000 (23:04 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@58 6f19259b-4bc3-4df7-8a09-765794883524

Tools/gcc/README.txt [new file with mode: 0644]
Tools/gcc/tianoCross-gcc-4.0 [new file with mode: 0644]
Tools/gcc/tianoCross-gcc-4.1 [new file with mode: 0644]

diff --git a/Tools/gcc/README.txt b/Tools/gcc/README.txt
new file mode 100644 (file)
index 0000000..0ec853d
--- /dev/null
@@ -0,0 +1,16 @@
+You may run these scripts to build a Tiano Cross compiler. They have been\r
+tested on Cygwin, OS X and Linux. You should expect to hack on these scripts to\r
+make them work on your system. You may need to install additional tools on your\r
+system to make the scripts work.\r
+\r
+You will need\r
+\r
+  A recent version of gcc that is able to produce executables for the machine\r
+    that you want to run this compiler on (the host machine).\r
+  wget or curl\r
+  tar\r
+  bzip\r
+  gzip\r
+  bash\r
+  and possibly others\r
+\r
diff --git a/Tools/gcc/tianoCross-gcc-4.0 b/Tools/gcc/tianoCross-gcc-4.0
new file mode 100644 (file)
index 0000000..19e2c82
--- /dev/null
@@ -0,0 +1,140 @@
+#!/bin/bash\r
+\r
+#\r
+# Get, build and install the latest cross-development tools and libraries\r
+#\r
+\r
+#\r
+# Specify the architectures for which the tools are to be built\r
+# To build for single target: ARCHS="m68k"\r
+#\r
+ARCHS="${ARCHS:-i386}"\r
+\r
+# Let's be nice\r
+renice 10 -p $$\r
+\r
+# If any thing goes wrong, we'll bail out.\r
+set -ex\r
+\r
+#\r
+# Specify the versions\r
+#\r
+GCC=gcc-4.0.2\r
+BINUTILS=binutils-2.16.1\r
+CYGWIN_SNAP=20060120 # You may need to find a more recent one.\r
+\r
+#\r
+# Where to install\r
+#\r
+PREFIX="${PREFIX:-/opt/tiano/}"\r
+\r
+#\r
+# Where to get the GNU tools\r
+#\r
+BINUTILS_URL=ftp://ftp.ibiblio.org/pub/mirrors/gnu/ftp/gnu/binutils/${BINUTILS}.tar.bz2\r
+GCC_URL=ftp://ftp.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gcc/gcc-4.0.2/${GCC}.tar.bz2\r
+CYG_LOC=http://cygwin.com/snapshots/cygwin-src-${CYGWIN_SNAP}.tar.bz2\r
+export http_proxy=http://proxy.dp.intel.com:911\r
+export ftp_proxy=http://proxy.dp.intel.com:911\r
+\r
+#\r
+# Uncomment one of the following depending upon which your system provides\r
+#\r
+GET_COMMAND="curl --remote-name"\r
+#GET_COMMAND="wget -nc --no-directories --retr-symlinks "\r
+\r
+#\r
+# Allow environment to override some programs\r
+#\r
+MAKE="${MAKE:-make}"\r
+export MAKE\r
+SHELL="${SHELL:-/bin/sh}"\r
+export SHELL\r
+\r
+#\r
+# Get the source\r
+# If you don't have curl on your machine, try using\r
+#     wget --passive-ftp --no-directories --retr-symlinks <<url>>\r
+# If that doesn't work, try without the --passive-ftp option.\r
+#\r
+getSource() {\r
+    ${GET_COMMAND} "${BINUTILS_URL}" &\r
+    ${GET_COMMAND}  "${GCC_URL}" &\r
+    ${GET_COMMAND}  "${CYG_LOC}" &\r
+    wait\r
+}\r
+\r
+#\r
+# Unpack the source\r
+#\r
+unpackSource() {\r
+    (rm -rf "${BINUTILS}"\r
+    tar jxf "${BINUTILS}.tar.bz2"\r
+    ) &\r
+\r
+    (rm -rf "${GCC}"\r
+    tar jxf "${GCC}.tar.bz2"\r
+    ) &\r
+\r
+    (rm -rf cygwin-snapshot-${CYGWIN_SNAP}-1/\r
+    tar jxf cygwin-src-${CYGWIN_SNAP}.tar.bz2\r
+    ) &\r
+\r
+    wait\r
+\r
+    # (cd "${GCC}" ; ln -sf "../cygwin-snapshot-20060120-1/newlib" newlib)\r
+\r
+}\r
+\r
+CONF_SHELL="${CONF_SHELL:-/bin/bash}"\r
+# CONF_SHELL="${CONF_SHELL:-echo}"\r
+\r
+#\r
+# Build\r
+#\r
+build() {\r
+    for arch in $ARCHS\r
+    do (\r
+        export targ=${arch}-tiano-pe\r
+        export pref=${PREFIX}${targ}\r
+        export PATH="${pref}/bin:$PATH"\r
+\r
+        ( mkdir -p build-binutils-$targ\r
+        cd build-binutils-$targ\r
+        "${CONF_SHELL}" "../${BINUTILS}/configure" \\r
+            --disable-nls "--target=${targ}" "--prefix=${pref}"\r
+        ${MAKE} -j1 -w all\r
+        ${MAKE} -w install\r
+        ) >> ${targ}.log 2>&1\r
+\r
+        (\r
+            mkdir -p $pref/$targ/sys-include;\r
+            cp -fr cygwin-snapshot-${CYGWIN_SNAP}-1/newlib/libc/include/* $pref/$targ/sys-include\r
+            cp -fr cygwin-snapshot-${CYGWIN_SNAP}-1/winsup/cygwin/include/* $pref/$targ/sys-include\r
+        )\r
+\r
+        ( mkdir -p build-gcc-$targ\r
+        cd build-gcc-$targ\r
+        "${CONF_SHELL}" "../${GCC}/configure" "--target=${targ}" "--prefix=${pref}" \\r
+            --with-gnu-as --with-gnu-ld --with-newlib --verbose \\r
+            --disable-nls --enable-languages=c\r
+        ${MAKE} -j1 -w all\r
+        ${MAKE} -w install \r
+        ) >> ${targ}.log 2>&1\r
+    ) &\r
+    done\r
+\r
+    wait\r
+}\r
+\r
+\r
+\r
+#\r
+# Do everything\r
+#\r
+# Comment out any activities you wish to omit\r
+#\r
+getSource\r
+unpackSource\r
+build\r
+\r
diff --git a/Tools/gcc/tianoCross-gcc-4.1 b/Tools/gcc/tianoCross-gcc-4.1
new file mode 100644 (file)
index 0000000..2b4e5ab
--- /dev/null
@@ -0,0 +1,138 @@
+#!/bin/bash\r
+\r
+#\r
+# Get, build and install the latest cross-development tools and libraries\r
+#\r
+\r
+#\r
+# Specify the architectures for which the tools are to be built\r
+# To build for single target: ARCHS="m68k"\r
+#\r
+ARCHS="${ARCHS:-i386}"\r
+\r
+# Let's be nice\r
+renice 10 -p $$\r
+\r
+# If any thing goes wrong, we'll bail out.\r
+set -e\r
+\r
+#\r
+# Specify the versions\r
+#\r
+GCC=gcc-4.1.0\r
+# BINUTILS=binutils-2.16.1\r
+BINUTILS=binutils-2.16.91-20060119-1\r
+CYGWIN_SNAP=20060403 # You may need to find a more recent one.\r
+\r
+#\r
+# Where to install\r
+#\r
+PREFIX="${PREFIX:-/opt/tiano/}"\r
+\r
+#\r
+# Where to get the GNU tools\r
+#\r
+BINUTILS_URL=http://superb.dl.sourceforge.net/sourceforge/mingw/${BINUTILS}-src.tar.gz\r
+GCC_URL=http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gcc/gcc-${GCC}/${GCC}.tar.bz2\r
+CYG_LOC=http://cygwin.com/snapshots/cygwin-src-${CYGWIN_SNAP}.tar.bz2\r
+# export http_proxy=http://proxy.dp.intel.com:911\r
+# export ftp_proxy=http://proxy.dp.intel.com:911\r
+\r
+#\r
+# Uncomment one of the following depending upon which your system provides\r
+#\r
+GET_COMMAND="curl --remote-name"\r
+#GET_COMMAND="wget -nc --no-directories --retr-symlinks "\r
+\r
+#\r
+# Allow environment to override some programs\r
+#\r
+MAKE="${MAKE:-make}"\r
+export MAKE\r
+SHELL="${SHELL:-/bin/sh}"\r
+export SHELL\r
+\r
+#\r
+# Get the source\r
+# If you don't have curl on your machine, try using\r
+#     wget --passive-ftp --no-directories --retr-symlinks <<url>>\r
+# If that doesn't work, try without the --passive-ftp option.\r
+#\r
+getSource() {\r
+    ${GET_COMMAND} "${BINUTILS_URL}" &\r
+    ${GET_COMMAND}  "${GCC_URL}" &\r
+    ${GET_COMMAND}  "${CYG_LOC}" &\r
+    wait\r
+}\r
+\r
+#\r
+# Unpack the source\r
+#\r
+unpackSource() {\r
+    (rm -rf "${BINUTILS}"\r
+    tar zxf "${BINUTILS}-src.tar.gz"\r
+    ) &\r
+\r
+    (rm -rf "${GCC}"\r
+    tar jxf "${GCC}.tar.bz2"\r
+    ) &\r
+\r
+    (rm -rf cygwin-snapshot-${CYGWIN_SNAP}-1/\r
+    tar jxf cygwin-src-${CYGWIN_SNAP}.tar.bz2\r
+    ) &\r
+\r
+    wait\r
+}\r
+\r
+CONF_SHELL="${CONF_SHELL:-/bin/bash}"\r
+# CONF_SHELL="${CONF_SHELL:-echo}"\r
+\r
+#\r
+# Build\r
+#\r
+build() {\r
+    for arch in $ARCHS\r
+    do (\r
+        export targ=${arch}-tiano-pe\r
+        export pref=${PREFIX}${targ}\r
+        export PATH="${pref}/bin:$PATH"\r
+\r
+        ( mkdir -p build-binutils-$targ\r
+        cd build-binutils-$targ\r
+        "${CONF_SHELL}" "../${BINUTILS}/configure" \\r
+            --disable-nls "--target=${targ}" "--prefix=${pref}"\r
+        ${MAKE} -j5 -w all\r
+        ${MAKE} -w install\r
+        ) >> ${targ}.log 2>&1\r
+\r
+        (\r
+            mkdir -p $pref/$targ/sys-include;\r
+            cp -fr cygwin-snapshot-${CYGWIN_SNAP}-1/newlib/libc/include/* $pref/$targ/sys-include\r
+            cp -fr cygwin-snapshot-${CYGWIN_SNAP}-1/winsup/cygwin/include/* $pref/$targ/sys-include\r
+        )\r
+\r
+        ( mkdir -p build-gcc-$targ\r
+        cd build-gcc-$targ\r
+        "${CONF_SHELL}" "../${GCC}/configure" "--target=${targ}" "--prefix=${pref}" \\r
+            --with-gnu-as --with-gnu-ld --with-newlib --verbose \\r
+            --disable-libssp \\r
+            --disable-nls --enable-languages=c\r
+        ${MAKE} -j5 -w all\r
+        ${MAKE} -w install \r
+        ) >> ${targ}.log 2>&1\r
+    ) &\r
+    done\r
+\r
+    wait\r
+}\r
+\r
+\r
+\r
+#\r
+# Do everything\r
+#\r
+# Comment out any activities you wish to omit\r
+#\r
+getSource\r
+unpackSource\r
+build\r