-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathmeson.build
132 lines (102 loc) · 4.19 KB
/
meson.build
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# This file is part of DirectFB.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
project('DirectFB2', 'c',
version: '2.0.0',
meson_version: '>= 0.61',
default_options: 'buildtype=release')
directfb_version = meson.project_version()
directfb_major_version = directfb_version.split('.')[0].to_int()
directfb_minor_version = directfb_version.split('.')[1].to_int()
directfb_micro_version = directfb_version.split('.')[2].to_int()
if get_option('default_library') == 'both'
error('''Choose library type between 'shared' or 'static'.''')
elif get_option('default_library') == 'shared'
libsuffix = '.so'
else
libsuffix = '.a'
endif
moduledirname = get_option('moduledirname')
if moduledirname == ''
if get_option('debug')
moduledirname = 'directfb-@0@.@1@-0-debug'.format(directfb_major_version, directfb_minor_version)
else
if not get_option('debug-support')
moduledirname = 'directfb-@0@.@1@-0-pure'.format(directfb_major_version, directfb_minor_version)
else
moduledirname = 'directfb-@0@.@1@-0'.format(directfb_major_version, directfb_minor_version)
endif
endif
endif
moduledir = join_paths(get_option('prefix'), get_option('libdir'), moduledirname)
cc = meson.get_compiler('c')
config_conf = configuration_data()
config_conf.set('SIZEOF_LONG', cc.sizeof('long'), description: 'The size of long, as computed by sizeof.')
config_conf.set('WORDS_BIGENDIAN', host_machine.endian() == 'big', description: 'Byte ordering is bigendian.')
if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64'
if get_option('mmx')
config_conf.set('USE_MMX', 1, description: 'Define to 1 if you are compiling MMX assembly support.')
endif
endif
if host_machine.cpu_family() == 'arm' or host_machine.cpu_family() == 'aarch64'
if get_option('neon')
config_conf.set('USE_NEON', 1, description: 'Define to 1 if you are compiling NEON assembly support.')
endif
endif
configure_file(configuration: config_conf, output: 'config.h')
config_inc = include_directories('.')
lib_inc = include_directories('lib')
directfb_inc = [include_directories('include', 'src'), lib_inc]
add_global_arguments('-Wstrict-prototypes', language: 'c')
pkgconfig = import('pkgconfig')
# core libraries
subdir('include')
subdir('lib/direct')
subdir('lib/fusion')
subdir('src')
# core system modules
subdir('systems/dummy')
if get_option('os') == 'linux'
if get_option('drmkms')
subdir('systems/drmkms')
endif
if get_option('fbdev')
subdir('systems/fbdev')
endif
endif
# input driver modules
if get_option('os') == 'linux'
if get_option('linux_input')
subdir('inputdrivers/linux_input')
endif
endif
# interface modules
subdir('interfaces/ICoreResourceManager')
subdir('interfaces/IDirectFBFont')
subdir('interfaces/IDirectFBImageProvider')
subdir('interfaces/IDirectFBVideoProvider')
subdir('interfaces/IDirectFBWindows')
# wm modules
subdir('wm/default')
# generate .pc files
dfb_update_pkgconfig_conf = configuration_data()
dfb_update_pkgconfig_conf.set('PKGCONFIGDIR', join_paths(get_option('prefix'), get_option('libdir'), 'pkgconfig'))
dfb_update_pkgconfig_conf.set('VERSION', directfb_version)
dfb_update_pkgconfig = configure_file(configuration: dfb_update_pkgconfig_conf,
input: 'dfb-update-pkgconfig.in',
output: 'dfb-update-pkgconfig',
install: true,
install_dir: get_option('bindir'))
meson.add_install_script(dfb_update_pkgconfig)