build: enable automake's silent rules option
[libguestfs.git] / bootstrap
1 #!/bin/sh
2
3 usage() {
4   echo >&2 "\
5 Usage: $0 [OPTION]...
6 Bootstrap this package from the checked-out sources.
7 "
8 }
9
10 for option
11 do
12   case $option in
13   --help)
14     usage
15     exit;;
16   *)
17     echo >&2 "$0: $option: unknown option"
18     exit 1;;
19   esac
20 done
21
22 # Get gnulib files.
23
24 echo "$0: getting gnulib files..."
25 git submodule init || exit $?
26 git submodule update || exit $?
27 GNULIB_SRCDIR=.gnulib
28
29 ls po/*.po 2>/dev/null | sed 's|.*/||; s|\.po$||' > po/LINGUAS
30
31 # Create gettext configuration.
32 echo "$0: Creating po/Makevars from po/Makevars.template ..."
33 rm -f po/Makevars
34 sed '
35   /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
36   /^MSGID_BUGS_ADDRESS *=/s/=.*/= '"$MSGID_BUGS_ADDRESS"'/
37   /^XGETTEXT_OPTIONS *=/{
38     s/$/ \\/
39     a\
40         '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
41   }
42 ' po/Makevars.template >po/Makevars
43
44 gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
45 <$gnulib_tool || exit
46
47 (cd daemon && mkdir -p tests lib && ../$gnulib_tool --update)
48
49 modules='
50 gitlog-to-changelog
51 gnu-make
52 gnumakefile
53 maintainer-makefile
54 manywarnings
55 warnings
56 vc-list-files
57 '
58
59 $gnulib_tool                    \
60   --avoid=dummy                 \
61   --with-tests                  \
62   --m4-base=gnulib/m4           \
63   --source-base=gnulib/lib      \
64   --tests-base=gnulib/tests     \
65   --import $modules