2005-11-02 13:19:10 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Run this to generate all the initial makefiles, etc.
|
autogen.sh: Restore --no-git (avoid git submodule update)
Prior to 2621d48f005a "gnulib: delete all gnulib integration",
one could pass ./autogen.sh --no-git to prevent the libvirt build
system from running git submodule update.
This feature is needed by systems like the Xen Project CI which want
to explicitly control the revisions of every tree. These will
typically arrange to initialise the submodules check out the right
version of everything, and then expect the build system not to mess
with it any more.
Despite to the old documentation comments referring only to gnulib,
the --no-git feature is required not only because of gnulib but also
because of the other submodule, src/keycodemapdb.
(And in any case, even if it were no longer required because all the
submodules were removed, it ought ideally to have been retained as a
no-op for compaibility reasons.)
So restore the --no-git feature.
Because of the way the argument parsing of autogen.sh works, it is
easiest to recognise this option only if it comes first. This works
for the Xen Project CI, which has always passed this option first.
If something else is using this option (and hasn't introduced a
different workaround in the meantime), not in the first position,
then perhaps a more sophisticated approach will be needed. But I
think this will do for now.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020-06-02 15:47:45 +00:00
|
|
|
#
|
|
|
|
# THe following options must come first. All other or subsequent
|
|
|
|
# arguments are passed to configure:
|
|
|
|
# --no-git skip `git submodule update --init`
|
|
|
|
|
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
|
|
|
|
autogen.sh: Restore --no-git (avoid git submodule update)
Prior to 2621d48f005a "gnulib: delete all gnulib integration",
one could pass ./autogen.sh --no-git to prevent the libvirt build
system from running git submodule update.
This feature is needed by systems like the Xen Project CI which want
to explicitly control the revisions of every tree. These will
typically arrange to initialise the submodules check out the right
version of everything, and then expect the build system not to mess
with it any more.
Despite to the old documentation comments referring only to gnulib,
the --no-git feature is required not only because of gnulib but also
because of the other submodule, src/keycodemapdb.
(And in any case, even if it were no longer required because all the
submodules were removed, it ought ideally to have been retained as a
no-op for compaibility reasons.)
So restore the --no-git feature.
Because of the way the argument parsing of autogen.sh works, it is
easiest to recognise this option only if it comes first. This works
for the Xen Project CI, which has always passed this option first.
If something else is using this option (and hasn't introduced a
different workaround in the meantime), not in the first position,
then perhaps a more sophisticated approach will be needed. But I
think this will do for now.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020-06-02 15:47:45 +00:00
|
|
|
if [ "x$1" = x--no-git ]; then
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
git submodule update --init || exit 1
|
|
|
|
fi
|
2010-03-16 20:08:31 +00:00
|
|
|
|
2020-01-17 16:00:27 +00:00
|
|
|
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
|