Author: cfinck
Date: Wed Oct 28 00:24:31 2009
New Revision: 43798
URL:
http://svn.reactos.org/svn/reactos?rev=43798&view=rev
Log:
- Added a script for compiling a working GNU toolchain using newer Binutils and GCC 4.4.2.
These will be used in RosBE-Windows 1.5 and RosBE-Unix 1.5.
The build and preliminary source packages are up at
http://reactos.coliinfinck.de
("toolchain_1.5.7z" and "sources_1.5.7z")
- Overhauled my tutorial about compiling GCC for Windows, including the new steps
necessary for 4.4.2 and possible issues.
Special thanks to Dmitry Gorbachev for his help on getting GCC 4.4.2 to compile and to
Caemyr for providing me with a powerful machine over RDP to get the builds done faster
:-)
Added:
trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/ (with props)
trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/Compiling a working GNU toolchain under
Windows.odt
- copied, changed from r43511, trunk/tools/RosBE/RosBE-Windows/Compiling a working
GNU toolchain under Windows.odt
trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.1.3/ (with props)
trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.1.3/buildtoolchain.sh
- copied, changed from r42638, trunk/tools/RosBE/RosBE-Windows/buildtoolchain.sh
trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.4.2/ (with props)
trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.4.2/buildtoolchain.sh (with
props)
Removed:
trunk/tools/RosBE/RosBE-Windows/Compiling a working GNU toolchain under Windows.odt
trunk/tools/RosBE/RosBE-Windows/buildtoolchain.sh
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Wed Oct 28 00:24:31 2009
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Copied: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/Compiling a working GNU toolchain
under Windows.odt (from r43511, trunk/tools/RosBE/RosBE-Windows/Compiling a working GNU
toolchain under Windows.odt)
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Buildtoo…
==============================================================================
Binary files - no diff available.
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.1.3/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Wed Oct 28 00:24:31 2009
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.1.3/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.1.3/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Copied: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.1.3/buildtoolchain.sh (from
r42638, trunk/tools/RosBE/RosBE-Windows/buildtoolchain.sh)
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Buildtoo…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/buildtoolchain.sh [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.1.3/buildtoolchain.sh
[iso-8859-1] Wed Oct 28 00:24:31 2009
@@ -7,11 +7,20 @@
# Released under GNU GPL v2 or any later version.
##################################################################################
-# This script was tested with the following toolchain versions:
-# - binutils v2.19.51-20090127 (snapshot) using the corresponding ReactOS patches
-# - gcc v4.1.3-20071015 (snapshot) using the corresponding ReactOS patches
+# This script was built for the following toolchain versions:
+# - binutils v2.19.51-20090127 (snapshot)
+# patched with:
+# *
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/Patches/binutils-2.18.…
+# - gcc v4.1.3-20071015 (snapshot)
+# patched with:
+# *
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/Patches/GCC-v4.1-r1293…
+# *
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/Patches/GCC-v4.1-r1293…
+# *
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/Patches/GCC-v4.1-r1294…
# - mingw-runtime 3.13
# - w32api 3.10
+#
+# These versions are used in RosBE-Windows 1.4.2-1.4.5 and RosBE-Unix 1.4-1.4.2.
+# Get the toolchain packages from one of these RosBE-Unix versions.
##################################################################################
#
@@ -71,6 +80,7 @@
# Entry point
#
echo "buildtoolchain - Build a binutils/GCC/mingw-runtime/w32api toolchain for
Windows"
+echo "Script for gcc_4.1.3 (see script header for details)"
echo "by Colin Finck <colin(a)reactos.org>"
echo
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.4.2/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Wed Oct 28 00:24:31 2009
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.4.2/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.4.2/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Added: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.4.2/buildtoolchain.sh
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Buildtoo…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.4.2/buildtoolchain.sh (added)
+++ trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.4.2/buildtoolchain.sh
[iso-8859-1] Wed Oct 28 00:24:31 2009
@@ -1,0 +1,316 @@
+#!/bin/bash
+#
+# ReactOS Build Environment for Windows - Script for building a
binutils/GCC/mingw-runtime/w32api toolchain for Windows
+# Partly based on RosBE-Unix' "RosBE-Builder.sh"
+# Copyright 2009 Colin Finck <colin(a)reactos.org>
+#
+# Released under GNU GPL v2 or any later version.
+
+########################################################################################################################
+# This script was built for the following toolchain versions:
+# - binutils 2.20.51-20091017 (snapshot)
+# - gcc 4.4.2
+# patched with:
+# *
http://gcc.gnu.org/bugzilla/attachment.cgi?id=18882&action=view (committed
in GCC r153606)
+# - gmp 4.3.1
+# - mingw-runtime 3.16
+# - mpfr 2.4.2-rc1
+# - w32api 3.13
+#
+# These tools were compiled under MSYS with "gcc version 3.4.5 (mingw-vista special
r3)"
+#
+# These versions are used in RosBE-Windows 1.5 and RosBE-Unix 1.5.
+# Get the toolchain packages from this RosBE-Unix version.
+########################################################################################################################
+
+
+#
+# Constants
+#
+WORKDIR="/c/buildtoolchain"
+
+HOST_CFLAGS="-pipe -fno-common -O3 -march=pentium3 -mfpmath=sse"
+HOST_GCC_VERSION="gcc version 3.4.5 (mingw-vista special r3)"
+INSTALLDIR="$WORKDIR/mingw"
+NEEDED_TOOLS="bison flex gcc g++ grep make makeinfo"
+SUPPORTDIR="$WORKDIR/support"
+SYSHEADERDIR="/mingw/include"
+TARGET="mingw32"
+TARGET_CFLAGS="-pipe -gstabs+ -O3 -march=pentium -mtune=i686"
+
+
+#
+# Functions
+#
+boldmsg()
+{
+ echo -e $2 "\e[1m$1\e[0m"
+}
+
+greenmsg()
+{
+ echo -e $2 "\e[32m$1\e[0m"
+}
+
+redmsg()
+{
+ echo -e $2 "\e[31m$1\e[0m"
+}
+
+check_run()
+{
+ if [ $? -ne 0 ]; then
+ redmsg "FAILED"
+ echo "Please take a look at the log file \"$WORKDIR/build.log\""
+ echo "Aborted!"
+ exit 1
+ else
+ greenmsg "OK"
+ rm "$WORKDIR/build.log"
+ fi
+}
+
+mkdir_if_not_exists()
+{
+ if ! [ -d "$1" ]; then
+ mkdir -p "$1"
+ fi
+}
+
+mkdir_empty()
+{
+ if [ -d "$1" ]; then
+ rm -rf "$1"
+ fi
+
+ mkdir -p "$1"
+}
+
+prepare_module()
+{
+ # Check if the module shall be built and extract it then
+ process_it=$1
+ module=$2
+
+ if [ "$process_it" = "0" ]; then
+ return 1
+ fi
+
+ cd "$WORKDIR"
+ rm -rf "$module"
+ rm -rf "$module-build"
+
+ echo -n "Extracting $module... "
+ tar -xjf "$source_path/$module.tar.bz2" >& build.log
+ check_run
+
+ mkdir "$module-build"
+ cd "$module-build"
+
+ return 0
+}
+
+do_command()
+{
+ echo -n "Running \"$*\"... "
+ $* >& "$WORKDIR/build.log"
+ check_run
+}
+
+clean_module()
+{
+ echo "Cleaning up $1..."
+ cd "$WORKDIR"
+ rm -rf "$1-build"
+ rm -rf "$1"
+}
+
+
+#
+# Entry point
+#
+echo "buildtoolchain - Build a binutils/GCC/mingw-runtime/w32api toolchain for
Windows"
+echo "Script for gcc_4.4.2 (see script header for details)"
+echo "by Colin Finck <colin(a)reactos.org>"
+echo
+
+if [ "`uname -o`" != "Msys" ]; then
+ echo "You can only run this script under a MSYS environment!"
+ exit 1
+fi
+
+# We don't want too less parameters
+if [ "$1" == "" ]; then
+ echo "Syntax: ./buildtoolchain.sh <sources> [w32api] [mingw-runtime] [gmp]
[mpfr] [binutils] [gcc]"
+ echo
+ echo " sources - Path to the directory containing RosBE-Unix toolchain packages
(.tar.bz2 files)"
+ echo
+ echo "The rest of the arguments are optional. You specify them if you want to
prevent a component"
+ echo "from being (re)built. Do this by passing 0 as the argument of the appropriate
component."
+ echo "Pass 1 if you want them to be built."
+ echo "By default, all of these components are built, so you don't need to pass
any of these parameters."
+ exit 1
+fi
+
+# Get the absolute path to the script directory
+cd `dirname $0`
+SCRIPTDIR="$PWD"
+
+# Find out whether the script directory contains spaces
+case "$SCRIPTDIR" in
+*" "*)
+ redmsg "The script directory \"$SCRIPTDIR\" contains spaces!"
+ redmsg "Therefore some build tools cannot be compiled properly."
+ echo
+ redmsg "Please move \"$SCRIPTDIR\" to a directory, which does not contain
spaces."
+
+ exit 1;;
+esac
+
+# Check if all necessary tools exist
+boldmsg "Checking for the needed tools..."
+
+toolmissing=false
+for tool in $NEEDED_TOOLS; do
+ echo -n "Checking for $tool... "
+
+ if which "$tool" >& /dev/null; then
+ greenmsg "OK"
+ else
+ redmsg "MISSING"
+ toolmissing=true
+ fi
+done
+
+# Check for the correct GCC version
+echo -n "Checking for the correct GCC version... "
+
+if gcc -v 2>&1 | grep "$HOST_GCC_VERSION" >& /dev/null; then
+ greenmsg "OK"
+else
+ redmsg "MISSING"
+ toolmissing=true
+fi
+
+if $toolmissing; then
+ echo "At least one needed tool is missing, aborted!"
+ exit 1
+fi
+
+echo
+
+# Get the absolute path to the source directory
+cd "$1"
+source_path="$PWD"
+
+# Create all necessary directories
+mkdir_if_not_exists "$INSTALLDIR/$TARGET"
+mkdir_empty "$SYSHEADERDIR"
+mkdir_if_not_exists "$SUPPORTDIR"
+
+# Process each module
+boldmsg "Building..."
+
+
+if [ "$2" != "0" ]; then
+ echo -n "Extracting w32api... "
+
+ cd "$INSTALLDIR/$TARGET"
+ tar -xjf "$source_path/w32api.tar.bz2" >&
"$WORKDIR/build.log"
+ check_run
+fi
+
+if prepare_module "$3" "mingw-runtime"; then
+ export CFLAGS="$TARGET_CFLAGS"
+ export C_INCLUDE_PATH="$INSTALLDIR/$TARGET/include"
+
+ do_command ../mingw-runtime/configure --prefix="$INSTALLDIR/$TARGET"
--host="$TARGET" --build="$TARGET"
+ do_command make
+ do_command make install
+
+ # libmingwex.a of the MinGW Runtime 3.15 and later references to _get_output_format,
which is exported by msvcr80.dll and later.
+ # For older Runtime DLLs (such as the msvcrt.dll we primarily use for ReactOS), MinGW
adds a _get_output_format function returning 0 to libmsvcrt.a.
+ # As we use MinGW's libmingwex.a, but our own libmsvcrt.a, linking to MinGW's
libmingwex.a will fail by default. Therefore we have to create an archive for the
compiled
+ # _get_output_format stub, copy it to our "lib" directory and include it when
linking to libmingwex.a.
+ ar r ofmt_stub.a ofmt_stub.o >& /dev/null
+ cp ofmt_stub.a "$INSTALLDIR/$TARGET/lib"
+
+ clean_module mingw-runtime
+
+ export CFLAGS=""
+ export C_INCLUDE_PATH=""
+fi
+
+if prepare_module "$4" "gmp"; then
+ export CFLAGS="$HOST_CFLAGS"
+
+ do_command ../gmp/configure ABI=32 --prefix="$SUPPORTDIR"
--host="$TARGET" --build="$TARGET" --disable-shared
+ do_command make
+ do_command make check
+ do_command make install
+ clean_module gmp
+
+ export CFLAGS=""
+fi
+
+if prepare_module "$5" "mpfr"; then
+ export CFLAGS="$HOST_CFLAGS"
+
+ do_command ../mpfr/configure --prefix="$SUPPORTDIR" --host="$TARGET"
--build="$TARGET" --with-gmp="$SUPPORTDIR" --disable-shared
+ do_command make
+ do_command make check
+ do_command make install
+ clean_module mpfr
+
+ export CFLAGS=""
+fi
+
+if prepare_module "$6" "binutils"; then
+ export CFLAGS="$HOST_CFLAGS"
+
+ do_command ../binutils/configure --prefix="$INSTALLDIR"
--host="$TARGET" --build="$TARGET" --target="$TARGET"
--disable-nls
+ do_command make
+ do_command make install
+ clean_module binutils
+
+ export CFLAGS=""
+fi
+
+if prepare_module "$7" "gcc"; then
+ export STAGE1_CFLAGS="$HOST_CFLAGS"
+ export BOOT_CFLAGS="$HOST_CFLAGS"
+ export CFLAGS_FOR_TARGET="$TARGET_CFLAGS"
+ export CXXFLAGS_FOR_TARGET="$TARGET_CFLAGS"
+ export C_INCLUDE_PATH="$INSTALLDIR/$TARGET/include"
+ export LIBRARY_PATH="$INSTALLDIR/$TARGET/lib"
+
+ do_command ../gcc/configure --prefix="$INSTALLDIR" --host="$TARGET"
--build="$TARGET" --target="$TARGET"
--with-gmp="$SUPPORTDIR" --with-mpfr="$SUPPORTDIR"
--enable-languages=c,c++ --enable-checking=release --enable-version-specific-runtime-libs
--enable-threads=win32 --disable-win32-registry --disable-shared --disable-nls
+ do_command make profiledbootstrap
+ do_command make install
+ clean_module gcc
+
+ export STAGE1_CFLAGS=""
+ export BOOT_CFLAGS=""
+ export CFLAGS_FOR_TARGET=""
+ export CXXFLAGS_FOR_TARGET=""
+ export C_INCLUDE_PATH=""
+ export LIBRARY_PATH=""
+fi
+
+
+# Final actions
+echo
+boldmsg "Final actions"
+cd "$INSTALLDIR"
+
+echo "Removing unneeded files..."
+rm -rf $TARGET/bin $TARGET/doc $TARGET/share include info man share
+rm -f lib/* >& /dev/null
+rm -f bin/c++.exe bin/gccbug bin/$TARGET-*
+
+echo "Removing debugging symbols..."
+find -name "*.exe" -type f -exec strip -s {} ";"
+find -name "*.a" -type f -exec strip -d {} ";"
+find -name "*.o" -type f -exec strip -d {} ";"
+
+echo "Finished!"
Propchange: trunk/tools/RosBE/RosBE-Windows/Buildtoolchain/gcc_4.4.2/buildtoolchain.sh
------------------------------------------------------------------------------
svn:eol-style = native
Removed: trunk/tools/RosBE/RosBE-Windows/Compiling a working GNU toolchain under
Windows.odt
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Compilin…
==============================================================================
Binary file - no diff available.
Removed: trunk/tools/RosBE/RosBE-Windows/buildtoolchain.sh
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/buildtoo…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/buildtoolchain.sh [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/buildtoolchain.sh (removed)
@@ -1,258 +1,0 @@
-#!/bin/bash
-#
-# ReactOS Build Environment for Windows - Script for building a
binutils/GCC/mingw-runtime/w32api toolchain for Windows
-# Partly based on RosBE-Unix' "RosBE-Builder.sh"
-# Copyright 2009 Colin Finck <colin(a)reactos.org>
-#
-# Released under GNU GPL v2 or any later version.
-
-##################################################################################
-# This script was tested with the following toolchain versions:
-# - binutils v2.19.51-20090127 (snapshot) using the corresponding ReactOS patches
-# - gcc v4.1.3-20071015 (snapshot) using the corresponding ReactOS patches
-# - mingw-runtime 3.13
-# - w32api 3.10
-##################################################################################
-
-#
-# Constants
-#
-CFLAGS="-O2"
-CXXFLAGS="$CFLAGS"
-INSTALLDIR="/c/buildtoolchain/mingw"
-LDFLAGS="-s"
-MINGWDIR="/mingw"
-NEEDED_TOOLS="bison flex gcc g++ grep make makeinfo"
-TARGET="mingw32"
-TEMPDIR="/c/buildtoolchain"
-WIN32_INSTALLDIR="c:/buildtoolchain/mingw"
-
-# Make sure we build an entirely native compiler, since MSYS might report subtle
differences (i.e. "i686-pc-mingw32" instead of "mingw32")
-BUILD="$TARGET"
-HOST="$TARGET"
-
-# The following variables need to be accessed by Make and its subprocesses.
-export CFLAGS
-export CXXFLAGS
-export LDFLAGS
-
-#
-# Functions
-#
-boldmsg()
-{
- echo -e $2 "\e[1m$1\e[0m"
-}
-
-greenmsg()
-{
- echo -e $2 "\e[32m$1\e[0m"
-}
-
-redmsg()
-{
- echo -e $2 "\e[31m$1\e[0m"
-}
-
-check_run()
-{
- if [ $? -ne 0 ]; then
- redmsg "FAILED"
- echo "Please take a look at the log file \"$TEMPDIR/build.log\""
- echo "Aborted!"
- exit 1
- else
- greenmsg "OK"
- rm "$TEMPDIR/build.log"
- fi
-}
-
-#
-# Entry point
-#
-echo "buildtoolchain - Build a binutils/GCC/mingw-runtime/w32api toolchain for
Windows"
-echo "by Colin Finck <colin(a)reactos.org>"
-echo
-
-if [ "`uname -o`" != "Msys" ]; then
- echo "You can only run this script under a MSYS environment!"
- exit 1
-fi
-
-# We don't want too less nor too many parameters
-if [ "$1" == "" ] || [ "$4" != "" ]; then
- echo "Syntax: ./buildtoolchain.sh <sources> [binutils] [gcc]"
- echo
- echo " sources - Path to the directory containing RosBE-Unix toolchain packages
(.tar.bz2 files)"
- echo " binutils - optional; whether binutils shall be built (0/1, default is
1)"
- echo " gcc - optional; whether gcc shall be built (0/1, default is 1)"
- exit 1
-fi
-
-# Get the absolute path to the script directory
-cd `dirname $0`
-SCRIPTDIR="$PWD"
-
-# Find out whether the script directory contains spaces
-case "$SCRIPTDIR" in
-*" "*)
- redmsg "The script directory \"$SCRIPTDIR\" contains spaces!"
- redmsg "Therefore some build tools cannot be compiled properly."
- echo
- redmsg "Please move \"$SCRIPTDIR\" to a directory, which does not contain
spaces."
-
- exit 1;;
-esac
-
-# Check if all necessary tools exist
-boldmsg "Checking for the needed tools..."
-
-toolmissing=false
-for tool in $NEEDED_TOOLS; do
- echo -n "Checking for $tool... "
-
- if which "$tool" >& /dev/null; then
- greenmsg "OK"
- else
- redmsg "MISSING"
- toolmissing=true
- fi
-done
-
-if $toolmissing; then
- echo "At least one needed tool is missing, aborted!"
- exit 1
-fi
-
-echo
-
-# Get the absolute path to the source directory
-cd "$1"
-source_path="$PWD"
-
-# What do we need to process?
-if [ "$2" == "0" ]; then
- process_binutils=false
-else
- process_binutils=true
-fi
-
-if [ "$3" == "0" ]; then
- process_gcc=false
-else
- process_gcc=true
-fi
-
-# Create all necessary directories
-if ! [ -d "$INSTALLDIR/$TARGET" ]; then
- mkdir -p "$INSTALLDIR/$TARGET"
-fi
-
-if [ -d "$MINGWDIR" ]; then
- rm -rf "$MINGWDIR"
-fi
-
-mkdir -p "$MINGWDIR"
-
-if ! [ -d "$TEMPDIR" ]; then
- mkdir -p "$TEMPDIR"
-fi
-
-cd "$MINGWDIR"
-
-boldmsg "Building..."
-
-# mingw-runtime
-echo -n "Extracting mingw-runtime... "
-tar -xjf "$source_path/mingw-runtime.tar.bz2" >&
"$TEMPDIR/build.log"
-check_run
-
-# w32api
-echo -n "Extracting w32api... "
-tar -xjf "$source_path/w32api.tar.bz2" >&
"$TEMPDIR/build.log"
-check_run
-
-# Copy the same stuff to the target directory (needed for building gcc and later getting
the files located properly)
-echo "Copying files... "
-cp -R $MINGWDIR/* "$INSTALLDIR/$TARGET"
-
-cd "$TEMPDIR"
-
-# binutils
-if $process_binutils; then
- rm -rf "binutils"
- rm -rf "binutils-build"
-
- echo -n "Extracting binutils... "
- tar -xjf "$source_path/binutils.tar.bz2" >& build.log
- check_run
-
- echo -n "Configuring binutils... "
- mkdir "binutils-build"
- cd "binutils-build"
- ../binutils/configure --prefix="$INSTALLDIR" --build="$BUILD"
--host="$HOST" --target="$TARGET" --disable-nls --disable-shared
>& "$TEMPDIR/build.log"
- check_run
-
- echo -n "Building binutils... "
- make >& "$TEMPDIR/build.log"
- check_run
-
- echo -n "Installing binutils... "
- make install >& "$TEMPDIR/build.log"
- check_run
-
- echo "Cleaning up binutils..."
- cd "$TEMPDIR"
- rm -rf "binutils-build"
- rm -rf "binutils"
-fi
-
-# gcc
-if $process_gcc; then
- rm -rf "gcc"
- rm -rf "gcc-build"
-
- echo -n "Extracting gcc... "
- tar -xjf "$source_path/gcc.tar.bz2" >& build.log
- check_run
-
- echo -n "Configuring gcc... "
- mkdir "gcc-build"
- cd "gcc-build"
-
- ../gcc/configure --prefix="$WIN32_INSTALLDIR" --build="$BUILD"
--host="$HOST" --target="$TARGET" --with-ld=/bin/ld \
- --enable-languages=c,c++ --enable-checking=release \
- --enable-threads=win32 --disable-win32-registry --disable-nls \
- --disable-shared >& "$TEMPDIR/build.log"
- check_run
-
- echo -n "Building gcc... "
- make >& "$TEMPDIR/build.log"
- check_run
-
- echo -n "Installing gcc... "
- make install >& "$TEMPDIR/build.log"
- check_run
-
- echo "Cleaning up gcc..."
- cd "$TEMPDIR"
- rm -rf "gcc-build"
- rm -rf "gcc"
-fi
-
-# Final actions
-echo
-boldmsg "Final actions"
-cd "$INSTALLDIR"
-
-echo "Removing unneeded files..."
-mv $TARGET/bin/* bin
-mv $TARGET/include/* include
-mv $TARGET/lib/* lib
-rm -rf $TARGET info man share
-rm -f bin/c++.exe bin/gccbug bin/$TARGET-*
-
-echo "Removing debugging symbols..."
-find -name "*.exe" -type f -exec strip -s {} ";"
-
-echo "Finished!"