File: meson.build

package info (click to toggle)
fribidi 1.0.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 19,676 kB
  • sloc: ansic: 8,715; sh: 4,531; makefile: 351; python: 27
file content (100 lines) | stat: -rw-r--r-- 2,859 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
project('fribidi', 'c', version: '1.0.8',
  meson_version : '>= 0.44')

# New release:
#   interface_age++
#   micro version++
#
# If any functions have been added:
#   interface_age = 0
#   interface_version++
#
# If binary backwards compatibility has been broken:
#   panic!

interface_age = 0
interface_version = 4

soversion = 0
libversion = '@0@.@1@.0'.format(soversion, interface_version, interface_age)

# C compiler. This is the cross compiler if we're cross-compiling
cc = meson.get_compiler('c')

if cc.get_id() == 'gcc' and cc.has_argument('-ansi')
  add_project_arguments('-ansi', language: 'c')
endif

# Symbol visibility
have_visibility_hidden = cc.has_argument('-fvisibility=hidden')
if have_visibility_hidden
  add_project_arguments('-fvisibility=hidden', language: 'c')
endif

# Must explicitly make symbols public if default visibility is hidden
if have_visibility_hidden
  visibility_args = ['-DFRIBIDI_ENTRY=extern __attribute__ ((visibility ("default")))']
else
  if host_machine.system() == 'windows' and get_option('default_library') != 'static'
    visibility_args = ['-DFRIBIDI_ENTRY=__declspec(dllexport)']
  else
    visibility_args = ['-DFRIBIDI_ENTRY=extern']
  endif
endif

cdata = configuration_data()

# Checks for library functions
foreach f : ['memmove', 'memset', 'strdup']
  cdata.set('HAVE_' + f.to_upper(), cc.has_function(f))
endforeach

# Checks for header files
# Some HAVE_FOO defines need to be defined to either 1 or 0, others need to
# be defined or undefined. The code base is a bit inconsistent there.
foreach h : ['stdlib.h', 'string.h', 'memory.h']
  cdata.set10('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
endforeach
foreach h : ['strings.h', 'sys/times.h']
  cdata.set('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
endforeach

# Not entirely correct, but sufficient for us. Should move away from this
# ancient define and just include individual headers based on individual defs
if cc.has_header('strings.h')
  # define to 1 or leave undefined otherwise, don't simplify
  cdata.set('STDC_HEADERS', 1)
endif

# This is available pretty much everywhere
cdata.set('HAVE_STRINGIZE', 1)

buildtype = get_option('buildtype')
if buildtype == 'debug' or buildtype == 'debugoptimized'
  cdata.set('DEBUG', 1)
endif

no_deprecated = not get_option('deprecated')
cdata.set('FRIBIDI_NO_DEPRECATED', no_deprecated)

# write config.h
config_h = configure_file(output: 'config.h', configuration: cdata)

incs = include_directories('.', 'lib', 'gen.tab')

subdir('gen.tab')
subdir('lib')
subdir('bin')
subdir('test')
if get_option('docs')
  subdir('doc')
endif

# fribidi.pc
pkg = import('pkgconfig')
pkg.generate(name: 'GNU FriBidi',
  filebase: 'fribidi',
  description: 'Unicode Bidirectional Algorithm Library',
  libraries: libfribidi, 
  subdirs: 'fribidi',
  version: meson.project_version())