Unverified Commit 4e8e7ecd authored by Karl Linden's avatar Karl Linden
Browse files

Use conf.check instead of conf.check_cc.

parent ff0463bd
......@@ -10,12 +10,12 @@ def configure(conf):
if conf.env['IS_WINDOWS']:
try:
conf.check_cc(function_name='regcomp', header_name='regex.h', lib='regex', uselib_store="REGEX", define_name='HAVE_REGEX_H')
conf.check(function_name='regcomp', header_name='regex.h', lib='regex', uselib_store="REGEX", define_name='HAVE_REGEX_H')
except:
conf.check_cc(function_name='regcomp', header_name='regex.h', lib='tre', uselib_store="REGEX", define_name='HAVE_REGEX_H')
conf.check_cc(function_name='htons', header_name='winsock2.h', lib='ws2_32', uselib_store="WS2_32", define_name='HAVE_WINSOCK2_H')
conf.check_cc(function_name='timeGetDevCaps', header_name=['windows.h', 'mmsystem.h'], lib='winmm', uselib_store="WINMM", define_name='HAVE_MMSYSTEM_H')
conf.check_cc(function_name='EnumProcesses', header_name=['windows.h', 'psapi.h'], lib='psapi', uselib_store="PSAPI", define_name='HAVE_PSAPI_H')
conf.check(function_name='regcomp', header_name='regex.h', lib='tre', uselib_store="REGEX", define_name='HAVE_REGEX_H')
conf.check(function_name='htons', header_name='winsock2.h', lib='ws2_32', uselib_store="WS2_32", define_name='HAVE_WINSOCK2_H')
conf.check(function_name='timeGetDevCaps', header_name=['windows.h', 'mmsystem.h'], lib='winmm', uselib_store="WINMM", define_name='HAVE_MMSYSTEM_H')
conf.check(function_name='EnumProcesses', header_name=['windows.h', 'psapi.h'], lib='psapi', uselib_store="PSAPI", define_name='HAVE_PSAPI_H')
def create_jack_process_obj(bld, target, sources, uselib = None):
process = bld(features = ['cxx', 'cxxshlib'])
......
......@@ -106,11 +106,11 @@ class AutoOption:
def add_library(self, library, uselib_store=None):
"""
Add a required library that should be checked during configuration. The
library will be checked using the conf.check_cc function. If the
library will be checked using the conf.check function. If the
uselib_store arugment is not given it defaults to LIBRARY (the uppercase
of the library argument). The uselib_store argument will be passed to
check_cc which means LIB_LIBRARY, CFLAGS_LIBRARY and DEFINES_LIBRARY,
etc. will be defined if the option is enabled.
check which means LIB_LIBRARY, CFLAGS_LIBRARY and DEFINES_LIBRARY, etc.
will be defined if the option is enabled.
"""
if not uselib_store:
uselib_store = library.upper().replace('-', '_')
......@@ -119,7 +119,7 @@ class AutoOption:
def add_header(self, header):
"""
Add a required header that should be checked during configuration. The
header will be checked using the conf.check_cc function which means
header will be checked using the conf.check function which means
HAVE_HEADER_H will be defined if found.
"""
self.headers.append(header)
......@@ -192,7 +192,7 @@ class AutoOption:
# check for libraries
for lib,uselib_store in self.libs:
try:
conf.check_cc(lib=lib, uselib_store=uselib_store, use=use)
conf.check(lib=lib, uselib_store=uselib_store, use=use)
except conf.errors.ConfigurationError:
all_found = False
self.libs_not_found.append(lib)
......@@ -200,7 +200,7 @@ class AutoOption:
# check for headers
for header in self.headers:
try:
conf.check_cc(header_name=header, use=use)
conf.check(header_name=header, use=use)
except conf.errors.ConfigurationError:
all_found = False
self.headers_not_found.append(header)
......@@ -348,13 +348,16 @@ def check_for_celt_error(conf):
# before. Thus a fragment with both stdio.h and readline/readline.h need to be
# test-compiled to find out whether readline is available.
def check_for_readline(conf):
# FIXME: This check can be incorporated into the AutoOptions class by
# passing header_name=['stdio.h', 'readline/readline.h'] to check.
try:
conf.check_cc(fragment='''
#include <stdio.h>
#include <readline/readline.h>
int main(void) { return 0; }''',
execute=False,
msg='Checking for header readline/readline.h')
conf.check(fragment='''
#include <stdio.h>
#include <readline/readline.h>
int main(void) { return 0; }''',
execute=False,
msg='Checking for header readline/readline.h',
errmsg='not found')
return True
except conf.errors.ConfigurationError:
return False
......@@ -363,13 +366,15 @@ def check_for_readline_error(conf):
print_error('--readline requires the readline/readline.h header, but it cannot be found.')
def check_for_mmsystem(conf):
# FIXME: See comment in check_for_readline.
try:
conf.check_cc(fragment='''
#include <windows.h>
#include <mmsystem.h>
int main(void) { return 0; }''',
execute=False,
msg='Checking for header mmsystem.h')
conf.check(fragment='''
#include <windows.h>
#include <mmsystem.h>
int main(void) { return 0; }''',
execute=False,
msg='Checking for header mmsystem.h',
errmsg='not found')
return True
except conf.errors.ConfigurationError:
return False
......@@ -477,7 +482,7 @@ def configure(conf):
configure_auto_options(conf)
# Check for functions.
conf.check_cc(
conf.check(
function_name='ppoll',
header_name=['poll.h', 'signal.h'],
defines=['_GNU_SOURCE'],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment