From 130cacceca840fe1b78c6a1f67c37f6bab3f7fc6 Mon Sep 17 00:00:00 2001 From: Adam Fedor Date: Thu, 1 May 2003 01:09:51 +0000 Subject: * 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. --- gdb/testsuite/lib/gdb.exp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'gdb/testsuite/lib') 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 } { -- cgit v1.1