#!/bin/sh
# Build tools for testing GCC.
-# Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2009
+# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
# INPUT:
# btest <target> <source> <prefix> <state> <build>
-# TARGET is the target triplet. It should be the same one
-# as used in constructing PREFIX.
+# TARGET is the target triplet. It should be the same one as used in
+# constructing PREFIX. Or it can be the keyword 'native', indicating
+# a target of whatever platform the script is running on.
TARGET=$1
# SOURCE is the directory containing the toplevel configure.
SOURCE=$2
then
make all-gdb all-dejagnu all-ld || exit 1
make install-gdb install-dejagnu install-ld || exit 1
+elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
else
make || exit 1
make install || exit 1
fi
-mkdir -p $PREFIX/share/gdb-testsuite || exit 1
-cd $SOURCE/gdb/testsuite || exit 1
-find . -print | cpio -pdmu $PREFIX/share/gdb-testsuite || exit 1
-# selftest.exp requires keeping old sources around, which is impractical
-rm $PREFIX/share/gdb-testsuite/gdb.base/selftest.exp
-# these tests seem to be broken and randomly failing
-rm -r $PREFIX/share/gdb-testsuite/gdb.mi
+if [ -x $PREFIX/bin/$TARGET-gdb ] ; then
+ mkdir -p $PREFIX/share/gdb-testsuite || exit 1
+ cd $SOURCE/gdb/testsuite || exit 1
+ find . -print | cpio -pdmu $PREFIX/share/gdb-testsuite || exit 1
+ # selftest.exp requires keeping old sources around, which is impractical
+ rm $PREFIX/share/gdb-testsuite/gdb.base/selftest.exp
+ # these tests seem to be broken and randomly failing
+ rm -r $PREFIX/share/gdb-testsuite/gdb.mi
+fi
echo pass > $RESULT
exit 0