2015-06-15 22:50:29 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
import lutin.module as module
|
|
|
|
import lutin.tools as tools
|
|
|
|
|
|
|
|
def get_desc():
|
|
|
|
return "Algorithm of speex codec"
|
|
|
|
|
|
|
|
|
|
|
|
def create(target):
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module = module.Module(__file__, 'speex-dsp', 'LIBRARY')
|
2015-06-15 22:50:29 +02:00
|
|
|
# add the file to compile:
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.add_src_file([
|
2015-06-15 22:50:29 +02:00
|
|
|
'speex-dsp/libspeexdsp/filterbank.c',
|
|
|
|
'speex-dsp/libspeexdsp/resample.c',
|
|
|
|
'speex-dsp/libspeexdsp/scal.c',
|
|
|
|
'speex-dsp/libspeexdsp/fftwrap.c',
|
|
|
|
'speex-dsp/libspeexdsp/jitter.c',
|
|
|
|
'speex-dsp/libspeexdsp/mdf.c',
|
|
|
|
'speex-dsp/libspeexdsp/preprocess.c',
|
|
|
|
'speex-dsp/libspeexdsp/smallft.c',
|
|
|
|
'speex-dsp/libspeexdsp/buffer.c',
|
|
|
|
'speex-dsp/libspeexdsp/kiss_fft.c',
|
|
|
|
'speex-dsp/libspeexdsp/kiss_fftr.c'
|
|
|
|
])
|
2015-09-14 21:11:04 +02:00
|
|
|
"""
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.add_header_file([
|
2015-09-14 21:11:04 +02:00
|
|
|
'speex-dsp/include/speex/filterbank.h',
|
|
|
|
'speex-dsp/include/speex/resample.h',
|
|
|
|
'speex-dsp/include/speex/scal.h',
|
|
|
|
'speex-dsp/include/speex/fftwrap.h',
|
|
|
|
'speex-dsp/include/speex/jitter.h',
|
|
|
|
'speex-dsp/include/speex/mdf.h',
|
|
|
|
'speex-dsp/include/speex/preprocess.h',
|
|
|
|
'speex-dsp/include/speex/smallft.h',
|
|
|
|
'speex-dsp/include/speex/buffer.h',
|
|
|
|
'speex-dsp/include/speex/kiss_fft.h',
|
|
|
|
'speex-dsp/include/speex/kiss_fftr.h'
|
|
|
|
])
|
|
|
|
"""
|
2015-06-15 22:50:29 +02:00
|
|
|
# name of the dependency
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.add_module_depend('z')
|
|
|
|
my_module.compile_version_CC(1999)
|
|
|
|
my_module.add_export_path(tools.get_current_path(__file__) + "/speex-dsp/include")
|
2015-06-15 22:50:29 +02:00
|
|
|
# configure library:
|
|
|
|
# Make use of ARM4 assembly optimizations
|
2015-09-24 21:44:04 +02:00
|
|
|
#my_module.compile_flags('c', "-DARM4_ASM=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Make use of ARM5E assembly optimizations
|
2015-09-24 21:44:04 +02:00
|
|
|
#my_module.compile_flags('c', "-DARM5E_ASM=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Make use of Blackfin assembly optimizations
|
2015-09-24 21:44:04 +02:00
|
|
|
#my_module.compile_flags('c', "-DBFIN_ASM=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Disable all parts of the API that are using floats
|
2015-09-24 21:44:04 +02:00
|
|
|
#my_module.compile_flags('c', "-DDISABLE_FLOAT_API=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Enable valgrind extra checks
|
2015-09-24 21:44:04 +02:00
|
|
|
#my_module.compile_flags('c', "-DENABLE_VALGRIND=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Symbol visibility prefix */
|
|
|
|
#define EXPORT __attribute__((visibility("default")))
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.compile_flags('c', "-DEXPORT=''")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Debug fixed-point implementation */
|
2015-09-24 21:44:04 +02:00
|
|
|
#my_module.compile_flags('c', "-DFIXED_DEBUG=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Compile as fixed-point / floating-point
|
|
|
|
if True:
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.compile_flags('c', "-DFIXED_POINT")
|
2015-06-15 22:50:29 +02:00
|
|
|
else:
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.compile_flags('c', "-DFLOATING_POINT")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Enable NEON support */
|
2015-09-24 21:44:04 +02:00
|
|
|
#my_module.compile_flags('c', "-D_USE_NEON=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Enable SSE support */
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.compile_flags('c', "-D_USE_SSE=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Enable SSE2 support */
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.compile_flags('c', "-D_USE_SSE2=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Define to 1 if you have the <alloca.h> header file.
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.compile_flags('c', "-DHAVE_ALLOCA_H=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Use FFT from OggVorbis */
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.compile_flags('c', "-DUSE_SMALLFT=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
# Use C99 variable-size arrays */
|
2015-09-24 21:44:04 +02:00
|
|
|
my_module.compile_flags('c', "-DVAR_ARRAYS=1")
|
2015-06-15 22:50:29 +02:00
|
|
|
|
2015-09-24 21:44:04 +02:00
|
|
|
return my_module
|
2015-06-15 22:50:29 +02:00
|
|
|
|
|
|
|
|