Author: cfinck
Date: Sat May 9 02:06:49 2009
New Revision: 40840
URL:
http://svn.reactos.org/svn/reactos?rev=40840&view=rev
Log:
The ReactOS Makefile only detects GCCs built for "mingw32" while MSYS
autodetects "i686-pc-mingw32".
I could fix that in the Makefile, but then compatibility with older revisions would still
be broken. Also this little detection inside the Makefile could prevent some people from
attempting to use their own, incompatible GCC versions.
Therefore I've added --build, --host and --target values to the toolchain's
configure scripts and set them all to "mingw32" to make sure that they
aren't doing any cross-compiling attempts.
i686 optimizations for the built compiler were manually applied with -march=i686 in CFLAGS
and CXXFLAGS. (which *doesn't* mean ROS itself will need an i686 onwards CPU from now
on)
Modified:
trunk/tools/RosBE/RosBE-Windows/Compiling a working GNU toolchain under Windows.odt
trunk/tools/RosBE/RosBE-Windows/buildtoolchain.sh
Modified: 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 files - no diff available.
Modified: 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 [iso-8859-1] Sat May 9 02:06:49
2009
@@ -17,12 +17,24 @@
#
# Constants
#
+CFLAGS="-march=i686 -O2"
+CXXFLAGS="$CFLAGS"
INSTALLDIR="/c/buildtoolchain/mingw"
+LDFLAGS="-s"
MINGWDIR="/mingw"
NEEDED_TOOLS="bison flex gcc g++ grep make makeinfo"
-TARGET="i686-pc-mingw32"
+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
@@ -178,11 +190,11 @@
echo -n "Configuring binutils... "
mkdir "binutils-build"
cd "binutils-build"
- ../binutils/configure --prefix="$INSTALLDIR" --disable-nls --disable-shared
>& "$TEMPDIR/build.log"
+ ../binutils/configure --prefix="$INSTALLDIR" --build="$BUILD"
--host="$HOST" --target="$TARGET" --disable-nls --disable-shared
>& "$TEMPDIR/build.log"
check_run
echo -n "Building binutils... "
- make CFLAGS="-O2 -fno-exceptions" LDFLAGS="-s" >&
"$TEMPDIR/build.log"
+ make >& "$TEMPDIR/build.log"
check_run
echo -n "Installing binutils... "
@@ -208,14 +220,14 @@
mkdir "gcc-build"
cd "gcc-build"
- ../gcc/configure --prefix="$WIN32_INSTALLDIR" --with-ld=/bin/ld \
+ ../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 CFLAGS="-O2" CXXFLAGS="-O2" LDFLAGS="-s" >&
"$TEMPDIR/build.log"
+ make >& "$TEMPDIR/build.log"
check_run
echo -n "Installing gcc... "