aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-10-29 14:04:24 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2019-10-29 14:04:24 +0100
commitbb6458a147fd4a6743daecf5e73b88af98aad37f (patch)
tree6adeb653c393942df2c1831b7cde3ce3f41fdc48
parent587e0c2d9067ed67ae70d2ad76511cd4e9ca9db6 (diff)
Add meson build system
Change-Id: Ie5ea4a42445e7c4df61284164f7dd14b0ca12295 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--compat/include/meson.build19
-rw-r--r--compat/meson.build24
-rw-r--r--compat/pkgconfig/meson.build46
-rw-r--r--compat/src/meson.build50
-rw-r--r--logo-cynagora-small.pngbin0 -> 11034 bytes
-rw-r--r--logo-cynagora.pngbin67130 -> 65942 bytes
-rw-r--r--meson.build77
-rw-r--r--meson_options.txt22
-rw-r--r--pkgconfig/cynagora.pc.in2
-rw-r--r--pkgconfig/meson.build29
-rw-r--r--src/meson.build98
-rw-r--r--systemd/meson.build43
12 files changed, 409 insertions, 1 deletions
diff --git a/compat/include/meson.build b/compat/include/meson.build
new file mode 100644
index 0000000..83b1bbb
--- /dev/null
+++ b/compat/include/meson.build
@@ -0,0 +1,19 @@
+###########################################################################
+# Copyright (C) 2018 "IoT.bzh"
+#
+# author: José Bollo <jose.bollo@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+install_subdir('cynara', install_dir: get_option('includedir'))
diff --git a/compat/meson.build b/compat/meson.build
new file mode 100644
index 0000000..d83d6fd
--- /dev/null
+++ b/compat/meson.build
@@ -0,0 +1,24 @@
+###########################################################################
+# Copyright (C) 2018 "IoT.bzh"
+#
+# author: José Bollo <jose.bollo@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+cynara_version = cynagora_version
+cynara_soversion = cynagora_soversion
+
+subdir('src')
+subdir('include')
+subdir('pkgconfig')
diff --git a/compat/pkgconfig/meson.build b/compat/pkgconfig/meson.build
new file mode 100644
index 0000000..8726960
--- /dev/null
+++ b/compat/pkgconfig/meson.build
@@ -0,0 +1,46 @@
+###########################################################################
+# Copyright (C) 2018 "IoT.bzh"
+#
+# author: José Bollo <jose.bollo@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+pkgconf = configuration_data()
+pkgconf.set('CYNARA_VERSION', cynara_version)
+pkgconf.set('CMAKE_INSTALL_FULL_LIBDIR', get_option('libdir'))
+pkgconf.set('CMAKE_INSTALL_FULL_INCLUDEDIR', get_option('includedir'))
+
+configure_file(
+ configuration: pkgconf,
+ input: 'cynara-compat.pc.in', output: 'cynara-compat.pc',
+ install: true, install_dir: get_option('libdir') + '/pkgconfig', install_mode: 'rw-r--r--'
+)
+
+foreach item : [ 'cynara-admin.pc',
+ 'cynara-agent.pc',
+ 'cynara-client-async.pc',
+ 'cynara-client.pc',
+ 'cynara-commons.pc',
+ 'cynara-creds-commons.pc',
+ 'cynara-creds-dbus.pc',
+ 'cynara-creds-gdbus.pc',
+ 'cynara-creds-self.pc',
+ 'cynara-creds-socket.pc',
+ 'cynara-monitor.pc',
+ 'cynara-plugin.pc',
+ 'cynara-session.pc' ]
+ custom_target(item, install: true, output: item, install_dir: get_option('libdir') + '/pkgconfig',
+ command: [ 'ln', '-sf', 'cynara-compat.pc', '@OUTPUT@' ])
+endforeach
+
diff --git a/compat/src/meson.build b/compat/src/meson.build
new file mode 100644
index 0000000..b1df225
--- /dev/null
+++ b/compat/src/meson.build
@@ -0,0 +1,50 @@
+###########################################################################
+# Copyright (C) 2018 "IoT.bzh"
+#
+# author: José Bollo <jose.bollo@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+cyninc = include_directories('../../src', '../include')
+
+###########################################
+# build and install libcynara-compat
+###########################################
+if get_option('direct-cynara-compat')
+ cynalib = shared_library('cynara-compat', 'lib-compat.c', clisrcs,
+ version: cynara_version, soversion: cynara_soversion,
+ c_args: '-DDEFAULT_SOCKET_DIR="' + socketdir + '"',
+ include_directories: cyninc,
+ link_args: '-Wl,--version-script='+meson.current_source_dir()+'/export-cynara-compat.map',
+ install: true
+ )
+else
+ cynalib = shared_library('cynara-compat', 'lib-compat.c',
+ version: cynara_version, soversion: cynara_soversion,
+ c_args: '-DDEFAULT_SOCKET_DIR="' + socketdir + '"',
+ include_directories: cyninc,
+ link_args: '-Wl,--version-script='+meson.current_source_dir()+'/export-cynara-compat.map',
+ link_with: clilib,
+ install: true
+ )
+endif
+
+###########################################
+# build and install test-old-cynara
+###########################################
+executable('test-old-cynara', 'main-test-old-cynara.c',
+ install: true,
+ include_directories: cyninc,
+ link_with: cynalib
+)
diff --git a/logo-cynagora-small.png b/logo-cynagora-small.png
new file mode 100644
index 0000000..14e9241
--- /dev/null
+++ b/logo-cynagora-small.png
Binary files differ
diff --git a/logo-cynagora.png b/logo-cynagora.png
index f68a3d7..1fb9d43 100644
--- a/logo-cynagora.png
+++ b/logo-cynagora.png
Binary files differ
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..0a02fe2
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,77 @@
+###########################################################################
+# Copyright (C) 2019 "IoT.bzh"
+#
+# author: José Bollo <jose.bollo@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+project('cynagora', 'c', version: '2.0', license: 'Apache-2.0')
+
+###########################################################################
+
+cynagora_version = meson.project_version()
+cynagora_soversion = '2'
+
+runstatedir = get_option('localstatedir') + '/run'
+dbdir = get_option('localstatedir') + '/lib/cynagora'
+socketdir = runstatedir + '/cynagora'
+init_file_dir = get_option('sysconfdir') + '/security'
+init_file = init_file_dir + '/cynagora.initial'
+
+###########################################################################
+
+add_project_arguments(
+ '-Wall',
+ '-Wextra',
+ '-Wconversion',
+ '-Wno-unused-parameter',
+ '-Werror=maybe-uninitialized',
+ '-Werror=implicit-function-declaration',
+ '-ffunction-sections',
+ '-fdata-sections',
+ '-D_GNU_SOURCE',
+ language: 'c'
+)
+
+add_project_link_arguments(
+ '-Wl,--as-needed',
+ '-Wl,--gc-sections',
+ '-Wl,--no-undefined',
+ language: 'c'
+)
+
+###########################################################################
+
+if get_option('with-systemd')
+ sysd = dependency('libsystemd', required: true, version: '>=222')
+else
+ sysd = dependency('', required: false )
+endif
+cap = dependency('libcap', required: true)
+
+###########################################################################
+
+subdir('src')
+subdir('pkgconfig')
+
+if get_option('with-systemd')
+ subdir('systemd')
+endif
+
+if get_option('with-cynara-compat')
+ subdir('compat')
+endif
+
+install_data('cynagora.initial', install_dir: init_file_dir, install_mode: 'rw-r--r--')
+
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..50e79d5
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,22 @@
+###########################################################################
+# Copyright (C) 2019 "IoT.bzh"
+#
+# author: José Bollo <jose.bollo@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+option('with-systemd', type: 'boolean', value: false, description: 'should include systemd unit settings')
+option('with-cynara-compat', type: 'boolean', value: false, description: 'produce artifacts for compatibility with cynara')
+option('direct-cynara-compat', type: 'boolean', value: false, description: 'cynara compat access server directly without using libcynagora')
+
diff --git a/pkgconfig/cynagora.pc.in b/pkgconfig/cynagora.pc.in
index cef6de3..cf7c787 100644
--- a/pkgconfig/cynagora.pc.in
+++ b/pkgconfig/cynagora.pc.in
@@ -2,4 +2,4 @@ Name: cynagora
Description: cynagora package
Version: @CYNAGORA_VERSION@
Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lcynagora
-Cflags: -I@CMAKE_INSTALL_FULL_INCLUDEDIR@ -I@CMAKE_INSTALL_FULL_INCLUDEDIR@
+Cflags: -I@CMAKE_INSTALL_FULL_INCLUDEDIR@
diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build
new file mode 100644
index 0000000..0d0c5dc
--- /dev/null
+++ b/pkgconfig/meson.build
@@ -0,0 +1,29 @@
+###########################################################################
+# Copyright (C) 2018 "IoT.bzh"
+#
+# author: José Bollo <jose.bollo@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+pkgconf = configuration_data()
+pkgconf.set('CYNAGORA_VERSION', cynagora_version)
+pkgconf.set('CMAKE_INSTALL_FULL_LIBDIR', get_option('libdir'))
+pkgconf.set('CMAKE_INSTALL_FULL_INCLUDEDIR', get_option('includedir'))
+
+configure_file(
+ configuration: pkgconf,
+ input: 'cynagora.pc.in', output: 'cynagora.pc',
+ install: true, install_dir: get_option('libdir') + '/pkgconfig', install_mode: 'rw-r--r--'
+)
+
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..bb0f4d7
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,98 @@
+###########################################################################
+# Copyright (C) 2018 "IoT.bzh"
+#
+# author: José Bollo <jose.bollo@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+coresrcs = files(
+ 'anydb.c',
+ 'cyn.c',
+ 'db.c',
+ 'dbinit.c',
+ 'expire.c',
+ 'fbuf.c',
+ 'filedb.c',
+ 'memdb.c',
+ 'names.c',
+ 'pollitem.c',
+ 'queue.c'
+)
+
+srvsrcs = files(
+ 'agent-at.c',
+ 'cyn-protocol.c',
+ 'cyn-server.c',
+ 'idgen.c',
+ 'main-cynagorad.c',
+ 'prot.c',
+ 'socket.c'
+)
+
+clisrcs = files(
+ 'cache.c',
+ 'cyn-protocol.c',
+ 'cynagora.c',
+ 'expire.c',
+ 'idgen.c',
+ 'names.c',
+ 'prot.c',
+ 'socket.c'
+)
+
+###########################################
+# build and install libcynagora-core
+###########################################
+corelib = shared_library('cynagora-core', coresrcs,
+ version: cynagora_version, soversion: cynagora_soversion,
+ link_args: '-Wl,--version-script='+meson.current_source_dir()+'/export-cynagora-core.map',
+ install: true
+)
+
+###########################################
+# build and install libcynagora-client
+###########################################
+clilib = shared_library('cynagora', clisrcs,
+ version: cynagora_version, soversion: cynagora_soversion,
+ c_args: '-DDEFAULT_SOCKET_DIR="' + socketdir + '"',
+ link_args: '-Wl,--version-script='+meson.current_source_dir()+'/export-cynagora.map',
+ install: true
+)
+install_headers('cynagora.h')
+
+###########################################
+# build and install cynagorad
+###########################################
+executable('cynagorad', srvsrcs,
+ c_args: [
+ '-DDEFAULT_DB_DIR="' + dbdir + '"',
+ '-DDEFAULT_SOCKET_DIR="' + socketdir + '"',
+ '-DDEFAULT_INIT_FILE="' + init_file + '"',
+ get_option('with-cynara-compat') ? '-DWITH_SYSTEMD_ACTIVATION' : '-DWITHOUT_SYSTEMD_ACTIVATION'
+ ],
+ dependencies: [ sysd, cap ],
+ link_with: corelib,
+ install: true
+)
+
+###########################################
+# build and install cynagora-admin
+###########################################
+executable('cynagora-admin', 'main-cynagora-admin.c', 'expire.c', link_with: clilib, install: true)
+
+###########################################
+# build and install cynagora-agent
+###########################################
+executable('cynagora-agent', 'main-cynagora-agent.c', 'expire.c', link_with: clilib, install: true)
+
diff --git a/systemd/meson.build b/systemd/meson.build
new file mode 100644
index 0000000..e99814d
--- /dev/null
+++ b/systemd/meson.build
@@ -0,0 +1,43 @@
+###########################################################################
+# Copyright (C) 2018 "IoT.bzh"
+#
+# author: José Bollo <jose.bollo@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+sysdconf = configuration_data()
+sysdconf.set('DEFAULT_SOCKET_DIR', socketdir )
+
+admin = configure_file( input: 'cynagora-admin.socket.in', output: 'cynagora-admin.socket', configuration: sysdconf)
+check = configure_file( input: 'cynagora-check.socket.in', output: 'cynagora-check.socket', configuration: sysdconf)
+agent = configure_file( input: 'cynagora-agent.socket.in', output: 'cynagora-agent.socket', configuration: sysdconf)
+
+unitdir = get_option('libdir') + '/systemd/system'
+
+install_data(
+ 'cynagora.service',
+ 'cynagora.target',
+ admin,
+ check,
+ agent,
+ install_dir: unitdir,
+ install_mode: 'rw-r--r--'
+)
+
+install_subdir(
+ 'sockets.target.wants',
+ install_dir: unitdir,
+ install_mode: 'rw-r--r--'
+)
+