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
|
project('dleyna', 'c',
version: '0.8.3',
license: 'LGPL-2.1-or-later',
meson_version: '>=0.54.0'
)
pkg = import('pkgconfig')
conf = configuration_data()
log_levels = [
0x00,
0x01,
0x02,
0x04,
0x08,
0x10,
0x20,
0x13,
0x3F
]
log_types = {
'syslog' : 0,
'glib' : 1
}
library_path = join_paths(get_option('prefix'), get_option('libdir'), 'dleyna')
conf.set_quoted('VERSION', meson.project_version())
conf.set('DLEYNA_LOG_LEVEL_DISABLED', log_levels[0], description: 'Log level flag for disabled messages')
conf.set('DLEYNA_LOG_LEVEL_ERROR', log_levels[1], description: 'Log level flag for errors')
conf.set('DLEYNA_LOG_LEVEL_CRITICAL', log_levels[2], description: 'Log level flag for critical messages')
conf.set('DLEYNA_LOG_LEVEL_WARNING', log_levels[3], description: 'Log level flag for warnings')
conf.set('DLEYNA_LOG_LEVEL_MESSAGE', log_levels[4], description: 'Log level flag for messages')
conf.set('DLEYNA_LOG_LEVEL_INFO', log_levels[5], description: 'Log level flag for informational messages')
conf.set('DLEYNA_LOG_LEVEL_DEBUG', log_levels[6], description: 'Log level flag for debug messages')
conf.set('DLEYNA_LOG_LEVEL_DEFAULT', log_levels[7], description: 'Log level flag to display default level messages')
conf.set('DLEYNA_LOG_LEVEL_ALL', log_levels[8], description: 'Log level flag for all messages')
conf.set('DLEYNA_NEVER_QUIT', get_option('never_quit').to_string().to_upper(), description : 'Default service behavior when last client disconnects')
conf.set_quoted('DLEYNA_CONNECTOR_NAME', get_option('connector'), description : 'IPC connector name')
conf.set_quoted('DLEYNA_CONNECTOR_LIB_PATTERN', get_option('connector_lib_pattern'), description : 'Starting pattern for dleyna connector libraries')
conf.set('DLEYNA_LOG_TYPE', log_types[get_option('log_type')], description: 'Define log output technology')
conf.set('DLEYNA_DEBUG_ENABLED', get_option('enable_debug'), description: 'Define extra debugging output for development')
exclusive = get_option('log_level').contains('0') or get_option('log_level').contains('7') or get_option('log_level').contains('8')
if exclusive and get_option('log_level').length() > 1
error('Log levels 0, 7 and 8 cannot be used with other log levels')
endif
log_level = 0
foreach value : get_option('log_level')
log_level += log_levels[value.to_int()]
endforeach
conf.set('DLEYNA_LOG_LEVEL', log_level)
conf.set_quoted('DLEYNA_SERVER_INTERFACE_MANAGER', get_option('interface_server_manager'))
conf.set_quoted('DLEYNA_INTERFACE_PUSH_HOST', get_option('interface_push_host'))
conf.set_quoted('DLEYNA_SERVER_INTERFACE_RENDERER_DEVICE', get_option('interface_renderer_device'))
conf.set_quoted('DLEYNA_SERVER_INTERFACE_MEDIA_DEVICE', get_option('interface_media_device'))
conf.set_quoted('DLEYNA_SERVER_OBJECT', get_option('server_object'))
conf.set_quoted('DLEYNA_SERVER_NAME', get_option('server_name'))
conf.set_quoted('DLEYNA_SERVER_PATH', get_option('server_path'))
conf.set_quoted('DLEYNA_RENDERER_INTERFACE_MANAGER', get_option('interface_renderer_manager'))
conf.set_quoted('DLEYNA_RENDERER_OBJECT', get_option('renderer_object'))
conf.set_quoted('DLEYNA_RENDERER_NAME', get_option('renderer_name'))
conf.set_quoted('DLEYNA_RENDERER_PATH', get_option('renderer_path'))
config_h_file = configure_file(output: 'config.h', configuration: conf)
config_h = declare_dependency(
include_directories : include_directories('.'),
compile_args : ['-include', 'config.h'],
sources : config_h_file
)
dbus_conf = configuration_data()
dbus_conf.set('DLEYNA_RENDERER_NAME', get_option('renderer_name'))
dbus_conf.set('DLEYNA_SERVER_NAME', get_option('server_name'))
dbus_conf.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir')))
glib = dependency('glib-2.0', version: '>= 2.28')
gio = dependency('gio-2.0', version: '>=2.28')
gio_unix = dependency('gio-unix-2.0', version: '>= 2.28', disabler: true)
gssdp = dependency('gssdp-1.6', version: '>= 1.6.0', default_options: ['sniffer=false', 'introspection=false', 'manpages=false', 'gtk_doc=false'])
gupnp = dependency('gupnp-1.6', version: '>= 1.6.0', default_options: ['introspection=false'])
gupnp_av = dependency('gupnp-av-1.0', version: '>= 0.12.9', default_options: ['introspection=false'])
gupnp_dlna = dependency('gupnp-dlna-2.0', version: '>= 0.9.4')
soup = dependency('libsoup-3.0', version: '>= 3.0')
libxml2 = dependency('libxml-2.0')
cc = meson.get_compiler('c')
math = cc.find_library('m', required: false)
subdir('libdleyna')
subdir('src')
subdir('examples')
subdir('python')
if get_option('build_server')
subdir('server')
subdir('renderer')
endif
subdir('doc')
summary(
{
'prefix': get_option('prefix'),
},
section: 'Paths'
)
summary(
{
'Build type': get_option('buildtype'),
'Enable werror': get_option('werror'),
'Enable never-quit': get_option('never_quit'),
'Connector name': get_option('connector'),
'Log level' : get_option('log_level'),
'Log type' : get_option('log_type'),
'Only build library' : not get_option('build_server'),
'User-Agent prefix' : get_option('user_agent_prefix')
},
section: 'Package features'
)
summary(
{
'Manual pages' : get_option('man_pages') and rst2man.found(),
'Documentation' : get_option('docs') and sphinx.found()
},
section: 'Documentation'
)
|