Skip to content

Commit

Permalink
Some versions of cc on Darwin don't support -gstabs
Browse files Browse the repository at this point in the history
So test for support before using it

Signed-off-by: Steve Bennett <steveb@workware.net.au>
  • Loading branch information
msteveb committed Mar 21, 2013
1 parent de88065 commit 9a3afc9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/cc.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,8 @@ proc cctest {args} {
set tmp conftest__.o
lappend cmdline -c
}
lappend cmdline {*}$opts(-cflags)
lappend cmdline {*}$opts(-cflags) {*}[get-define cc-default-debug ""]

switch -glob -- [get-define host] {
*-*-darwin* {
# Don't generate .dSYM directories
lappend cmdline -gstabs
}
}
lappend cmdline $src -o $tmp {*}$opts(-libs)

# At this point we have the complete command line and the
Expand Down Expand Up @@ -688,6 +682,16 @@ if {[get-define CXX] ne "false"} {
}
msg-result "Build C compiler...[get-define CC_FOR_BUILD]"

# On Darwin, we prefer to use -gstabs to avoid creating .dSYM directories
# but some compilers don't support -gstabs, so test for it here.
switch -glob -- [get-define host] {
*-*-darwin* {
if {[cctest -cflags {-gstabs}]} {
define cc-default-debug -gstabs
}
}
}

if {![cc-check-includes stdlib.h]} {
user-error "Compiler does not work. See config.log"
}

0 comments on commit 9a3afc9

Please sign in to comment.