From 74e79a0da99992c182da26abf45447722eaa400d Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 2 Apr 2021 11:47:52 -0400 Subject: [PATCH] Add 'src' dir to global include path The objective is to move internal headers from the global 'include' directory to their respective private directories under 'src'. Move the private generated 'config.h' to 'src/common/config.h', this way it can be include with 'common/config.h' and reduce the risk of clashing with a similarly named file. This is part of an effort to standardize our autotools setup across projects to simplify maintenance. Change-Id: Ie62a81e46458bffb6d31af66411865f23cf1cb4f Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- .gitignore | 8 ++++---- configure.ac | 4 ++-- doc/examples/Makefile.am | 4 +++- src/common/.placeholder | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 src/common/.placeholder diff --git a/.gitignore b/.gitignore index 7bf195fb..42171575 100644 --- a/.gitignore +++ b/.gitignore @@ -19,9 +19,6 @@ cscope.* /configure /aclocal.m4 /autom4te.cache -/include/config.h -/include/config.h.in -/include/stamp-h1 /include/lttng/stamp-h2 /include/lttng/stamp-h3 /include/lttng/ust-version.h @@ -49,8 +46,11 @@ cscope.* /config.status /libtool -/src/lttng-ust.pc +/src/common/config.h +/src/common/config.h.in +/src/common/stamp-h1 /src/lttng-ust-ctl.pc +/src/lttng-ust.pc /doc/examples/demo/demo /doc/examples/easy-ust/sample diff --git a/configure.ac b/configure.ac index 99b99852..80226c78 100644 --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,7 @@ m4_define([ust_ctl_lib_version], ust_ctl_lib_version_current[:]ust_ctl_lib_versi AC_PREREQ([2.69]) AC_INIT([lttng-ust],[ust_version],[mathieu dot desnoyers at efficios dot com],[],[https://lttng.org]) -AC_CONFIG_HEADERS([include/config.h include/lttng/ust-config.h include/lttng/ust-version.h]) +AC_CONFIG_HEADERS([src/common/config.h include/lttng/ust-config.h include/lttng/ust-version.h]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) @@ -501,7 +501,7 @@ AC_SUBST(AM_CXXFLAGS) # The order in which the include folders are searched is important. # The top_builddir should always be searched first in the event that a build # time generated file is included. -AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -include config.h" +AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -I\$(top_builddir)/src -I\$(top_srcdir)/src -include common/config.h" AC_SUBST(AM_CPPFLAGS) AC_SUBST(JNI_CPPFLAGS) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 93132f6a..06e40662 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -136,7 +136,9 @@ all-local: CPPFLAGS="$(CPPFLAGS)" \ AM_CPPFLAGS="$(AM_CPPFLAGS) \ -I$$rel_src_subdir$(top_srcdir)/include/ \ - -I$$rel_build_subdir$(top_builddir)/include/" \ + -I$$rel_build_subdir$(top_builddir)/include/ \ + -I$$rel_src_subdir$(top_srcdir)/src/ \ + -I$$rel_build_subdir$(top_builddir)/src/" \ CFLAGS='$(CFLAGS)' \ AM_CFLAGS='$(AM_CFLAGS)' \ LDFLAGS="$(LDFLAGS)" \ diff --git a/src/common/.placeholder b/src/common/.placeholder new file mode 100644 index 00000000..959eb256 --- /dev/null +++ b/src/common/.placeholder @@ -0,0 +1 @@ +# Git doesn't support empty folders -- 2.34.1