|
From: Alperovitch, M. <mal...@hp...> - 2011-04-07 12:09:24
|
________________________________ I am trying to build cross compiler on windows for target=sparc64-sun-solaris2.10 and I got error message during gcc build for gcc-core-3.4.2-20040916-src.tar.gz, but file input.h exists in this directory and I have correct PATH. gcc -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/c/mingw/source/gcc-3.4.2-20040916-1/gcc -I/c/mingw/source/gcc-3.4.2-20040916-1/gcc/. -I/c/mingw/source/gcc-3.4.2-20040916-1/gcc/../include /c/mingw/source/gcc-3.4.2-20040916-1/gcc/gengtype.c -o gengtype.o gcc -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-error -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/c/mingw/source/gcc-3.4.2-20040916-1/gcc -I/c/mingw/source/gcc-3.4.2-20040916-1/gcc/. -I/c/mingw/source/gcc-3.4.2-20040916-1/gcc/../include \ /c/mingw/source/gcc-3.4.2-20040916-1/gcc/gengtype-lex.c -o gengtype-lex.o gengtype-lex.c:2655:12: warning: 'input' defined but not used gcc -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-error -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/c/mingw/source/gcc-3.4.2-20040916-1/gcc -I/c/mingw/source/gcc-3.4.2-20040916-1/gcc/. -I/c/mingw/source/gcc-3.4.2-20040916-1/gcc/../include \ /c/mingw/source/gcc-3.4.2-20040916-1/gcc/gengtype-yacc.c -o gengtype-yacc.o gcc -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -o gengtype.exe \ gengtype.o gengtype-lex.o gengtype-yacc.o ../libiberty/libiberty.a ./gengtype /c/mingw/source/gcc-3.4.2-20040916-1/gcc/input.h: No such file or directory make[1]: *** [s-gtype] Error 1 make[1]: Leaving directory `/c/mingw/gcc-sparc64-sun-solaris2.10/gcc' make: *** [all-gcc] Error 2 I am using this script: #!/bin/sh # This is my script for building a complete cross-compiler toolchain. # It is based partly on Ray Kelm's script, which in turn was built on # Mo Dejong's script for doing the same, but with some added fixes. # The intent with this script is to build a cross-compiled version # of the current MinGW environment. # # Updated by Sam Lantinga <sl...@li...<mailto:sl...@li...>> # what flavor are we building? #TARGET=i386-mingw32msvc TARGET=sparc64-sun-solaris2.10 # uncomment or add entries here # where does it go? (your cross tools install directory) #PREFIX=$HOME/cross-tools PREFIX=c:/mingw/cross-tools # if the prefix you are using needs root/sudo to access it please uncomment one of these #SU="su -c" #SUDO="sudo " # uncomment this to strip binaries installed #STRIP_BINARIES=1 # your favorite downloader (pick one) DOWNLOADER="wget -c" #DOWNLOADER="curl -#OLC -" # your platform specific optimisation flags. This is so that the compiler is optimised. This does not affect the win32 binaries in any way. # CFLAGS="-O3 -march=pentium" # your favorite mirror MINGW_URL=http://easynews.dl.sourceforge.net/sourceforge/mingw TOPDIR=`pwd` SRCDIR="$TOPDIR/source" GCC_VERSION=3.4.2-20040916-1 #GCC_VERSION=3.4.5-20060117-2 GCC=gcc-$GCC_VERSION GCC_CORE=gcc-core-$GCC_VERSION GCC_CORE_ARCHIVE=$GCC_CORE-src.tar.gz GCC_GPP=gcc-g++-$GCC_VERSION GCC_GPP_ARCHIVE=$GCC_GPP-src.tar.gz GCC_PATCH="" #BINUTILS=binutils-2.15.91-20040904-1 BINUTILS=binutils-2.21 BINUTILS_ARCHIVE=$BINUTILS-src.tar.gz #MINGW=mingw-runtime-3.9 MINGW=mingw-runtime-3.14 MINGW_ARCHIVE=$MINGW.tar.gz #W32API=w32api-3.5 W32API=w32api-3.11 W32API_ARCHIVE=$W32API.tar.gz # you probably don't need to change anything from here down # These are the files from the SDL website #SDL_URL=http://www.libsdl.org/extras/win32/common # don't use the directx and opengl headers from SDL website, they are outdated and don't work with clanlib # the opengl and directx headers included in w32api-2.4 are better # if you have access to the directx sdk headers/libs would be even better #OPENGL_ARCHIVE=opengl-devel.tar.gz #DIRECTX_ARCHIVE=directx-devel.tar.gz # need install directory first on the path so gcc can find binutils #PATH="$PREFIX/bin:$PATH" PATH=/c/mingw/bin:/c/mingw/msys/1.0/bin:/c/mingw/cross-tools/bin:/c/mingw/source/gcc-3.4.2-20040916-1/gcc/:/usr/local/bin::/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem echo $PATH check_envars() { echo "checking envars..." echo "If we bail out here, please edit this script to fix problems." if test -z "$PREFIX"; then echo "PREFIX not set, please set PREFIX to /usr/local/cross-tools or where-ever you want your cross tools" echo "Note that you will also need to set DO_SU=1 if your install path needs root access" exit 1 fi if test -z "$DOWNLOADER"; then echo "DOWNLOADER not set, please set DOWNLOADER to your favorite download program like wget, curl..." exit 1 fi if test -z "$MINGW_URL"; then echo "MINGW_URL not set, please set MINGW_URL to your favorite mirror" exit 1 fi echo "done checking envars" } # # download a file from a given url, only if it is not present # download_file() { cd "$SRCDIR" if test ! -f $1 ; then echo "Downloading $1" $DOWNLOADER "$2/$1" if test ! $? || test ! -f $1 ; then echo "Could not download $1" exit 1 fi else echo "Found $1 in the srcdir $SRCDIR" fi cd "$TOPDIR" } download_files() { mkdir -p "$SRCDIR" # Make sure wget is installed #if test "x`which wget`" = "x" ; then # echo "You need to install wget." # exit 1 #fi download_file "$GCC_CORE_ARCHIVE" "$MINGW_URL" download_file "$GCC_GPP_ARCHIVE" "$MINGW_URL" download_file "$BINUTILS_ARCHIVE" "$MINGW_URL" download_file "$MINGW_ARCHIVE" "$MINGW_URL" download_file "$W32API_ARCHIVE" "$MINGW_URL" # download_file "$OPENGL_ARCHIVE" "$SDL_URL" # download_file "$DIRECTX_ARCHIVE" "$SDL_URL" } do_install() { if test -n "$SU"; then $SU -c "$@ &> install.log" elif test -n $SUDO; then $SUDO $@ &> install.log else $@ &> install.log fi if test $? -ne 0; then SUBDIR=`pwd` SUBDIR=`basename $SUBDIR` echo "install failed - log available: $SUBDIR/install.log" cd "$TOPDIR" exit 1 fi } install_libs() { echo "Installing cross libs and includes" cat >install_libs.sh<<INSTALL_LIBS mkdir -p "$PREFIX/$TARGET" cd "$PREFIX/$TARGET" gzip -dc "$SRCDIR/$MINGW_ARCHIVE" | tar xf - gzip -dc "$SRCDIR/$W32API_ARCHIVE" | tar xf - # gzip -dc "$SRCDIR/$OPENGL_ARCHIVE" | tar xf - # gzip -dc "$SRCDIR/$DIRECTX_ARCHIVE" | tar xf - INSTALL_LIBS do_install sh install_libs.sh rm -f install_libs.sh cd "$TOPDIR" } extract_binutils() { cd "$SRCDIR" rm -rf "$BINUTILS" echo "Extracting binutils" #gzip -dc "$SRCDIR/$BINUTILS_ARCHIVE" | tar xf - gunzip "$SRCDIR/$BINUTILS_ARCHIVE" tar xvf binutils-2.21-src.tar cd "$TOPDIR" } configure_binutils() { cd "$TOPDIR" rm -rf "binutils-$TARGET" mkdir "binutils-$TARGET" cd "binutils-$TARGET" echo "Configuring binutils" "$SRCDIR/$BINUTILS/configure" --prefix="$PREFIX" --target=$TARGET &> configure.log cd "$TOPDIR" } build_binutils() { cd "$TOPDIR/binutils-$TARGET" echo "Building binutils" make &> make.log if test $? -ne 0; then echo "make failed - log available: binutils-$TARGET/make.log" exit 1 fi cd "$TOPDIR" } install_binutils() { cd "$TOPDIR/binutils-$TARGET" echo "Installing binutils" do_install make install cd "$TOPDIR" } extract_gcc() { cd "$SRCDIR" rm -rf "$GCC" echo "Extracting gcc" gzip -dc "$SRCDIR/$GCC_CORE_ARCHIVE" | tar xf - gzip -dc "$SRCDIR/$GCC_GPP_ARCHIVE" | tar xf - cd "$TOPDIR" } patch_gcc() { if [ "$GCC_PATCH" != "" ]; then echo "Patching gcc" cd "$SRCDIR/$GCC" patch -p1 < "$SRCDIR/$GCC_PATCH" cd "$TOPDIR" fi } configure_gcc() { cd "$TOPDIR" rm -rf "gcc-$TARGET" mkdir "gcc-$TARGET" cd "gcc-$TARGET" echo "Configuring gcc" "$SRCDIR/$GCC/configure" -v \ --enable-languages="c,c++" \ --prefix="$PREFIX" --target="$TARGET" \ --with-headers="$PREFIX/$TARGET/include" \ --with-gnu-as --with-gnu-ld \ --disable-shared \ --disable-nls \ --disable-win32-registry \ --without-newlib --disable-multilib &> configure.log cd "$TOPDIR" } build_gcc() { cd "$TOPDIR/gcc-$TARGET" echo "Building gcc" make &> make.log if test $? -ne 0; then echo "make failed - log available: gcc-$TARGET/make.log" exit 1 fi cd "$TOPDIR" } install_gcc() { cd "$TOPDIR/gcc-$TARGET" echo "Installing gcc" do_install make install cd "$TOPDIR" } final_tweaks() { echo "Finalizing installation" cat >final_tweaks.sh<<FINAL_TWEAKS # remove gcc build headers rm -rf "$PREFIX/$TARGET/sys-include" # Add extra binary links if [ ! -f "$PREFIX/$TARGET/bin/objdump" ]; then ln -s "../../bin/$TARGET-objdump" "$PREFIX/$TARGET/bin/objdump" fi if [ ! -f "$PREFIX/$TARGET/bin/dllwrap" ]; then ln -s "../../bin/$TARGET-dllwrap" "$PREFIX/$TARGET/bin/dllwrap" fi if [ ! -f "$PREFIX/$TARGET/bin/windres" ]; then ln -s "../../bin/$TARGET-windres" "$PREFIX/$TARGET/bin/windres" fi # make cc and c++ symlinks to gcc and g++ if [ ! -f "$PREFIX/$TARGET/bin/g++" ]; then ln -s "../../bin/$TARGET-g++" "$PREFIX/$TARGET/bin/g++" fi if [ ! -f "$PREFIX/$TARGET/bin/cc" ]; then ln -s "gcc" "$PREFIX/$TARGET/bin/cc" fi if [ ! -f "$PREFIX/$TARGET/bin/c++" ]; then ln -s "g++" "$PREFIX/$TARGET/bin/c++" fi # strip all the binaries if test -n "$STRIP_BINARIES"; then ls "$PREFIX"/bin/* "$PREFIX/$TARGET"/bin/* | grep -v '\\.dll$' | while read file; do strip "$file" done fi FINAL_TWEAKS do_install sh final_tweaks.sh rm -f final_tweaks.sh echo "Installation complete!" } check_envars #download_files #install_libs #extract_binutils #configure_binutils #build_binutils #install_binutils #extract_gcc #patch_gcc configure_gcc build_gcc install_gcc final_tweaks |