1project('terminology', 'c',
2        version: '1.9.0',
3        default_options: ['buildtype=plain', 'c_std=gnu99'],
4        license: 'BSD')
5
6cc = meson.get_compiler('c')
7
8prefix = get_option('prefix')
9add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
10config_data = configuration_data()
11config_data.set('EFL_BETA_API_SUPPORT', 1)
12config_data.set('EFL_EO_API_SUPPORT', 1)
13config_data.set_quoted('PACKAGE_VERSION', meson.project_version())
14config_data.set_quoted('PACKAGE', meson.project_name())
15config_data.set_quoted('PACKAGE_BUGREPORT',
16                       'enlightenment-devel@lists.sourceforge.net')
17config_data.set_quoted('PACKAGE_NAME', meson.project_name())
18config_data.set_quoted('PACKAGE_TARNAME', meson.project_name())
19config_data.set_quoted('PACKAGE_URL',
20                       'https://www.enlightenment.org/about-terminology')
21config_data.set_quoted('PACKAGE_BIN_DIR',
22                       join_paths(prefix, get_option('bindir')))
23config_data.set_quoted('PACKAGE_DATA_DIR',
24                       join_paths(prefix, get_option('datadir'),
25                                  meson.project_name()))
26config_data.set_quoted('PACKAGE_LIB_DIR',
27                       join_paths(prefix, get_option('libdir')))
28config_data.set_quoted('LOCALEDIR', join_paths(prefix, get_option('localedir')))
29
30host_os = host_machine.system()
31
32if host_os == 'linux'
33   config_data.set('_GNU_SOURCE', 1)
34   config_data.set('__EXTENSIONS__', 1)
35   config_data.set('_POSIX_PTHREAD_SEMANTICS', 1)
36   config_data.set('_TANDEM_SOURCE', 1)
37   config_data.set('_ALL_SOURCE', 1)
38   config_data.set('_POSIX_SOURCE', 1)
39   config_data.set('_POSIX_1_SOURCE', 1)
40endif
41
42efl_version = '1.22.0'
43m_dep = cc.find_library('m', required : false)
44efl_deps = ['edje',
45            'elementary',
46            'eina',
47            'eet',
48            'evas',
49            'ecore',
50            'ecore-evas',
51            'ecore-file',
52            'emotion',
53            'ecore-input',
54            'ecore-imf',
55            'ecore-imf-evas',
56            'ecore-ipc',
57            'efreet',
58            'ecore-con',
59            'ethumb_client']
60terminology_dependencies = [ m_dep ]
61edje_cc_path = ''
62eet_path = ''
63edj_targets = []
64edj_files = []
65
66if get_option('nls') == true
67  subdir('po')
68   terminology_dependencies += cc.find_library('intl', required: false)
69endif
70
71foreach efl_dep: efl_deps
72  dep = dependency(efl_dep, version: '>=' + efl_version)
73  terminology_dependencies += [dep]
74  if efl_dep == 'edje'
75    edje_cc_path = dep.get_pkgconfig_variable('prefix') + '/bin/edje_cc'
76  endif
77  if efl_dep == 'eet'
78    eet_path = dep.get_pkgconfig_variable('prefix') + '/bin/eet'
79  endif
80endforeach
81
82if cc.has_function('mkstemps')
83  config_data.set('HAVE_MKSTEMPS', 1)
84endif
85
86if cc.has_function('strchrnul')
87  config_data.set('HAVE_STRCHRNUL', 1)
88endif
89
90url_head_code = '''#include <Ecore_Con.h>
91int main(void) { ecore_con_url_head(NULL); return 0; }
92'''
93
94found = 'Not found'
95
96if cc.links(url_head_code, dependencies: terminology_dependencies)
97  config_data.set('HAVE_ECORE_CON_URL_HEAD', 1)
98  found = 'Found'
99endif
100
101message('Checking for ecore_con_url_head: ' + found)
102
103eet_bin = get_option('eet')
104if eet_bin == ''
105  eet_bin = eet_path
106endif
107
108edje_cc = get_option('edje-cc')
109if edje_cc == ''
110  edje_cc = edje_cc_path
111endif
112
113res = run_command(edje_cc, meson.current_source_dir() + '/data/test_offscale.edc')
114if res.returncode() == 0
115  message('edje_cc has support for offscale')
116  edje_offscale='-DHAS_OFFSCALE=1'
117else
118  message('edje_cc does not have support for offscale')
119  edje_offscale='-DHAS_OFFSCALE=0'
120endif
121
122fuzzing = get_option('fuzzing')
123
124if fuzzing
125  message('Fuzzing is enabled')
126else
127  message('Fuzzing is disabled')
128endif
129
130tests = get_option('tests')
131if tests
132  message('Tests are enabled')
133else
134  message('Tests are disabled')
135endif
136
137message('edje_cc set to:' + edje_cc)
138
139sed = find_program('sed')
140
141configure_file(output: 'terminology_config.h',
142               configuration: config_data)
143
144config_dir = include_directories('.')
145subdir('data')
146subdir('man')
147subdir('src/bin')
148
149