OSDN Git Service

2009-01-15 Chris Fairles <cfairles@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / lib / libstdc++.exp
1 # libstdc++ "tool init file" for DejaGNU
2
3 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4 # Free Software Foundation, Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20
21
22 # Define callbacks and load other libraries.  This file is loaded relatively
23 # early, and before any other file we write ourselves.  "load_lib" will
24 # find anything in the DejaGNU installation tree, or in our lib directory.
25 # "load_gcc_lib" will search the core compiler's .exp collection instead.
26 #
27 # The naming rule is that dg.exp looks for "tool-" and runtest.exp looks
28 # for "tool_" when finding callbacks.  Utility routines we define for
29 # our callbacks begin with "v3-".
30 #
31 # libstdc++_* callbacks we don't define, but could:
32 # ..._option_help           prints additional --help output
33 # ..._option_proc (--foo)   process our own options
34 # ..._init (normal.exp)     called once per test file
35 # ..._finish                bracketing function for libstdc++_init
36 # ...-dg-prune              removing output text, see top of system dg.exp
37 #
38 # Useful hook:  if ${hostname}_init exists, it will be called, almost
39 # the last thing before testing begins.  This can be defined in, e.g.,
40 # ~/.dejagnurc or $DEJAGNU.
41
42 proc load_gcc_lib { filename } {
43     global srcdir
44     load_file $srcdir/../../gcc/testsuite/lib/$filename
45 }
46
47 # system routines
48 load_lib dg.exp
49 load_lib libgloss.exp
50 # compiler routines, then ours
51 load_gcc_lib target-supports.exp
52 load_gcc_lib target-supports-dg.exp
53 load_lib prune.exp
54 load_lib dg-options.exp
55 load_gcc_lib target-libpath.exp
56 load_gcc_lib timeout.exp
57 load_gcc_lib timeout-dg.exp
58 load_gcc_lib wrapper.exp
59
60 # Useful for debugging.  Pass the name of a variable and the verbosity
61 # threshold (number of -v's on the command line).
62 proc v3track { var n } {
63     upvar $var val
64     verbose "++ $var is $val" $n
65 }
66
67 # Called by v3-init below.  "Static" to this file.
68 proc v3-copy-files {srcfiles} {
69     foreach f $srcfiles {
70         if { [catch { set symlink [file readlink $f] } x] } then {
71             remote_download target $f
72         } else {
73             if { [regexp "^/" "$symlink"] } then {
74                 remote_download target $symlink
75             } else {
76                 set dirname [file dirname $f]
77                 remote_download target $dirname/$symlink
78             }
79         }
80     }
81 }
82
83 # Called once, during runtest.exp setup.
84 proc libstdc++_init { testfile } {
85     global env
86     global v3-sharedlib v3-libgomp
87     global srcdir blddir objdir tool_root_dir
88     global cc cxx cxxflags cxxpchflags cxxldflags
89     global includes
90     global gluefile wrap_flags
91     global ld_library_path
92     global target_triplet
93     global flags_file
94     global tool_timeout
95
96     # We set LC_ALL and LANG to C so that we get the same error
97     # messages as expected.
98     setenv LC_ALL C
99     setenv LANG C
100
101     set blddir [lookfor_file [get_multilibs] libstdc++-v3]
102     set flags_file "${blddir}/scripts/testsuite_flags"
103     v3track flags_file 2
104
105     # If a test doesn't have special options, use DEFAULT_CXXFLAGS.
106     # Use this variable if the behavior
107     #   1) only applies to libstdc++ testing
108     #   2) might need to be negated 
109     # In particular, some tests have to be run without precompiled
110     # headers, or without assertions.
111     global DEFAULT_CXXFLAGS
112     if ![info exists DEFAULT_CXXFLAGS] then {
113         set DEFAULT_CXXFLAGS ""
114         # Host specific goo here.
115         if { [string match "powerpc-*-darwin*" $target_triplet] } {
116             append DEFAULT_CXXFLAGS " -multiply_defined suppress"
117         } 
118     }
119     v3track DEFAULT_CXXFLAGS 2
120
121     # By default, we assume we want to run program images.
122     global dg-do-what-default
123     set dg-do-what-default run
124
125     # Copy any required data files.
126     v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"]
127     v3-copy-files [glob -nocomplain "$srcdir/data/*.txt"]
128
129     set ld_library_path_tmp ""
130
131     # Locate libgcc.a so we don't need to account for different values of
132     # SHLIB_EXT on different platforms
133     set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
134     if {$gccdir != ""} {
135         set gccdir [file dirname $gccdir]
136         append ld_library_path_tmp ":${gccdir}"
137     }
138     v3track gccdir 3
139
140     # Locate libgomp. This is only required for parallel mode.
141     set v3-libgomp 0
142     set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.so]
143     if {$libgompdir != ""} {
144         set v3-libgomp 1
145         set libgompdir [file dirname $libgompdir]
146         append ld_library_path_tmp ":${libgompdir}"
147         verbose -log "libgomp support detected"
148     }
149     v3track libgompdir 3
150
151     # Locate libstdc++ shared library. (ie libstdc++.so.)
152     set v3-sharedlib 0
153     set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.so]
154     if {$sharedlibdir != ""} {
155         if { [string match "*-*-linux*" $target_triplet] && [isnative] } {
156             set v3-sharedlib 1
157             verbose -log "shared library support detected"
158         } 
159     }
160     v3track v3-sharedlib 3
161
162     # Compute what needs to be added to the existing LD_LIBRARY_PATH.
163     if {$gccdir != ""} {
164         set compiler ${gccdir}/g++
165         set ld_library_path ${ld_library_path_tmp}
166         append ld_library_path ":${blddir}/src/.libs"
167
168         if { [is_remote host] == 0 && [which $compiler] != 0 } {
169           foreach i "[exec $compiler --print-multi-lib]" {
170             set mldir ""
171             regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
172             set mldir [string trimright $mldir "\;@"]
173             if { "$mldir" == "." } {
174               continue
175             }
176             if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
177               append ld_library_path ":${gccdir}/${mldir}"
178             }
179           }
180         }
181
182         set_ld_library_path_env_vars
183         if [info exists env(LD_LIBRARY_PATH)] {
184           verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
185         }
186     } else {
187         set compiler [transform "g++"]
188     }
189
190     # Set the default timeout for v3 tests.
191     set tool_timeout 600
192
193     # Default settings.
194     set cxx [transform "g++"]
195     set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0"
196     set cxxpchflags ""
197     set cxxldflags ""
198     set cc [transform "gcc"]
199     # Locate testsuite_hooks.h and other testsuite headers.
200     set includes "-I${srcdir}/util"
201     # Adapt the defaults for special circumstances.
202     if [is_remote host] {
203         # A remote host does not, in general, have access to the
204         # $srcdir so we copy the testsuite headers into the current
205         # directory, and then add that to the search path.
206         foreach src [glob "${srcdir}/util/*.h" \
207                           "${srcdir}/util/*.cc" \
208                           "${srcdir}/util/*/*.hpp" \
209                           "${srcdir}/util/*/*.cc" \
210                           "${srcdir}/util/*/*.hpp" \
211                           "${srcdir}/util/*/*/*.cc" \
212                           "${srcdir}/util/*/*/*.hpp" \
213                           "${srcdir}/util/*/*/*/*.cc" \
214                           "${srcdir}/util/*/*/*/*.hpp" \
215                           "${srcdir}/util/*/*/*/*/*.cc" \
216                           "${srcdir}/util/*/*/*/*/*.hpp" ] {
217             # Remove everything up to "util/..."
218             set dst [string range $src [string length "${srcdir}/"] end]
219             # Create the directory containing the file.
220             set dir [file dirname $dst]
221             remote_exec host "mkdir" [list "-p" "$dir"]
222             # Download the file.
223             set result [remote_download host $src $dst]
224             if { $result == "" } {
225                 verbose -log "Unable to download ${srcdir}/${src} to host."
226                 return "untested"
227             }
228         }
229         set includes "-Iutil"
230     } elseif { [file exists $flags_file] } {
231         # If we find a testsuite_flags file, we're testing in the build dir.
232         set cxx [exec sh $flags_file --build-cxx]
233         set cxxflags [exec sh $flags_file --cxxflags]
234         set cxxpchflags [exec sh $flags_file --cxxpchflags]
235         set cxxldflags [exec sh $flags_file --cxxldflags]
236         set cc [exec sh $flags_file --build-cc]
237         set includes [exec sh $flags_file --build-includes]
238     }
239     append cxxflags " "
240     append cxxflags [getenv CXXFLAGS]
241     v3track cxxflags 2
242
243     # Always use MO files built by this test harness.
244     set cxxflags "$cxxflags -DLOCALEDIR=\".\""
245     set ccflags "$cxxflags -DLOCALEDIR=\".\""
246
247     # If a PCH file is available, use it.  We must delay performing
248     # this check until $cxx and such have been initialized because we
249     # perform a test compilation.  (Ideally, gcc --print-file-name would
250     # list PCH files, but it does not.)
251     if { $cxxpchflags != "" } {
252         set src "config[pid].cc"
253         set f [open $src "w"]
254         puts $f "int main () {}"
255         close $f
256
257         # Fixme: "additional_flags=$cxxpchflags" fails, but would be
258         # useful as then the requested variant of the pre-build PCH
259         # files could be tested to see if it works.
260         set lines [v3_target_compile $src "config[pid].o" object \
261                    "additional_flags=-include additional_flags=bits/stdc++.h"]
262         if { $lines != "" } {
263             verbose -log "Requested PCH file: $cxxpchflags"
264             verbose -log "is not working, and will not be used."
265             set cxxpchflags ""
266         } 
267         file delete $src
268      } 
269     v3track cxxpchflags 2
270
271     global PCH_CXXFLAGS
272     if ![info exists PCH_CXXFLAGS] then {
273         set PCH_CXXFLAGS $cxxpchflags
274         v3track PCH_CXXFLAGS 2
275     }
276
277     libstdc++_maybe_build_wrapper "${objdir}/testglue.o" "-fexceptions"
278 }
279
280 # Callback for cleanup routines.
281 proc libstdc++_exit { } {
282     global gluefile;
283
284     if [info exists gluefile] {
285         file_on_build delete $gluefile;
286         unset gluefile;
287     }
288 }
289
290 # Callback from system dg-test.
291 proc libstdc++-dg-test { prog do_what extra_tool_flags } {
292     # Set up the compiler flags, based on what we're going to do.
293     switch $do_what {
294         "preprocess" {
295             set compile_type "preprocess"
296             set output_file "[file rootname [file tail $prog]].i"
297         }
298         "compile" {
299             set compile_type "assembly"
300             set output_file "[file rootname [file tail $prog]].s"
301         }
302         "assemble" {
303             set compile_type "object"
304             set output_file "[file rootname [file tail $prog]].o"
305         }
306         "link" {
307             set compile_type "executable"
308             set output_file "./[file rootname [file tail $prog]].exe"
309         }
310         "run" {
311             set compile_type "executable"
312             # FIXME: "./" is to cope with "." not being in $PATH.
313             # Should this be handled elsewhere?
314             # YES.
315             set output_file "./[file rootname [file tail $prog]].exe"
316             # This is the only place where we care if an executable was
317             # created or not.  If it was, dg.exp will try to run it.
318             catch { remote_file build delete $output_file }
319         }
320         default {
321             perror "$do_what: not a valid dg-do keyword"
322             return ""
323         }
324     }
325
326     # Short-circut a bunch of complicated goo here for the special
327     # case of compiling a test file as a "C" file, not as C++. Why? So
328     # -nostdc++ doesn't trip us up. So all the extra object files
329     # don't trip us up. So automatically linking in libstdc++ doesn't
330     # happen. So CXXFLAGS don't error.
331     set select_compile "v3_target_compile"
332     set options ""
333     if { $extra_tool_flags != "" } {
334         verbose -log "extra_tool_flags are:"
335         verbose -log $extra_tool_flags
336         if { [string first "-x c" $extra_tool_flags ] != -1 } {
337             verbose -log "compiling and executing as C, not C++"
338             set edit_tool_flags $extra_tool_flags
339             regsub -all ".x c" $edit_tool_flags "" edit_tool_flags
340             lappend options "additional_flags=$edit_tool_flags"
341             set select_compile "v3_target_compile_as_c"
342         } else {
343             lappend options "additional_flags=$extra_tool_flags"
344         }
345     }
346
347     # There is a libstdc++_compile made for us by default (via the tool-
348     # and-target file), but the defaults are lacking in goodness.
349     set comp_output [$select_compile "$prog" "$output_file" "$compile_type" $options];
350     set comp_output [ prune_g++_output $comp_output ];
351
352     return [list $comp_output $output_file]
353 }
354
355 # Override the DejaGnu dg-test in order to clear flags after a test, as
356 # is done for compiler tests in gcc-dg.exp.
357
358 if { [info procs saved-dg-test] == [list] } {
359     rename dg-test saved-dg-test
360
361     proc dg-test { args } {
362         global errorInfo
363
364         if { [ catch { eval saved-dg-test $args } errmsg ] } {
365             set saved_info $errorInfo
366             unset_timeout_vars
367             error $errmsg $saved_info
368         }
369         unset_timeout_vars
370     }
371 }
372
373 # True if the library supports wchar_t.
374 set v3-wchar_t 0
375
376 # True if the library supports threads.
377 set v3-threads 0
378
379 # True if the library supports symbol versioning.
380 set v3-symver 0
381
382 # Called from libstdc++-dg-test above.  Calls back into system's
383 # target_compile to actually do the work.
384 proc v3_target_compile { source dest type options } {
385     global gluefile 
386     global wrap_flags
387     global cxx
388     global cxxflags
389     global cxxldflags
390     global includes
391
392     if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
393         lappend options "libs=${gluefile}"
394         lappend options "ldflags=${wrap_flags}"
395     }
396
397     set cxx_final $cxx
398     set cxxlibglossflags  [libgloss_link_flags]
399     set cxx_final [concat $cxx_final $cxxlibglossflags]
400     set cxx_final [concat $cxx_final $cxxflags]
401     set cxx_final [concat $cxx_final $includes]
402
403     # Flag setting based on type argument.
404     if { $type == "executable" } {
405         # Link the support objects into executables.
406         set cxx_final [concat $cxx_final $cxxldflags]
407         lappend options "additional_flags=./libtestc++.a"
408     } else {
409         if { $type == "sharedlib" } {
410             # Don't link in anything.
411             set type "executable"
412         }
413     }
414
415     lappend options "compiler=$cxx_final"
416     lappend options "timeout=[timeout_value]"
417
418     return [target_compile $source $dest $type $options]
419 }
420
421
422 # Called from libstdc++-dg-test above, but only for "C" compilation.
423 # Calls back into system's target_compile to actually do the work.
424 proc v3_target_compile_as_c { source dest type options } {
425     global gluefile 
426     global wrap_flags
427     global includes
428     global flags_file
429     global blddir
430     global cc
431     global cxxflags
432
433     if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
434         lappend options "libs=${gluefile}"
435         lappend options "ldflags=${wrap_flags}"
436     }
437
438     set tname [target_info name]
439     set cc_final $cc
440     set cxxlibglossflags [libgloss_link_flags]
441     set cc_final [concat $cc_final $cxxlibglossflags]
442     set cc_final [concat $cc_final $cxxflags]
443     set cc_final [concat $cc_final $includes]
444     regsub -all {\s[-]nostdinc[+][+]} $cc_final "" cc_final
445
446     # This is needed for "C" tests, as this type of test may need the
447     # C++ includes. And if we're not testing in the build directory,
448     # the includes variable is not likely to include the necessary
449     # info.
450     if { ![file exists $flags_file] } {
451         # ??? We need a --print-include-dirs option to GCC, so that
452         # we can avoid these hacks.  The heuristics here will not
453         # work with non-standard --with-includedir= options.
454         set version [remote_exec host ${cc} -dumpversion]
455         # Remove the trailing newline from the output.
456         set version [string trimright [lindex $version 1]]
457         set machine [remote_exec host ${cc} -dumpmachine]
458         set machine [string trimright [lindex $machine 1]]
459         set comp_base_dir [remote_exec host ${cc} --print-prog-name=cc1]
460         set comp_base_dir [lindex $comp_base_dir 1]
461         set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname $comp_base_dir]]]]]
462         # For a cross compiler, the header files will be located in a
463         # machine-specific subdirectory.
464         set crossbase "${comp_base_dir}/${machine}/include/c++/${version}"
465         set crosstarget "${crossbase}/${machine}"
466         set cc_final [concat $cc_final "-I$crossbase -I$crosstarget"]
467         # For a native compiler, the header files will be located at 
468         # the top level.
469         set includesbase "${comp_base_dir}/include/c++/${version}"
470         set includestarget "${includesbase}/${machine}"
471         set cc_final [concat $cc_final "-I$includesbase -I$includestarget"]
472
473         set libdir "-L${comp_base_dir}/lib"
474     } else {
475         set libdir "-L${blddir}/libsupc++/.libs"
476         set libdir [concat $libdir "-L${blddir}/src/.libs"]
477     }
478
479     set cc_final [concat $cc_final "$libdir"]
480
481     lappend options "compiler=$cc_final"
482     lappend options "timeout=[timeout_value]"
483
484     return [target_compile $source $dest $type $options]
485 }
486
487 # Build the support objects linked in with the libstdc++ tests.  In
488 # addition, set v3-wchar_t, v3-threads, and v3-symver appropriately.
489 proc v3-build_support { } {
490     global env
491     global srcdir
492     global v3-wchar_t
493     global v3-threads
494     global v3-symver
495     global v3-sharedlib
496
497     # Figure out whether or not the library supports certain features.
498     set v3-wchar_t 0
499     set v3-threads 0
500     set v3-symver 0
501     set libtest_objs ""
502
503     set config_src "config.cc"
504     set config_out "config.ii"
505     set f [open $config_src "w"]
506     puts $f "#include <bits/c++config.h>"
507     puts $f "#include <bits/gthr.h>"
508     close $f
509     v3_target_compile $config_src $config_out preprocess "additional_flags=-dN"
510     set file [open $config_out r]
511     set preprocessed [read $file]
512     close $file
513     if { [string first "_GLIBCXX_USE_WCHAR_T" $preprocessed] != -1 } {
514         verbose -log "wchar_t support detected"
515         set v3-wchar_t 1
516     }
517     if { [string first "_GLIBCXX_SYMVER" $preprocessed] != -1 } {
518         verbose -log "symbol versioning support detected"
519         set v3-symver 1
520     }
521     if { [string first "__GTHREADS" $preprocessed] != -1 } {
522         verbose -log "thread support detected"
523         set v3-threads 1
524     }
525
526     # Try to build the MO files that are used by some of the locale
527     # tests.  If we can't build them, that's OK; it just means that
528     # those tests will fail.
529     foreach lang [list "fr" "de"] {
530         catch {
531             file mkdir "$lang/LC_MESSAGES"
532             remote_exec "build" "msgfmt" "-o $lang/LC_MESSAGES/libstdc++.mo $srcdir/../po/$lang.po"
533             if [is_remote host] {
534                 remote_exec "host" "mkdir" "-p $lang/LC_MESSAGES"
535                 remote_download "host" "$lang/LC_MESSAGES/libstdc++.mo" "$lang/LC_MESSAGES/libstdc++.mo"
536             }
537         }
538     }
539
540     # Build the support objects.
541     set source_files [list testsuite_abi.cc testsuite_allocator.cc \
542                           testsuite_character.cc testsuite_hooks.cc \
543                           io/verified_cmd_line_input.cc \
544                           io/prog_bar.cc performance/time/elapsed_timer.cc ]
545     foreach f $source_files {
546         set obj [file rootname $f].o
547         set object_file [file tail $obj]
548         # Compile with "-w" so that warnings issued by the compiler
549         # do not prevent compilation.
550         if { [v3_target_compile $srcdir/util/$f $object_file "object" \
551                   [list "incdir=$srcdir" "additional_flags=-w"]]
552              != "" } {
553             error "could not compile $f"
554         }
555         append libtest_objs "$object_file "
556     }
557
558     # Collect into libtestc++.a
559     if  [info exists env(AR)] {
560         set ar $env(AR)
561     } else {
562         set ar [transform "ar"]
563     }
564     set arargs "-rc ./libtestc++.a ${libtest_objs}"
565     verbose -log "$ar $arargs"
566     set result [lindex [remote_exec host "$ar" "$arargs"] 0]
567     verbose "link result is $result"
568     if { $result == 0 } {
569         if  [info exists env(RANLIB)] {
570             set ranlib $env(RANLIB)
571         } else {
572             set ranlib [transform "ranlib"]
573         }
574         set ranlibargs "./libtestc++.a"
575         verbose -log "$ranlib $ranlibargs"
576         set result [lindex [remote_exec host "$ranlib" "$ranlibargs"] 0]
577         if { $result != 0 } {
578             error "could not link libtestc++.a"
579         }
580     }
581
582     # Build any shared objects needed for regression testing.
583     if { ${v3-sharedlib} == 1 } {
584         set source_files [list testsuite_shared.cc]
585         foreach f $source_files {
586             set object_file [file rootname $f].so
587             # Compile with "-w" so that warnings issued by the compiler
588             # do not prevent compilation.
589             if { [v3_target_compile $srcdir/util/$f $object_file "sharedlib" \
590              [list "incdir=$srcdir" "additional_flags=-w -shared -fPIC -DPIC"]]
591                  != "" } {
592                 error "could not compile $f"
593             }
594         }
595     }
596 }
597
598 proc check_v3_target_fileio { } {
599     global et_fileio_saved
600     global et_fileio_target_name
601     global tool 
602
603     if { ![info exists et_fileio_target_name] } {
604         set et_fileio_target_name ""
605     }
606
607     # If the target has changed since we set the cached value, clear it.
608     set current_target [current_target_name]
609     if { $current_target != $et_fileio_target_name } {
610         verbose "check_v3_target_fileio: `$et_fileio_target_name'" 2
611         set et_fileio_target_name $current_target
612         if [info exists et_fileio_saved] {
613             verbose "check_v3_target_fileio: removing cached result" 2
614             unset et_fileio_saved
615         }
616     }
617
618     if [info exists et_fileio_saved] {
619         verbose "check_v3_target_fileio: using cached result" 2
620     } else {
621         set et_fileio_saved 0
622
623         # Set up, compile, and execute a C++ test program that tries to use
624         # the file functions
625         set src fileio[pid].cc
626         set exe fileio[pid].x
627
628         set f [open $src "w"]
629         puts $f "#include <sys/types.h>"
630         puts $f "#include <sys/stat.h>"
631         puts $f "#include <fcntl.h>"
632         puts $f "#include <unistd.h>"
633         puts $f "#include <errno.h>"
634         puts $f "using namespace std;"  
635         puts $f "int main ()"
636         puts $f "{"
637         puts $f "  int fd  = open (\".\", O_RDONLY);"
638         puts $f "  int ret = 0;"
639         puts $f "  if (fd == -1)"
640         puts $f "  {"
641         puts $f "    int err = errno;"
642         puts $f "    if (err == EIO || err == ENOSYS)"
643         puts $f "      ret = 1;"
644         puts $f "  }"
645         puts $f "  else"
646         puts $f "  {"
647         puts $f "    if (lseek (fd, 0, SEEK_CUR) == -1)"
648         puts $f "      ret = 1;"
649         puts $f "    close (fd);"
650         puts $f "  }"
651         puts $f "  return ret;"
652         puts $f "}" 
653         close $f
654
655         set lines [v3_target_compile $src $exe executable ""]
656         file delete $src
657
658         if [string match "" $lines] {
659             # No error message, compilation succeeded.
660             set result [${tool}_load "./$exe" "" ""]
661             set status [lindex $result 0]
662             remote_file build delete $exe
663
664             verbose "check_v3_target_fileio: status is <$status>" 2
665
666             if { $status == "pass" } {
667                 set et_fileio_saved 1
668             }
669         } else {
670             verbose "check_v3_target_fileio: compilation failed" 2
671         }
672     }
673     return $et_fileio_saved
674 }
675
676 # Eventually we want C90/C99 determining and switching from this.
677 proc check_v3_target_c_std { } {
678     global et_c_std_saved
679     global et_c_std_target_name
680     global tool 
681
682     if { ![info exists et_c_std_target_name] } {
683         set et_c_std_target_name ""
684     }
685
686     # If the target has changed since we set the cached value, clear it.
687     set current_target [current_target_name]
688     if { $current_target != $et_c_std_target_name } {
689         verbose "check_v3_target_c_std: `$et_c_std_target_name'" 2
690         set et_c_std_target_name $current_target
691         if [info exists et_c_std_saved] {
692             verbose "check_v3_target_c_std: removing cached result" 2
693             unset et_c_std_saved
694         }
695     }
696
697     if [info exists et_c_std_saved] {
698         verbose "check_v3_target_c_std: using cached result" 2
699     } else {
700         set et_c_std_saved 0
701
702         # Set up, compile, and execute a C++ test program that tries to use
703         # C99 functionality.
704         # For math bits, could use check_effective_target_c99_math.
705         set src fileio[pid].cc
706         set exe fileio[pid].x
707
708         set f [open $src "w"]
709         puts $f "#include <tr1/cmath>"
710         puts $f "#include <cstdlib>"
711         puts $f "int main ()"
712         puts $f "{"
713         puts $f "  float f = 45.55;"
714         puts $f "  int i = std::tr1::isnan(f);"
715         puts $f "  "
716         puts $f "  using std::wctomb;"
717         puts $f "  return i;"
718         puts $f "}" 
719         close $f
720
721         set lines [v3_target_compile $src $exe executable ""]
722         file delete $src
723
724         if [string match "" $lines] {
725             # No error message, compilation succeeded.
726             set result [${tool}_load "./$exe" "" ""]
727             set status [lindex $result 0]
728             remote_file build delete $exe
729
730             verbose "check_v3_target_c_std: status is <$status>" 2
731
732             if { $status == "pass" } {
733                 set et_c_std_saved 1
734             }
735         } else {
736             verbose "check_v3_target_c_std: compilation failed" 2
737         }
738     }
739     return $et_c_std_saved
740 }
741
742 proc check_v3_target_sharedlib { } {
743     global v3-sharedlib
744     return ${v3-sharedlib}
745 }
746
747 proc check_v3_target_time { } {
748     global et_time_saved
749     global et_time_target_name
750     global tool 
751
752     if { ![info exists et_time_target_name] } {
753         set et_time_target_name ""
754     }
755
756     # If the target has changed since we set the cached value, clear it.
757     set current_target [current_target_name]
758     if { $current_target != $et_time_target_name } {
759         verbose "check_v3_target_time: `$et_time_target_name'" 2
760         set et_time_target_name $current_target
761         if [info exists et_time_saved] {
762             verbose "check_v3_target_time: removing cached result" 2
763             unset et_time_saved
764         }
765     }
766
767     if [info exists et_time_saved] {
768         verbose "check_v3_target_time: using cached result" 2
769     } else {
770         set et_time_saved 0
771
772         # Set up and compile a C++ test program that tries to use
773         # the time function
774         set src time[pid].cc
775         set exe time[pid].x
776
777         set f [open $src "w"]
778         puts $f "#include <time.h>"
779         puts $f "using namespace std;"  
780         puts $f "int main ()"
781         puts $f "{"
782         puts $f "  time (0);"   
783         puts $f "}" 
784         close $f
785
786         set lines [v3_target_compile $src $exe executable ""]
787         file delete $src
788
789         if [string match "" $lines] {
790             # No error message, compilation succeeded.
791             verbose "check_v3_target_time: compilation succeeded" 2
792             remote_file build delete $exe
793             set et_time_saved 1
794         } else {
795             verbose "check_v3_target_time: compilation failed" 2
796         }
797     }
798     return $et_time_saved
799 }
800
801 proc check_v3_target_rvalref { } {
802     global et_rvalref_saved
803     global et_rvalref_target_name
804     global tool 
805
806     if { ![info exists et_rvalref_target_name] } {
807         set et_rvalref_target_name ""
808     }
809
810     # If the target has changed since we set the cached value, clear it.
811     set current_target [current_target_name]
812     if { $current_target != $et_rvalref_target_name } {
813         verbose "check_v3_target_rvalref: `$et_rvalref_target_name'" 2
814         set et_rvalref_target_name $current_target
815         if [info exists et_rvalref_saved] {
816             verbose "check_v3_target_rvalref: removing cached result" 2
817             unset et_rvalref_saved
818         }
819     }
820
821     if [info exists et_rvalref_saved] {
822         verbose "check_v3_target_rvalref: using cached result" 2
823     } else {
824         set et_rvalref_saved 0
825
826         # Set up and compile a C++ test program that tries to use
827         # the library components of rval references
828         set src rvalref[pid].cc
829         set exe rvalref[pid].x
830
831         set f [open $src "w"]
832         puts $f "#include <iterator>"
833         puts $f "#include <utility>"
834         puts $f "using std::move;"
835         puts $f "using std::identity;"
836         puts $f "using std::forward;"
837         puts $f "using std::move_iterator;"
838         puts $f "using std::make_move_iterator;"
839         close $f
840
841         set lines [v3_target_compile $src $exe executable ""]
842         file delete $src
843
844         if [string match "" $lines] {
845             # No error message, compilation succeeded.
846             verbose "check_v3_target_rvalref: compilation succeeded" 2
847             remote_file build delete $exe
848             set et_rvalref_saved 1
849         } else {
850             verbose "check_v3_target_rvalref: compilation failed" 2
851         }
852     }
853     return $et_rvalref_saved
854 }
855
856 proc check_v3_target_namedlocale { } {
857     global et_namedlocale_saved
858     global et_namedlocale_target_name
859     global tool 
860
861     if { ![info exists et_namedlocale_target_name] } {
862         set et_namedlocale_target_name ""
863     }
864
865     # If the target has changed since we set the cached value, clear it.
866     set current_target [current_target_name]
867     if { $current_target != $et_namedlocale_target_name } {
868         verbose "check_v3_target_namedlocale: `$et_namedlocale_target_name'" 2
869         set et_namedlocale_target_name $current_target
870         if [info exists et_namedlocale_saved] {
871             verbose "check_v3_target_namedlocale: removing cached result" 2
872             unset et_namedlocale_saved
873         }
874     }
875
876     if [info exists et_namedlocale_saved] {
877         verbose "check_v3_target_namedlocale: using cached result" 2
878     } else {
879         set et_namedlocale_saved 0
880
881         # Set up, compile, and execute a C++ test program that tries to use
882         # all the required named locales.
883         set src nlocale[pid].cc
884         set exe nlocale[pid].x
885
886         set f [open $src "w"]
887         puts $f "#include <locale>"
888         puts $f "using namespace std;"  
889         puts $f "int main ()"
890         puts $f "{"
891         puts $f "  try" 
892         puts $f "  {" 
893         puts $f "     locale(\"\");"
894         puts $f "     locale(\"de_DE\");"
895         puts $f "     locale(\"de_DE.ISO-8859-15@euro\");"
896         puts $f "     locale(\"de_DE@euro\");"
897         puts $f "     locale(\"en_HK\");"
898         puts $f "     locale(\"en_PH\");"
899         puts $f "     locale(\"en_US\");"
900         puts $f "     locale(\"en_US.ISO-8859-1\");"
901         puts $f "     locale(\"en_US.ISO-8859-15\");"
902         puts $f "     locale(\"en_US.UTF-8\");"
903         puts $f "     locale(\"es_ES\");"
904         puts $f "     locale(\"es_MX\");"
905         puts $f "     locale(\"fr_FR\");"
906         puts $f "     locale(\"fr_FR@euro\");"
907         puts $f "     locale(\"is_IS\");"
908         puts $f "     locale(\"is_IS.UTF-8\");"
909         puts $f "     locale(\"it_IT\");"
910         puts $f "     locale(\"ja_JP.eucjp\");"
911         puts $f "     locale(\"se_NO.UTF-8\");"
912         puts $f "     locale(\"ta_IN\");"
913         puts $f "     locale(\"zh_TW\");"
914         puts $f "     return 0;"
915         puts $f "  }"
916         puts $f "  catch(...)"
917         puts $f "  {"
918         puts $f "     return 1;"
919         puts $f "  }"   
920         puts $f "}"
921         close $f
922
923         set lines [v3_target_compile $src $exe executable ""]
924         file delete $src
925
926         if [string match "" $lines] {
927             # No error message, compilation succeeded.
928             set result [${tool}_load "./$exe" "" ""]
929             set status [lindex $result 0]
930             remote_file build delete $exe
931
932             verbose "check_v3_target_namedlocale: status is <$status>" 2
933
934             if { $status == "pass" } {
935                 set et_namedlocale_saved 1
936             }
937         } else {
938             verbose "check_v3_target_namedlocale: compilation failed" 2
939         }
940     }
941     return $et_namedlocale_saved
942 }
943
944 proc check_v3_target_debug_mode { } {
945     global cxxflags
946     global et_debug_mode
947     global tool 
948
949     if { ![info exists et_debug_mode_target_name] } {
950         set et_debug_mode_target_name ""
951     }
952
953     # If the target has changed since we set the cached value, clear it.
954     set current_target [current_target_name]
955     if { $current_target != $et_debug_mode_target_name } {
956         verbose "check_v3_target_debug_mode: `$et_debug_mode_target_name'" 2
957         set et_debug_mode_target_name $current_target
958         if [info exists et_debug_mode] {
959             verbose "check_v3_target_debug_mode: removing cached result" 2
960             unset et_debug_mode
961         }
962     }
963
964     if [info exists et_debug_mode] {
965         verbose "check_v3_target_debug_mode: using cached result" 2
966     } else {
967         set et_debug_mode 0
968
969         # Set up and compile a C++ test program that depends
970         # on debug mode working.
971         set src debug_mode[pid].cc
972         set exe debug_mode[pid].exe
973
974         set f [open $src "w"]
975         puts $f "#include <string>"
976         puts $f "using namespace std;"  
977         puts $f "int main()"
978         puts $f "{ return 0; }"
979         close $f
980
981         set cxxflags_saved $cxxflags
982         set cxxflags "$cxxflags -Werror -O0 -D_GLIBCXX_DEBUG"
983         set lines [v3_target_compile $src $exe executable ""]
984         set cxxflags $cxxflags_saved
985         file delete $src
986
987         if [string match "" $lines] {
988             # No error message, compilation succeeded.
989             set et_debug_mode 1
990         }
991     }
992     verbose "check_v3_target_debug_mode: $et_debug_mode" 2
993     return $et_debug_mode
994 }
995
996 proc check_v3_target_parallel_mode { } {
997     global cxxflags
998     global v3-libgomp
999     global et_parallel_mode
1000
1001     global tool 
1002
1003     if { ![info exists et_parallel_mode_target_name] } {
1004         set et_parallel_mode_target_name ""
1005     }
1006
1007     # If the target has changed since we set the cached value, clear it.
1008     set current_target [current_target_name]
1009     if { $current_target != $et_parallel_mode_target_name } {
1010         verbose "check_v3_target_parallel_mode: `$et_parallel_mode_target_name'" 2
1011         set et_parallel_mode_target_name $current_target
1012         if [info exists et_parallel_mode] {
1013             verbose "check_v3_target_parallel_mode: removing cached result" 2
1014             unset et_parallel_mode
1015         }
1016     }
1017
1018     if [info exists et_parallel_mode] {
1019         verbose "check_v3_target_parallel_mode: using cached result" 2
1020     } else {
1021         set et_parallel_mode 0
1022
1023         # If 'make check-parallel' is running the test succeeds.
1024         if { ${v3-libgomp} == 1 && [regexp "libgomp" $cxxflags] } {
1025             set et_parallel_mode 1
1026         }
1027     }
1028     verbose "check_v3_target_parallel_mode: $et_parallel_mode" 2
1029     return $et_parallel_mode
1030 }
1031
1032 proc check_v3_target_cstdint { } {
1033     global cxxflags
1034     global DEFAULT_CXXFLAGS
1035     global et_cstdint
1036
1037     global tool 
1038
1039     if { ![info exists et_cstdint_target_name] } {
1040         set et_cstdint_target_name ""
1041     }
1042
1043     # If the target has changed since we set the cached value, clear it.
1044     set current_target [current_target_name]
1045     if { $current_target != $et_cstdint_target_name } {
1046         verbose "check_v3_target_cstdint: `$et_cstdint_target_name'" 2
1047         set et_cstdint_target_name $current_target
1048         if [info exists et_cstdint] {
1049             verbose "check_v3_target_cstdint: removing cached result" 2
1050             unset et_cstdint
1051         }
1052     }
1053
1054     if [info exists et_cstdint] {
1055         verbose "check_v3_target_cstdint: using cached result" 2
1056     } else {
1057         set et_cstdint 0
1058
1059         # Set up and compile a C++0x test program that depends
1060         # on the C99 stdint facilities to be available.
1061         set src cstdint[pid].cc
1062         set exe cstdint[pid].exe
1063
1064         set f [open $src "w"]
1065         puts $f "#include <tr1/cstdint>"
1066         puts $f "int main()"
1067         puts $f "#ifdef _GLIBCXX_USE_C99_STDINT_TR1"
1068         puts $f "{ return 0; }"
1069         puts $f "#endif"
1070         close $f
1071
1072         set cxxflags_saved $cxxflags
1073         set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
1074
1075         set lines [v3_target_compile $src $exe executable ""]
1076         set cxxflags $cxxflags_saved
1077         file delete $src
1078
1079         if [string match "" $lines] {
1080             # No error message, compilation succeeded.
1081             set et_cstdint 1
1082         } else {
1083             verbose "check_v3_target_cstdint: compilation failed" 2
1084         }
1085     }
1086     verbose "check_v3_target_cstdint: $et_cstdint" 2
1087     return $et_cstdint
1088 }
1089
1090 proc check_v3_target_atomic_builtins { } {
1091     global cxxflags
1092     global DEFAULT_CXXFLAGS
1093     global et_cstdint
1094
1095     global tool 
1096
1097     if { ![info exists et_atomic_builtins_target_name] } {
1098         set et_atomic_builtins_target_name ""
1099     }
1100
1101     # If the target has changed since we set the cached value, clear it.
1102     set current_target [current_target_name]
1103     if { $current_target != $et_atomic_builtins_target_name } {
1104         verbose "check_v3_target_atomic_builtins: `$et_atomic_builtins_target_name'" 2
1105         set et_atomic_builtins_target_name $current_target
1106         if [info exists et_atomic_builtins] {
1107             verbose "check_v3_target_atomic_builtins: removing cached result" 2
1108             unset et_atomic_builtins
1109         }
1110     }
1111
1112     if [info exists et_atomic_builtins] {
1113         verbose "check_v3_target_atomic_builtins: using cached result" 2
1114     } else {
1115         set et_atomic_builtins 0
1116
1117         # Set up and compile a C++0x test program that depends
1118         # on the atomic builtin facilities to be available.
1119         set src atomic_builtins[pid].cc
1120         set exe atomic_builtins[pid].exe
1121
1122         set f [open $src "w"]
1123         puts $f "#include <bits/c++config.h>"
1124         puts $f "int main()"
1125         puts $f "#ifdef _GLIBCXX_ATOMIC_BUILTINS_4"
1126         puts $f "{ return 0; }"
1127         puts $f "#endif"
1128         close $f
1129
1130         set cxxflags_saved $cxxflags
1131         set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
1132
1133         set lines [v3_target_compile $src $exe executable ""]
1134         set cxxflags $cxxflags_saved
1135         file delete $src
1136
1137         if [string match "" $lines] {
1138             # No error message, compilation succeeded.
1139             set et_atomic_builtins 1
1140         } else {
1141             verbose "check_v3_target_atomic_builtins: compilation failed" 2
1142         }
1143     }
1144     verbose "check_v3_target_atomic_builtins: $et_atomic_builtins" 2
1145     return $et_atomic_builtins
1146 }
1147
1148 proc check_v3_target_gthreads { } {
1149     global cxxflags
1150     global DEFAULT_CXXFLAGS
1151     global et_gthreads
1152
1153     global tool
1154
1155     if { ![info exists et_gthreads_target_name] } {
1156         set et_gthreads_target_name ""
1157     }
1158
1159     # If the target has changed since we set the cached value, clear it.
1160     set current_target [current_target_name]
1161     if { $current_target != $et_gthreads_target_name } {
1162         verbose "check_v3_target_gthreads: `$et_gthreads_target_name'" 2
1163         set et_gthreads_target_name $current_target
1164         if [info exists et_gthreads] {
1165             verbose "check_v3_target_gthreads: removing cached result" 2
1166             unset et_gthreads
1167         }
1168     }
1169
1170     if [info exists et_gthreads] {
1171         verbose "check_v3_target_gthreads: using cached result" 2
1172     } else {
1173         set et_gthreads 0
1174
1175         # Set up and compile a C++0x test program that depends
1176         # on the gthreads facilities to be available.
1177         set src gthreads[pid].cc
1178         set exe gthreads[pid].exe
1179
1180         set f [open $src "w"]
1181         puts $f "#include <bits/c++config.h>"
1182         puts $f "int main()"
1183         puts $f "#ifdef _GLIBCXX_HAS_GTHREADS"
1184         puts $f "{ return 0; }"
1185         puts $f "#endif"
1186         close $f
1187
1188         set cxxflags_saved $cxxflags
1189         set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
1190
1191         set lines [v3_target_compile $src $exe executable ""]
1192         set cxxflags $cxxflags_saved
1193         file delete $src
1194
1195         if [string match "" $lines] {
1196             # No error message, compilation succeeded.
1197             set et_gthreads 1
1198         } else {
1199             verbose "check_v3_target_gthreads: compilation failed" 2
1200         }
1201     }
1202     verbose "check_v3_target_gthreads: $et_gthreads" 2
1203     return $et_gthreads
1204 }
1205
1206 proc check_v3_target_nanosleep { } {
1207     global cxxflags
1208     global DEFAULT_CXXFLAGS
1209     global et_nanosleep
1210
1211     global tool
1212
1213     if { ![info exists et_nanosleep_target_name] } {
1214         set et_nanosleep_target_name ""
1215     }
1216
1217     # If the target has changed since we set the cached value, clear it.
1218     set current_target [current_target_name]
1219     if { $current_target != $et_nanosleep_target_name } {
1220         verbose "check_v3_target_nanosleep: `$et_nanosleep_target_name'" 2
1221         set et_nanosleep_target_name $current_target
1222         if [info exists et_nanosleep] {
1223             verbose "check_v3_target_nanosleep: removing cached result" 2
1224             unset et_nanosleep
1225         }
1226     }
1227
1228     if [info exists et_nanosleep] {
1229         verbose "check_v3_target_nanosleep: using cached result" 2
1230     } else {
1231         set et_nanosleep 0
1232         
1233         # Set up and compile a C++0x test program that depends
1234         # on the nanosleep facilities to be available.
1235         set src nanosleep[pid].cc
1236         set exe nanosleep[pid].exe
1237
1238         set f [open $src "w"]
1239         puts $f "#include <bits/c++config.h>"
1240         puts $f "int main()"
1241         puts $f "#ifdef _GLIBCXX_USE_NANOSLEEP"
1242         puts $f "{ return 0; }"
1243         puts $f "#endif"
1244         close $f
1245
1246         set cxxflags_saved $cxxflags
1247         set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
1248
1249         set lines [v3_target_compile $src $exe executable ""]
1250         set cxxflags $cxxflags_saved
1251         file delete $src
1252
1253         if [string match "" $lines] {
1254             # No error message, compilation succeeded.
1255             set et_nanosleep 1
1256         } else {
1257             verbose "check_v3_target_nanosleep: compilation failed" 2
1258         }
1259     }
1260     verbose "check_v3_target_nanosleep: $et_nanosleep" 2
1261     return $et_nanosleep
1262 }
1263
1264 proc check_v3_target_sched_yield { } {
1265     global cxxflags
1266     global DEFAULT_CXXFLAGS
1267     global et_sched_yield
1268
1269     global tool
1270
1271     if { ![info exists et_sched_yield_target_name] } {
1272         set et_sched_yield_target_name ""
1273     }
1274
1275     # If the target has changed since we set the cached value, clear it.
1276     set current_target [current_target_name]
1277     if { $current_target != $et_sched_yield_target_name } {
1278         verbose "check_v3_target_sched_yield: `$et_sched_yield_target_name'" 2
1279         set et_sched_yield_target_name $current_target
1280         if [info exists et_sched_yield] {
1281             verbose "check_v3_target_sched_yield: removing cached result" 2
1282             unset et_sched_yield
1283         }
1284     }
1285
1286     if [info exists et_sched_yield] {
1287         verbose "check_v3_target_sched_yield: using cached result" 2
1288     } else {
1289         set et_sched_yield 0
1290
1291         # Set up and compile a C++0x test program that depends
1292         # on the sched_yield facility to be available.
1293         set src sched_yield[pid].cc
1294         set exe sched_yield[pid].exe
1295
1296         set f [open $src "w"]
1297         puts $f "#include <bits/c++config.h>"
1298         puts $f "int main()"
1299         puts $f "#ifdef _GLIBCXX_USE_SCHED_YIELD"
1300         puts $f "{ return 0; }"
1301         puts $f "#endif"
1302         close $f
1303
1304         set cxxflags_saved $cxxflags
1305         set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
1306
1307         set lines [v3_target_compile $src $exe executable ""]
1308         set cxxflags $cxxflags_saved
1309         file delete $src
1310
1311         if [string match "" $lines] {
1312             # No error message, compilation succeeded.
1313             set et_sched_yield 1
1314         } else {
1315             verbose "check_v3_target_sched_yield: compilation failed" 2
1316         }
1317     }
1318     verbose "check_v3_target_sched_yield: $et_sched_yield" 2
1319     return $et_sched_yield
1320 }
1321
1322 proc check_v3_target_string_conversions { } {
1323     global cxxflags
1324     global DEFAULT_CXXFLAGS
1325     global et_string_conversions
1326
1327     global tool
1328
1329     if { ![info exists et_string_conversions_target_name] } {
1330         set et_string_conversions_target_name ""
1331     }
1332
1333     # If the target has changed since we set the cached value, clear it.
1334     set current_target [current_target_name]
1335     if { $current_target != $et_string_conversions_target_name } {
1336         verbose "check_v3_target_string_conversions: `$et_string_conversions_target_name'" 2
1337         set et_string_conversions_target_name $current_target
1338         if [info exists et_string_conversions] {
1339             verbose "check_v3_target_string_conversions: removing cached result" 2
1340             unset et_string_conversions
1341         }
1342     }
1343
1344     if [info exists et_string_conversions] {
1345         verbose "check_v3_target_string_conversions: using cached result" 2
1346     } else {
1347         set et_string_conversions 0
1348         
1349         # Set up and compile a C++0x test program that depends
1350         # on the string_conversions facilities to be available.
1351         set src string_conversions[pid].cc
1352         set exe string_conversions[pid].exe
1353
1354         set f [open $src "w"]
1355         puts $f "#include <bits/c++config.h>"
1356         puts $f "int main()"
1357         puts $f "#if defined(_GLIBCXX_USE_C99) && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)"
1358         puts $f "{ return 0; }"
1359         puts $f "#endif"
1360         close $f
1361
1362         set cxxflags_saved $cxxflags
1363         set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
1364
1365         set lines [v3_target_compile $src $exe executable ""]
1366         set cxxflags $cxxflags_saved
1367         file delete $src
1368
1369         if [string match "" $lines] {
1370             # No error message, compilation succeeded.
1371             set et_string_conversions 1
1372         } else {
1373             verbose "check_v3_target_string_conversions: compilation failed" 2
1374         }
1375     }
1376     verbose "check_v3_target_string_conversions: $et_string_conversions" 2
1377     return $et_string_conversions
1378 }