script:
# We can't run 'distcheck' or 'syntax-check' because they fail on
# macOS, but doing 'install' and 'dist' gives us some useful coverage
- - ./autogen.sh --prefix=$(pwd)/install-root && make -j3 && make -j3 install && make -j3 dist
+ - mkdir build && cd build
+ - ../autogen.sh --prefix=$(pwd)/install-root && make -j3 && make -j3 install && make -j3 dist
git:
submodules: true
This eases our maintenance burden, (fewer merges etc.), but imposes more
requirements on anyone wishing to build from the just-checked-out sources.
Note the requirements to build the released archive are much less and
-are just the requirements of the standard ./configure && make procedure.
+are just the requirements of the standard configure && make procedure.
Specific development tools and versions will be checked for and listed by
the bootstrap script.
$ export GNULIB_SRCDIR=/path/to/gnulib
+We require to have the build directory different than the source directory:
+
+ $ mkdir build && cd build
+
The next step is to get all required pieces from gnulib,
-to run autoreconf, and to invoke ./configure:
+to run autoreconf, and to invoke ../autogen.sh:
- $ ./autogen.sh
+ $ ../autogen.sh
And there you are! Just
At this point, there should be no difference between your local copy,
and the GIT master copy:
+ $ cd ..
$ git diff
should output no difference.
------------
Libvirt uses the GNU Autotools build system, so in general can be built
-and installed with the usual commands. For example, to build in a manner
-that is suitable for installing as root, use:
+and installed with the usual commands, however, we mandate to have the
+build directory different than the source directory. For example, to build
+in a manner that is suitable for installing as root, use:
```
-$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
+$ mkdir build && cd build
+$ ../configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ make
$ sudo make install
```
While to build & install as an unprivileged user
```
-$ ./configure --prefix=$HOME/usr
+$ mkdir build && cd build
+$ ../configure --prefix=$HOME/usr
$ make
$ make install
```
sed 's,\.\./\.\./\.\.,../..,g; s/^TESTS /GNULIB_TESTS /' $m > $m-t
mv -f $m-t $m
}
+
+bootstrap_epilogue()
+{
+ echo "$0: done. Now you can run 'mkdir build && cd build && ../configure'."
+ exit 0
+}
dnl <http://www.gnu.org/licenses/>.
AC_INIT([libvirt], [5.10.0], [libvir-list@redhat.com], [], [https://libvirt.org])
+
+if test $srcdir = "."
+then
+ AC_MSG_ERROR([Build directory must be different from source directory])
+fi
+
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
<h2><a id="compiling">Compiling a release tarball</a></h2>
<p>
- libvirt uses the standard configure/make/install steps:
+ libvirt uses the standard configure/make/install steps and mandates
+ that the build directory is different that the source directory:
</p>
<pre>
$ xz -c libvirt-x.x.x.tar.xz | tar xvf -
$ cd libvirt-x.x.x
-$ ./configure</pre>
+$ mkdir build && cd build
+$ ../configure</pre>
<p>
The <i>configure</i> script can be given options to change its default
</p>
<pre>
-$ ./configure <i>--help</i></pre>
+$ ../configure <i>--help</i></pre>
<p>
When you have determined which options you want to use (if any),
</p>
<pre>
-$ ./configure <i>[possible options]</i>
+$ ../configure <i>[possible options]</i>
$ make
$ <b>sudo</b> <i>make install</i></pre>
</p>
<pre>
-./configure \
+mkdir build && cd build
+../configure \
--without-sasl \
--without-polkit \
--without-python \
%endif
rm -f po/stamp-po
-%configure --with-runstatedir=%{_rundir} \
+
+%define _configure ../configure
+mkdir %{_vpath_builddir}
+cd %{_vpath_builddir}
+
+%configure --enable-dependency-tracking \
+ --with-runstatedir=%{_rundir} \
%{?arg_qemu} \
%{?arg_openvz} \
%{?arg_lxc} \
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
+cd %{_vpath_builddir}
%make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=%{_unitdir} V=1
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%endif
%check
+cd %{_vpath_builddir}
if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=1
then
cat test-suite.log || true