diff options
author | Adam Fedor <fedor@gnu.org> | 2003-05-01 01:09:51 +0000 |
---|---|---|
committer | Adam Fedor <fedor@gnu.org> | 2003-05-01 01:09:51 +0000 |
commit | 130cacceca840fe1b78c6a1f67c37f6bab3f7fc6 (patch) | |
tree | 6a13bdcc70d03e09468bbd424425ba2f68756772 /gdb/testsuite/lib | |
parent | 10a9829174397471ff95856c94aac352190ca7b9 (diff) | |
download | gdb-130cacceca840fe1b78c6a1f67c37f6bab3f7fc6.zip gdb-130cacceca840fe1b78c6a1f67c37f6bab3f7fc6.tar.gz gdb-130cacceca840fe1b78c6a1f67c37f6bab3f7fc6.tar.bz2 |
* Makefile.in (ALL_SUBDIRS): Add gdb.objc
* configure.in (AC_OUTPUT): Add gdb.objc/Makefile
* gdb.objc/Makefile.in, gdb.objc/basicclass.exp,
gdb.objc/basicclass.m: : New files
* lib/gdb.exp (gdb_compile_objc): New procedure.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 4dfbf76..a16b0fa 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1283,6 +1283,46 @@ proc gdb_compile_pthreads {source dest type options} { } } +# This is just like gdb_compile_pthreads, above, except that we always add the +# objc library for compiling Objective-C programs +proc gdb_compile_objc {source dest type options} { + set built_binfile 0 + set why_msg "unrecognized error" + foreach lib {-lobjc -lpthreads -lpthread -lthread solaris} { + # This kind of wipes out whatever libs the caller may have + # set. Or maybe theirs will override ours. How infelicitous. + if { $lib == "solaris" } { + set lib "-lpthread -lposix4" + } + if { $lib != "-lobjc" } { + set lib "-lobjc $lib" + } + set options_with_lib [concat $options [list libs=$lib quiet]] + set ccout [gdb_compile $source $dest $type $options_with_lib] + switch -regexp -- $ccout { + ".*no posix threads support.*" { + set why_msg "missing threads include file" + break + } + ".*cannot open -lpthread.*" { + set why_msg "missing runtime threads library" + } + ".*Can't find library for -lpthread.*" { + set why_msg "missing runtime threads library" + } + {^$} { + pass "successfully compiled objc with posix threads test case" + set built_binfile 1 + break + } + } + } + if {!$built_binfile} { + unsupported "Couldn't compile $source: ${why_msg}" + return -1 + } +} + proc send_gdb { string } { global suppress_flag; if { $suppress_flag } { |