Skip to content

Commit 5d412ed

Browse files
committed
Meson support
1 parent 4d2c976 commit 5d412ed

38 files changed

+3978
-0
lines changed

audio/meson.build

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
audio_lib_cpp_args = []
2+
audio_lib_deps = []
3+
4+
# nas
5+
6+
if not get_option('audio_nas').disabled()
7+
# nas does not provide a pkg-config file, so we do the detection manually:
8+
audio_nas_dep = dependency('audio', required: false)
9+
if not audio_nas_dep.found()
10+
audio_nas_dep = cxx.find_library('audio', has_headers: 'audio/audiolib.h', required: false)
11+
if audio_nas_dep.found()
12+
audio_lib_cpp_args += '-DSUPPORT_NAS'
13+
audio_lib_deps += audio_nas_dep
14+
else
15+
assert(not get_option('audio_nas').enabled(), 'NAS enabled but dependency not found')
16+
endif
17+
endif
18+
endif
19+
20+
# esd
21+
# esd has been removed from debian stable. Are there esd users out there?
22+
audio_esd_dep = dependency('esound', required: get_option('audio_esd'))
23+
if audio_esd_dep.found()
24+
audio_lib_cpp_args += '-DSUPPORT_ESD'
25+
audio_lib_deps += audio_esd_dep
26+
endif
27+
28+
# sun16audio
29+
if host_machine.system() == 'sunos' # illumos and Solaris
30+
audio_lib_cpp_args += '-DSUPPORT_SUN16'
31+
endif
32+
33+
# mplayer (disabled by default, not a robust solution)
34+
if not get_option('audio_mplayer').disabled()
35+
audio_lib_cpp_args += '-DSUPPORT_MPLAYER'
36+
endif
37+
38+
39+
# winmm audio
40+
if not get_option('audio_win32').disabled() and (host_machine.system() == 'windows' or host_machine.system() == 'cygwin')
41+
audio_lib_cpp_args += '-DSUPPORT_WIN32AUDIO'
42+
# Here I could try to possibly use find_library()...
43+
winmm_dep = cxx.find_library('winmm')
44+
audio_lib_deps += winmm_dep
45+
endif
46+
47+
if host_machine.system() == 'windows'
48+
winsock2_dep = cxx.find_library('wsock32')
49+
audio_lib_deps += winsock2_dep
50+
endif
51+
52+
53+
# irix audio
54+
if not get_option('audio_irix').disabled() and host_machine.system().startswith('irix')
55+
irix_dep = cxx.find_library('audio', has_headers: 'audio.h', required: audio_irix)
56+
if irix_dep.found()
57+
audio_lib_cpp_args += '-DSUPPORT_IRIX'
58+
audio_lib_deps += irix_dep
59+
# usleep not available on irix 5.3:
60+
if not cxx.has_function('usleep', prefix : '#include <unistd.h>')
61+
audio_lib_cpp_args += '-DSUPPORT_IRIX53'
62+
endif
63+
endif
64+
endif
65+
66+
# os2audio
67+
if not get_option('audio_os2').disabled()
68+
error('the meson build system for speech-tools does not support the os/2 operating system')
69+
# You will need -los2me, according to os2_audio.cc
70+
endif
71+
72+
#macosxaudio
73+
if not get_option('audio_osx').disabled() and host_machine.system() == 'darwin'
74+
audio_lib_cpp_args += '-DSUPPORT_MACOSX_AUDIO'
75+
# Here I could try to possibly use find_library()...
76+
osx_dep = declare_dependency(link_args: ['-framework', 'CoreAudio', '-framework', 'AudioUnit',
77+
'-framework', 'AudioToolbox', '-framework', 'Cocoa'])
78+
audio_lib_deps += osx_dep
79+
endif
80+
81+
#pulseaudio
82+
audio_pulse_dep = dependency('libpulse-simple', required: get_option('audio_pulseaudio'))
83+
if audio_pulse_dep.found()
84+
audio_lib_cpp_args += '-DSUPPORT_PULSEAUDIO'
85+
audio_lib_deps += audio_pulse_dep
86+
endif
87+
88+
89+
#linuxsound
90+
## alsa
91+
audio_alsa_dep = dependency('alsa', required: get_option('audio_alsa'))
92+
if audio_alsa_dep.found()
93+
audio_lib_cpp_args += '-DSUPPORT_ALSALINUX'
94+
audio_lib_deps += audio_alsa_dep
95+
endif
96+
97+
## voxware
98+
if host_machine.system() == 'freebsd' or host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd'
99+
audio_lib_cpp_args += '-DSUPPORT_FREEBSD16'
100+
endif
101+
102+
if host_machine.system() == 'linux' and not audio_alsa_dep.found()
103+
audio_lib_cpp_args += '-DSUPPORT_VOXWARE'
104+
endif
105+
106+
# The linux_sound.cc define logic could be cleaned up (e.g. unused SUPPORT_LINUX16)
107+
108+
109+
audio_lib = static_library(
110+
'audio_lib',
111+
sources: files(
112+
'gen_audio.cc',
113+
'nas.cc',
114+
'esd.cc',
115+
'sun16audio.cc',
116+
'mplayer.cc',
117+
'win32audio.cc',
118+
'irixaudio.cc',
119+
'os2audio.cc',
120+
'macosxaudio.cc',
121+
'pulseaudio.cc',
122+
'linux_sound.cc'
123+
),
124+
include_directories : ['.', '../include/'],
125+
install: false,
126+
cpp_args: audio_lib_cpp_args,
127+
dependencies: audio_lib_deps
128+
)
129+
130+
libestbase_conv_libs += audio_lib
131+

base_class/inst_tmpl/meson.build

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
base_class_inst_tmpl_lib = static_library(
2+
'base_class_inst_tmpl',
3+
sources: files( # estbase
4+
'deq_i_t.cc',
5+
'deq_s_t.cc',
6+
'hash_fi_t.cc',
7+
'hash_ii_t.cc',
8+
'hash_iv_t.cc',
9+
'hash_sd_t.cc',
10+
'hash_sfmp_t.cc',
11+
'hash_sf_t.cc',
12+
'hash_si_t.cc',
13+
'hash_srp.cc',
14+
'hash_ss_t.cc',
15+
'hash_sv_t.cc',
16+
'kvl_fi_t.cc',
17+
'kvl_ii_t.cc',
18+
'kvl_rs_t.cc',
19+
'kvl_sd_t.cc',
20+
'kvl_sf_t.cc',
21+
'kvl_si_t.cc',
22+
'kvl_ss_t.cc',
23+
'kvl_sv_t.cc',
24+
'kvl_vpi_t.cc',
25+
'list_c_t.cc',
26+
'list_d_t.cc',
27+
'list_f_t.cc',
28+
'list_i_t.cc',
29+
'list_li_t.cc',
30+
'list_si_t.cc',
31+
'list_s_t.cc',
32+
'list_val_t.cc',
33+
'list_vi_t.cc',
34+
'list_vs_t.cc',
35+
'matrix_d_t.cc',
36+
'matrix_f_t.cc',
37+
'matrix_i_t.cc',
38+
'matrix_si_t.cc',
39+
'matrix_s_t.cc',
40+
'matrix_val_t.cc',
41+
'tbuffer_t.cc',
42+
'vector_c_t.cc',
43+
'vector_dmatrix_t.cc',
44+
'vector_d_t.cc',
45+
'vector_dvector_t.cc',
46+
'vector_fmatrix_t.cc',
47+
'vector_f_t.cc',
48+
'vector_fvector_t.cc',
49+
'vector_i_t.cc',
50+
'vector_ls_t.cc',
51+
'vector_si_t.cc',
52+
'vector_s_t.cc',
53+
'vector_val_t.cc',
54+
# 'timeindex_tr.cc'
55+
),
56+
cpp_args: ['-DINSTANTIATE_TEMPLATES'],
57+
include_directories : ['.', '..', '../../include/']
58+
)
59+
60+
libestbase_conv_libs += base_class_inst_tmpl_lib
61+

base_class/meson.build

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
# These are headers and template headers that should not be compiled
3+
# Most of them have .cc extensions, probably because when they were written
4+
# templates were so new that it was confusing to have implementations in header files.
5+
base_class_headers = files(
6+
'EST_matrix_support.h',
7+
'EST_TBuffer.cc',
8+
'EST_TDeque.cc',
9+
'EST_THash.cc',
10+
'EST_TKVL.cc',
11+
'EST_TList.cc',
12+
'EST_TMatrix.cc',
13+
'EST_TNamedEnum.cc',
14+
'EST_TSimpleMatrix.cc',
15+
'EST_TSimpleVector.cc',
16+
'EST_TSortable.cc',
17+
'EST_TTimeIndex.cc',
18+
'EST_Tvectlist.cc',
19+
'EST_TVector.cc'
20+
21+
)
22+
23+
# Since speech tools include/ headers expect these headers to be on ../base_class
24+
# we set up the $includedir/speech_tools/ to have a base_class/ and an include/ directory
25+
install_headers(
26+
base_class_headers,
27+
subdir : meson.project_name() / 'base_class'
28+
)
29+
30+
31+
# Files that need to instantiate templates:
32+
33+
base_class_tsrcs = files(
34+
'EST_Featured.cc',
35+
'EST_Features.cc'
36+
)
37+
38+
base_class_t_lib = static_library(
39+
'base_class_t_lib',
40+
sources: base_class_tsrcs,
41+
cpp_args : ['-DINSTANTIATE_TEMPLATES'],
42+
include_directories : ['.', '../include/']
43+
)
44+
45+
libestbase_conv_libs += base_class_t_lib
46+
47+
48+
# Files that do not instantiate templates:
49+
base_class_cpp = files(
50+
'EST_UList.cc',
51+
'EST_Option.cc',
52+
'EST_StringTrie.cc',
53+
'EST_Token.cc',
54+
'vec_mat_aux.cc',
55+
'THash_aux.cc',
56+
'EST_FMatrix.cc',
57+
'EST_Complex.cc',
58+
'EST_Val.cc',
59+
'EST_matrix_support.cc',
60+
'rateconv.cc',
61+
'EST_IMatrix.cc',
62+
'EST_SMatrix.cc',
63+
'EST_DMatrix.cc',
64+
'vec_mat_aux_d.cc',
65+
'EST_FeatureData.cc',
66+
'EST_slist_aux.cc',
67+
'EST_svec_aux.cc',
68+
'EST_ilist_aux.cc',
69+
'EST_features_aux.cc',
70+
'EST_features_io.cc',
71+
'vec_mat_aux_i.cc'
72+
)
73+
74+
if host_machine.system() == 'windows'
75+
base_class_cpp += files('EST_Pathname_win32.cc')
76+
else
77+
base_class_cpp += files('EST_Pathname_unix.cc')
78+
endif
79+
80+
81+
base_class_lib = static_library(
82+
'base_class_lib',
83+
sources: base_class_cpp,
84+
include_directories : ['.', '../include/']
85+
)
86+
87+
libestbase_conv_libs += base_class_lib
88+
89+
subdir('inst_tmpl')
90+
subdir('string')
91+

base_class/string/meson.build

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
base_class_string_lib = static_library(
2+
'base_class_string_lib',
3+
sources: files(
4+
'regerror.c',
5+
'regsub.c',
6+
'EST_strcasecmp.c',
7+
'EST_String.cc',
8+
'EST_Regex.cc',
9+
'EST_Chunk.cc',
10+
'regexp.cc'
11+
),
12+
include_directories : ['.', '..', '../../include/']
13+
)
14+
15+
16+
libestring_conv_libs += base_class_string_lib
17+

0 commit comments

Comments
 (0)