We don't use all of the defines so copy only the ones actually used.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Makefile.am | 41 -----------------------------------------
configmake.h.in | 16 ++++++++++++++++
meson.build | 23 +++++++++++++++++++++++
3 files changed, 39 insertions(+), 41 deletions(-)
create mode 100644 configmake.h.in
diff --git a/Makefile.am b/Makefile.am
index fbb3cb09ff1..82ccbac6f91 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,44 +63,3 @@ gen-AUTHORS:
ci-%:
$(MAKE) -C $(srcdir)/ci/ $@
-
-# Listed in the same order as the GNU makefile conventions, and
-# provided by autoconf 2.59c+ or 2.70.
-# The Automake-defined pkg* macros are appended, in the order
-# listed in the Automake 1.10a+ documentation.
-configmake.h: Makefile
- $(AM_V_GEN)rm -f $@-t && \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- echo '#if WIN32'; \
- echo '# include <winsock2.h> /* avoid mingw pollution on DATADIR */'; \
- echo '#endif'; \
- echo '#define PREFIX "$(prefix)"'; \
- echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
- echo '#define BINDIR "$(bindir)"'; \
- echo '#define SBINDIR "$(sbindir)"'; \
- echo '#define LIBEXECDIR "$(libexecdir)"'; \
- echo '#define DATAROOTDIR "$(datarootdir)"'; \
- echo '#define DATADIR "$(datadir)"'; \
- echo '#define SYSCONFDIR "$(sysconfdir)"'; \
- echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
- echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
- echo '#define RUNSTATEDIR "$(runstatedir)"'; \
- echo '#define INCLUDEDIR "$(includedir)"'; \
- echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
- echo '#define DOCDIR "$(docdir)"'; \
- echo '#define INFODIR "$(infodir)"'; \
- echo '#define HTMLDIR "$(htmldir)"'; \
- echo '#define DVIDIR "$(dvidir)"'; \
- echo '#define PDFDIR "$(pdfdir)"'; \
- echo '#define PSDIR "$(psdir)"'; \
- echo '#define LIBDIR "$(libdir)"'; \
- echo '#define LISPDIR "$(lispdir)"'; \
- echo '#define LOCALEDIR "$(localedir)"'; \
- echo '#define MANDIR "$(mandir)"'; \
- echo '#define MANEXT "$(manext)"'; \
- echo '#define PKGDATADIR "$(pkgdatadir)"'; \
- echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
- echo '#define PKGLIBDIR "$(pkglibdir)"'; \
- echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
- } | sed '/""/d' > $@-t && \
- mv -f $@-t $@
diff --git a/configmake.h.in b/configmake.h.in
new file mode 100644
index 00000000000..c9930b60493
--- /dev/null
+++ b/configmake.h.in
@@ -0,0 +1,16 @@
+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
+#if WIN32
+# include <winsock2.h> /* avoid mingw pollution on DATADIR */
+#endif
+#mesondefine BINDIR
+#mesondefine DATADIR
+#mesondefine LIBDIR
+#mesondefine LIBEXECDIR
+#mesondefine LOCALEDIR
+#mesondefine LOCALSTATEDIR
+#mesondefine MANDIR
+#mesondefine PKGDATADIR
+#mesondefine PREFIX
+#mesondefine RUNSTATEDIR
+#mesondefine SBINDIR
+#mesondefine SYSCONFDIR
diff --git a/meson.build b/meson.build
index 3b149e829d3..07dacf92009 100644
--- a/meson.build
+++ b/meson.build
@@ -87,6 +87,29 @@ docdir = datadir / 'doc' / meson.project_name()
pkgdatadir = datadir / meson.project_name()
+# generate configmake.h header
+
+configmake_conf = configuration_data()
+configmake_conf.set_quoted('BINDIR', bindir)
+configmake_conf.set_quoted('DATADIR', datadir)
+configmake_conf.set_quoted('LIBDIR', libdir)
+configmake_conf.set_quoted('LIBEXECDIR', libexecdir)
+configmake_conf.set_quoted('LOCALEDIR', localedir)
+configmake_conf.set_quoted('LOCALSTATEDIR', localstatedir)
+configmake_conf.set_quoted('MANDIR', mandir)
+configmake_conf.set_quoted('PKGDATADIR', pkgdatadir)
+configmake_conf.set_quoted('PREFIX', prefix)
+configmake_conf.set_quoted('RUNSTATEDIR', runstatedir)
+configmake_conf.set_quoted('SBINDIR', sbindir)
+configmake_conf.set_quoted('SYSCONFDIR', sysconfdir)
+
+configure_file(
+ input: 'configmake.h.in',
+ output: 'configmake.h',
+ configuration: configmake_conf,
+)
+
+
# figure out libvirt version strings
arr_version = meson.project_version().split('.')
--
2.26.2