MCPcopy Create free account
hub / github.com/NetSys/bess / check_c_lib

Function check_c_lib

build.py:144–163  ·  view source on GitHub ↗
(lib)

Source from the content-addressed store, hash-verified

142
143
144def check_c_lib(lib):
145 test_c_file = '%s/test.c' % DEPS_DIR
146 test_e_file = '%s/test' % DEPS_DIR
147
148 src = """
149 int main()
150 {
151 return 0;
152 }
153 """
154
155 try:
156 with open(test_c_file, 'w') as fp:
157 fp.write(textwrap.dedent(src))
158
159 return cmd_success('gcc %s -l%s %s %s -o %s' %
160 (test_c_file, lib, ' '.join(cxx_flags),
161 ' '.join(ld_flags), test_e_file))
162 finally:
163 cmd('rm -f %s %s' % (test_c_file, test_e_file), quiet=True)
164
165
166def required(header_file, lib_name, compiler):

Callers 1

check_bnxFunction · 0.85

Calls 2

cmd_successFunction · 0.85
cmdFunction · 0.70

Tested by

no test coverage detected