| 1 | 306 | jeremybenn | #   Copyright (C) 2004, 2007 Free Software Foundation, Inc.
 | 
      
         | 2 |  |  |  
 | 
      
         | 3 |  |  | # This program is free software; you can redistribute it and/or modify
 | 
      
         | 4 |  |  | # it under the terms of the GNU General Public License as published by
 | 
      
         | 5 |  |  | # the Free Software Foundation; either version 3 of the License, or
 | 
      
         | 6 |  |  | # (at your option) any later version.
 | 
      
         | 7 |  |  | #
 | 
      
         | 8 |  |  | # This program is distributed in the hope that it will be useful,
 | 
      
         | 9 |  |  | # but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
      
         | 10 |  |  | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
      
         | 11 |  |  | # GNU General Public License for more details.
 | 
      
         | 12 |  |  | #
 | 
      
         | 13 |  |  | # You should have received a copy of the GNU General Public License
 | 
      
         | 14 |  |  | # along with GCC; see the file COPYING3.  If not see
 | 
      
         | 15 |  |  | # .
 | 
      
         | 16 |  |  |  
 | 
      
         | 17 |  |  | # This file contains GCC-specifics for status wrappers for test programs.
 | 
      
         | 18 |  |  |  
 | 
      
         | 19 |  |  | # ${tool}_maybe_build_wrapper -- Build wrapper object if the target
 | 
      
         | 20 |  |  | # needs it.  FILENAME is the path to the wrapper file.  If there are
 | 
      
         | 21 |  |  | # additional arguments, they are command-line options to provide to
 | 
      
         | 22 |  |  | # the compiler when compiling FILENAME.
 | 
      
         | 23 |  |  |  
 | 
      
         | 24 |  |  | proc ${tool}_maybe_build_wrapper { filename args } {
 | 
      
         | 25 |  |  |     global gluefile wrap_flags
 | 
      
         | 26 |  |  |  
 | 
      
         | 27 |  |  |     if { [target_info needs_status_wrapper] != "" \
 | 
      
         | 28 |  |  |          && [target_info needs_status_wrapper] != "0" \
 | 
      
         | 29 |  |  |          && ![info exists gluefile] } {
 | 
      
         | 30 |  |  |         set_ld_library_path_env_vars
 | 
      
         | 31 |  |  |         set saved_wrap_compile_flags [target_info wrap_compile_flags]
 | 
      
         | 32 |  |  |         set flags [join $args " "]
 | 
      
         | 33 |  |  |         # The wrapper code may contain code that gcc objects on.  This
 | 
      
         | 34 |  |  |         # became true for dejagnu-1.4.4.  The set of warnings and code
 | 
      
         | 35 |  |  |         # that gcc objects on may change, so just make sure -w is always
 | 
      
         | 36 |  |  |         # passed to turn off all warnings.
 | 
      
         | 37 |  |  |         set_currtarget_info wrap_compile_flags \
 | 
      
         | 38 |  |  |             "$saved_wrap_compile_flags -w $flags"
 | 
      
         | 39 |  |  |         set result [build_wrapper $filename]
 | 
      
         | 40 |  |  |         set_currtarget_info wrap_compile_flags "$saved_wrap_compile_flags"
 | 
      
         | 41 |  |  |         if { $result != "" } {
 | 
      
         | 42 |  |  |             set gluefile [lindex $result 0]
 | 
      
         | 43 |  |  |             set wrap_flags [lindex $result 1]
 | 
      
         | 44 |  |  |         }
 | 
      
         | 45 |  |  |     }
 | 
      
         | 46 |  |  | }
 |