From: Eric Gillespie Date: Thu, 11 Dec 2025 17:57:33 +0000 (-0600) Subject: fix out-of-tree build (builddir != srcdir) X-Git-Tag: v0.13.1~58^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1079%2Fhead;p=thirdparty%2Fsnapper.git fix out-of-tree build (builddir != srcdir) autoconf and automake mostly give us this for free, but we do have to take some care. This enables out-of-tree builds configured such as: (cd /obj/snapper && ~/work/snapper/configure ...) make -C /obj/snapper ... --- diff --git a/configure.ac b/configure.ac index a116203d..4649a58c 100644 --- a/configure.ac +++ b/configure.ac @@ -2,12 +2,12 @@ AC_INIT AC_CONFIG_SRCDIR([snapper/Snapper.h]) -VERSION=`cat ./VERSION` +VERSION=`cat "$srcdir/VERSION"` || exit -LIBVERSION=`cat ./LIBVERSION` -LIBVERSION_MAJOR=`cut -d . -f 1 ./LIBVERSION` -LIBVERSION_MINOR=`cut -d . -f 2 ./LIBVERSION` -LIBVERSION_PATCHLEVEL=`cut -d . -f 3 ./LIBVERSION` +LIBVERSION=`cat "$srcdir/LIBVERSION"` +LIBVERSION_MAJOR=`cut -d . -f 1 "$srcdir/LIBVERSION"` +LIBVERSION_MINOR=`cut -d . -f 2 "$srcdir/LIBVERSION"` +LIBVERSION_PATCHLEVEL=`cut -d . -f 3 "$srcdir/LIBVERSION"` LIBVERSION_CURRENT=`expr $LIBVERSION_MAJOR + $LIBVERSION_MINOR` LIBVERSION_REVISON=`expr $LIBVERSION_PATCHLEVEL` diff --git a/doc/Makefile.am b/doc/Makefile.am index 522ce63c..f6fe4220 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -19,10 +19,10 @@ man_MANS += mksubvolume.8 endif .xml.5: .xml - $(XSLTPROC) --nonet manpages.xsl $< + $(XSLTPROC) --nonet $(srcdir)/manpages.xsl $< .xml.8: .xml - $(XSLTPROC) --nonet manpages.xsl $< + $(XSLTPROC) --nonet $(srcdir)/manpages.xsl $< html: $(man_MANS:%.5=%.html) $(man_MANS:%.8=%.html) diff --git a/snapper/Makefile.am b/snapper/Makefile.am index d1c26b23..5cdcc737 100644 --- a/snapper/Makefile.am +++ b/snapper/Makefile.am @@ -3,6 +3,7 @@ # AM_CXXFLAGS = -D_FILE_OFFSET_BITS=64 +INCLUDES = -I$(top_srcdir) lib_LTLIBRARIES = libsnapper.la diff --git a/zypp-plugin/Makefile.am b/zypp-plugin/Makefile.am index e395f59d..2d899151 100644 --- a/zypp-plugin/Makefile.am +++ b/zypp-plugin/Makefile.am @@ -9,7 +9,7 @@ if HAVE_ZYPP plugindir = /usr/lib/zypp/plugins/commit plugin_PROGRAMS = snapper-zypp-plugin -AM_CPPFLAGS = $(DBUS_CFLAGS) $(XML2_CFLAGS) $(JSON_C_CFLAGS) +AM_CPPFLAGS = $(DBUS_CFLAGS) $(XML2_CFLAGS) $(JSON_C_CFLAGS) -I$(top_srcdir) snapper_zypp_plugin_SOURCES = \ snapper-zypp-plugin.cc snapper-zypp-plugin.h \