btrfs-progs: convert: Fix a bug leads to discontinuous extents
[btrfs-progs-unstable/devel.git] / autogen.sh
blob80442c5b37dd09d10a543019f477e8741439a236
1 #!/bin/sh
4 # Helps generate autoconf stuff, when code is checked out from SCM.
6 # Copyright (C) 2006-2014 - Karel Zak <kzak@redhat.com>
9 srcdir=`dirname $0`
10 test -z "$srcdir" && srcdir=.
12 THEDIR=`pwd`
13 cd $srcdir
14 DIE=0
16 test -f btrfs.c || {
17 echo
18 echo "You must run this script in the top-level btrfs-progs directory"
19 echo
20 DIE=1
23 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
24 echo
25 echo "You must have autoconf installed to generate btrfs-progs build system."
26 echo
27 DIE=1
29 (autoheader --version) < /dev/null > /dev/null 2>&1 || {
30 echo
31 echo "You must have autoheader installed to generate btrfs-progs build system."
32 echo "The autoheader command is part of the GNU autoconf package."
33 echo
34 DIE=1
37 (automake --version) < /dev/null > /dev/null 2>&1 || {
38 echo
39 echo "You must have automake installed to generate btrfs-progs build system."
40 echo
41 DIE=1
44 (pkg-config --version) < /dev/null > /dev/null 2>&1 || {
45 echo
46 echo "You must have pkg-config installed to use btrfs-progs build system."
47 echo "The pkg-config utility was not found in the standard location, set"
48 echo "the PKG_CONFIG/PKG_CONFIG_PATH/PKG_CONFIG_LIBDIR variables at the"
49 echo "configure time."
50 echo
53 if test "$DIE" -eq 1; then
54 exit 1
57 echo
58 echo "Generate build-system by:"
59 echo " aclocal: $(aclocal --version | head -1)"
60 echo " autoconf: $(autoconf --version | head -1)"
61 echo " autoheader: $(autoheader --version | head -1)"
62 echo " automake: $(automake --version | head -1)"
64 chmod +x version.sh
65 rm -rf autom4te.cache
67 aclocal -I m4 $AL_OPTS &&
68 autoconf -I m4 $AC_OPTS &&
69 autoheader -I m4 $AH_OPTS ||
70 exit 1
72 # it's better to use helper files from automake installation than
73 # maintain copies in git tree
74 find_autofile() {
75 if [ -f "$1" ]; then
76 return
78 for HELPER_DIR in $(automake --print-libdir 2>/dev/null) \
79 /usr/share/libtool \
80 /usr/share/automake-* ; do
81 f="$HELPER_DIR/$1"
82 if [ -f "$f" ]; then
83 cp "$f" config/
84 return
86 done
87 echo "Cannot find "$1" in known locations"
88 exit 1
91 mkdir -p config/
92 find_autofile config.guess
93 find_autofile config.sub
94 find_autofile install-sh
96 cd "$THEDIR"
98 echo
99 echo "Now type '$srcdir/configure' and 'make' to compile."
100 echo