V3 PATCH: mkcheck.in and tests_flags.in

Gabriel Dos Reis gdr@codesourcery.com
Fri Jan 19 17:02:00 GMT 2001


I sort of needed to clean up the mess I put in tests_flags.in.
The forthcoming new style DejaGnu based V3 testsuite relies on this
patch.

Tested on i686-pc-linux-gnu

-- Gaby
CodeSourcery, LLC            http://www.codesourcery.com
     http://www.codesourcery.com/gcc-compile.shtml

2001-01-20  Gabriel Dos Reis  <gdr@codesourcery.com>

	* tests_flags.in: Just output the bare minimum to run tests.
	Let's the caller do its own arrangement.

	* mkcheck.in: Rename INC_PATH to INCLUDES.  Adjust flags
	computations.

Index: mkcheck.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/mkcheck.in,v
retrieving revision 1.46
diff -p -r1.46 mkcheck.in
*** mkcheck.in	2001/01/18 07:23:04	1.46
--- mkcheck.in	2001/01/20 00:49:55
*************** esac
*** 53,61 ****
  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; CXX=$7; CXXFLAGS=$8;
  IFS=$saved_ifs
  
  # specific libtool flag(s) to force the use of shared libraries, if any
  SH_FLAG=
  
--- 53,70 ----
  saved_ifs=$IFS
  IFS=':'
  set `./tests_flags ${query} $*` || exit 1
! BUILD_DIR=$1; SRC_DIR=$2; PREFIX_DIR=$3; CXX=$4; CXXFLAGS=$5; INCLUDES=$6; LIBS=$7;
  IFS=$saved_ifs
  
+ # Build libtoolized surrogates to compile and run testcases.  Also,
+ # adjust CXX so that the newly built compiler can find headers.
+ if [ x$WHICH = x0 ] ; then
+     CXX="$CXX -B`dirname $CXX`/"
+ fi
+ LIBTOOL="$BUILD_DIR/libtool"
+ LTEXE="$LIBTOOL --mode=execute"
+ LTCXX="$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $INCLUDES $LIBS"
+ 
  # specific libtool flag(s) to force the use of shared libraries, if any
  SH_FLAG=
  
*************** test_file()
*** 310,316 ****
      # and harder as we try compiling at, say, top of the hour; we would
      # eventually have to calculate time_t anyhow.  Or 3) just grab two
      # time_t's (no more overhead than grabbing two date(1)'s).
!     compiler_invocation="$LTCXX $S_FLAG $SRC_NAME -o $EXENAME $LIBS"
      COMP_TIME_START=$($TIMER_COMMAND)
      $compiler_invocation >> compile.out 2>&1
      COMP_TIME_END=$($TIMER_COMMAND)
--- 319,325 ----
      # and harder as we try compiling at, say, top of the hour; we would
      # eventually have to calculate time_t anyhow.  Or 3) just grab two
      # time_t's (no more overhead than grabbing two date(1)'s).
!     compiler_invocation="$LTCXX $S_FLAG $SRC_NAME -o $EXENAME"
      COMP_TIME_START=$($TIMER_COMMAND)
      $compiler_invocation >> compile.out 2>&1
      COMP_TIME_END=$($TIMER_COMMAND)
Index: tests_flags.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/tests_flags.in,v
retrieving revision 1.8
diff -p -r1.8 tests_flags.in
*** tests_flags.in	2001/01/10 02:48:08	1.8
--- tests_flags.in	2001/01/20 00:49:55
***************
*** 3,10 ****
  #
  # 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>
  #
--- 3,10 ----
  #
  # This script computes the various flags needed to run GNU C++ testsuites
  # (compiler specific as well as library specific).  It is based on 
! # 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>
  #
***************
*** 21,36 ****
  #     
  #      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:CXXFLAGS 
  #      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
- #	 CXX         which C++ compiler is being used
- #        CXXFLAGS    special C++ flags used
  #
  
  ##
--- 21,35 ----
  #     
  #      Returns a colon-separated list of space-separated list of flags,
  #      needed to run library specific tests,
! #      BUILD_DIR:SRC_DIR:PREFIX_DIR:CXX:CXXFLAGS:INCLUDES:LIBS 
  #      the meaning of which is as follows:
  #        BUILD_DIR   build-dir
  #        SRC_DIR     src-dir
  #        PREFIX_DIR  install-dir (meaningful only with --installed-library)
! #        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
  #
  
  ##
*************** case ${query} in
*** 97,127 ****
      ;;
  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
--- 96,121 ----
      ;;
  esac
  
  # Compute include paths
! # INCLUDES == 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)
!     INCLUDES="-I${SRC_DIR}/testsuite"
      ;;
      *)
!     INCLUDES="-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 appropriate include paths
  case ${query} in
      --compiler)
!     echo ${INCLUDES} -I${SRC_DIR}/include/backward -I${SRC_DIR}/include/ext
      exit 0
      ;;
  esac
*************** esac
*** 130,140 ****
  . ${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
--- 124,134 ----
  . ${top_srcdir}/configure.target
  
  # LIB_PATH == where to find the build libraries for libtool's use
! # CXX == the full pathname of the compiler
  case ${query} in
      --built-library)
      LIB_PATH=${BUILD_DIR}/src
!     CXX="${BUILD_DIR}/../../gcc/g++"
      ;;
      --installed-library)
      LIB_PATH=${PREFIX_DIR}/lib
*************** esac
*** 146,175 ****
  # but thst's really meant for building the library itself, not using it)
  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)
  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"
      case @target_os@ in
!         *cygwin*)  LIBS="-nodefaultlibs -lgcc -lcygwin -luser32
                           -lkernel32 -ladvapi32 -lshell32" ;;
!         *)         LIBS="-nodefaultlibs -lc -lgcc -lc" ;;
      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=
      ;;
  esac
  
! echo ${BUILD_DIR}:${SRC_DIR}:${PREFIX_DIR}:${LTCXX}:${LIBS}:${LTEXE}:${CXX}:${CXXFLAGS}
  exit 0
--- 140,161 ----
  # but thst's really meant for building the library itself, not using it)
  CXXFLAGS="-ggdb3 -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
  
  # LIBS == any extra needed -l switches, etc (may need more libs, lose lose)
  case ${query} in
      --built-library)
!     LIBS="${LIB_PATH}/../libsupc++/libsupc++.la ${LIB_PATH}/libstdc++.la
! 	    -no-install"
      case @target_os@ in
!         *cygwin*)  LIBS="${LIBS} -nodefaultlibs -lgcc -lcygwin -luser32
                           -lkernel32 -ladvapi32 -lshell32" ;;
!         *)         LIBS="${LIBS} -nodefaultlibs -lc -lgcc -lc" ;;
      esac
      ;;
      --installed-library)
!     LIBS="-L${LIB_PATH} ${LIB_PATH}/libstdc++.la -no-install
! 	    -rpath ${LIB_PATH}"
      ;;
  esac
  
! echo -n ${BUILD_DIR}:${SRC_DIR}:${PREFIX_DIR}:${CXX}:${CXXFLAGS}:${INCLUDES}:${LIBS}
  exit 0




More information about the Libstdc++ mailing list