#! /bin/sh
if test -f site.exp; then
echo site.exp already exists >&2
exit 1
fi
while true; do
case "$1" in
--with-testsuite=*) testsuite=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--srcdir=*) srcdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--prefix=*) prefix=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--with-gcc=*) GCC_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--with-g++=*) GXX_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--with-g77=*) G77_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--without-gcc) GCC_UNDER_TEST=no; shift;;
--without-g++) GXX_UNDER_TEST=no; shift;;
--without-g77) G77_UNDER_TEST=no; shift;;
--without-objc) OBJC_UNDER_TEST=no; shift;;
--tmpdir=*) tmpdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--help) cat <<\EOF
Runs the testsuite for an installed version of gcc/g++/g77/objc
Copyright (C) 1998 Free Software Foundation
by Alexandre Oliva <oliva@dcc.unicamp.br>
Supported arguments:
--help prints this page
--with-testsuite=/some/dir/gcc/testsuite specify the testsuite directory
--srcdir=/some/dir same as --with-testsuite=/some/dir/gcc/testsuite
[deduced from shell-script pathname]
--prefix=/some/dir use gcc, g++ and g77 from /some/dir/bin [PATH]
--with-gcc=/some/dir/bin/gcc use specified gcc program [gcc]
--with-g++=/some/dir/bin/g++ use specified g++ program [g++]
--with-g77=/some/dir/bin/g77 use specified g77 program [g77]
--without-gcc do not run gcc testsuite
--without-g++ do not run g++ testsuite
--without-g77 do not run g77 testsuite
--without-objc do not run objc testsuite
--tmpdir=/some/dir create temporaries and leave failed programs
at specified directory [.]
-- end of argument list; following arguments are passed to runtest
EOF
exit
;;
--) shift; break;;
*) break;;
esac
done
if test x"${testsuite+set}" != x"set" && test x"${srcdir+set}" != x"set"; then
file=$0
while [ -h $file ]; do
file=`ls -l $file | sed s/'.* -> '//`
done
srcdir=`CDPATH=. && cd \`echo "$file" | sed 's,/*[^/]*$,,;s,^$,.,'\`/.. >/dev/null && ${PWDCMD-pwd}`
fi
cat >site.exp <<EOF
set rootme "."
set tmpdir "${tmpdir-`${PWDCMD-pwd}`}"
set srcdir "${testsuite-${srcdir}/gcc/testsuite}"
set CFLAGS ""
set CXXFLAGS ""
set GCC_UNDER_TEST "${GCC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}"
set GXX_UNDER_TEST "${GXX_UNDER_TEST-${prefix}${prefix+/bin/}g++}"
set G77_UNDER_TEST "${G77_UNDER_TEST-${prefix}${prefix+/bin/}g77}"
set OBJC_UNDER_TEST "${OBJC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}"
EOF
test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"}
test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"}
test x"${G77_UNDER_TEST}" = x"no" || runtest --tool g77 ${1+"$@"}
test x"${OBJC_UNDER_TEST}" = x"no" || runtest --tool objc ${1+"$@"}
exit 0