OSDN Git Service

2003-07-04 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / scripts / testsuite_flags.in
1 #!/bin/sh
2
3 #
4 # This script computes the various flags needed to run GNU C++ testsuites
5 # (compiler specific as well as library specific). 
6 #
7 # Written by Benjamin Kosnik <bkoz@redhat.com>
8 #            Gabriel Dos Reis <gdr@codesourcery.com>
9 #
10
11 # Print a message saying how this script is intended to be invoked
12 print_usage() {
13     cat <<EOF
14 Usage: 
15     testsuite_flags --install-includes
16                     --build-includes
17                     --build-cxx
18                     --install-cxx
19                     --cxxflags
20 EOF
21 }
22
23 # Establish configure-generated directory structure.
24 BUILD_DIR=@glibcxx_builddir@
25 SRC_DIR=@glibcxx_srcdir@
26 PREFIX_DIR=@glibcxx_prefixdir@
27 query=$1
28
29 case ${query} in
30     --install-includes)
31       INCLUDES="-I${SRC_DIR}/testsuite"
32       echo ${INCLUDES}
33       ;;
34     --build-includes)
35       INCLUDES="-nostdinc++ @GLIBCXX_INCLUDES@
36                 -I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio 
37                 -I${SRC_DIR}/include/backward 
38                 -I${SRC_DIR}/testsuite"
39       echo ${INCLUDES}
40       ;;
41     --install-cxx)
42       CXX=${PREFIX_DIR}/bin/g++
43       echo ${CXX}
44       ;;
45     --build-cxx)
46       PCHFLAGS="@glibcxx_PCHFLAGS@"
47       CXX_build="@glibcxx_CXX@ ${PCHFLAGS}"
48       CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'`
49       echo ${CXX}
50       ;;
51     --cxxflags)
52       CXXFLAGS_save="-g -O2"
53       CXXFLAGS_config='@SECTION_FLAGS@ @SECTION_LDFLAGS@ -fmessage-length=0 
54                       @EXTRA_CXX_FLAGS@ -DLOCALEDIR="@glibcxx_localedir@" '
55       echo ${CXXFLAGS_save} ${CXXFLAGS_config}
56       ;;
57     *)
58       print_usage
59       ;;
60 esac
61
62 exit 0