2016-08-23 12:50:54 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
from waflib.extras import autowaf as autowaf
|
|
|
|
from waflib import TaskGen
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
# Version of this package (even if built as a child)
|
2018-10-17 18:41:02 -04:00
|
|
|
MAJOR = '2'
|
|
|
|
MINOR = '0'
|
|
|
|
MICRO = '1'
|
2016-08-23 12:50:54 -04:00
|
|
|
LIBFLUIDSYNTH_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
|
|
|
|
|
|
|
|
# Variables for 'waf dist'
|
|
|
|
APPNAME = 'libltc'
|
|
|
|
VERSION = LIBFLUIDSYNTH_VERSION
|
|
|
|
I18N_PACKAGE = 'libfluidsynth'
|
|
|
|
|
|
|
|
# Mandatory variables
|
|
|
|
top = '.'
|
|
|
|
out = 'build'
|
|
|
|
|
|
|
|
def options(opt):
|
|
|
|
autowaf.set_options(opt)
|
|
|
|
|
|
|
|
def configure(conf):
|
|
|
|
if conf.is_defined('USE_EXTERNAL_LIBS'):
|
2016-08-23 20:26:39 -04:00
|
|
|
autowaf.check_pkg(conf, 'fluidsynth', uselib_store='LIBFLUIDSYNTH', atleast_version=LIBFLUIDSYNTH_VERSION, mandatory=True)
|
2016-08-23 12:50:54 -04:00
|
|
|
else:
|
|
|
|
conf.load('compiler_c')
|
|
|
|
autowaf.configure(conf)
|
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
if bld.is_defined('USE_EXTERNAL_LIBS'):
|
|
|
|
return
|
|
|
|
bld (export_includes = ['fluidsynth'],
|
|
|
|
name = 'libfluidsynth_includes'
|
|
|
|
)
|
2016-08-25 15:36:02 -04:00
|
|
|
obj = bld.stlib (source = [
|
2016-08-23 12:50:54 -04:00
|
|
|
'src/fluid_midi.c',
|
|
|
|
'src/fluid_adsr_env.c',
|
|
|
|
'src/fluid_chorus.c',
|
|
|
|
'src/fluid_iir_filter.c',
|
|
|
|
'src/fluid_lfo.c',
|
|
|
|
'src/fluid_rev.c',
|
|
|
|
'src/fluid_rvoice.c',
|
|
|
|
'src/fluid_rvoice_dsp.c',
|
|
|
|
'src/fluid_rvoice_event.c',
|
|
|
|
'src/fluid_rvoice_mixer.c',
|
|
|
|
'src/fluid_defsfont.c',
|
|
|
|
'src/fluid_chan.c',
|
|
|
|
'src/fluid_event.c',
|
|
|
|
'src/fluid_gen.c',
|
|
|
|
'src/fluid_mod.c',
|
|
|
|
'src/fluid_synth.c',
|
|
|
|
'src/fluid_tuning.c',
|
|
|
|
'src/fluid_voice.c',
|
|
|
|
'src/fluid_conv.c',
|
|
|
|
'src/fluid_hash.c',
|
|
|
|
'src/fluid_list.c',
|
|
|
|
'src/fluid_ringbuffer.c',
|
2018-10-17 18:41:02 -04:00
|
|
|
'src/fluid_samplecache.c',
|
2016-08-23 12:50:54 -04:00
|
|
|
'src/fluid_settings.c',
|
2018-10-17 18:41:02 -04:00
|
|
|
'src/fluid_sffile.c',
|
|
|
|
'src/fluid_sfont.c',
|
|
|
|
'src/fluid_synth_monopoly.c',
|
2016-08-23 12:50:54 -04:00
|
|
|
'src/fluid_sys.c'
|
|
|
|
],
|
2018-10-17 22:09:14 -04:00
|
|
|
cflags = [ bld.env['compiler_flags_dict']['pic'], '-fvisibility=hidden', '-std=gnu99' ],
|
2016-08-23 12:50:54 -04:00
|
|
|
includes = ['.', 'src/' ],
|
|
|
|
target = 'libfluidsynth',
|
|
|
|
use = 'libfluidsynth_includes',
|
|
|
|
uselib = 'GLIB',
|
|
|
|
defines = [ 'HAVE_CONFIG_H', 'DEFAULT_SOUNDFONT=""' ]
|
|
|
|
)
|
|
|
|
|
2016-08-25 15:36:02 -04:00
|
|
|
# wine-gcc hacks:
|
|
|
|
# defining __MINGW32__ for wine-gcc is a workaround for fluidsynth's include
|
|
|
|
# strategy (which is made for mingw or windows) without it
|
|
|
|
# winsock2.h will complain about undeclared "u_short"
|
|
|
|
# we also need to explicitly define _WIN32
|
|
|
|
if bld.is_defined('WINDOWS_VST_SUPPORT') and not bld.env['build_target'] == 'mingw':
|
|
|
|
obj.defines += [ '_WIN32', '__MINGW32__' ]
|
|
|
|
|
2016-08-23 12:50:54 -04:00
|
|
|
def shutdown():
|
|
|
|
autowaf.shutdown()
|