fish: Allow '-' prefix on command line to override exit on error (RHBZ#578407).
[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 # Also, released autopoint has the tendency to install macros that have
33 # been obsoleted in current gnulib, so run this before gnulib-tool.
34 autopoint --force
35
36 # Autoreconf runs aclocal before libtoolize, which causes spurious
37 # warnings if the initial aclocal is confused by the libtoolized
38 # (or worse out-of-date) macro directory.
39 libtoolize --copy --install
40
41 # Create gettext configuration.
42 echo "$0: Creating po/Makevars from po/Makevars.template ..."
43 rm -f po/Makevars
44 sed '
45   /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
46   /^MSGID_BUGS_ADDRESS *=/s/=.*/= '"$MSGID_BUGS_ADDRESS"'/
47   /^XGETTEXT_OPTIONS *=/{
48     s/$/ \\/
49     a\
50         '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
51   }
52 ' po/Makevars.template >po/Makevars
53
54 gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
55 <$gnulib_tool || exit
56
57 (cd daemon && mkdir -p tests lib && ../$gnulib_tool --update)
58
59 modules='
60 arpa_inet
61 c-ctype
62 closeout
63 error
64 filevercmp
65 fts
66 full-read
67 full-write
68 gitlog-to-changelog
69 gnu-make
70 gnumakefile
71 hash
72 hash-pjw
73 ignore-value
74 lock
75 maintainer-makefile
76 manywarnings
77 netinet_in
78 progname
79 setenv
80 strchrnul
81 strerror
82 strndup
83 vasprintf
84 vc-list-files
85 warnings
86 xalloc
87 xalloc-die
88 xstrtol
89 xstrtoll
90 xvasprintf
91 '
92
93 $gnulib_tool                    \
94   --avoid=dummy                 \
95   --with-tests                  \
96   --m4-base=m4                  \
97   --source-base=gnulib/lib      \
98   --tests-base=gnulib/tests     \
99   --import $modules
100
101 # Disable autopoint and libtoolize, since they were already done above.
102 AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install