1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

build: generate configmake.h in root directory

Currently we rely on gnulib creating configmake.h, but we
can easily create it ourselves instead.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-01-17 11:32:09 +00:00
parent 27a6edf50f
commit f80c009cb3
4 changed files with 51 additions and 18 deletions

View File

@ -129,6 +129,9 @@ clean-cov:
MAINTAINERCLEANFILES = .git-module-status MAINTAINERCLEANFILES = .git-module-status
BUILT_SOURCES = configmake.h
CLEANFILES = configmake.h
distclean-local: clean-GNUmakefile distclean-local: clean-GNUmakefile
clean-GNUmakefile: clean-GNUmakefile:
test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
@ -154,3 +157,44 @@ gen-AUTHORS:
ci-%: ci-%:
$(MAKE) -C $(srcdir)/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 $@

View File

@ -132,14 +132,12 @@ AC_PROG_CPP
dnl autoconf 2.70 adds a --runstatedir option so that downstreams dnl autoconf 2.70 adds a --runstatedir option so that downstreams
dnl can point to /run instead of the historic /var/run, but dnl can point to /run instead of the historic /var/run, but
dnl autoconf hasn't had a release since 2012. dnl autoconf hasn't had a release since 2012.
dnl if test "x$runstatedir" = x; then
dnl gnulib sets configmake.h to include runstatedir, but sets AC_SUBST([runstatedir], ['${localstatedir}/run'])
dnl it to $localstatedir/run if $runstatedir env var is not set fi
dnl which is useless for apps that need to use /run without
dnl waiting for autoconf 2.70
dnl
dnl we introduce --with-runstatedir and then overwrite the dnl we introduce --with-runstatedir and then overwrite the
dnl value of $runstatedir so gnulib's configmake.h becomes useful dnl value of $runstatedir so configmake.h is more useful
AC_ARG_WITH( AC_ARG_WITH(
[runstatedir], [runstatedir],
[AS_HELP_STRING( [AS_HELP_STRING(

View File

@ -41,12 +41,7 @@
# include <nsswitch.h> # include <nsswitch.h>
#endif #endif
/* #include "configmake.h"
* This gnulib files is used for its macros only,
* so doesn't introduce a link time dep, which we
* must avoid
*/
#include "gnulib/lib/configmake.h"
#include "libvirt_nss_leases.h" #include "libvirt_nss_leases.h"

View File

@ -28,11 +28,7 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
/* #include "configmake.h"
* These gnulib files are used for their macros only,
* so don't introduce a link time dep, which we must avoid
*/
#include "gnulib/lib/configmake.h"
#define VIR_INT64_STR_BUFLEN 21 #define VIR_INT64_STR_BUFLEN 21