TEMP disable %check
[libvirt/apevec.git] / autogen.sh
blob6c2e3bc60e6a9359faea38ccecb0b8fe46753b6c
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 srcdir=`dirname "$0"`
5 test -z "$srcdir" && srcdir=.
7 THEDIR=`pwd`
8 cd "$srcdir"
10 test -f src/libvirt.c || {
11 echo "You must run this script in the top-level libvirt directory"
12 exit 1
16 EXTRA_ARGS=
17 if test "x$1" = "x--system"; then
18 shift
19 EXTRA_ARGS="--prefix=/usr --sysconfdir=/etc --localstatedir=/var"
20 echo "Running ./configure with $EXTRA_ARGS $@"
21 else
22 if test -z "$*" && test ! -f "$THEDIR/config.status"; then
23 echo "I am going to run ./configure with no arguments - if you wish "
24 echo "to pass any to it, please specify them on the $0 command line."
28 # Compute the hash we'll use to determine whether rerunning bootstrap
29 # is required. The first is just the SHA1 that selects a gnulib snapshot.
30 # The second ensures that whenever we change the set of gnulib modules used
31 # by this package, we rerun bootstrap to pull in the matching set of files.
32 bootstrap_hash()
34 git submodule status | sed 's/^[ +-]//;s/ .*//'
35 git hash-object bootstrap.conf
38 # Ensure that whenever we pull in a gnulib update or otherwise change to a
39 # different version (i.e., when switching branches), we also rerun ./bootstrap.
40 # Also, running 'make rpm' tends to litter the po/ directory, and some people
41 # like to run 'git clean -x -f po' to fix it; but only ./bootstrap regenerates
42 # the required file po/Makevars.
43 curr_status=.git-module-status
44 t=$(bootstrap_hash; git diff .gnulib)
45 if test "$t" = "$(cat $curr_status 2>/dev/null)" \
46 && test -f "po/Makevars"; then
47 # good, it's up to date, all we need is autoreconf
48 autoreconf -if
49 else
50 echo running bootstrap...
51 ./bootstrap && bootstrap_hash > $curr_status \
52 || { echo "Failed to bootstrap, please investigate."; exit 1; }
55 cd "$THEDIR"
57 if test "x$OBJ_DIR" != x; then
58 mkdir -p "$OBJ_DIR"
59 cd "$OBJ_DIR"
62 if test -z "$*" && test -f config.status; then
63 ./config.status --recheck
64 else
65 $srcdir/configure $EXTRA_ARGS "$@"
66 fi && {
67 echo
68 echo "Now type 'make' to compile libvirt."