提交 f80c009c 编写于 作者: D Daniel P. Berrangé

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: NPavel Hrdina <phrdina@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 27a6edf5
......@@ -129,6 +129,9 @@ clean-cov:
MAINTAINERCLEANFILES = .git-module-status
BUILT_SOURCES = configmake.h
CLEANFILES = configmake.h
distclean-local: clean-GNUmakefile
clean-GNUmakefile:
test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
......@@ -154,3 +157,44 @@ 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 $@
......@@ -132,14 +132,12 @@ AC_PROG_CPP
dnl autoconf 2.70 adds a --runstatedir option so that downstreams
dnl can point to /run instead of the historic /var/run, but
dnl autoconf hasn't had a release since 2012.
dnl
dnl gnulib sets configmake.h to include runstatedir, but sets
dnl it to $localstatedir/run if $runstatedir env var is not set
dnl which is useless for apps that need to use /run without
dnl waiting for autoconf 2.70
dnl
if test "x$runstatedir" = x; then
AC_SUBST([runstatedir], ['${localstatedir}/run'])
fi
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(
[runstatedir],
[AS_HELP_STRING(
......
......@@ -41,12 +41,7 @@
# include <nsswitch.h>
#endif
/*
* 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 "configmake.h"
#include "libvirt_nss_leases.h"
......
......@@ -28,11 +28,7 @@
#include <errno.h>
#include <string.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"
#include "configmake.h"
#define VIR_INT64_STR_BUFLEN 21
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册