summaryrefslogtreecommitdiff
path: root/Makefile-libglnx.am
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2021-04-06 18:08:55 +0100
committerSimon McVittie <smcv@collabora.com>2021-06-28 15:53:32 +0100
commitc306703c6fb4b52b8ef1ebfdeb1b234fef8665a0 (patch)
tree6f8b4273dd4bce25f2647de66b33d7fd27035c6f /Makefile-libglnx.am
parent1f02e4313a98a972d41e948f4cecba9c664b20ab (diff)
downloadlibglnx-c306703c6fb4b52b8ef1ebfdeb1b234fef8665a0.tar.gz
Include libglnx-config.h instead of config.h
This avoids colliding with a config.h generated by a parent Meson project. In the Meson build system, we generate libglnx-config.h by doing our own checks, so we want to avoid it colliding. In the Autotools build system, we assume that the parent project will generate its own config.h that contains the results of LIBGLNX_CONFIGURE, and create a forwarding header libglnx-config.h in the $(top_builddir) (so that it is next to config.h). Note that after updating libglnx in an Autotools non-recursive-Make project (libostree, flatpak, flatpak-builder) it will be necessary to re-run autogen.sh. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'Makefile-libglnx.am')
-rw-r--r--Makefile-libglnx.am6
1 files changed, 5 insertions, 1 deletions
diff --git a/Makefile-libglnx.am b/Makefile-libglnx.am
index 957eae9..b09e43b 100644
--- a/Makefile-libglnx.am
+++ b/Makefile-libglnx.am
@@ -21,6 +21,10 @@ EXTRA_DIST += \
$(libglnx_srcpath)/libglnx.m4 \
$(NULL)
+BUILT_SOURCES += $(top_builddir)/libglnx-config.h
+$(top_builddir)/libglnx-config.h: Makefile.am
+ echo '#include "config.h"' > $@
+
libglnx_la_SOURCES = \
$(libglnx_srcpath)/glnx-macros.h \
$(libglnx_srcpath)/glnx-backport-autocleanups.h \
@@ -49,7 +53,7 @@ libglnx_la_SOURCES = \
$(libglnx_srcpath)/tests/libglnx-testlib.h \
$(NULL)
-libglnx_la_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags)
+libglnx_la_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags) -I$(builddir)
libglnx_la_LDFLAGS = -avoid-version -Bsymbolic-functions -export-symbols-regex "^glnx_" -no-undefined -export-dynamic
libglnx_la_LIBADD = $(libglnx_libs)