diff options
author | Steve Bennett <steveb@workware.net.au> | 2016-10-26 19:52:06 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-10-26 19:52:51 +1000 |
commit | 7d5a6e3b6f19a5c9260c131f428711320da452a0 (patch) | |
tree | b024d6e8c3d97ceb1a210a7e533a818fe26ed337 /autosetup/cc.tcl | |
parent | b7efe69818d2d12c0f004a5aaca70cd2ed2f388a (diff) | |
download | jimtcl-7d5a6e3b6f19a5c9260c131f428711320da452a0.zip jimtcl-7d5a6e3b6f19a5c9260c131f428711320da452a0.tar.gz jimtcl-7d5a6e3b6f19a5c9260c131f428711320da452a0.tar.bz2 |
build: update autosetup for LIBS/LDFLAGS fix
343be844 cc tests should use LIBS and LDFLAGS
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'autosetup/cc.tcl')
-rw-r--r-- | autosetup/cc.tcl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/autosetup/cc.tcl b/autosetup/cc.tcl index 67f1ccd..c6702a2 100644 --- a/autosetup/cc.tcl +++ b/autosetup/cc.tcl @@ -211,7 +211,7 @@ proc cc-check-members {args} { # # If the function is found, the feature is defined and lib_$function is defined # to -l$lib where the function was found, or "" if no library required. -# In addition, -l$lib is added to the LIBS define. +# In addition, -l$lib is prepended to the LIBS define. # # If additional libraries may be needed for linking, they should be specified # as $extralibs as "-lotherlib1 -lotherlib2". @@ -233,7 +233,8 @@ proc cc-check-function-in-lib {function libs {otherlibs {}}} { if {[cctest_function $function]} { msg-result -l$lib define lib_$function -l$lib - define-append LIBS -l$lib + # prepend to LIBS + define LIBS "-l$lib [get-define LIBS]" incr found break } @@ -499,13 +500,17 @@ proc cctest {args} { } } - if {!$opts(-link)} { + if {$opts(-link)} { + lappend cmdline {*}[get-define LDFLAGS] + } else { set tmp conftest__.o lappend cmdline -c } lappend cmdline {*}$opts(-cflags) {*}[get-define cc-default-debug ""] - lappend cmdline $src -o $tmp {*}$opts(-libs) + if {$opts(-link)} { + lappend cmdline {*}[get-define LIBS] + } # At this point we have the complete command line and the # complete source to be compiled. Get the result from cache if |