diff options
Diffstat (limited to 'libmudflap/testsuite/lib/libmudflap.exp')
-rw-r--r-- | libmudflap/testsuite/lib/libmudflap.exp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libmudflap/testsuite/lib/libmudflap.exp b/libmudflap/testsuite/lib/libmudflap.exp index 634f1cb28ad..e08f13d25ef 100644 --- a/libmudflap/testsuite/lib/libmudflap.exp +++ b/libmudflap/testsuite/lib/libmudflap.exp @@ -117,6 +117,28 @@ proc libmudflap-init { language } { unset gluefile } } + + # If there is no static library then don't run tests with -static. + global tool + set opts "additional_flags=-static" + lappend opts "additional_flags=-fmudflap" + lappend opts "additional_flags=-lmudflap" + set src stlm[pid].c + set exe stlm[pid].x + + set f [open $src "w"] + puts $f "int main () { }" + close $f + set lines [${tool}_target_compile $src $exe executable "$opts"] + file delete $src + remote_file build delete $exe + + if { ![string match "" $lines] } { + # Compilation failed; assume static library is not available. + global MUDFLAP_FLAGS + set i [lsearch $MUDFLAP_FLAGS "*static*"] + set MUDFLAP_FLAGS [lreplace $MUDFLAP_FLAGS $i $i] + } } proc libmudflap-dg-test { prog do_what extra_tool_flags } { |