mirror of git://gcc.gnu.org/git/gcc.git
tests_flags.in: New file.
libstdc++-v3:
* tests_flags.in: New file. Split out of ...
* mkcheck.in: ... this. Move flags computation into
tests_flags.in.
* configure.in: Add support for tests_flags.
* confiigure: Regenerate.
gcc/testsuite:
* lib/g++.exp (g++_include_flags): Invoke 'tests_flags --compiler'
instead of 'mkcheck 2'.
From-SVN: r37756
This commit is contained in:
parent
ba188b3d0d
commit
b21218ce2e
|
|
@ -1,3 +1,8 @@
|
|||
2000-11-26 Gabriel Dos Reis <gdr@codesourcery.com>
|
||||
|
||||
* lib/g++.exp (g++_include_flags): Invoke 'tests_flags --compiler'
|
||||
instead of 'mkcheck 2'.
|
||||
|
||||
2000-11-25 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
|
||||
* gcc.c-torture/execute/memcheck/driver.c,
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ proc g++_include_flags { args } {
|
|||
if { ${HAVE_LIBSTDCXX_V3} } {
|
||||
set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
|
||||
set sdir_v3 [lookfor_file ${srcdir} libstdc++-v3]
|
||||
append flags [exec ${odir_v3}/mkcheck 2 ${odir_v3} ${sdir_v3}]
|
||||
append flags [exec ${odir_v3}/tests_flags --compiler ${odir_v3} ${sdir_v3}]
|
||||
} else {
|
||||
set odir_v2 [lookfor_file ${gccpath} libstdc++]
|
||||
set sdir_v2 [lookfor_file ${srcdir} libstdc++]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,11 @@
|
|||
2000-11-26 Gabriel Dos Reis <gdr@codesourcery.com>
|
||||
|
||||
* tests_flags.in: New file. Split out of ...
|
||||
* mkcheck.in: ... this. Move flags computation into
|
||||
tests_flags.in.
|
||||
* configure.in: Add support for tests_flags.
|
||||
* confiigure: Regenerate.
|
||||
|
||||
2000-11-25 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
|
||||
* acinclude.m4: Change C9X references to refer to C99.
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -226,11 +226,12 @@ fi
|
|||
# place. To work around this not being passed down from config-ml.in
|
||||
# -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
|
||||
# append it here.
|
||||
AC_OUTPUT(mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
|
||||
AC_OUTPUT(tests_flags mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
|
||||
[if test -n "$CONFIG_FILES"; then
|
||||
ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
|
||||
grep '^MULTISUBDIR =' Makefile >> src/Makefile
|
||||
fi
|
||||
chmod +x tests_flags
|
||||
chmod +x mkcheck
|
||||
],
|
||||
srcdir=${srcdir}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
# has been enabled.
|
||||
|
||||
# Invocation
|
||||
# mkcheck [012] (path to build) (path to src) (path to install)
|
||||
# mkcheck [01] (path to build) (path to src) (path to install)
|
||||
|
||||
### XXX There are a lot of tests in here for OS-specific stuff. If we
|
||||
### move to a 'configure.target' method of determining those extra
|
||||
|
|
@ -19,70 +19,29 @@
|
|||
### XXX Note that breaking out of this with ^C will not work. Dunno why.
|
||||
|
||||
|
||||
#
|
||||
# 1: variables
|
||||
#
|
||||
# WHICH determines if you are
|
||||
# (0) testing the build binary and headers, or
|
||||
# (1) testing the installed binary and headers, or
|
||||
# (2) testing under dejagnu (just print the standard flags needed).
|
||||
WHICH=$1
|
||||
if [ "$WHICH"x = 0x ] && [ $# -eq 3 ]; then
|
||||
echo "running mkcheck"
|
||||
echo "$0: testing the build directory"
|
||||
query="--built-library"
|
||||
elif [ "$WHICH"x = 1x ] && [ $# -eq 4 ]; then
|
||||
echo "running mkcheck"
|
||||
echo "$0: testing the install directory $4"
|
||||
elif [ "$WHICH"x = 2x ] && [ $# -eq 3 ]; then
|
||||
true
|
||||
query="--installed-library"
|
||||
else
|
||||
echo 'Usage: mkcheck 0 (path to build) (path to src)'
|
||||
echo ' mkcheck 1 (path to build) (path to src) (path to install)'
|
||||
echo ' mkcheck 2 (path to build) (path to src)'
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
BUILD_DIR=$2
|
||||
if [ ! -d "$BUILD_DIR" ]; then
|
||||
echo "build directory $BUILD_DIR not found, exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SRC_DIR=$3
|
||||
if [ ! -d "$SRC_DIR" ]; then
|
||||
echo "source directory $SRC_DIR not found, exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $WHICH -eq 1 ]; then
|
||||
PREFIX_DIR=$4
|
||||
if [ ! -d "$PREFIX_DIR" ]; then
|
||||
echo "install directory $PREFIX_DIR not found, exiting."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# This is LIBTOOL=@LIBTOOL@ piped through a bit of sanity that we can
|
||||
# assume for this script (by the time we run this).
|
||||
LIBTOOL="$BUILD_DIR/libtool"
|
||||
chmod u+x $LIBTOOL
|
||||
|
||||
# INC_PATH == include path to new headers for use on gcc command-line
|
||||
top_srcdir=@top_srcdir@
|
||||
C_DIR="`basename @C_INCLUDE_DIR@`"
|
||||
if [ $WHICH != "1" ]; then
|
||||
INC_PATH="-nostdinc++ @CSHADOW_FLAGS@ -I$BUILD_DIR/include \
|
||||
-I$SRC_DIR/include/std -I$SRC_DIR/include/$C_DIR \
|
||||
-I$SRC_DIR/include -I$SRC_DIR/libsupc++ -I$SRC_DIR/libio \
|
||||
-I$SRC_DIR/testsuite"
|
||||
elif [ $WHICH -eq 1 ]; then
|
||||
INC_PATH="-I$SRC_DIR/testsuite"
|
||||
fi
|
||||
|
||||
if [ $WHICH -eq 2 ]; then
|
||||
echo $INC_PATH -I$SRC_DIR/include/backward -I$SRC_DIR/include/ext
|
||||
exit 0;
|
||||
fi
|
||||
# Now that we've successfully translated the numerical option into
|
||||
# a symbolic one, we can safely ignore it.
|
||||
shift
|
||||
|
||||
# This has been true all along. Found out about it the hard way...
|
||||
case $BASH_VERSION in
|
||||
|
|
@ -90,49 +49,12 @@ case $BASH_VERSION in
|
|||
*) ;; # ??
|
||||
esac
|
||||
|
||||
# It's not dejagnu; we need to do things ourselves. Pick up any extra
|
||||
# settings for this target.
|
||||
. ${top_srcdir}/configure.target
|
||||
|
||||
# LIB_PATH == where to find the build libraries for libtool's use
|
||||
# CXX == how to call the compiler
|
||||
if [ $WHICH -eq 0 ]; then
|
||||
LIB_PATH="$BUILD_DIR/src"
|
||||
CXX="$BUILD_DIR/../../gcc/g++ -B$BUILD_DIR/../../gcc/"
|
||||
elif [ $WHICH -eq 1 ]; then
|
||||
LIB_PATH="$PREFIX_DIR/lib"
|
||||
CXX="$PREFIX_DIR/bin/g++"
|
||||
fi
|
||||
|
||||
# gcc compiler flags (maybe use glibcpp_cxxflags from configure.target,
|
||||
# but thst's really meant for building the library itself, not using it)
|
||||
CXX_FLAG="-ggdb3 -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
|
||||
|
||||
# specific libtool flag(s) to force the use of shared libraries, if any
|
||||
SH_FLAG=""
|
||||
|
||||
# specific libtool flag(s) to force the use of static libraries, if any
|
||||
ST_FLAG="-static"
|
||||
#ST_FLAG="-all-static"
|
||||
|
||||
# LTCXX == how to call libtool when creating an executable
|
||||
# LIBS == any extra needed -l switches, etc (may need more libs, lose lose)
|
||||
if [ $WHICH -eq 0 ]; then
|
||||
LTCXX="$LIBTOOL --tag=CXX --mode=link \
|
||||
$CXX $CXX_FLAG $INC_PATH \
|
||||
$LIB_PATH/../libsupc++/libsupc++.la $LIB_PATH/libstdc++.la \
|
||||
-no-install"
|
||||
LIBS="-nodefaultlibs -lc -lgcc -lc"
|
||||
elif [ $WHICH -eq 1 ]; then
|
||||
# For the installed version, we really only need to use libtool and
|
||||
# the .la file to get correct rpaths.
|
||||
LTCXX="$LIBTOOL --tag=CXX --mode=link \
|
||||
$CXX $CXX_FLAG $INC_PATH -L$LIB_PATH \
|
||||
$LIB_PATH/libstdc++.la -no-install -rpath $LIB_PATH"
|
||||
LIBS=
|
||||
fi
|
||||
# LTEXE == how to call libtool when running an executable
|
||||
LTEXE="$LIBTOOL --mode=execute"
|
||||
# Compute the flags necessary to run the testsuite.
|
||||
saved_ifs=$IFS
|
||||
IFS=':'
|
||||
set `./tests_flags ${query} $*` || exit 1
|
||||
BUILD_DIR=$1; SRC_DIR=$2; PREFIX_DIR=$3; LTCXX=$4; LIBS=$5; LTEXE=$6;
|
||||
IFS=$saved_ifs
|
||||
|
||||
# Set up the testing directory, which should be in a directory called
|
||||
# "testsuite" in the root level of the build directory.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,177 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# This script computes the various flags needed to run GNU C++ testsuites
|
||||
# (compiler specific as well as library specific). It is based on
|
||||
# the ./mkcheck.in, which in the long will be removed in favor of a
|
||||
# DejaGnu-base framework.
|
||||
#
|
||||
# Written by Gabriel Dos Reis <gdr@codesourcery.com>
|
||||
#
|
||||
|
||||
#
|
||||
# Synopsis
|
||||
# * tests_flags --compiler build-dir src-dir
|
||||
#
|
||||
# Returns a space-separated list of flags needed to run front-end
|
||||
# specific tests.
|
||||
#
|
||||
# * tests_flags --built-library build-dir src-dir
|
||||
# * tests_flags --installed-library build-dir src-dir install-dir
|
||||
#
|
||||
# Returns a colon-separated list of space-separated list of flags,
|
||||
# needed to run library specific tests,
|
||||
# BUILD_DIR:SRC_DIR:PREFIX_DIR:LTCXX:LIBS:LTEXE the meaning of which
|
||||
# is as follows:
|
||||
# BUILD_DIR build-dir
|
||||
# SRC_DIR src-dir
|
||||
# PREFIX_DIR install-dir (meaningful only with --installed-library)
|
||||
# LTCXX libtoolized command to compile a C++ program
|
||||
# LIBS flags to pass to the linker
|
||||
# LTEXE libtoolized command to run a compiled C++ program
|
||||
#
|
||||
|
||||
|
||||
##
|
||||
## Utility functions
|
||||
##
|
||||
|
||||
# Print a message saying how this script is intended to be invoked
|
||||
print_usage() {
|
||||
cat <<EOF
|
||||
Usage:
|
||||
tests_fags --compiler <build-dir> <src-dir>
|
||||
--built-library <build-dir> <src-dir>
|
||||
--installed-library <build-dir> <src-dir> <install-dir>
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check for command line option
|
||||
check_options() {
|
||||
# First, check for number of command line arguments
|
||||
if [ \( $1 -ne 3 \) -a \( $1 -ne 4 \) ]; then
|
||||
print_usage;
|
||||
fi
|
||||
|
||||
# Then, see if we understand the job we're asked for
|
||||
case $2 in
|
||||
--compiler|--built-library|--installed-library)
|
||||
# OK
|
||||
;;
|
||||
*)
|
||||
print_usage
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Directory sanity check
|
||||
check_directory() {
|
||||
if [ ! $2 ]; then
|
||||
echo "$1 '$2' directory not found, exiting."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
##
|
||||
## Main processing
|
||||
##
|
||||
|
||||
# Command line options sanity check
|
||||
check_options $# $1
|
||||
|
||||
query=$1
|
||||
|
||||
# Check for build, source and install directories
|
||||
BUILD_DIR=$2; SRC_DIR=$3
|
||||
check_directory 'Build' ${BUILD_DIR}
|
||||
check_directory 'Source' ${SRC_DIR}
|
||||
case ${query} in
|
||||
--installed-library)
|
||||
PREFIX_DIR=$4
|
||||
check_directory 'Install' ${PREFIX_FIR}
|
||||
;;
|
||||
*)
|
||||
PREFIX_DIR=
|
||||
;;
|
||||
esac
|
||||
|
||||
# This is LIBTOOL=@LIBTOOL@ piped through a bit of sanity that we can
|
||||
# assume for this script (by the time we run this).
|
||||
LIBTOOL="${BUILD_DIR}/libtool"
|
||||
chmod u+x ${LIBTOOL}
|
||||
|
||||
# Compute include paths
|
||||
# INC_PATH == include path to new headers for use on gcc command-line
|
||||
top_srcdir=@top_srcdir@
|
||||
C_DIR="`basename @C_INCLUDE_DIR@`"
|
||||
case ${query} in
|
||||
--installed-library)
|
||||
INC_PATH="-I${SRC_DIR}/testsuite"
|
||||
;;
|
||||
*)
|
||||
INC_PATH="-nostdinc++ @CSHADOW_FLAGS@ -I${BUILD_DIR}/include
|
||||
-I${SRC_DIR}/include/std -I${SRC_DIR}/include/$C_DIR
|
||||
-I${SRC_DIR}/include -I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio
|
||||
-I${SRC_DIR}/testsuite"
|
||||
;;
|
||||
esac
|
||||
|
||||
# If called for compiler tests, just output include paths
|
||||
case ${query} in
|
||||
--compiler)
|
||||
echo ${INC_PATH} -I${SRC_DIR}/include/backward -I${SRC_DIR}/include/ext
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# For built or installed libraries, we need to get right OS-specific bits.
|
||||
. ${top_srcdir}/configure.target
|
||||
|
||||
# LIB_PATH == where to find the build libraries for libtool's use
|
||||
# CXX == how to call the compiler
|
||||
case ${query} in
|
||||
--built-library)
|
||||
LIB_PATH=${BUILD_DIR}/src
|
||||
CXX="${BUILD_DIR}/../../gcc/g++ -B${BUILD_DIR}/../../gcc/"
|
||||
;;
|
||||
--installed-library)
|
||||
LIB_PATH=${PREFIX_DIR}/lib
|
||||
CXX=${PREFIX_DIR}/bin/g++
|
||||
;;
|
||||
esac
|
||||
|
||||
# gcc compiler flags (maybe use glibcpp_cxxflags from configure.target,
|
||||
# but thst's really meant for building the library itself, not using it)
|
||||
CXXFLAGS="-ggdb3 -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
|
||||
|
||||
# specific libtool flag(s) to force the use of shared libraries, if any
|
||||
SH_FLAGS=
|
||||
|
||||
# specific libtool flag(s) to force the use of static libraries, if any
|
||||
ST_FLAGS="-static"
|
||||
#ST_FLAGS="-all-static"
|
||||
|
||||
# LTCXX == how to call libtool when creating an executable
|
||||
# LIBS == any extra needed -l switches, etc (may need more libs, lose lose)
|
||||
case ${query} in
|
||||
--built-library)
|
||||
LTCXX="${LIBTOOL} --tag=CXX --mode=link ${CXX} ${CXX_FLAG} ${INC_PATH}
|
||||
${LIB_PATH}/../libsupc++/libsupc++.la ${LIB_PATH}/libstdc++.la
|
||||
-no-install"
|
||||
LTEXE="${LIBTOOL} --mode=execute"
|
||||
LIBS="-nodefaultlibs -lc -lgcc -lc"
|
||||
;;
|
||||
--installed-library)
|
||||
# For the installed version, we really only need to use libtool and
|
||||
# the .la file to get correct rpaths.
|
||||
LTCXX="${LIBTOOL} --tag=CXX --mode=link ${CXX} ${CXX_FLAG} ${INC_PATH}
|
||||
-L${LIB_PATH} ${LIB_PATH}/libstdc++.la -no-install
|
||||
-rpath ${LIB_PATH}"
|
||||
LTEXE="${LIBTOOL} --mode=execute"
|
||||
LIBS=
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ${BUILD_DIR}:${SRC_DIR}:${PREFIX_DIR}:${LTCXX}:${LIBS}:${LTEXE}
|
||||
exit 0
|
||||
Loading…
Reference in New Issue