diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-08-12 15:26:29 +0200 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-10-02 17:22:50 +0200 |
commit | 46d464e5bfc10398461a33a2256c1c58d509dd1a (patch) | |
tree | 8c1a9272c05f14033a4430bc122632461bd73608 /src/lib/eina/meson.build | |
parent | 70ecf1056bb4be5a68b63044f938ccc2fe0a58c0 (diff) |
here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.
meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.
Further informations can be gathered from the README.meson
Right now, bindings & windows support are missing.
It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.
Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
Diffstat (limited to '')
-rw-r--r-- | src/lib/eina/meson.build | 398 |
1 files changed, 398 insertions, 0 deletions
diff --git a/src/lib/eina/meson.build b/src/lib/eina/meson.build new file mode 100644 index 0000000000..1d3bd51bed --- /dev/null +++ b/src/lib/eina/meson.build | |||
@@ -0,0 +1,398 @@ | |||
1 | eina_deps = [] | ||
2 | eina_pub_deps = [thread_dep] | ||
3 | |||
4 | public_sub_headers = [ | ||
5 | 'eina_promise.h', | ||
6 | 'eina_safety_checks.h', | ||
7 | 'eina_error.h', | ||
8 | 'eina_debug.h', | ||
9 | 'eina_debug_private.h', | ||
10 | 'eina_log.h', | ||
11 | 'eina_inline_log.x', | ||
12 | 'eina_fp.h', | ||
13 | 'eina_inline_f32p32.x', | ||
14 | 'eina_inline_f16p16.x', | ||
15 | 'eina_inline_f8p24.x', | ||
16 | 'eina_inline_fp.x', | ||
17 | 'eina_hash.h', | ||
18 | 'eina_inline_hash.x', | ||
19 | 'eina_lalloc.h', | ||
20 | 'eina_clist.h', | ||
21 | 'eina_inline_clist.x', | ||
22 | 'eina_inarray.h', | ||
23 | 'eina_inlist.h', | ||
24 | 'eina_inline_inlist.x', | ||
25 | 'eina_list.h', | ||
26 | 'eina_file.h', | ||
27 | 'eina_inline_file.x', | ||
28 | 'eina_mempool.h', | ||
29 | 'eina_module.h', | ||
30 | 'eina_rectangle.h', | ||
31 | 'eina_types.h', | ||
32 | 'eina_array.h', | ||
33 | 'eina_counter.h', | ||
34 | 'eina_inline_array.x', | ||
35 | 'eina_magic.h', | ||
36 | 'eina_stringshare.h', | ||
37 | 'eina_binshare.h', | ||
38 | 'eina_binbuf.h', | ||
39 | 'eina_ustringshare.h', | ||
40 | 'eina_inline_stringshare.x', | ||
41 | 'eina_inline_ustringshare.x', | ||
42 | 'eina_inline_list.x', | ||
43 | 'eina_accessor.h', | ||
44 | 'eina_convert.h', | ||
45 | 'eina_rbtree.h', | ||
46 | 'eina_benchmark.h', | ||
47 | 'eina_inline_rbtree.x', | ||
48 | 'eina_inline_mempool.x', | ||
49 | 'eina_inline_rectangle.x', | ||
50 | 'eina_inline_trash.x', | ||
51 | 'eina_thread.h', | ||
52 | 'eina_trash.h', | ||
53 | 'eina_iterator.h', | ||
54 | 'eina_main.h', | ||
55 | 'eina_cpu.h', | ||
56 | 'eina_inline_cpu.x', | ||
57 | 'eina_sched.h', | ||
58 | 'eina_tiler.h', | ||
59 | 'eina_hamster.h', | ||
60 | 'eina_matrixsparse.h', | ||
61 | 'eina_inline_tiler.x', | ||
62 | 'eina_str.h', | ||
63 | 'eina_inline_str.x', | ||
64 | 'eina_strbuf.h', | ||
65 | 'eina_ustrbuf.h', | ||
66 | 'eina_unicode.h', | ||
67 | 'eina_quadtree.h', | ||
68 | 'eina_simple_xml_parser.h', | ||
69 | 'eina_lock.h', | ||
70 | 'eina_prefix.h', | ||
71 | 'eina_refcount.h', | ||
72 | 'eina_mmap.h', | ||
73 | 'eina_xattr.h', | ||
74 | 'eina_value.h', | ||
75 | 'eina_inline_value.x', | ||
76 | 'eina_value_util.h', | ||
77 | 'eina_inline_value_util.x', | ||
78 | 'eina_inline_lock_barrier.x', | ||
79 | 'eina_inline_lock_posix.x', | ||
80 | 'eina_tmpstr.h', | ||
81 | 'eina_alloca.h', | ||
82 | 'eina_cow.h', | ||
83 | 'eina_inline_unicode.x', | ||
84 | 'eina_thread_queue.h', | ||
85 | 'eina_matrix.h', | ||
86 | 'eina_quad.h', | ||
87 | 'eina_crc.h', | ||
88 | 'eina_inline_crc.x', | ||
89 | 'eina_evlog.h', | ||
90 | 'eina_util.h', | ||
91 | 'eina_inline_util.x', | ||
92 | 'eina_quaternion.h', | ||
93 | 'eina_vector.h', | ||
94 | 'eina_inline_vector.x', | ||
95 | 'eina_bezier.h', | ||
96 | 'eina_safepointer.h', | ||
97 | 'eina_inline_safepointer.x', | ||
98 | 'eina_slice.h', | ||
99 | 'eina_inline_slice.x', | ||
100 | 'eina_inline_modinfo.x', | ||
101 | 'eina_freeq.h', | ||
102 | 'eina_slstr.h', | ||
103 | 'eina_vpath.h', | ||
104 | ] | ||
105 | |||
106 | public_headers = [ | ||
107 | 'Eina.h' | ||
108 | ] | ||
109 | |||
110 | sources = [ | ||
111 | 'eina_abi.c', | ||
112 | 'eina_accessor.c', | ||
113 | 'eina_array.c', | ||
114 | 'eina_benchmark.c', | ||
115 | 'eina_binbuf.c', | ||
116 | 'eina_binshare.c', | ||
117 | 'eina_convert.c', | ||
118 | 'eina_counter.c', | ||
119 | 'eina_cow.c', | ||
120 | 'eina_cpu.c', | ||
121 | 'eina_crc.c', | ||
122 | 'eina_debug.c', | ||
123 | 'eina_debug_bt.c', | ||
124 | 'eina_debug_bt_file.c', | ||
125 | 'eina_debug_chunk.c', | ||
126 | 'eina_debug_thread.c', | ||
127 | 'eina_debug_cpu.c', | ||
128 | 'eina_debug_timer.c', | ||
129 | 'eina_error.c', | ||
130 | 'eina_evlog.c', | ||
131 | 'eina_file_common.h', | ||
132 | 'eina_file_common.c', | ||
133 | 'eina_fp.c', | ||
134 | 'eina_hamster.c', | ||
135 | 'eina_hash.c', | ||
136 | 'eina_inarray.c', | ||
137 | 'eina_inlist.c', | ||
138 | 'eina_iterator.c', | ||
139 | 'eina_lalloc.c', | ||
140 | 'eina_list.c', | ||
141 | 'eina_lock.c', | ||
142 | 'eina_log.c', | ||
143 | 'eina_magic.c', | ||
144 | 'eina_main.c', | ||
145 | 'eina_matrix.c', | ||
146 | 'eina_matrixsparse.c', | ||
147 | 'eina_mempool.c', | ||
148 | 'eina_mmap.c', | ||
149 | 'eina_module.c', | ||
150 | 'eina_prefix.c', | ||
151 | 'eina_promise.c', | ||
152 | 'eina_promise_private.h', | ||
153 | 'eina_quad.c', | ||
154 | 'eina_quadtree.c', | ||
155 | 'eina_rbtree.c', | ||
156 | 'eina_rectangle.c', | ||
157 | 'eina_safety_checks.c', | ||
158 | 'eina_sched.c', | ||
159 | 'eina_share_common.c', | ||
160 | 'eina_simple_xml_parser.c', | ||
161 | 'eina_str.c', | ||
162 | 'eina_strbuf.c', | ||
163 | 'eina_strbuf_common.c', | ||
164 | 'eina_stringshare.c', | ||
165 | 'eina_thread.c', | ||
166 | 'eina_thread_queue.c', | ||
167 | 'eina_tiler.c', | ||
168 | 'eina_tmpstr.c', | ||
169 | 'eina_unicode.c', | ||
170 | 'eina_ustrbuf.c', | ||
171 | 'eina_ustringshare.c', | ||
172 | 'eina_util.c', | ||
173 | 'eina_value.c', | ||
174 | 'eina_value_util.c', | ||
175 | 'eina_xattr.c', | ||
176 | 'eina_private.h', | ||
177 | 'eina_share_common.h', | ||
178 | 'eina_strbuf_common.h', | ||
179 | 'eina_quaternion.c', | ||
180 | 'eina_bezier.c', | ||
181 | 'eina_safepointer.c', | ||
182 | 'eina_freeq.c', | ||
183 | 'eina_slstr.c', | ||
184 | 'eina_vpath.c', | ||
185 | 'eina_vpath_xdg.c' | ||
186 | ] | ||
187 | |||
188 | if target_machine.system() == 'cygwin' | ||
189 | sources += 'eina_file_win32.c' | ||
190 | else | ||
191 | sources += 'eina_file.c' | ||
192 | endif | ||
193 | |||
194 | eina_config = configuration_data() | ||
195 | |||
196 | if get_option('buildtype') == 'plain' | ||
197 | with_max_log_level=-1 | ||
198 | stringshare_usage=false | ||
199 | use_valgrind=true | ||
200 | debug_malloc=false | ||
201 | debug_threads=false | ||
202 | default_mempool=false | ||
203 | want_cow_magic=false | ||
204 | elif get_option('buildtype') == 'debug' | ||
205 | with_max_log_level=-1 | ||
206 | stringshare_usage=true | ||
207 | use_valgrind=true | ||
208 | debug_malloc=true | ||
209 | debug_threads=true | ||
210 | default_mempool=true | ||
211 | want_cow_magic=true | ||
212 | elif get_option('buildtype') == 'release' | ||
213 | with_max_log_level=3 | ||
214 | stringshare_usage=false | ||
215 | use_valgrind=false | ||
216 | debug_malloc=false | ||
217 | debug_threads=false | ||
218 | default_mempool=false | ||
219 | want_cow_magic=false | ||
220 | endif | ||
221 | |||
222 | if with_max_log_level != -1 | ||
223 | config_h.set('EINA_LOG_LEVEL_MAXIMUM', with_max_log_level) | ||
224 | endif | ||
225 | |||
226 | if stringshare_usage | ||
227 | config_h.set('EINA_STRINGSHARE_USAGE', 1) | ||
228 | endif | ||
229 | |||
230 | if use_valgrind | ||
231 | valgrind = dependency('valgrind', required: false) | ||
232 | if valgrind.found() == false | ||
233 | config_h.set('NVALGRIND', 1) | ||
234 | else | ||
235 | config_h.set('HAVE_VALGRIND', 1) | ||
236 | endif | ||
237 | eina_deps += valgrind | ||
238 | else | ||
239 | config_h.set('NVALGRIND', 1) | ||
240 | valgrind = [] | ||
241 | endif | ||
242 | |||
243 | if debug_malloc | ||
244 | config_h.set('EINA_DEBUG_MALLOC', 1) | ||
245 | endif | ||
246 | |||
247 | if want_cow_magic | ||
248 | config_h.set('EINA_COW_MAGIC_ON', 1) | ||
249 | endif | ||
250 | |||
251 | if get_option('eina-magic-debug') | ||
252 | eina_config.set('EINA_MAGIC_DEBUG', '1') | ||
253 | endif | ||
254 | |||
255 | if default_mempool | ||
256 | eina_config.set('EINA_DEFAULT_MEMPOOL', '1') | ||
257 | endif | ||
258 | |||
259 | if get_option('systemd') == true | ||
260 | systemd = dependency('libsystemd') | ||
261 | eina_deps += systemd | ||
262 | config_h.set('HAVE_SYSTEMD', '1') | ||
263 | else | ||
264 | systemd = [] | ||
265 | endif | ||
266 | |||
267 | |||
268 | eina_config.set('EINA_SAFETY_CHECKS', '1') | ||
269 | eina_config.set('EINA_HAVE_THREADS', '1') | ||
270 | |||
271 | |||
272 | if cc.has_header_symbol('pthread.h', 'pthread_barrier_init') | ||
273 | eina_config.set('EINA_HAVE_PTHREAD_BARRIER', '1') | ||
274 | endif | ||
275 | |||
276 | if target_machine.system() == 'linux' | ||
277 | pthread_np_header_file = 'pthread.h' | ||
278 | pthread_setname_np_api = 'pthread_setname_np' | ||
279 | pthread_args = '-D_GNU_SOURCE' | ||
280 | else | ||
281 | pthread_np_header_file = 'pthread_np.h' | ||
282 | pthread_setname_np_api = 'pthread_set_name_np' | ||
283 | pthread_args = [] | ||
284 | endif | ||
285 | |||
286 | if cc.has_header_symbol(pthread_np_header_file, pthread_setname_np_api, args : pthread_args) | ||
287 | eina_config.set('EINA_HAVE_PTHREAD_SETNAME', '1') | ||
288 | endif | ||
289 | |||
290 | if cc.has_header_symbol(pthread_np_header_file, 'pthread_attr_setaffinity_np', args : pthread_args) | ||
291 | eina_config.set('EINA_HAVE_PTHREAD_AFFINITY', '1') | ||
292 | endif | ||
293 | # FIXME the author of eina_debug probebly never ran with EINA_HAVE_DEBUG_THREADS | ||
294 | # however eina debug decides to init that lock and never frees it. which means | ||
295 | # the code in eina_main.c will not work in the way it currently is there. | ||
296 | |||
297 | #if debug_threads or get_option('debug-threads') | ||
298 | # eina_config.set('EINA_HAVE_DEBUG_THREADS', '1') | ||
299 | #endif | ||
300 | |||
301 | eina_config.set('EINA_SIZEOF_WCHAR_T', cc.sizeof('wchar_t', prefix : '#include<wchar.h>')) | ||
302 | |||
303 | uintptr_size = cc.sizeof('uintptr_t', prefix : '#include<stdint.h>') | ||
304 | |||
305 | eina_config.set('EINA_SIZEOF_UINTPTR_T', uintptr_size) | ||
306 | config_h.set('SIZEOF_UINTPTR_T', uintptr_size) | ||
307 | |||
308 | if cc.has_header('dirent.h') | ||
309 | eina_config.set('EINA_CONFIGURE_HAVE_DIRENT_H', '1') | ||
310 | endif | ||
311 | |||
312 | eina_config.set('EINA_ENABLE_LOG', '1') | ||
313 | |||
314 | if cc.has_header_symbol('alloca.h', 'alloca') | ||
315 | eina_config.set('EINA_HAVE_ALLOCA_H', '1') | ||
316 | endif | ||
317 | |||
318 | if cc.has_header('byteswap.h') | ||
319 | eina_config.set('EINA_HAVE_BYTESWAP_H', '1') | ||
320 | endif | ||
321 | |||
322 | if cc.has_header_symbol('byteswap.h', 'bswap_16') | ||
323 | eina_config.set('EINA_HAVE_BSWAP16', '1') | ||
324 | endif | ||
325 | |||
326 | if cc.has_header_symbol('byteswap.h', 'bswap_32') | ||
327 | eina_config.set('EINA_HAVE_BSWAP32', '1') | ||
328 | endif | ||
329 | |||
330 | if cc.has_header_symbol('byteswap.h', 'bswap_64') | ||
331 | eina_config.set('EINA_HAVE_BSWAP64', '1') | ||
332 | endif | ||
333 | |||
334 | if cc.has_header_symbol('pthread.h', 'pthread_spin_init') | ||
335 | eina_config.set('EINA_HAVE_POSIX_SPINLOCK', '1') | ||
336 | endif | ||
337 | |||
338 | if target_machine.system() == 'darwin' | ||
339 | if cc.has_header_symbol('libkern/OSAtomic.h', 'OSSpinLockTry') | ||
340 | eina_config.set('EINA_HAVE_OSX_SPINLOCK', 1) | ||
341 | endif | ||
342 | if cc.has_header_symbol('mach/task.h', 'semaphore_create') | ||
343 | eina_config.set('EINA_HAVE_OSX_SEMAPHORE', 1) | ||
344 | endif | ||
345 | |||
346 | endif | ||
347 | |||
348 | eina_config_file = configure_file( | ||
349 | output: 'eina_config.h', | ||
350 | configuration: eina_config, | ||
351 | install: true) | ||
352 | |||
353 | public_headers += eina_config_file | ||
354 | |||
355 | unwind = dependency('libunwind-generic', required: false) | ||
356 | if unwind.found() | ||
357 | config_h.set('HAVE_UNWIND', 1) | ||
358 | eina_deps += unwind | ||
359 | endif | ||
360 | |||
361 | #for the case that the iconv library is not part of libc but rather libiconv or smth. like that | ||
362 | iconv = dependency('iconv', required: false) | ||
363 | if iconv.found() == false | ||
364 | iconv = cc.find_library('iconv', required: false) | ||
365 | endif | ||
366 | |||
367 | execinfo = cc.find_library('execinfo', required: false) | ||
368 | |||
369 | eina_lib = library('eina', sources, | ||
370 | include_directories : config_dir, | ||
371 | dependencies: [m, rt, dl, execinfo, iconv, eina_deps, thread_dep, eina_mem_pools], | ||
372 | install: true, | ||
373 | version : meson.project_version() | ||
374 | ) | ||
375 | |||
376 | |||
377 | eina = declare_dependency( | ||
378 | include_directories: [include_directories('.')] + config_dir, | ||
379 | dependencies : eina_pub_deps + eina_deps, | ||
380 | link_with: eina_lib, | ||
381 | ) | ||
382 | |||
383 | install_headers(public_headers, | ||
384 | install_dir : dir_package_include, | ||
385 | ) | ||
386 | |||
387 | install_headers(public_sub_headers, | ||
388 | install_dir : join_paths(dir_package_include, 'eina') | ||
389 | ) | ||
390 | |||
391 | automatic_pkgfile = false | ||
392 | |||
393 | pkgconfig.generate(eina_lib, | ||
394 | name : 'eina', | ||
395 | subdirs : ['eina-'+version_major, 'efl-'+version_major, join_paths('eina-'+version_major, 'eina')], | ||
396 | version : version_major + '.' + version_minor, | ||
397 | libraries : eina_pub_deps, | ||
398 | ) | ||