compiling gcc-4.1.1 for windows on linux

luoyi luoyi.ly@gmail.com
Fri Jun 9 10:04:00 GMT 2006


> You need to put "xgcc/bin" in your PATH ahead of
> everything else or specify
> "--with-as=/path/to/xgcc/bin/i686-pc-mingw32-as" and
> "--with-ld=/path/to/xgcc/bin/i686-pc-mingw32-ld" on the
> configure command line for the crossed-native build.

My script is:
*********************************************************************
#!/bin/sh
# Script to configure a GCC crossed-native-compiler for MinGW.
# You MUST update these variables to reflect your set up.
#
# IMPORTANT:
# ----------
# a. You should have installed cross-binutils and GCC cross-compiler
# for MinGW in the folder $XGCC_DIR.
#
# b. You should have installed mingw-runtime, w32api and libregex
# for MinGW in the folder $PREFIX/mingw32.
#
GCC_SRC_DIR=../gcc-4.1.1
XGCC_DIR=/opt/linuxsir/gcc411/xgcc
XBIN_DIR=/opt/linuxsir/gcc411/xbin
PREFIX=`pwd`
MINGWROOT=$PREFIX/sys-root
# You do not have to change anything below this, but it does not
# hurt to review it anyway.
BUILD=`$GCC_SRC_DIR/config.guess`
TARGET=i686-pc-mingw32
HOST=$TARGET
export CC=$XGCC_DIR/bin/$TARGET-gcc
export CXX=$XGCC_DIR/bin/$TARGET-g++
export AS=$XBIN_DIR/bin/$TARGET-as
export LD=$XBIN_DIR/bin/$TARGET-ld
export AR=$XBIN_DIR/bin/$TARGET-ar
export CFLAGS='-O2 -g0 -pipe'
export CXXFLAGS='-O2 -g0 -pipe'
export LDFLAGS='-s'
export DEBUG_FLAGS='-g0'
export PATH=$XBIN_DIR/bin:$XGCC_DIR/bin:$PATH
$GCC_SRC_DIR/configure --prefix=$PREFIX \
 --build=$BUILD --host=$HOST --target=$TARGET \
 --enable-languages=c,c++ --with-sysroot=$MINGWROOT --with-build-sysroot=$MINGWROOT 
\
 --with-gcc --with-gnu-as --with-gnu-ld \
 --with-as=$AS --with-ld=$LD \
 --enable-threads=win32 --disable-nls --disable-win32-registry \
 --disable-shared --disable-debug --without-newlib
*************************************************************************************
and echo $PATH I can get:
/opt/linuxsir/gcc411/xgcc/bin:/opt/linuxsir/gcc411/xbin/bin:/usr/kerberos/sbin:/usr/luoyi/vim/bin:/usr/luoyi/gcc-41/bin:/usr/
kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/luoyi/bin


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /