[MLton-user] native gcc and i386-pc-* vs. i386-*?

Anoq of the Sun anoq@HardcoreProcessing.com
Fri, 07 Nov 2003 21:42:25 +0200


This is a multi-part message in MIME format.
--------------DDFCD6B2EA3D9018C94EF5CD
Content-Type: text/plain; charset=iso-8859-7
Content-Transfer-Encoding: 7bit

Hello!


I have now managed to compile a native gcc of the
same version as the cross compiler. I have attached
the script I used for compiling it - which is heavily
copied & pasted from the cross-compilation script.

So now the command:

gcc -b i386-mingw32msvc hello.c

can compile the famous Hello World for Windows,
which is what the MLton build-process expects.

I have one question though regarding the target name
of the cross compiler:

In the build-files I found at www.libsdl.org they use
the target i386-mingw32msvc (which I also use in the
script I sent earlier) and the files I found at
www.mingw.org just uses mingw32. Pete's suggestion
from earlier uses yet another flavour: i386-pc-mingw32msvc.

I don't know if there is any difference in these
target names and whether or not there is a recommended
target name. Does anyone know?


Cheers
-- 
http://www.HardcoreProcessing.com
--------------DDFCD6B2EA3D9018C94EF5CD
Content-Type: application/x-sh;
 name="gcc-3.2.3-build-native.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="gcc-3.2.3-build-native.sh"

#!/usr/bin/env bash

# Variables with filenames etc.
gccVers='3.2.3-20030504-1'
# gccTar="gcc-core-$gccVers.tar"
# Annoying that the .tar file ends in -src and the unpacked directory does not
gccTar="gcc-$gccVers-src.tar"
binutils='binutils-2.13.90-20030111-1-src'
binutilsTar="$binutils.tar"

prefix='/usr'

root=`pwd`

# Utility functions
exists () {
        if [ ! -r "$1" ]; then
                die "$1 does not exist"
        fi
}

# Unpack and build binutils
echo 'Unpacking binutils.'
cd $root
exists $binutilsTar
tar x <$binutilsTar

echo 'Building binutils.'
mkdir -p build-binutils-native
cd build-binutils-native
../$binutils/configure --prefix=$prefix \
        >$root/configure-binutils-native-log 2>&1 ||
        die "Configure of binutils failed."
make all install >$root/build-binutils-native-log 2>&1 ||
        die "Build of binutils failed."

# Unpack the gcc tar-file
echo 'Unpacking gcc.'
cd $root
exists $gccTar
tar x <$gccTar

# build it
echo 'Building gcc.'
mkdir -p build-native
cd build-native
../gcc-$gccVers/configure  --with-gcc --with-gnu-ld --with-gnu-as --prefix=$prefix  --enable-threads --disable-nls --enable-languages=c,c++ --disable-multilib \
	>$root/configure-gcc-native-log 2>&1 ||
	die "Configure of gcc failed."
make "CFLAGS=-O2" "LDFLAGS=-s" bootstrap >$root/build-gcc-native-log 2>&1 ||
	die "Build of gcc failed."

# install it
make install

echo 'Success.'

--------------DDFCD6B2EA3D9018C94EF5CD--