#!/usr/bin/env python
from waflib.extras import autowaf as autowaf

def build(bld):
    obj = bld(features        = 'cxx cxxshlib',
              export_includes = ['../../include'],
              includes        = ['..', '../..', '../../include'],
              name            = 'libingen_shared',
              target          = 'ingen_shared',
              vnum            = '0.0.0',
              install_path    = '${LIBDIR}',
              linkflags       = '-ldl')
    autowaf.use_lib(bld, obj, 'GLIBMM LV2CORE LILV RAUL SORD LIBLO')

    obj.source = '''
            Builder.cpp
            ClashAvoider.cpp
            Configuration.cpp
            LV2Atom.cpp
            LV2Features.cpp
            LV2URIMap.cpp
            ResourceImpl.cpp
            Store.cpp
            World.cpp
            runtime_paths.cpp
    '''

    if bld.is_defined('HAVE_LIBLO'):
        obj.source += ' OSCSender.cpp '

    if bld.is_defined('HAVE_SOUP'):
        autowaf.use_lib(bld, obj, 'SOUP')
        obj.source += ' HTTPSender.cpp '