Update called vala api.
[stuffkeeper.git] / autogen.sh
blob133068dbb40eb1fc1a94485bbe127490e641b260
1 #!/bin/sh
2 # Run this to set up the build system: configure, makefiles, etc.
3 # (at one point this was based on the version in enlightenment's cvs)
5 package="stuffkeeper"
7 olddir="`pwd`"
8 srcdir="`dirname $0`"
9 test -z "$srcdir" && srcdir=.
10 cd "$srcdir"
11 DIE=
12 AM_VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
13 AC_VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9][0-9]\).*/\1/"
14 VERSIONMKINT="sed -e s/[^0-9]//"
15 if test -n "$AM_FORCE_VERSION"
16 then
17 AM_VERSIONS="$AM_FORCE_VERSION"
18 else
19 AM_VERSIONS='1.6 1.7 1.8 1.9'
21 if test -n "$AC_FORCE_VERSION"
22 then
23 AC_VERSIONS="$AC_FORCE_VERSION"
24 else
25 AC_VERSIONS='2.58 2.59'
28 versioned_bins ()
30 bin="$1"
31 needed_int=`echo $VERNEEDED | $VERSIONMKINT`
32 for i in $VERSIONS
34 i_int=`echo $i | $VERSIONMKINT`
35 if test $i_int -ge $needed_int
36 then
37 echo $bin-$i $bin$i $bin-$i_int $bin$i_int
39 done
40 echo $bin
43 for c in autoconf autoheader automake aclocal
45 uc=`echo $c | tr a-z A-Z`
46 eval "val=`echo '$'$uc`"
47 if test -n "$val"
48 then
49 echo "$uc=$val in environment, will not attempt to auto-detect"
50 continue
53 case "$c" in
54 autoconf|autoheader)
55 VERNEEDED=`fgrep AC_PREREQ configure.ac | $AC_VERSIONGREP`
56 VERSIONS="$AC_VERSIONS"
57 pkg=autoconf
59 automake|aclocal)
60 VERNEEDED=`fgrep AUTOMAKE_OPTIONS Makefile.am | $AM_VERSIONGREP`
61 VERSIONS="$AM_VERSIONS"
62 pkg=automake
64 esac
65 printf "checking for $c ... "
66 for x in `versioned_bins $c`; do
67 ($x --version < /dev/null > /dev/null 2>&1) > /dev/null 2>&1
68 if test $? -eq 0
69 then
70 echo $x
71 eval $uc=$x
72 break
74 done
75 eval "val=`echo '$'$uc`"
76 if test -z "$val"
77 then
78 if test $c = $pkg
79 then
80 DIE="$DIE $c=$VERNEEDED"
81 else
82 DIE="$DIE $c($pkg)=$VERNEEDED"
85 done
87 if test -n "$LIBTOOLIZE"
88 then
89 echo "LIBTOOLIZE=$LIBTOOLIZE in environment," \
90 "will not attempt to auto-detect"
91 else
92 printf "checking for libtoolize ... "
93 for x in libtoolize glibtoolize
95 ($x --version < /dev/null > /dev/null 2>&1) > /dev/null 2>&1
96 if test $? -eq 0
97 then
98 echo $x
99 LIBTOOLIZE=$x
100 break
102 done
105 if test -z "$LIBTOOLIZE"
106 then
107 DIE="$DIE libtoolize(libtool)"
111 if test -n "$INTLTOOLIZE"
112 then
113 echo "INTLTOOLIZE=$INTLTOOLIZE in environment," \
114 "will not attempt to auto-detect"
115 else
116 printf "checking for intltoolize ... "
117 for x in intltoolize
119 ($x --version < /dev/null > /dev/null 2>&1) > /dev/null 2>&1
120 if test $? -eq 0
121 then
122 echo $x
123 INTLTOOLIZE=$x
124 break
126 done
129 if test -z "$INTLTOOLIZE"
130 then
131 DIE="$DIE libtoolize(libtool)"
145 if test -n "$DIE"
146 then
147 echo "You must have the following installed to compile $package:"
148 for i in $DIE
150 printf ' '
151 echo $i | sed -e 's/(/ (from /' -e 's/=\(.*\)/ (>= \1)/'
152 done
153 echo "Download the appropriate package(s) for your system,"
154 echo "or get the source from one of the GNU ftp sites"
155 echo "listed in http://www.gnu.org/order/ftp.html"
156 exit 1
159 echo "Generating configuration files for $package, please wait...."
161 ACLOCAL_FLAGS="$ACLOCAL_FLAGS"
163 # /usr/share/aclocal is most likely included by default, already...
164 ac_local_paths='
165 /usr/local/share/aclocal
166 /sw/share/aclocal
167 /usr/pkg/share/aclocal
168 /opt/share/aclocal
169 /usr/gnu/share/aclocal
172 for i in $ac_local_paths; do
173 if test -d "$i"; then
174 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $i"
175 # we probably only want one of these...
176 break
178 done
180 echo " $ACLOCAL $ACLOCAL_FLAGS"
181 $ACLOCAL $ACLOCAL_FLAGS || exit 1
183 echo " $AUTOHEADER"
184 $AUTOHEADER || exit 1
186 echo " $LIBTOOLIZE --automake"
187 $LIBTOOLIZE --automake || exit 1
189 echo " $INTLTOOLIZE --automake"
190 $INTLTOOLIZE --automake || exit 1
192 echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
193 $AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1
195 echo " $AUTOCONF"
196 $AUTOCONF || exit 1
198 cd "$olddir"
199 if test x$NOCONFIGURE = x; then
200 "$srcdir"/configure "$@" || exit 1