Fossil SCM
Improve auto-detection of Tcl on systems where -lpthread is missing from TCL_LIB_SPEC.
Commit
352e2ef9c62efd07a5057a1b37fe9766bf555721
Parent
b41f42841f029b8…
1 file changed
+17
M
auto.def
+17
| --- auto.def | ||
| +++ auto.def | ||
| @@ -372,10 +372,27 @@ | ||
| 372 | 372 | # On some systems, using "-lieee" from TCL_LIB_SPEC appears |
| 373 | 373 | # to cause issues. |
| 374 | 374 | msg-result "Removing \"-lieee\" and retrying for Tcl..." |
| 375 | 375 | set libs [string map [list -lieee ""] $libs] |
| 376 | 376 | cc-with [list -cflags $cflags -libs $libs] { |
| 377 | + if {$tclstubs} { | |
| 378 | + if {[cc-check-functions Tcl_InitStubs]} { | |
| 379 | + set foundtcl 1 | |
| 380 | + } | |
| 381 | + } else { | |
| 382 | + if {[cc-check-functions Tcl_CreateInterp]} { | |
| 383 | + set foundtcl 1 | |
| 384 | + } | |
| 385 | + } | |
| 386 | + } | |
| 387 | + } | |
| 388 | + if {!$foundtcl && ![string match *-lpthread* $libs]} { | |
| 389 | + # On some systems, TCL_LIB_SPEC appears to be missing | |
| 390 | + # "-lpthread". Try adding it. | |
| 391 | + msg-result "Adding \"-lpthread\" and retrying for Tcl..." | |
| 392 | + set libs "$libs -lpthread" | |
| 393 | + cc-with [list -cflags $cflags -libs $libs] { | |
| 377 | 394 | if {$tclstubs} { |
| 378 | 395 | if {[cc-check-functions Tcl_InitStubs]} { |
| 379 | 396 | set foundtcl 1 |
| 380 | 397 | } |
| 381 | 398 | } else { |
| 382 | 399 |
| --- auto.def | |
| +++ auto.def | |
| @@ -372,10 +372,27 @@ | |
| 372 | # On some systems, using "-lieee" from TCL_LIB_SPEC appears |
| 373 | # to cause issues. |
| 374 | msg-result "Removing \"-lieee\" and retrying for Tcl..." |
| 375 | set libs [string map [list -lieee ""] $libs] |
| 376 | cc-with [list -cflags $cflags -libs $libs] { |
| 377 | if {$tclstubs} { |
| 378 | if {[cc-check-functions Tcl_InitStubs]} { |
| 379 | set foundtcl 1 |
| 380 | } |
| 381 | } else { |
| 382 |
| --- auto.def | |
| +++ auto.def | |
| @@ -372,10 +372,27 @@ | |
| 372 | # On some systems, using "-lieee" from TCL_LIB_SPEC appears |
| 373 | # to cause issues. |
| 374 | msg-result "Removing \"-lieee\" and retrying for Tcl..." |
| 375 | set libs [string map [list -lieee ""] $libs] |
| 376 | cc-with [list -cflags $cflags -libs $libs] { |
| 377 | if {$tclstubs} { |
| 378 | if {[cc-check-functions Tcl_InitStubs]} { |
| 379 | set foundtcl 1 |
| 380 | } |
| 381 | } else { |
| 382 | if {[cc-check-functions Tcl_CreateInterp]} { |
| 383 | set foundtcl 1 |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | if {!$foundtcl && ![string match *-lpthread* $libs]} { |
| 389 | # On some systems, TCL_LIB_SPEC appears to be missing |
| 390 | # "-lpthread". Try adding it. |
| 391 | msg-result "Adding \"-lpthread\" and retrying for Tcl..." |
| 392 | set libs "$libs -lpthread" |
| 393 | cc-with [list -cflags $cflags -libs $libs] { |
| 394 | if {$tclstubs} { |
| 395 | if {[cc-check-functions Tcl_InitStubs]} { |
| 396 | set foundtcl 1 |
| 397 | } |
| 398 | } else { |
| 399 |