File: meson.build

package info (click to toggle)
cinnamon-session 6.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,356 kB
  • sloc: ansic: 14,302; xml: 871; python: 372; sh: 35; makefile: 9
file content (182 lines) | stat: -rw-r--r-- 5,798 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# https://github.com/linuxmint/cinnamon-session
project(
  'cinnamon-session',
  ['c'],
  version : '6.4.2',
  meson_version : '>=0.56.0'
)

################################################################################
gnome = import('gnome')

cc = meson.get_compiler('c')
conf = configuration_data()
project_cflags = []

if not get_option('frequent_warnings')
  warnflags = [
    '-Wno-deprecated-declarations',
    '-Wno-unused',
  ]
  foreach arg : warnflags
    if cc.has_argument(arg)
      project_cflags += arg
    endif
  endforeach
endif

################################################################################
# Dependencies

gio         = dependency('gio-2.0')
gtk3        = dependency('gtk+-3.0',    version: '>=3.0.0')
glib        = dependency('glib-2.0',    version: '>=2.37.3')
libcanberra = dependency('libcanberra')
pango       = dependency('pango')
pangoxft    = dependency('pangoxft', required: false)
sm          = dependency('sm')
ice         = dependency('ice')
x11         = dependency('x11')
xext        = dependency('xext')
xapp        = dependency('xapp', version: '>=1.0.4')
xau         = dependency('xau')
xcomposite  = dependency('xcomposite')
gl          = dependency('gl')
cinnamon_desktop = dependency('cinnamon-desktop', version: '>=6.0.0')

gio_unix    = dependency('gio-unix-2.0',      required: false)
libelogind  = dependency('libelogind',        required: false)
libsystemdl = dependency('libsystemd-login',  required: false)
if not libsystemdl.found()
  libsystemdl=dependency('libsystemd',        required: false)
endif

if gio_unix.found() and libsystemdl.found()
  logind = declare_dependency(dependencies: [ gio_unix, libsystemdl ])
else
  logind = dependency('', required: false)
endif
conf.set('HAVE_LOGIND', logind.found())

if gio_unix.found() and libelogind.found()
  elogind = declare_dependency(dependencies: [ gio_unix, libelogind ])
else
  elogind = dependency('', required: false)
endif
conf.set('HAVE_ELOGIND', elogind.found())


xtest   = dependency('xtst',    required: false)
conf.set('HAVE_XTEST', xtest.found())

xrender = dependency('xrender', required: false)
conf.set('HAVE_XRENDER', xrender.found())

# Execinfo support
conf.set10('HAVE_EXECINFO_H', cc.has_header('execinfo.h'))
backtrace = cc.find_library('backtrace',  required: false)
execinfo  = cc.find_library('execinfo',   required: false)


# Check for X transport interface - allows to disable ICE Transports
# See also https://bugzilla.gnome.org/show_bug.cgi?id=725100
if get_option('xtrans')
  xtrans = dependency('xtrans')
else
  xtrans = dependency('', required: false)
endif
conf.set10('HAVE_XTRANS', xtrans.found())

# Check whether IPv6 is enabled on the system...
have_ipv6 = false
ipv6_libs = []
if get_option('ipv6')
  if cc.compiles('''
    #include <sys/types.h>
    #include <sys/socket.h>
    int main() {
      socket(AF_INET6, SOCK_STREAM, 0);
      return 0;
    }
    ''')
    if cc.has_function('getaddrinfo')
      have_ipv6 = true
    else
      ipv6_test_libraries = [
        cc.find_library('bsd', required: false),
        cc.find_library('socket', required: false),
        cc.find_library('inet', required: false),
      ]
      foreach lib: ipv6_test_libraries
        if (not have_ipv6) and cc.has_function('getaddrinfo', dependencies: lib)
          have_ipv6 = true
          ipv6_libs = lib
        endif
      endforeach
    endif
  endif
endif
conf.set('ENABLE_IPV6', have_ipv6)

################################################################################
# Additionnal flags

rootInclude = include_directories('.')

pkg_datadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())

conf.set_quoted('PKGDATADIR',         pkg_datadir)
conf.set_quoted('LIBEXECDIR',         join_paths(get_option('prefix'), get_option('libexecdir')))
conf.set_quoted('LOCALE_DIR',         join_paths(get_option('prefix'), get_option('localedir')))

conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('VERSION', meson.project_version())
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())


configure_file(
  output: 'config.h',
  configuration: conf,
)

project_cflags += [
  '-DHAVE_CONFIG_H',
]

add_project_arguments(project_cflags,
  language: 'c',
)

subdir('cinnamon-session')
subdir('data')
subdir('doc')
subdir('po')
subdir('tools')
subdir('cinnamon-session-quit')

message('\n'.join([
'',
'                cinnamon-session @0@'.format(meson.project_version()),
'',
'        prefix:                   @0@'.format(get_option('prefix')),
'        exec_prefix:              @0@'.format(get_option('prefix')),
'        libdir:                   @0@'.format(get_option('libdir')),
'        libexecdir:               @0@'.format(get_option('libexecdir')),
'        bindir:                   @0@'.format(get_option('bindir')),
'        sbindir:                  @0@'.format(get_option('sbindir')),
'        sysconfdir:               @0@'.format(get_option('sysconfdir')),
'        localstatedir:            @0@'.format(get_option('localstatedir')),
'        datadir:                  @0@'.format(get_option('datadir')),
'        source code location:     @0@'.format(meson.project_source_root()),
'        compiler:                 @0@'.format(cc.get_id()),
'        cflags:                   @0@'.format(project_cflags),
#'        Maintainer mode:          @0@'.format(USE_MAINTAINER_MODE),
#'        Use *_DISABLE_DEPRECATED: @0@'.format(enable_deprecation_flags),
'',
'        Logind support:           @0@'.format(logind.found()),
'        IPv6 support:             @0@'.format(have_ipv6),
'        Backtrace support:        @0@'.format(backtrace.found()),
'        XRender support:          @0@'.format(xrender.found()),
'        XTest support:            @0@'.format(xtest.found()),
'',
]))