Commit 7b7fd36a authored by Dylan Baker's avatar Dylan Baker Committed by Alan Coopersmith
Browse files

wip: meson: add initial meson build system

This currently doesn't handle the docs and specs, but it does handle the
c files, headers, and pkg-config

I think the translation of m4 is correct here, but I'm not 100% sure.
The xtrans stuff is another thing that we could move to a meson xorg
module.
parent 54595bc3
Pipeline #573990 passed with stages
in 2 minutes and 19 seconds
# SPDX-License-Identifier: MIT
# Copyright © 2021 Intel Corporation
install_headers(
'X11/ICE/ICElib.h',
'X11/ICE/ICEmsg.h',
'X11/ICE/ICEconn.h',
'X11/ICE/ICEproto.h',
'X11/ICE/ICEutil.h',
'X11/ICE/ICE.h',
subdir : 'X11/ICE',
)
# SPDX-License-Identifier: MIT
# Copyright © 2021 Intel Corporation
project(
'ice',
['c'],
version : '1.0.10',
meson_version : '>= 0.55.0',
license : 'MIT AND MIT-open-group',
)
cc = meson.get_compiler('c')
add_project_arguments(
'-D_GNU_SOURCE', '-DHAVE_CONFIG_H',
cc.get_supported_arguments(
'-Wshadow',
),
language : ['c']
)
dep_xproto = dependency('xproto')
dep_xtrans = dependency('xtrans')
dep_bsd = dependency('libbsd', required : false)
config = configuration_data()
config.set('ICE_t', 1)
config.set('TRANS_CLIENT', 1)
config.set('TRANS_SERVER', 1)
unix_tp = get_option('unix-transport')
if not unix_tp.disabled() and (
unix_tp.enabled() or not (host_machine.system() == 'windows' and cc.get_id() == 'gcc')) # mingw
config.set('UNIXCONN', 1)
endif
if get_option('tcp-transport')
config.set('TCPCONN', 1)
endif
local_tp = get_option('local-transport')
if not local_tp.disabled() and (local_tp.enabled() or host_machine.system() == 'sunos')
config.set('LOCALCONN', 1)
endif
if dep_bsd.found()
config.set('HAVE_LIBBSD', 1)
if cc.has_function('arc4random_buf', dependencies : dep_bsd)
config.set('HAVE_ARC4RANDOM_BUF', 1)
endif
endif
foreach f : ['asprintf', 'getentropy', 'strcasecmp', 'strlcpy']
if cc.has_function(f)
config.set('HAVE_@0@'.format(f.to_upper()), 1)
endif
endforeach
config_h = configure_file(
configuration : config,
output : 'config.h',
)
inc = include_directories('include')
# TODO: subdir('doc')
# TODO: subdir('specs')
subdir('include')
subdir('src')
# SPDX-License-Identifier: MIT
# Copyright © 2021 Intel Corporation
option(
'unix-transport',
type : 'feature',
description : 'Enable UNIX domain socket transport',
)
option(
'tcp-transport',
type : 'boolean',
value : true,
description : 'Enable TCP socket transport',
)
option(
'local-transport',
type : 'feature',
description : 'Enable OS specific transport',
)
# SPDX-License-Identifier: MIT
# Copyright © 2021 Intel Corporation
libice = library(
'ICE',
[
'accept.c',
'authutil.c',
'connect.c',
'error.c',
'getauth.c',
'iceauth.c',
'icetrans.c',
'listen.c',
'listenwk.c',
'locking.c',
'misc.c',
'ping.c',
'process.c',
'protosetup.c',
'register.c',
'replywait.c',
'setauth.c',
'shutdown.c',
'watch.c',
config_h,
],
include_directories : [include_directories('..'), inc],
dependencies : [dep_bsd, dep_xproto, dep_xtrans],
version : '6.3.0',
install : true,
)
# For external projects depending on libice
dep_ice = declare_dependency(
link_with : libice,
include_directories : inc,
version : meson.project_version(),
)
meson.override_dependency('ice', dep_ice)
# Use this instad of configure_file on the pc.in because Meson will then track
# dependencies automatically.
import('pkgconfig').generate(
libice,
name : 'ice',
description : 'X Inter Client Exchange Library',
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment