2 from waflib.extras import autowaf as autowaf
3 from waflib import TaskGen
7 # Version of this package (even if built as a child)
11 LIBFLUIDSYNTH_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
13 # Variables for 'waf dist'
15 VERSION = LIBFLUIDSYNTH_VERSION
16 I18N_PACKAGE = 'libfluidsynth'
23 autowaf.set_options(opt)
26 if conf.is_defined('USE_EXTERNAL_LIBS'):
27 autowaf.check_pkg(conf, 'fluidsynth', uselib_store='LIBFLUIDSYNTH', atleast_version=LIBFLUIDSYNTH_VERSION, mandatory=True)
29 conf.load('compiler_c')
30 autowaf.configure(conf)
33 if bld.is_defined('USE_EXTERNAL_LIBS'):
35 bld (export_includes = ['fluidsynth'],
36 name = 'libfluidsynth_includes'
38 obj = bld.stlib (source = [
40 'src/fluid_adsr_env.c',
42 'src/fluid_iir_filter.c',
46 'src/fluid_rvoice_dsp.c',
47 'src/fluid_rvoice_event.c',
48 'src/fluid_rvoice_mixer.c',
49 'src/fluid_defsfont.c',
60 'src/fluid_ringbuffer.c',
61 'src/fluid_samplecache.c',
62 'src/fluid_settings.c',
65 'src/fluid_synth_monopoly.c',
68 cflags = [ bld.env['compiler_flags_dict']['pic'], '-fvisibility=hidden', '-std=gnu99' ],
69 includes = ['.', 'src/' ],
70 target = 'libfluidsynth',
71 use = 'libfluidsynth_includes',
73 defines = [ 'HAVE_CONFIG_H', 'DEFAULT_SOUNDFONT=""' ]
77 # defining __MINGW32__ for wine-gcc is a workaround for fluidsynth's include
78 # strategy (which is made for mingw or windows) without it
79 # winsock2.h will complain about undeclared "u_short"
80 # we also need to explicitly define _WIN32
81 if bld.is_defined('WINDOWS_VST_SUPPORT') and not bld.env['build_target'] == 'mingw':
82 obj.defines += [ '_WIN32', '__MINGW32__' ]