This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problems with building binutils using script build-cross.sh


hi everyone
at

http://www.libsdl.org/extras/win32/cross/

i found the build-cross.sh script for a linux hosted mingw32 compiler.
file download works well. but building binutils i get the following message in make.log

make[1]: Wechsel in das Verzeichnis Verzeichnis »/home2/cross-gcc/script_mumid/binutils-i686-mingw32msvc/libiberty«
if [ x"" != x ] && [ ! -d pic ]; then \
  mkdir pic; \
else true; fi
touch stamp-picdir
if [ x"" != x ]; then \
  gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/../include  -W -Wall -Wtraditional -pedantic  /home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c -o pic/regex.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/../include  -W -Wall -Wtraditional -pedantic /home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c -o regex.o
In file included from /home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:198:
/usr/local/include/ctype.h:101: syntax error before `int'
In file included from /home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:649:
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c: In function `byte_regex_compile':
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:2527: warning: implicit declaration of function `free'
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:2588: warning: function `free' was previously declared within a block
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:2621: warning: function `free' was previously declared within a block
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:2728: warning: function `free' was previously declared within a block
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:3731: warning: function `free' was previously declared within a block
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:4238: warning: function `free' was previously declared within a block
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c: In function `byte_compile_range':
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:4602: warning: signed and unsigned type in conditional expression
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:4612: warning: signed and unsigned type in conditional expression
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:4612: warning: signed and unsigned type in conditional expression
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c: In function `byte_re_compile_fastmap':
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:4952: warning: implicit declaration of function `abort'
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c: At top level:
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1380: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1382: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1383: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1385: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1386: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1388: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1389: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1391: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1392: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1394: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1395: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1397: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1398: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1400: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1401: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1403: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1404: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1406: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1407: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1409: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1410: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1412: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1413: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1415: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1416: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1418: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1419: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1421: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1422: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1424: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1425: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:1427: warning: traditional C rejects string concatenation
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c: In function `xregcomp':
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:8099: warning: signed and unsigned type in conditional expression
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:8138: warning: function `free' was previously declared within a block
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c: In function `xregexec':
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:8217: warning: function `free' was previously declared within a block
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c: In function `xregerror':
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:8234: warning: unused parameter `preg'
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c: In function `xregfree':
/home2/cross-gcc/script_mumid/source/binutils-2.13-20020808-1/libiberty/regex.c:8283: warning: function `free' was previously declared within a block
make[1]: *** [regex.o] Fehler 1
make[1]: Verlassen des Verzeichnisses Verzeichnis »/home2/cross-gcc/script_mumid/binutils-i686-mingw32msvc/libiberty«
make: *** [all-libiberty] Fehler 2
seems to me as if ctype.h is searched in the wrong path.
 has anyone experienced the same problem?
how to fix this problem?

thanx
knut ;-)


#
#  B U I L D  -  C R O S S  .  S H
#

#!/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 <slouken@libsdl.org>

# what flavor are we building?
TARGET=i686-mingw32msvc

# where does it go?
#PREFIX=/usr/local/cross-tools
PREFIX=/home2/cross-gcc/script_mumid/cross-tools

# you probably don't need to change anything from here down

TOPDIR=`pwd`
SRCDIR="$TOPDIR/source"

# These are the files from the MinGW 1.1 release
MINGW_URL=http://unc.dl.sourceforge.net/sourceforge/mingw
#GCC=gcc-2.95.3-20010828
GCC=gcc-3.2-20020817-1
GCC_ARCHIVE=$GCC.src.tar.gz
GCC_PATCH=""
#BINUTILS=binutils-2.11.90-20010915
BINUTILS=binutils-2.13-20020808-1
BINUTILS_ARCHIVE=$BINUTILS-src.tar.gz
#MINGW=mingw-runtime-1.1
MINGW=mingw-runtime-2.2
MINGW_ARCHIVE=$MINGW.tar.gz
#W32API=w32api-1.1
W32API=w32api-1.5
W32API_ARCHIVE=$W32API.tar.gz

# These are the files from the SDL website
SDL_URL=http://www.libsdl.org/extras/win32/common
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"

#
# 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"
		wget "$2/$1"
		if 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_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"
}

install_libs()
{
	echo "Installing cross libs and includes"
	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 -
	cd "$TOPDIR"
}

extract_binutils()
{
	cd "$SRCDIR"
	rm -rf "$BINUTILS"
	echo "Extracting binutils"
	gzip -dc "$SRCDIR/$BINUTILS_ARCHIVE" | tar xf -
	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"
	make install &> make-install.log
	if test $? -ne 0; then
		echo "install failed - log available: binutils-$TARGET/make-install.log"
		exit 1
	fi
	cd "$TOPDIR"
}

extract_gcc()
{
	cd "$SRCDIR"
	rm -rf "$GCC"
	echo "Extracting gcc"
	gzip -dc "$SRCDIR/$GCC_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 \
		--prefix="$PREFIX" --target=$TARGET \
		--with-headers="$PREFIX/$TARGET/include" \
		--with-gnu-as --with-gnu-ld \
		--without-newlib --disable-multilib &> configure.log
	cd "$TOPDIR"
}

build_gcc()
{
	cd "$TOPDIR/gcc-$TARGET"
	echo "Building gcc"
	make LANGUAGES="c c++" &> 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"
	make LANGUAGES="c c++" install &> make-install.log
	if test $? -ne 0; then
		echo "install failed - log available: gcc-$TARGET/make-install.log"
		exit 1
	fi
	cd "$TOPDIR"
}

final_tweaks()
{
	echo "Finalizing installation"

	# remove gcc build headers
	rm -rf "$PREFIX/$TARGET/sys-include"

	# make cc and c++ symlinks to gcc and g++
	if [ ! -f "$PREFIX/$TARGET/bin/g++" ]; then
		ln "$PREFIX/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
	ls "$PREFIX"/bin/* "$PREFIX/$TARGET"/bin/* | egrep -v '.dll$' |
	while read file; do
		strip "$file"
	done

	echo "Installation complete!"
}

download_files

install_libs

extract_binutils
configure_binutils
build_binutils
install_binutils

extract_gcc
patch_gcc
configure_gcc
build_gcc
install_gcc

final_tweaks




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]