summaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib/objc.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/lib/objc.exp')
-rw-r--r--gcc/testsuite/lib/objc.exp8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp
index 9e7c445d3ce..1817c7022e8 100644
--- a/gcc/testsuite/lib/objc.exp
+++ b/gcc/testsuite/lib/objc.exp
@@ -168,13 +168,15 @@ proc objc_target_compile { source dest type options } {
set options [concat "additional_flags=$TOOL_OPTIONS" $options];
}
- # Point to the ObjC headers in libobjc.
- set objc_include_dir "${srcdir}/../../libobjc"
- lappend options "additional_flags=-I${objc_include_dir}"
+ # If we have built libobjc along with the compiler (which usually
+ # _is not_ the case on Mac OS X systems), point the test harness
+ # at it (and associated headers).
set objcpath "[get_multilibs]"
set libobjc_dir [lookfor_file ${objcpath} libobjc/.libs/libobjc.a]
if { $libobjc_dir != "" } {
+ set objc_include_dir "${srcdir}/../../libobjc"
+ lappend options "additional_flags=-I${objc_include_dir}"
set libobjc_dir [file dirname ${libobjc_dir}]
set objc_link_flags "-L${libobjc_dir}"
lappend options "additional_flags=${objc_link_flags}"