OSDN Git Service

* Makefile.in (install-headers): Remove redundant dependency.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / tests_flags.in
index 4fc3bdf..9377844 100644 (file)
@@ -3,8 +3,8 @@
 #
 # 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.
+# the file ./mkcheck.in, which in the long will be removed in favor of a
+# DejaGnu-based framework.
 #
 # Written by Gabriel Dos Reis <gdr@codesourcery.com>
 #
 #     
 #      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:CXX:CXXFLAG
+#      BUILD_DIR:SRC_DIR:PREFIX_DIR:CXX:CXXFLAGS:INCLUDES:LIB
 #      the meaning of which is as follows:
-#        BUILD_DIR   build-dir
-#        SRC_DIR     src-dir
+#        BUILD_DIR   libstdc++-v3 build-dir
+#        SRC_DIR     libstdc++-v3 src-dir
 #        PREFIX_DIR  install-dir (meaningful only with --installed-library)
-#        LTCXX       libtoolized command to compile a C++ program
+#        CXX         which C++ compiler is being used
+#        CXXFLAGS    special flags to pass to g++
+#        INCLUDES    paths to headers
 #        LIBS        flags to pass to the linker
-#        LTEXE       libtoolized command to run a compiled C++ program
-#       CXX         which C++ compiler is being used
-#        CXXFLAGS    special C++ flags used
 #
 
 ##
@@ -57,7 +56,7 @@ check_options() {
     
     # Then, see if we understand the job we're asked for
     case $2 in
-       --compiler|--built-library|--installed-library)
+       --compiler | --built-library | --installed-library)
        # OK
        ;;
        *) 
@@ -89,87 +88,81 @@ check_directory 'Build' ${BUILD_DIR}
 check_directory 'Source' ${SRC_DIR}
 case ${query} in
     --installed-library)
-    PREFIX_DIR=$4
-    check_directory 'Install' ${PREFIX_DIR}
-    ;;
+      PREFIX_DIR=$4
+      check_directory 'Install' ${PREFIX_DIR}
+      ;;
     *)
-    PREFIX_DIR=
-    ;;
+      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@
+# INCLUDES == include path to new headers for use on gcc command-line
 C_DIR="`basename  @C_INCLUDE_DIR@`"
 case ${query} in
     --installed-library)
-    INC_PATH="-I${SRC_DIR}/testsuite"
-    ;;
+      INCLUDES="-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"
-    ;;
+      INCLUDES="-nostdinc++ -I${BUILD_DIR}/include -I${SRC_DIR}/include
+                -I${SRC_DIR}/include/std  -I${SRC_DIR}/include/$C_DIR
+               -I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio 
+               -I${SRC_DIR}/testsuite"
+      if test x@xcompiling@ = x1; then
+        INCLUDES="${INCLUDES} -I${SRC_DIR}/../newlib/libc/include"
+      fi
+      ;;
 esac
 
-# If called for compiler tests, just output include paths
+# If called for compiler tests, just output appropriate include paths
 case ${query} in
     --compiler)
-    echo ${INC_PATH} -I${SRC_DIR}/include/backward -I${SRC_DIR}/include/ext
-    exit 0
-    ;;
+      echo ${INCLUDES} -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
+. ${SRC_DIR}/configure.target
 
-# LIB_PATH == where to find the build libraries for libtool's use
-# CXX == how to call the compiler
+# LIB_PATH == where to find the C++ build libraries for libtool's use
+# GCC_LIB_PATH == where to find the gcc build libraries for libtool's use
+# CXX == how to invoke the compiler
 case ${query} in
     --built-library)
-    LIB_PATH=${BUILD_DIR}/src
-    CXX="${BUILD_DIR}/../../gcc/g++ -B${BUILD_DIR}/../../gcc/"
-    ;;
+      LIB_PATH=${BUILD_DIR}/src
+      GCC_LIB_PATH=${BUILD_DIR}/../../gcc
+      CXX='@glibcpp_CXX@'
+      ;;
     --installed-library)
-    LIB_PATH=${PREFIX_DIR}/lib
-    CXX=${PREFIX_DIR}/bin/g++
-    ;;
+      LIB_PATH=${PREFIX_DIR}/lib
+      GCC_LIB_PATH=
+      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 == run the testsuite with any special configuration
+# flags from the library build.
 CXXFLAGS="-ggdb3 -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
 
-# LTCXX == how to call libtool when creating an executable
-# LIBS == any extra needed -l switches, etc (may need more libs, lose lose)
+# LIBS == any extra may needed -L switches
 case ${query} in
     --built-library)
-    LTCXX="${LIBTOOL} --tag=CXX --mode=link ${CXX} ${CXXFLAGS} ${INC_PATH} 
-          ${LIB_PATH}/../libsupc++/libsupc++.la  ${LIB_PATH}/libstdc++.la
-          -no-install"
-    LTEXE="${LIBTOOL} --mode=execute"
+      LIBS="${LIB_PATH}/libstdc++.la -no-install -rpath ${GCC_LIB_PATH}"
     case @target_os@ in
-        *cygwin*)  LIBS="-nodefaultlibs -lgcc -lcygwin -luser32
-                         -lkernel32 -ladvapi32 -lshell32" ;;
-        *)         LIBS="-nodefaultlibs -lc -lgcc -lc" ;;
+        *cygwin*)  
+         LIBS="${LIBS} -nodefaultlibs -lgcc -lcygwin -luser32
+                -lkernel32 -ladvapi32 -lshell32" 
+         ;;
+        *)         
+         LIBS="${LIBS} -nodefaultlibs -lgcc -lc -lgcc" 
+         ;;
     esac
     ;;
     --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} ${CXXFLAGS} ${INC_PATH}
-          -L${LIB_PATH} ${LIB_PATH}/libstdc++.la -no-install 
-          -rpath ${LIB_PATH}"
-    LTEXE="${LIBTOOL} --mode=execute"
-    LIBS=
-    ;;
+       LIBS="${LIB_PATH}/libstdc++.la -no-install -rpath ${LIB_PATH}"
+       ;;
 esac
 
-echo ${BUILD_DIR}:${SRC_DIR}:${PREFIX_DIR}:${LTCXX}:${LIBS}:${LTEXE}:${CXX}:${CXXFLAGS}
+echo ${BUILD_DIR}:${SRC_DIR}:${PREFIX_DIR}:${CXX}:${CXXFLAGS}:${INCLUDES}:${LIBS}
 exit 0