Export inspect_linux_kernel in Lib.pm
[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 # Run autopoint, to get po/Makevars.template:
32 autopoint
33
34 # Create gettext configuration.
35 echo "$0: Creating po/Makevars from po/Makevars.template ..."
36 rm -f po/Makevars
37 sed '
38   /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
39   /^MSGID_BUGS_ADDRESS *=/s/=.*/= '"$MSGID_BUGS_ADDRESS"'/
40   /^XGETTEXT_OPTIONS *=/{
41     s/$/ \\/
42     a\
43         '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
44   }
45 ' po/Makevars.template >po/Makevars
46
47 gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
48 <$gnulib_tool || exit
49
50 (cd daemon && mkdir -p tests lib && ../$gnulib_tool --update)
51
52 modules='
53 gitlog-to-changelog
54 gnu-make
55 gnumakefile
56 ignore-value
57 maintainer-makefile
58 manywarnings
59 warnings
60 vc-list-files
61 '
62
63 $gnulib_tool                    \
64   --avoid=dummy                 \
65   --with-tests                  \
66   --m4-base=gnulib/m4           \
67   --source-base=gnulib/lib      \
68   --tests-base=gnulib/tests     \
69   --import $modules