2005-11-02 13:19:10 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Run this to generate all the initial makefiles, etc.
|
2020-01-17 16:00:27 +00:00
|
|
|
test -n "$srcdir" || srcdir=$(dirname "$0")
|
|
|
|
test -n "$srcdir" || srcdir=.
|
2005-11-02 13:19:10 +00:00
|
|
|
|
2020-01-17 16:00:27 +00:00
|
|
|
olddir=$(pwd)
|
2005-11-02 13:19:10 +00:00
|
|
|
|
2020-01-17 16:00:27 +00:00
|
|
|
cd "$srcdir"
|
2005-11-02 13:19:10 +00:00
|
|
|
|
2020-01-17 16:00:27 +00: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 11:09:08 +00:00
|
|
|
}
|
2009-11-26 14:38:50 +00:00
|
|
|
|
2020-01-17 16:00:27 +00:00
|
|
|
git submodule update --init || exit 1
|
2010-03-16 20:08:31 +00:00
|
|
|
|
2020-01-17 16:00:27 +00:00
|
|
|
aclocal --install || exit 1
|
|
|
|
autoreconf --verbose --force --install || exit 1
|
2017-04-12 11:09:08 +00:00
|
|
|
|
2020-01-17 16:00:27 +00: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 11:09:08 +00:00
|
|
|
fi
|
2020-01-17 16:00:27 +00:00
|
|
|
EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
|
|
|
|
fi
|
2017-04-12 11:09:08 +00:00
|
|
|
|
2020-01-17 16:00:27 +00:00
|
|
|
cd "$olddir"
|
2017-04-12 11:09:08 +00:00
|
|
|
|
2020-01-17 16:00:27 +00:00
|
|
|
if [ "$NOCONFIGURE" = "" ]; then
|
|
|
|
$srcdir/configure $EXTRA_ARGS "$@" || exit 1
|
2017-04-12 11:09:08 +00:00
|
|
|
|
2020-01-17 16:00:27 +00:00
|
|
|
if [ "$1" = "--help" ]; then
|
|
|
|
exit 0
|
2017-04-12 11:09:08 +00:00
|
|
|
else
|
2020-01-17 16:00:27 +00: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 15:10:20 +00:00
|
|
|
fi
|
2010-03-25 23:37:32 +00:00
|
|
|
else
|
2020-01-17 16:00:27 +00:00
|
|
|
echo "Skipping configure process."
|
2017-04-12 11:09:08 +00:00
|
|
|
fi
|