1 project('fribidi', 'c', version: '1.0.5',
2 meson_version : '>= 0.44')
8 # If any functions have been added:
12 # If binary backwards compatibility has been broken:
19 libversion = '@0@.@1@.0'.format(soversion, interface_version, interface_age)
21 # C compiler. This is the cross compiler if we're cross-compiling
22 cc = meson.get_compiler('c')
24 if cc.get_id() == 'gcc' and cc.has_argument('-ansi')
25 add_project_arguments('-ansi', language: 'c')
29 have_visibility_hidden = cc.has_argument('-fvisibility=hidden')
30 if have_visibility_hidden
31 add_project_arguments('-fvisibility=hidden', language: 'c')
34 # Must explicitly make symbols public if default visibility is hidden
35 if have_visibility_hidden
36 visibility_args = ['-DFRIBIDI_ENTRY=extern __attribute__ ((visibility ("default")))']
38 if host_machine.system() == 'windows' and get_option('default_library') != 'static'
39 visibility_args = ['-DFRIBIDI_ENTRY=__declspec(dllexport)']
41 visibility_args = ['-DFRIBIDI_ENTRY=extern']
45 cdata = configuration_data()
47 # Checks for library functions
48 foreach f : ['memmove', 'memset', 'strdup']
49 cdata.set('HAVE_' + f.to_upper(), cc.has_function(f))
52 # Checks for header files
53 # Some HAVE_FOO defines need to be defined to either 1 or 0, others need to
54 # be defined or undefined. The code base is a bit inconsistent there.
55 foreach h : ['stdlib.h', 'string.h', 'memory.h']
56 cdata.set10('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
58 foreach h : ['strings.h', 'sys/times.h']
59 cdata.set('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
62 # Not entirely correct, but sufficient for us. Should move away from this
63 # ancient define and just include individual headers based on individual defs
64 if cc.has_header('strings.h')
65 # define to 1 or leave undefined otherwise, don't simplify
66 cdata.set('STDC_HEADERS', 1)
69 # This is available pretty much everywhere
70 cdata.set('HAVE_STRINGIZE', 1)
72 buildtype = get_option('buildtype')
73 if buildtype == 'debug' or buildtype == 'debugoptimized'
77 no_deprecated = not get_option('deprecated')
78 cdata.set('FRIBIDI_NO_DEPRECATED', no_deprecated)
81 config_h = configure_file(output: 'config.h', configuration: cdata)
83 incs = include_directories('.', 'lib')
94 pkg = import('pkgconfig')
95 pkg.generate(name: 'GNU FriBidi',
97 description: 'Unicode Bidirectional Algorithm Library',
98 libraries: libfribidi,
100 version: meson.project_version())