2005-11-02 16:19:10 +03:00
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
2020-01-17 19:00:27 +03:00
test -n " $srcdir " || srcdir = $( dirname " $0 " )
test -n " $srcdir " || srcdir = .
2005-11-02 16:19:10 +03:00
2020-01-17 19:00:27 +03:00
olddir = $( pwd )
2005-11-02 16:19:10 +03:00
2020-01-17 19:00:27 +03:00
cd " $srcdir "
2005-11-02 16:19:10 +03:00
2020-01-17 19:00:27 +03:00
( test -f src/libvirt.c) || {
echo -n "**Error**: Directory " \` $srcdir \' " does not look like the"
echo " top-level libvirt directory"
exit 1
2017-04-12 14:09:08 +03:00
}
2009-11-26 17:38:50 +03:00
2020-01-17 19:00:27 +03:00
git submodule update --init || exit 1
2010-03-16 23:08:31 +03:00
2020-01-17 19:00:27 +03:00
autoreconf --verbose --force --install || exit 1
2017-04-12 14:09:08 +03:00
2020-01-17 19:00:27 +03:00
if test " x $1 " = "x--system" ; then
shift
prefix = /usr
libdir = $prefix /lib
sysconfdir = /etc
localstatedir = /var
if [ -d /usr/lib64 ] ; then
libdir = $prefix /lib64
2017-04-12 14:09:08 +03:00
fi
2020-01-17 19:00:27 +03:00
EXTRA_ARGS = " --prefix= $prefix --sysconfdir= $sysconfdir --localstatedir= $localstatedir --libdir= $libdir "
fi
2017-04-12 14:09:08 +03:00
2020-01-17 19:00:27 +03:00
cd " $olddir "
2017-04-12 14:09:08 +03:00
2020-01-17 19:00:27 +03:00
if [ " $NOCONFIGURE " = "" ] ; then
$srcdir /configure $EXTRA_ARGS " $@ " || exit 1
2017-04-12 14:09:08 +03:00
2020-01-17 19:00:27 +03:00
if [ " $1 " = "--help" ] ; then
exit 0
2017-04-12 14:09:08 +03:00
else
2020-01-17 19:00:27 +03:00
echo "Now type 'make' to compile libvirt" || exit 1
build: avoid infinite autogen loop
Several people have reported that if the .gnulib submodule is dirty,
then 'make' will go into an infinite loop attempting to rerun bootstrap,
because that never cleans up the dirty submodule. By default, we
should halt and make the user investigate, but if the user doesn't
know why or care that the submodule is dirty, I also added the ability
to 'make CLEAN_SUBMODULE=1' to get things going again.
Also, while testing this, I noticed that when a submodule update was
needed, 'make' would first run autoreconf, then bootstrap (which
reruns autoreconf); adding a strategic dependency allows for less work.
* .gnulib: Update to latest, for maint.mk improvements.
* cfg.mk (_autogen): Also hook maint.mk, to run before autoreconf.
* autogen.sh (bootstrap): Refuse to run if gnulib is dirty, unless
user requests discarding gnulib changes.
2012-10-01 19:10:20 +04:00
fi
2010-03-26 02:37:32 +03:00
else
2020-01-17 19:00:27 +03:00
echo "Skipping configure process."
2017-04-12 14:09:08 +03:00
fi