Use is_defined to check for HAVE_* variables set by checks.

Note that conf.define('FOO', 1) will NOT set conf.env['FOO'].


git-svn-id: svn://localhost/ardour2/branches/3.0@10164 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2011-09-29 20:29:06 +00:00
parent c1ef7b14a3
commit 4ffe8418e3
8 changed files with 23 additions and 21 deletions

View File

@ -370,10 +370,10 @@ def build(bld):
]
obj.includes += ['../libs']
if bld.env['HAVE_SUIL']:
if bld.is_defined('HAVE_SUIL'):
obj.source += [ 'lv2_plugin_ui.cc' ]
obj.uselib += ' SUIL '
elif bld.env['HAVE_SLV2']:
elif bld.is_defined('HAVE_SLV2'):
obj.source += [ 'lv2_plugin_ui.cc' ]
obj.uselib += ' SLV2 '

View File

@ -256,13 +256,13 @@ def configure(conf):
atleast_version='2.0')
autowaf.check_pkg(conf, 'lilv-0', uselib_store='LILV',
atleast_version='0.0.0', mandatory=False)
if conf.env['HAVE_LILV']:
if conf.is_defined('HAVE_LILV'):
autowaf.check_pkg(conf, 'suil-0', uselib_store='SUIL',
atleast_version='0.2.0', mandatory=False)
else:
autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2',
atleast_version='0.6.4', mandatory=False)
if conf.env['HAVE_SLV2']:
if conf.is_defined('HAVE_SLV2'):
autowaf.check_pkg(conf, 'rasqal', uselib_store='RASQAL',
atleast_version='0.9.14', mandatory=False)
autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH',
@ -338,7 +338,7 @@ int main(int argc, char **argv) {
if ogg_supported():
conf.define ('HAVE_OGG', 1)
if conf.env['HAVE_LILV'] or conf.env['HAVE_SLV2']:
if conf.is_defined('HAVE_LILV') or conf.is_defined('HAVE_SLV2'):
conf.define ('LV2_SUPPORT', 1)
conf.write_config_header('libardour-config.h', remove=False)
@ -382,13 +382,13 @@ def build(bld):
#obj.uselib += ' SOUNDTOUCH '
#obj.add_objects = 'default/libs/surfaces/control_protocol/smpte_1.o'
if bld.env['HAVE_LILV']:
if bld.is_defined('HAVE_LILV') :
obj.source += [ 'lv2_plugin_lilv.cc', 'lv2_event_buffer.cc',
'uri_map.cc', 'rdff.c' ]
obj.uselib += ['LILV']
if bld.env['HAVE_SUIL']:
if bld.is_defined('HAVE_SUIL'):
obj.uselib += ['SUIL']
elif bld.env['HAVE_SLV2']:
elif bld.is_defined('HAVE_SLV2'):
obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc',
'uri_map.cc', 'rdff.c' ]
obj.uselib += ['SLV2','RASQAL']
@ -424,7 +424,7 @@ def build(bld):
lang, 'LC_MESSAGES', 'libardour3.mo'),
mo)
if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
# Unit tests
testobj = bld(features = 'cxx cxxprogram')
testobj.source = '''

View File

@ -50,7 +50,9 @@ def build(bld):
#bld.install_files('${INCLUDEDIR}/audiographer/utils', 'audiographer/utils/*.h')
#bld.env['BUILD_TESTS'] = True
bld.env['HAVE_ALL_GTHREAD'] = bld.env['HAVE_GLIB'] and bld.env['HAVE_GLIBMM'] and bld.env['HAVE_GTHREAD']
bld.env['HAVE_ALL_GTHREAD'] = (bld.is_defined('HAVE_GLIB')
and bld.is_defined('HAVE_GLIBMM')
and bld.is_defined('HAVE_GTHREAD'))
audiographer = bld(features = 'cxx cxxshlib')
audiographer.source = '''

View File

@ -97,7 +97,7 @@ def build(bld):
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.defines = ['PACKAGE="libevoral"' ]
if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
# Static library (for unit test code coverage)
obj = bld(features = 'cxx cstlib')
obj.source = lib_source

View File

@ -127,7 +127,7 @@ def build(bld):
if bld.env['build_target'] == 'x86_64':
obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
# Unit tests
testobj = bld(features = 'cxx cxxprogram')
testobj.source = '''

View File

@ -45,7 +45,7 @@ def configure(conf):
sub_config_and_use(conf, i)
autowaf.check_pkg(conf, 'libusb-1.0', uselib_store='USB', mandatory=False)
if conf.env['HAVE_USB']:
if conf.is_defined('HAVE_USB'):
conf.define('BUILD_TRANZPORT', 1)
#conf.check_cc (lib='libusb', header_name='libusb.h', function_name='usb_interrupt_write', define_name='BUILD_TRANZPORT')
@ -53,12 +53,12 @@ def configure(conf):
conf.check_cc (lib='lo', header_name='lo/lo.h', function_name='lo_server_new', define_name='BUILD_OSC')
if Options.options.wiimote:
conf.check_cc (header_name='cwiid.h',define_name='HAVE_CWIID_H')
if not conf.env['HAVE_CWIID_H']:
conf.check_cc (header_name='cwiid.h', define_name='HAVE_CWIID_H')
if not conf.is_defined('HAVE_CWIID_H'):
print('WIIMOTE configured but you are missing libcwiid!')
sys.exit(1)
conf.check_cc (header_name='bluetooth/bluetooth.h',define_name='HAVE_BLUETOOTH_H')
if not conf.env['HAVE_BLUETOOTH_H']:
conf.check_cc (header_name='bluetooth/bluetooth.h', define_name='HAVE_BLUETOOTH_H')
if not conf.is_defined('HAVE_BLUETOOTH_H'):
print('WIIMOTE configured but you are missing the libbluetooth headers needed to compile wiimote support!')
sys.exit(1)
conf.define ('BUILD_WIIMOTE', 1)

View File

@ -46,7 +46,7 @@ def build(bld):
obj.target = 'ardourvampplugins'
obj.uselib = 'FFTW3F'
obj.use = 'libvampplugin libqmdsp'
if bld.env['HAVE_AUBIO']:
if bld.is_defined('HAVE_AUBIO'):
obj.source += ' Onset.cpp '
obj.uselib += ' AUBIO '
obj.vnum = LIBARDOURVAMPPLUGINS_LIB_VERSION

View File

@ -230,7 +230,7 @@ def set_compiler_flags (conf,opt):
print("\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)")
# check this even if we aren't using FPU optimization
if not conf.env['HAVE_POSIX_MEMALIGN']:
if not conf.is_defined('HAVE_POSIX_MEMALIGN'):
optimization_flags.append("-DNO_POSIX_MEMALIGN")
# end optimization section
@ -552,7 +552,7 @@ def configure(conf):
conf.define('LXVST_SUPPORT', 1)
conf.env['LXVST_SUPPORT'] = True
if bool(conf.env['JACK_SESSION']):
conf.define ('HAVE_JACK_SESSION', 1)
conf.define('HAVE_JACK_SESSION', 1)
if opts.wiimote:
conf.define('WIIMOTE', 1)
conf.env['WIIMOTE'] = True
@ -560,7 +560,7 @@ def configure(conf):
conf.env['PROGRAM_NAME'] = opts.program_name
if opts.rt_alloc_debug:
conf.define('DEBUG_RT_ALLOC', 1)
if not conf.env['HAVE_CPPUNIT']:
if not conf.is_defined('HAVE_CPPUNIT'):
conf.env['BUILD_TESTS'] = False
set_compiler_flags (conf, Options.options)