MinGW - Minimalist GNU for Windows
http://sourceforge.net/project/showfiles.php?group... http://www.mingw.org/download.shtml
Index of /gnu/binutils
http://ftp.gnu.org/gnu/binutils/
Info-ZIP's UnZip
http://www.info-zip.org/UnZip.html
mkdir /opt/xmingw32/ mkdir /opt/xmingw32/src
cd ${XMINGW}
mkdir mingw32
cd mingw32
tar -zxf ${XMGWSRC}/mingw-runtime-3.9.tar.gz
tar -zxf ${XMGWSRC}/w32api-3.6.tar.gz
cd ${XMGWSRC}
tar -jxf binutils-2.16.tar.bz2
cd binutils-2.16
mkdir build
cd build
../configure --prefix=${XMINGW} --target=mingw32 --disable-nls --disable-shared
make CFLAGS="-O2 -fno-exceptions" LDFLAGS=-s >make.log 2>&1
make install >install.log 2>errinstall.log
localhost build # ${XMINGW}/bin/mingw32-strings --help Usage: /opt/xmingw32/bin/mingw32-strings [option(s)] [file(s)] Display printable strings in [file(s)] (stdin by default) The options are: -a - --all Scan the entire file, not just the data section -f --print-file-name Print the name of the file before each string -n --bytes=[number] Locate & print any NUL-terminated sequence of at -<number> least [number] characters (default 4). -t --radix={o,d,x} Print the location of the string in base 8, 10 or 16 -o An alias for --radix=o -T --target=<BFDNAME> Specify the binary file format -e --encoding={s,S,b,l,B,L} Select character size and endianness: s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit -h --help Display this information -v --version Print the program's version number /opt/cross-tools/mingw32/bin/mingw32-strings: supported targets: pe-i386 pei-i38 6 elf32-i386 elf32-little elf32-big srec symbolsrec tekhex binary ihex Report bugs to <URL:http://www.sourceware.org/bugzilla/>
cd ../..
rm binutils-2.16 -r
# コピーする場合。
cp ${XMINGW}/bin/mingw32-dllwrap ${XMINGW}/mingw32/bin/.
# シンボリックリンクを作成する場合。
ln -s ${XMINGW}/bin/mingw32-dllwrap ${XMINGW}/mingw32/bin/.
PATH=${XMINGW}/bin:$PATH
cd ${XMGWSRC}
tar -zxf gcc-core-3.4.5-20051220-1-src.tar.gz
tar -zxf gcc-g++-3.4.5-20051220-1-src.tar.gz
cd gcc-3.4.5-20051220-1
mkdir build
cd build
../configure --prefix=${XMINGW} --target=mingw32 --host=${MACHTYPE} --enable-threads --disable-nls --disable-win32-registry --disable-shared --enable-languages=c,c++ --enable-sjlj-exceptions --enable-libstdcxx-debug
make CFLAGS="-O2 -fomit-frame-pointer" LDFLAGS=-s >make.log 2>&1
make install >install.log 2>errinstall.log
mingw32-gcc --version
gcc (GCC) 3.4.5 (mingw special) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
cd ../..
rm gcc-3.4.5-20051220-1 -r
cd ${XMGWSRC}
tar -zxf mingw-utils-0.3-src.tar.gz
cd mingw-utils-0.3
mkdir build
cd build
../configure --prefix=${XMINGW}/mingw32 --target=mingw32 --host=${MACHTYPE} CFLAGS="-O2 -march=pentiumpro" LDFLAGS="-s"
make >make.log 2>&1
make install >install.log 2>errinstall.log
tar -zxf unzip552.tar.gz
cd unzip-5.52
make -f unix/Makefile generic
make -f unix/Makefile test
make -f unix/Makefile install >install.log 2>errinstall.log
cd ..
rm unzip-5.52 -r
# cross.env #PREFIX=/opt/xmingw32 TARGET=mingw32 PATH="${PREFIX}/local/bin:${PREFIX}/${TARGET}/bin:${PREFIX}/bin:${PATH}" export CC="mingw32-gcc " export CXX="mingw32-g++ " export C_INCLUDE_PATH="${PREFIX}/local/include:${PREFIX}/${TARGET}/include:${PREFIX}/include" export CPLUS_INCLUDE_PATH=${C_INCLUDE_PATH} #export LIBRARY_PATH="${PREFIX}/local/lib:${PREFIX}/${TARGET}/lib:${PREFIX}/lib" export LD_LIBRARY_PATH="${PREFIX}/local/lib:${PREFIX}/${TARGET}/lib:${PREFIX}/lib:${LD_LIBRARY_PATH}" export OBJDUMP="${PREFIX}/bin/mingw32-objdump " export PKG_CONFIG_PATH="${EXTRA_PKG_CONFIG_PATH}:${PREFIX}/local/lib/pkgconfig:${PREFIX}/${TARGET}/lib/pkgconfig" #export BUILD_FOR_CC="build4cc " #export BUILD_FOR_CXX="build4cxx " export MANPATH=${PREFIX}/man:${XLOCAL}/man:${MANPATH} export INFOPATH=${PREFIX}/info:${XLOCAL}/info:${INFOPATH} config_commands=" cppunit-config aalib-config fftw-wisdom-to-conf freetype-config gimptool-2.0 libart2-config libpng-config libwmf-config ${TARGET}-croco-0.6-config ${TARGET}-sdl-config xml2-config " for c in $config_commands do v=`echo $c | sed 's/-[0-9]\+\.[0-9]\+//'` v=`echo $v | sed "s/^${TARGET}-//"` v=`echo $v | tr '[:lower:]-' '[:upper:]_'` vv=$(eval echo `echo \\$$v`) if test -z $vv then for p in $PREFIX/local/bin $PREFIX/$TARGET/bin $PREFIX/bin do if test -f "$p/$c" then export $v="$p/$c" break fi done fi done
#!/bin/sh prog=$1 shift PREFIX=/opt/xmingw32 . ${PREFIX}/cross.env ${prog} "$@"
chmod 755 ${XMINGW}/cross
${XMINGW}/cross gcc --version
args: gcc --version gcc (GCC) 3.4.5 (mingw special) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#!/bin/sh CONFIG_SHELL=/bin/sh export CONFIG_SHELL PREFIX=/opt/xmingw32 . ${PREFIX}/cross.env echo -n "args: " echo "$@" cache=cross-config.cache sh ../configure --cache-file="$cache" \ --target=${TARGET} --host=${TARGET} --build=${MACHTYPE} \ "$@" status=$? rm -f "$cache" exit $status
chmod 755 ${XMINGW}/cross-ppconfigure
BUILD_PREFIX=/usr export CC="${BUILD_PREFIX}/bin/gcc " export CXX="${BUILD_PREFIX}/bin/g++ " export C_INCLUDE_PATH="${BUILD_PREFIX}/local/include:${BUILD_PREFIX}/include" export CPLUS_INCLUDE_PATH=${C_INCLUDE_PATH} export PKG_CONFIG_PATH="${BUILD_PREFIX}/local/lib/pkgconfig:${BUILD_PREFIX}/lib/pkgconfig" export LD_LIBRARY_PATH="${BUILD_PREFIX}/local/lib:${BUILD_PREFIX}/lib:${LD_LIBRARY_PATH}" #export LIBRARY_PATH="${BUILD_PREFIX}/local/lib:${BUILD_PREFIX}/lib" export OBJDUMP=${BUILD_PREFIX}/bin/objdump
PREFIX=/opt/xmingw32 . ${PREFIX}/bin/build4cc.env ${CC} "$@"
chmod 755 ${XMINGW}/bin/build4cc
PREFIX=/opt/xmingw32 . ${PREFIX}/bin/build4cc.env ${CXX} "$@"
chmod 755 ${XMINGW}/bin/build4cxx