src/bindings/python/bt2/Makefile
src/bindings/python/bt2/setup.py
src/cli/Makefile
- src/common/Makefile
src/Makefile
tests/bitfield/Makefile
tests/ctf-writer/Makefile
# SPDX-License-Identifier: MIT
-# Build 'common' first to ensure 'version.h' is generated before any
-# compilation.
+# Build the current dir containing the library and plugins before the cli and
+# bindings.
SUBDIRS = \
- common \
. \
cli
endif
noinst_HEADERS = \
+ common/align.h \
+ common/list.h \
+ common/macros.h \
+ common/mmap-align.h \
+ common/safe.h \
+ common/version.h \
+ common/version.i \
cpp-common/bt2/clock-class.hpp \
cpp-common/bt2/clock-snapshot.hpp \
cpp-common/bt2/common-iter.hpp \
cpp-common/uuid-view.hpp \
cpp-common/vector.hpp
+## This target generates an include file that contains the git version
+## string of the current branch, it must be continuously updated when
+## we build in the git repo and shipped in dist tarballs to reflect the
+## status of the tree when it was generated. If the tree is clean and
+## the current commit is a tag starting with "v", consider this a
+## release version and set an empty git version.
+
+version_verbose = $(version_verbose_@AM_V@)
+version_verbose_ = $(version_verbose_@AM_DEFAULT_V@)
+version_verbose_0 = @echo " GEN " $@;
+
+common/version.i:
+ $(version_verbose)GREP=$(GREP) SED=$(SED) TOP_SRCDIR="$(top_srcdir)" $(SHELL) $(srcdir)/gen-version-i.sh
+
+dist_noinst_SCRIPTS = gen-version-i.sh
+
+# Ensure version.i is generated before any code is built.
+BUILT_SOURCES = common/version.i
+
+##
+## version.i is defined as a .PHONY target even if it's a real file,
+## we want the target to be re-run on every make.
+##
+.PHONY: common/version.i
+
+CLEANFILES = common/version.i.tmp
+
+##
+## Only clean "version.i" on dist-clean, we need to keep it on regular
+## clean when it's part of a dist tarball.
+##
+DISTCLEANFILES = common/version.i
+
#
# Convenience libraries
#
noinst_LTLIBRARIES = \
argpar/libargpar.la \
autodisc/libautodisc.la \
+ common/libcommon.la \
compat/libcompat.la \
ctfser/libctfser.la \
fd-cache/libfd-cache.la \
plugins/ctf/common/metadata/libctf-parser.la \
string-format/libstring-format.la
+
argpar_libargpar_la_SOURCES = \
argpar/argpar.c \
argpar/argpar.h
autodisc/autodisc.c \
autodisc/autodisc.h
+common_libcommon_la_SOURCES = \
+ common/assert.c \
+ common/assert.h \
+ common/common.c \
+ common/common.h \
+ common/uuid.c \
+ common/uuid.h
+
+common_libcommon_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DBABELTRACE_PLUGINS_DIR=\"$(BABELTRACE_PLUGINS_DIR)\"
+
compat_libcompat_la_SOURCES = \
compat/bitfield.h \
compat/compiler.h \
plugins_ctf_common_metadata_libctf_ast_la_LIBADD = -lintl -liconv -lole32
endif
-BUILT_SOURCES = \
+BUILT_SOURCES += \
plugins/ctf/common/metadata/parser.hpp
-# Start with empty files to clean
-CLEANFILES =
ALL_LOCAL =
if HAVE_BISON
lib_libbabeltrace2_la_LIBADD = \
logging/liblogging.la \
- common/libbabeltrace2-common.la \
+ common/libcommon.la \
compat/libcompat.la
ctf_writer_libbabeltrace2_ctf_writer_la_SOURCES = \
ctf_writer_libbabeltrace2_ctf_writer_la_LIBADD = \
logging/liblogging.la \
- common/libbabeltrace2-common.la \
+ common/libcommon.la \
ctfser/libctfser.la \
compat/libcompat.la
if !ENABLE_BUILT_IN_PLUGINS
python_plugin_provider_babeltrace2_python_plugin_provider_la_LIBADD += \
logging/liblogging.la \
- common/libbabeltrace2-common.la \
+ common/libcommon.la \
py-common/libpy-common.la \
lib/libbabeltrace2.la
endif
if !ENABLE_BUILT_IN_PLUGINS
plugins_utils_babeltrace_plugin_utils_la_LIBADD += \
lib/libbabeltrace2.la \
- common/libbabeltrace2-common.la \
+ common/libcommon.la \
logging/liblogging.la \
plugins/common/param-validation/libparam-validation.la
endif
lib/libbabeltrace2.la \
logging/liblogging.la \
plugins/common/muxing/libmuxing.la \
- common/libbabeltrace2-common.la \
+ common/libcommon.la \
ctfser/libctfser.la
endif
if !ENABLE_BUILT_IN_PLUGINS
plugins_text_babeltrace_plugin_text_la_LIBADD += \
lib/libbabeltrace2.la \
- common/libbabeltrace2-common.la \
+ common/libcommon.la \
logging/liblogging.la \
compat/libcompat.la \
plugins/common/param-validation/libparam-validation.la
if !ENABLE_BUILT_IN_PLUGINS
plugins_lttng_utils_babeltrace_plugin_lttng_utils_la_LIBADD += \
lib/libbabeltrace2.la \
- common/libbabeltrace2-common.la \
+ common/libcommon.la \
logging/liblogging.la \
plugins/common/param-validation/libparam-validation.la
endif # !ENABLE_BUILT_IN_PLUGINS
STATIC_LIBRARIES_DEPS = \
$(top_builddir)/src/autodisc/libautodisc.la \
$(top_builddir)/src/logging/liblogging.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/py-common/libpy-common.la \
$(top_builddir)/src/string-format/libstring-format.la
extra_objects=[
"@top_builddir@/src/autodisc/.libs/libautodisc.a",
"@top_builddir@/src/logging/.libs/liblogging.a",
- "@top_builddir@/src/common/.libs/libbabeltrace2-common.a",
+ "@top_builddir@/src/common/.libs/libcommon.a",
"@top_builddir@/src/py-common/.libs/libpy-common.a",
"@top_builddir@/src/string-format/.libs/libstring-format.a",
],
$(top_builddir)/src/string-format/libstring-format.la \
$(top_builddir)/src/lib/libbabeltrace2.la \
$(top_builddir)/src/compat/libcompat.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/logging/liblogging.la \
$(top_builddir)/src/ctfser/libctfser.la
+++ /dev/null
-# SPDX-License-Identifier: MIT
-
-AM_CPPFLAGS += -DBABELTRACE_PLUGINS_DIR=\"$(BABELTRACE_PLUGINS_DIR)\"
-
-noinst_LTLIBRARIES = libbabeltrace2-common.la
-
-libbabeltrace2_common_la_SOURCES = \
- assert.c \
- assert.h \
- common.c \
- common.h \
- uuid.c \
- uuid.h
-
-noinst_HEADERS = \
- align.h \
- list.h \
- macros.h \
- mmap-align.h \
- safe.h
-
-## This target generates an include file that contains the git version
-## string of the current branch, it must be continuously updated when
-## we build in the git repo and shipped in dist tarballs to reflect the
-## status of the tree when it was generated. If the tree is clean and
-## the current commit is tag a starting with "v", consider this a
-## release version and set an empty git version.
-
-version_verbose = $(version_verbose_@AM_V@)
-version_verbose_ = $(version_verbose_@AM_DEFAULT_V@)
-version_verbose_0 = @echo " GEN " $@;
-
-version.i:
- $(version_verbose)GREP=$(GREP) SED=$(SED) TOP_SRCDIR="$(top_srcdir)" $(SHELL) $(srcdir)/gen-version-i.sh
-
-dist_noinst_SCRIPTS = gen-version-i.sh
-
-##
-## version.i is defined as a .PHONY target even if it's a real file,
-## we want the target to be re-run on every make.
-##
-.PHONY: version.i
-
-CLEANFILES = version.i.tmp
-
-##
-## Only clean "version.i" on dist-clean, we need to keep it on regular
-## clean when it's part of a dist tarball.
-##
-DISTCLEANFILES = version.i
-
-noinst_HEADERS += version.h version.i
+++ /dev/null
-#!/usr/bin/env sh
-#
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Copyright (C) 2023 EfficiOS, Inc.
-
-# This file generates an include file that contains the git version
-# string of the current branch, it must be continuously updated when
-# we build in the git repo and shipped in dist tarballs to reflect the
-# status of the tree when it was generated. If the tree is clean and
-# the current commit is a tag starting with "v", consider this a
-# release version and set an empty git version.
-
-set -o nounset
-set -o errexit
-
-if test "${TOP_SRCDIR:-}" = ""; then
- echo "$0: TOP_SRCDIR is not set" >&2
- exit 1
-fi
-
-GREP=${GREP:-grep}
-SED=${SED:-sed}
-
-# Delete any stale "version.i.tmp" file.
-rm -f version.i.tmp
-
-if test ! -f version.i && test -f "$TOP_SRCDIR/include/version.i"; then
- cp "$TOP_SRCDIR/include/version.i" version.i
-fi
-
-# If "bootstrap" and ".git" exists in the top source directory and the git
-# executable is available, get the current git version string in the form:
-#
-# "latest_tag"(-"number_of_commits_on_top")(-g"latest_commit_hash")(-dirty)
-#
-# And store it in "version.i.tmp", if the current commit is tagged, the tag
-# starts with "v" and the tree is clean, consider this a release version and
-# overwrite the git version with an empty string in "version.i.tmp".
-#
-# Use an explicit hash abbreviation length, to avoid local `core.abbrev`
-# configurations leading to different results.
-if test -r "$TOP_SRCDIR/bootstrap" && test -r "$TOP_SRCDIR/.git" &&
- (command -v git > /dev/null 2>&1); then
- GIT_VERSION_STR="$(cd "$TOP_SRCDIR" && git describe --always --tags --dirty --abbrev=12)"
- GIT_CURRENT_TAG="$(cd "$TOP_SRCDIR" && (git describe --tags --exact-match --match="v[0-9]*" HEAD || true) 2> /dev/null)"
- echo "#define BT_VERSION_GIT \"$GIT_VERSION_STR\"" > version.i.tmp
-
- if ! $GREP -- "-dirty" version.i.tmp > /dev/null &&
- test "x$GIT_CURRENT_TAG" != "x"; then
- echo "#define BT_VERSION_GIT \"\"" > version.i.tmp
- fi
-fi
-
-# If we don't have a "version.i.tmp" nor a "version.i", generate an empty
-# string as a failover. If a "version.i" is present, for example when building
-# from a distribution tarball, get the git_version using grep.
-if test ! -f version.i.tmp; then
- if test -f version.i; then
- $GREP "^#define \bBT_VERSION_GIT\b.*" version.i > version.i.tmp
- else
- echo '#define BT_VERSION_GIT ""' > version.i.tmp
- fi
-fi
-
-{
- # Fetch the BT_VERSION_EXTRA_NAME define from "version/extra_version_name" and output it
- # to "version.i.tmp".
- echo "#define BT_VERSION_EXTRA_NAME \"$($SED -n '1p' "$TOP_SRCDIR/version/extra_version_name" 2> /dev/null)\""
-
- # Fetch the BT_VERSION_EXTRA_DESCRIPTION define from "version/extra_version_description",
- # sanitize and format it with a sed script to replace all non-alpha-numeric values
- # with "-" and join all lines by replacing "\n" with litteral string c-style "\n" and
- # output it to "version.i.tmp".
- echo "#define BT_VERSION_EXTRA_DESCRIPTION \"$($SED -E ':a ; N ; $!ba ; s/[^a-zA-Z0-9 \n\t\.,]/-/g ; s/\r{0,1}\n/\\n/g' "$TOP_SRCDIR/version/extra_version_description" 2> /dev/null)\""
-
- # Repeat the same logic for the "version/extra_patches" directory.
- # Data fetched from "version/extra_patches" must be sanitized and
- # formatted.
- # The data is fetched using "find" with an ignore pattern for the README.adoc file.
- # The sanitize step uses sed with a script to replace all
- # non-alpha-numeric values, except " " (space), to "-".
- # The formatting step uses sed with a script to join all lines
- # by replacing "\n" with litteral string c-style "\n".
- # shellcheck disable=SC2012
- echo "#define BT_VERSION_EXTRA_PATCHES \"$(ls -1 "$TOP_SRCDIR/version/extra_patches" | $GREP -v '^README.adoc' | $SED -E ':a ; N ; $!ba ; s/[^a-zA-Z0-9 \n\t\.]/-/g ; s/\r{0,1}\n/\\n/g' 2> /dev/null)\""
-} >> version.i.tmp
-
-# If we don't have a "version.i" or we have both files (version.i, version.i.tmp)
-# and they are different, copy "version.i.tmp" over "version.i".
-# This way the dependent targets are only rebuilt when the git version
-# string or either one of extra version string change.
-if test ! -f version.i ||
- test x"$(cat version.i.tmp)" != x"$(cat version.i)"; then
- mv -f version.i.tmp version.i
-fi
-
-rm -f version.i.tmp
--- /dev/null
+#!/usr/bin/env sh
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2023 EfficiOS, Inc.
+
+# This file generates an include file that contains the git version
+# string of the current branch, it must be continuously updated when
+# we build in the git repo and shipped in dist tarballs to reflect the
+# status of the tree when it was generated. If the tree is clean and
+# the current commit is a tag starting with "v", consider this a
+# release version and set an empty git version.
+
+set -o nounset
+set -o errexit
+
+if test "${TOP_SRCDIR:-}" = ""; then
+ echo "$0: TOP_SRCDIR is not set" >&2
+ exit 1
+fi
+
+GREP=${GREP:-grep}
+SED=${SED:-sed}
+
+# Delete any stale "version.i.tmp" file.
+rm -f common/version.i.tmp
+
+if test ! -f common/version.i && test -f "$TOP_SRCDIR/include/version.i"; then
+ cp "$TOP_SRCDIR/include/version.i" common/version.i
+fi
+
+# If "bootstrap" and ".git" exists in the top source directory and the git
+# executable is available, get the current git version string in the form:
+#
+# "latest_tag"(-"number_of_commits_on_top")(-g"latest_commit_hash")(-dirty)
+#
+# And store it in "version.i.tmp", if the current commit is tagged, the tag
+# starts with "v" and the tree is clean, consider this a release version and
+# overwrite the git version with an empty string in "version.i.tmp".
+#
+# Use an explicit hash abbreviation length, to avoid local `core.abbrev`
+# configurations leading to different results.
+if test -r "$TOP_SRCDIR/bootstrap" && test -r "$TOP_SRCDIR/.git" &&
+ (command -v git > /dev/null 2>&1); then
+ GIT_VERSION_STR="$(cd "$TOP_SRCDIR" && git describe --always --tags --dirty --abbrev=12)"
+ GIT_CURRENT_TAG="$(cd "$TOP_SRCDIR" && (git describe --tags --exact-match --match="v[0-9]*" HEAD || true) 2> /dev/null)"
+ echo "#define BT_VERSION_GIT \"$GIT_VERSION_STR\"" > common/version.i.tmp
+
+ if ! $GREP -- "-dirty" common/version.i.tmp > /dev/null &&
+ test "x$GIT_CURRENT_TAG" != "x"; then
+ echo "#define BT_VERSION_GIT \"\"" > common/version.i.tmp
+ fi
+fi
+
+# If we don't have a "version.i.tmp" nor a "version.i", generate an empty
+# string as a failover. If a "version.i" is present, for example when building
+# from a distribution tarball, get the git_version using grep.
+if test ! -f common/version.i.tmp; then
+ if test -f common/version.i; then
+ $GREP "^#define \bBT_VERSION_GIT\b.*" common/version.i > common/version.i.tmp
+ else
+ echo '#define BT_VERSION_GIT ""' > common/version.i.tmp
+ fi
+fi
+
+{
+ # Fetch the BT_VERSION_EXTRA_NAME define from "version/extra_version_name" and output it
+ # to "version.i.tmp".
+ echo "#define BT_VERSION_EXTRA_NAME \"$($SED -n '1p' "$TOP_SRCDIR/version/extra_version_name" 2> /dev/null)\""
+
+ # Fetch the BT_VERSION_EXTRA_DESCRIPTION define from "version/extra_version_description",
+ # sanitize and format it with a sed script to replace all non-alpha-numeric values
+ # with "-" and join all lines by replacing "\n" with litteral string c-style "\n" and
+ # output it to "version.i.tmp".
+ echo "#define BT_VERSION_EXTRA_DESCRIPTION \"$($SED -E ':a ; N ; $!ba ; s/[^a-zA-Z0-9 \n\t\.,]/-/g ; s/\r{0,1}\n/\\n/g' "$TOP_SRCDIR/version/extra_version_description" 2> /dev/null)\""
+
+ # Repeat the same logic for the "version/extra_patches" directory.
+ # Data fetched from "version/extra_patches" must be sanitized and
+ # formatted.
+ # The data is fetched using "find" with an ignore pattern for the README.adoc file.
+ # The sanitize step uses sed with a script to replace all
+ # non-alpha-numeric values, except " " (space), to "-".
+ # The formatting step uses sed with a script to join all lines
+ # by replacing "\n" with litteral string c-style "\n".
+ # shellcheck disable=SC2012
+ echo "#define BT_VERSION_EXTRA_PATCHES \"$(ls -1 "$TOP_SRCDIR/version/extra_patches" | $GREP -v '^README.adoc' | $SED -E ':a ; N ; $!ba ; s/[^a-zA-Z0-9 \n\t\.]/-/g ; s/\r{0,1}\n/\\n/g' 2> /dev/null)\""
+} >> common/version.i.tmp
+
+# If we don't have a "version.i" or we have both files (version.i, version.i.tmp)
+# and they are different, copy "version.i.tmp" over "version.i".
+# This way the dependent targets are only rebuilt when the git version
+# string or either one of extra version string change.
+if test ! -f common/version.i ||
+ test x"$(cat common/version.i.tmp)" != x"$(cat common/version.i)"; then
+ mv -f common/version.i.tmp common/version.i
+fi
+
+rm -f common/version.i.tmp
$(top_builddir)/tests/utils/tap/libtap.la \
$(top_builddir)/tests/utils/libtestcommon.la \
$(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/logging/liblogging.la
$(top_builddir)/tests/utils/tap/libtap.la \
$(top_builddir)/tests/utils/libtestcommon.la \
$(top_builddir)/tests/lib/utils/liblib-utils.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/logging/liblogging.la
test_bt_values_LDADD = $(COMMON_TEST_LDADD) \
conds_triggers_LDADD = \
$(top_builddir)/tests/lib/utils/liblib-utils.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/logging/liblogging.la \
$(top_builddir)/src/lib/libbabeltrace2.la
-rpath / -avoid-version -module $(LD_NOTEXT)
plugin_minimal_la_LIBADD = \
$(top_builddir)/src/lib/libbabeltrace2.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/logging/liblogging.la
# source/filter/sink plugin
-rpath / -avoid-version -module $(LD_NOTEXT)
plugin_sfs_la_LIBADD = \
$(top_builddir)/src/lib/libbabeltrace2.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/logging/liblogging.la
$(top_builddir)/src/param-parse/libparam-parse.la \
$(top_builddir)/src/plugins/common/param-validation/libparam-validation.la \
$(top_builddir)/src/lib/libbabeltrace2.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/logging/liblogging.la \
$(top_builddir)/tests/utils/tap/libtap.la
$(top_builddir)/src/plugins/lttng-utils/debug-info/libdebug-info.la \
$(top_builddir)/src/fd-cache/libfd-cache.la \
$(top_builddir)/src/logging/liblogging.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(ELFUTILS_LIBS) \
$(LIBTAP)
test_dwarf_SOURCES = test-dwarf.c
$(top_builddir)/src/plugins/lttng-utils/debug-info/libdebug-info.la \
$(top_builddir)/src/fd-cache/libfd-cache.la \
$(top_builddir)/src/logging/liblogging.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/lib/libbabeltrace2.la \
$(ELFUTILS_LIBS) \
$(LIBTAP)
# CTF trace generators
GEN_TRACE_LDADD = \
$(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/logging/liblogging.la
gen_trace_float_SOURCES = gen-trace-float.c
# CTF trace generators
GEN_TRACE_LDADD = \
$(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la \
- $(top_builddir)/src/common/libbabeltrace2-common.la \
+ $(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/logging/liblogging.la
gen_trace_simple_SOURCES = gen-trace-simple.c