cc-with-tweaks.exp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright 2013-2022 Free Software Foundation, Inc.
  2. # This program is free software; you can redistribute it and/or modify
  3. # it under the terms of the GNU General Public License as published by
  4. # the Free Software Foundation; either version 3 of the License, or
  5. # (at your option) any later version.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. # This file is a dejagnu "board file" and is used to run the testsuite
  15. # with contrib/cc-with-tweaks.sh.
  16. #
  17. # NOTE: If using dwz, We assume it is in $PATH.
  18. #
  19. # Example usage:
  20. # bash$ cd $objdir/gdb
  21. # bash$ make check \
  22. # RUNTESTFLAGS='--target_board=cc-with-tweaks' \
  23. # CC_WITH_TWEAKS_FLAGS='-z'
  24. #
  25. # Note: this does not work from $objdir with make check-gdb because
  26. # CC_WITH_TWEAKS_FLAGS is not passed down from the top level Makefile.
  27. #
  28. # The default value of CC_WITH_TWEAKS_FLAGS is "".
  29. if ![info exists CC_WITH_TWEAKS_FLAGS] {
  30. set CC_WITH_TWEAKS_FLAGS ""
  31. }
  32. # This is needed otherwise dejagnu tries to rsh to host "cc-with-tweaks".
  33. load_board_description "local-board"
  34. # This is based on baseboards/unix.exp.
  35. # At the moment we only support systems that unix.exp supports.
  36. load_generic_config "unix"
  37. process_multilib_options ""
  38. set found_gcc [find_gcc]
  39. set found_gxx [find_g++]
  40. set found_gnatmake [find_gnatmake]
  41. set found_f90 [find_gfortran]
  42. set found_f77 [find_g77]
  43. set_board_info compiler "$found_gcc"
  44. set contrib_dir [file normalize $srcdir/../contrib]
  45. if ![info exists CC_FOR_TARGET] {
  46. set CC_FOR_TARGET "$found_gcc"
  47. }
  48. set CC_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh $CC_WITH_TWEAKS_FLAGS $CC_FOR_TARGET"
  49. if ![info exists CXX_FOR_TARGET] {
  50. set CXX_FOR_TARGET "$found_gxx"
  51. }
  52. set CXX_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh $CC_WITH_TWEAKS_FLAGS $CXX_FOR_TARGET"
  53. if ![info exists GNATMAKE_FOR_TARGET] {
  54. set GNATMAKE_FOR_TARGET "$found_gnatmake"
  55. }
  56. set GNATMAKE_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh $CC_WITH_TWEAKS_FLAGS $GNATMAKE_FOR_TARGET"
  57. if ![info exists F90_FOR_TARGET] {
  58. set F90_FOR_TARGET "$found_f90"
  59. }
  60. set F90_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh $CC_WITH_TWEAKS_FLAGS $F90_FOR_TARGET"
  61. if ![info exists F77_FOR_TARGET] {
  62. set F77_FOR_TARGET "$found_f77"
  63. }
  64. set F77_FOR_TARGET "$contrib_dir/cc-with-tweaks.sh $CC_WITH_TWEAKS_FLAGS $F77_FOR_TARGET"
  65. set env(GDB) \
  66. [cached_file gdb.sh "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS \"\$@\"" 1]