Skip to contentSkip to conversation

libtracefs: Add initial support for meson

PATCH Superseded Daniel Wagner 1 participant 1 message Dec 23, 2022

Subsystems (2)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 libtracefs: Add initial support for meson

Introduce Meson as build framework for building libtracefs. This lives besides the Makefiles until all the expected initial fallouts have been dealed with.

The build steps are:

  # configure using .build as build directory and install destination
  # /tmp/test
  meson --prefix=/tmp/libtracefs .build
  # trigger the build
  ninja -C .build
  # install the library
  ninja -C .build install

In case you want to build/install the documentation the setup is

meson -Ddocs-build=true .build

---
v4:
- add subdir include path to cflags in pkgconfg file
- refactoring build instruction for section 1 and section 3 documentation into one loop (reduce code duplication)

v3:
- build documetation
- build samples
- set default location to /usr/local

v2:
- updated commit message
- dropped the include path patch, the pkg-config from libtraceevent is including them

v1:
- initial version

 Documentation/list-txt.sh  |  11 ++++
 Documentation/meson.build  | 123 +++++++++++++++++++++++++++++++++++++
 include/meson.build        |   9 +++
 meson.build                |  47 ++++++++++++++
 meson_options.txt          |  18 ++++++
 samples/extract-example.sh |   3 +
 samples/meson.build        |  44 +++++++++++++
 src/meson.build            |  65 ++++++++++++++++++++
 utest/meson.build          |  17 +++++
 9 files changed, 337 insertions(+)
 create mode 100644 Documentation/list-txt.sh
 create mode 100644 Documentation/meson.build
 create mode 100644 include/meson.build
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
 create mode 100644 samples/extract-example.sh
 create mode 100644 samples/meson.build
 create mode 100644 src/meson.build
 create mode 100644 utest/meson.build
Documentation/list-txt.sh new file +11 -0
new file mode 100644
index 000000000000..89c3bceff14c
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+SECTION=$1
+TXT_PATH=$2
+
+if [ "$SECTION" = "1" ] ; then
+  ls -1 ${TXT_PATH}/libtracefs-*.txt.1
+elif [ "$SECTION" = "3" ] ; then
+  ls -1 ${TXT_PATH}/libtracefs-*.txt
+  ls -1 ${TXT_PATH}/libtracefs.txt
+fi
Documentation/meson.build new file +123 -0

123 lines not on this page · raw message

include/meson.build new file +9 -0
new file mode 100644
index 000000000000..1bbfe8afb280
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: LGPL-2.1
+
+headers = [
+   'tracefs.h',
+]
+
+foreach h : headers
+	install_headers(h, subdir : 'libtracefs')
+endforeach
meson.build new file +47 -0

47 lines not on this page · raw message

meson_options.txt new file +18 -0
new file mode 100644
index 000000000000..9bcd66f49f06
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: LGPL-2.1
+#
+# Copyright (c) 2022 Daniel Wagner, SUSE LLC
+
+option('docs-build', type : 'boolean', value : false,
+       description : 'build documentation')
+option('htmldir', type : 'string', value : '',
+       description : 'directory for HTML documentation')
+option('asciidoctor', type : 'boolean', value: false,
+       description : 'use asciidoctor instead of asciidoc')
+option('docbook-xls-172', type : 'boolean', value : false,
+       description : 'enable docbook XLS 172 workaround')
+option('asciidoc-no-roff', type : 'boolean', value : false,
+       description : 'enable no roff workaround')
+option('man-bold-literal', type : 'boolean', value : false,
+       description : 'enable bold literals')
+option('docbook-suppress-sp', type : 'boolean', value : false,
+       description : 'docbook suppress sp')
samples/extract-example.sh new file +3 -0
new file mode 100644
index 000000000000..c5c0f702e7f0
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+cat $1 | sed -ne '/^EXAMPLE/,/FILES/ { /EXAMPLE/,+2d ; /^FILES/d ;  /^--/d ; p}' > $2
samples/meson.build new file +44 -0

44 lines not on this page · raw message

src/meson.build new file +65 -0

65 lines not on this page · raw message

utest/meson.build new file +17 -0
new file mode 100644
index 000000000000..8c8caf37803d
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: LGPL-2.1
+#
+# Copyright (c) 2022 Daniel Wagner, SUSE LLC
+
+source = [
+    'trace-utest.c',
+    'tracefs-utest.c',
+]
+
+e = executable(
+   'trace-utest',
+   source,
+   include_directories: [incdir],
+   dependencies: [libtraceevent_dep, cunit_dep],
+   link_with: libtracefs_static)
+
+test('trace-utest', e)
Signature · 1 line
2.39.0