OSDN Git Service

* objs-gcc.sh: Set up the GDB testsuite even if the gdb installed
[pf3gnuchains/gcc-fork.git] / contrib / regression / objs-gcc.sh
index 839fcff..9099850 100755 (executable)
 
 #  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
+#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 # 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
@@ -104,18 +105,23 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
  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 -o -x $PREFIX/bin/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