Bump to 1.14.1
[platform/upstream/augeas.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 Options:
9  --gnulib-srcdir=DIRNAME  Specify the local directory where gnulib
10                           sources reside.  Use this if you already
11                           have gnulib sources on your machine, and
12                           do not want to waste your bandwidth downloading
13                           them again.
14
15 If the file bootstrap.conf exists in the current working directory, its
16 contents are read as shell variables to configure the bootstrap.
17
18 Running without arguments will suffice in most cases.
19 "
20 }
21
22 for option
23 do
24   case $option in
25   --help)
26     usage
27     exit;;
28   --gnulib-srcdir=*)
29     GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
30   *)
31     echo >&2 "$0: $option: unknown option"
32     exit 1;;
33   esac
34 done
35
36 # Get gnulib files.
37
38 case ${GNULIB_SRCDIR--} in
39 -)
40   echo "$0: getting gnulib files..."
41   git submodule init || exit $?
42   git submodule update || exit $?
43   GNULIB_SRCDIR=.gnulib
44   ;;
45 *)
46   # Redirect the gnulib submodule to the directory on the command line
47   # if possible.
48   if test -d "$GNULIB_SRCDIR"/.git && \
49         git config --file .gitmodules submodule.gnulib.url >/dev/null; then
50     git submodule init
51     GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd`
52     git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR
53     echo "$0: getting gnulib files..."
54     git submodule update || exit $?
55     GNULIB_SRCDIR=.gnulib
56   else
57     echo >&2 "$0: invalid gnulib srcdir: $GNULIB_SRCDIR"
58     exit 1
59   fi
60   ;;
61 esac
62
63 gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
64 <$gnulib_tool || exit
65
66 modules='
67 argz
68 fnmatch
69 getline
70 getopt-gnu
71 gitlog-to-changelog
72 canonicalize-lgpl
73 isblank
74 locale
75 mkstemp
76 regex
77 safe-alloc
78 selinux-h
79 stpcpy
80 stpncpy
81 strchrnul
82 strndup
83 sys_wait
84 vasprintf
85 '
86
87 # Tell gnulib to:
88 #   require LGPLv2+
89 #   put *.m4 files in new gnulib/m4/ dir
90 #   put *.[ch] files in new gnulib/lib/ dir.
91
92 $gnulib_tool                    \
93   --lgpl=2                      \
94   --with-tests                  \
95   --m4-base=gnulib/m4           \
96   --source-base=gnulib/lib      \
97   --tests-base=gnulib/tests     \
98   --aux-dir=build/ac-aux        \
99   --libtool                     \
100   --quiet                       \
101   --import $modules