cli: Indicate which brick of the replica is the arbiter
[obnox/glusterfs.git] / autogen.sh
1 #!/bin/sh
2
3 echo
4 echo ... GlusterFS autogen ...
5 echo
6
7 ## Check all dependencies are present
8 MISSING=""
9
10 # Check for aclocal
11 env aclocal --version > /dev/null 2>&1
12 if [ $? -eq 0 ]; then
13   ACLOCAL=aclocal
14 else
15   MISSING="$MISSING aclocal"
16 fi
17
18 # Check for autoconf
19 env autoconf --version > /dev/null 2>&1
20 if [ $? -eq 0 ]; then
21   AUTOCONF=autoconf
22 else
23   MISSING="$MISSING autoconf"
24 fi
25
26 # Check for autoheader
27 env autoheader --version > /dev/null 2>&1
28 if [ $? -eq 0 ]; then
29   AUTOHEADER=autoheader
30 else
31   MISSING="$MISSING autoheader"
32 fi
33
34 # Check for automake
35 env automake --version > /dev/null 2>&1
36 if [ $? -eq 0 ]; then
37   AUTOMAKE=automake
38 else
39   MISSING="$MISSING automake"
40 fi
41
42 # Check for libtoolize or glibtoolize
43 env libtoolize --version > /dev/null 2>&1
44 if [ $? -eq 0 ]; then
45   # libtoolize was found, so use it
46   TOOL=libtoolize
47 else
48   # libtoolize wasn't found, so check for glibtoolize
49   env glibtoolize --version > /dev/null 2>&1
50   if [ $? -eq 0 ]; then
51     TOOL=glibtoolize
52   else
53     MISSING="$MISSING libtoolize/glibtoolize"
54   fi
55 fi
56
57 # Check for tar
58 env tar -cf /dev/null /dev/null > /dev/null 2>&1
59 if [ $? -ne 0 ]; then
60   MISSING="$MISSING tar"
61 fi
62
63 ## If dependencies are missing, warn the user and abort
64 if [ "x$MISSING" != "x" ]; then
65   echo "Aborting."
66   echo
67   echo "The following build tools are missing:"
68   echo
69   for pkg in $MISSING; do
70     echo "  * $pkg"
71   done
72   echo
73   echo "Please install them and try again."
74   echo
75   exit 1
76 fi
77
78 ## Do the autogeneration
79 echo Running ${ACLOCAL}...
80 $ACLOCAL -I ./contrib/aclocal
81 echo Running ${AUTOHEADER}...
82 $AUTOHEADER
83 echo Running ${TOOL}...
84 $TOOL --automake --copy --force
85 echo Running ${AUTOCONF}...
86 $AUTOCONF
87 echo Running ${AUTOMAKE}...
88 $AUTOMAKE --add-missing --copy --foreign
89
90 # Run autogen in the argp-standalone sub-directory
91 echo "Running autogen.sh in argp-standalone ..."
92 ( cd contrib/argp-standalone;./autogen.sh )
93
94 # Instruct user on next steps
95 echo
96 echo "Please proceed with configuring, compiling, and installing."