Okay, now I'm really frustrated. I've been working on a little script
to do combined builds. It's been succeeding at the build & install
(sort of). But suddenly, when I try it today, I get a bunch of syntax
errors in libiberty:
/Users/rmann/Desktop/gcconepass/build/./gcc/xgcc -B/Users/rmann/
Desktop/gcconepass/build/./gcc/ -B/usr/local/xscale-gcc-test/xscale-
elf/bin/ -B/usr/local/xscale-gcc-test/xscale-elf/lib/ -isystem /usr/
local/xscale-gcc-test/xscale-elf/include -isystem /usr/local/xscale-
gcc-test/xscale-elf/sys-include -L/Users/rmann/Desktop/gcconepass/
build/./ld -c -DHAVE_CONFIG_H -O2 -g -O2 -I. -I../../../combined/
libiberty/../include -W -Wall -pedantic -Wwrite-strings -Wstrict-
prototypes -Wc++-compat ../../../combined/libiberty/regex.c -o regex.o
../../../combined/libiberty/regex.c:51:25: error: sys/types.h: No such
file or directory
../../../combined/libiberty/regex.c:130: warning: function declaration
isn't a prototype
../../../combined/libiberty/regex.c:130: warning: conflicting types
for built-in function 'malloc'
../../../combined/libiberty/regex.c:131: warning: function declaration
isn't a prototype
../../../combined/libiberty/regex.c:158:25: error: strings.h: No such
file or directory
In file included from ../../../combined/libiberty/../include/xregex.h:
26,
from ../../../combined/libiberty/regex.c:193:
Sigh. I've started from scratch. Here's my script. I'm at my wits' end
with gcc, and I really need to get past all this mess. Any suggestions
would be greatly appreciated.
#!/bin/sh -x
gPrefix=/usr/local/xscale-gcc-test
# Get the user's password for sudoing...
gSaveStty=`stty -g`
stty -echo
read -p "sudo password (for installation step): " password
stty $gSaveStty
#set +o xtrace
gStartMsg="Start time: $(date)"
# Remove dirs from before...
echo "Removing dirs from last build
========================================="
rm -rf combined build
#rm -rf binutils-2.17 newlib-1.15 gcc-4.2.1
if [ ! -d binutils-2.17 ]; then
tar -jxf binutils-2.17.tar.bz2
fi
if [ ! -d newlib-1.15.0 ]; then
tar -zxf newlib-1.15.0.tar.gz
fi
if [ ! -d gcc-4.2.1 ]; then
tar -jxf gcc-4.2.1.tar.bz2
fi
# Create the combined dir...
mkdir combined
cd combined
ln -s ../gcc-4.2.1/* .
ln -s ../binutils-2.17/* . > /dev/null 2>&1
ln -s ../newlib-1.15/* . > /dev/null 2>&1
cd ..
mkdir build
cd build
../combined/configure --prefix=$gPrefix --target=xscale-elf --enable-
languages=c,c++ --disable-nls --with-newlib --disable-libssp
#--disable-newlib-supplied-syscalls
# Remove some files that choke on Mac OS X (not sure even what they
are, but
# they don't appear to be necessary)...
rm ../combined/gprof/*.m
# Build it...
echo "Running make ========================================="
make
err=$?
# Install it...
if [ $err -eq 0 ]; then
echo "Running make install ========================================="
echo "$password" | sudo -S rm -rf $gPrefix
echo "$password" | sudo -S make install
err=$?
fi
if [ $err -eq 0 ]; then
else
echo "Build failed, exiting"
exit $err
fi