Login
Check-in [539b7ab15d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:new linkability proc in configure tool ("cc-check-linkability")
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | bsd_cfg
Files: files | file ages | folders
SHA1: 539b7ab15d73e34bc1db47df3d56151bc3bd4671
User & Date: bch 2014-05-09 21:12:32.272
Context
2014-05-09
21:13
take advantage of new configure test operation (cc-check-linkability). Closed-Leaf check-in: 731f828b21 user: bch tags: bsd_cfg
21:12
new linkability proc in configure tool ("cc-check-linkability") check-in: 539b7ab15d user: bch tags: bsd_cfg
17:56
attempt "linux way" first, to work around a linux-side problem. check-in: c7b18e1dd7 user: stephan tags: trunk
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to autosetup/lib/cc-lib.tcl.
71
72
73
74
75
76
77


































78
79
80
81
82
83
84
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







			set rc 1
		} else {
			msg-result "unknown"
		}
	}
	return $rc
}

# @cc-check-linkability lib ?...?
#
# Checks whether the given C/C++ linker flags can be used. Defines feature
# names prefixed with 'HAVE_CFLAG' and 'HAVE_CXXFLAG' respectively, and
# appends working flags to '-cflags' and 'CFLAGS' or 'CXXFLAGS'.
proc cc-check-linkability {args} {
    set result 1
    array set opts [cc-get-settings]
    switch -exact -- $opts(-lang) {
        c++ {
            set lang C++
            set prefix CXXFLAG
        }
        c {
            set lang C
            set prefix CFLAG
        }
        default {
            autosetup-error "cc-check-flags failed with unknown language: $opts(-lang)"
        }
    }
    foreach library $args {
        msg-checking "Checking whether we can link against $library..."
        if {[cctest -libs $library]} {
            msg-result yes
	    set result 1
        } else {
            msg-result no
            set result 0
        }
    }
    return $result
}

# @cc-check-flags flag ?...?
#
# Checks whether the given C/C++ compiler flags can be used. Defines feature
# names prefixed with 'HAVE_CFLAG' and 'HAVE_CXXFLAG' respectively, and
# appends working flags to '-cflags' and 'CFLAGS' or 'CXXFLAGS'.
proc cc-check-flags {args} {