build: update gnulib submodule to latest
[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 asprintf
54 closeout
55 gitlog-to-changelog
56 gnu-make
57 gnumakefile
58 ignore-value
59 maintainer-makefile
60 manywarnings
61 progname
62 strchrnul
63 strerror
64 strndup
65 vasprintf
66 vc-list-files
67 warnings
68 '
69
70 $gnulib_tool                    \
71   --avoid=dummy                 \
72   --with-tests                  \
73   --m4-base=gnulib/m4           \
74   --source-base=gnulib/lib      \
75   --tests-base=gnulib/tests     \
76   --import $modules