3 # We change dir since the later utilities assume to work in the project dir
6 # make sure autoconf is up-to-date
7 ac_ver=`autoconf --version | head -n 1 | awk '{print $NF}'`
8 ac_maj=`echo $ac_ver|sed 's/\..*//'`
9 ac_min=`echo $ac_ver|sed 's/.*\.//'`
10 if [[ $ac_maj -lt 2 ]]; then
11 echo Min autoconf version is 2.57
13 elif [[ $ac_maj -eq 2 && $ac_min -lt 57 ]]; then
14 echo Min autoconf version is 2.57
18 # make sure automake is up-to-date
19 am_ver=`automake --version | head -n 1 | awk '{print $NF}'`
20 am_maj=`echo $am_ver|sed 's/\..*//'`
21 am_min=`echo $am_ver|sed 's/[^\.]*\.\([^\.]*\)\.*.*/\1/'`
22 am_sub=`echo $am_ver|sed 's/[^\.]*\.[^\.]*\.*//'`
23 if [[ $am_maj -lt 1 ]]; then
24 echo Min automake version is 1.6.3
26 elif [[ $am_maj -eq 1 && $am_min -lt 6 ]]; then
27 echo "automake version is too old:$am_maj.$am_min.$am_sub < required 1.6.3"
29 elif [[ $am_maj -eq 1 && $am_min -eq 6 && $am_sub -lt 3 ]]; then
30 echo "automake version is too old:$am_maj.$am_min.$am_sub < required 1.6.3"
34 # make sure libtool is up-to-date
35 lt_ver=`libtool --version | head -n 1 | awk '{print $4}'`
36 lt_maj=`echo $lt_ver|sed 's/\..*//'`
37 lt_min=`echo $lt_ver|sed 's/[^\.]*\.\([^\.]*\)\.*.*/\1/'`
38 lt_sub=`echo $lt_ver|sed 's/[^\.]*\.[^\.]*\.*//'`
39 if [[ $lt_maj -lt 1 ]]; then
40 echo Min libtool version is 1.4.2
42 elif [[ $lt_maj -eq 1 && $lt_min -lt 4 ]]; then
43 echo "libtool version is too old:$lt_maj.$lt_min.$lt_sub < required 1.4.2"
45 elif [[ $lt_maj -eq 1 && $lt_min -eq 4 && $lt_sub -lt 2 ]]; then
46 echo "libtool version is too old:$lt_maj.$lt_min.$lt_sub < required 1.4.2"
51 find . \( -name Makefile.in -o -name aclocal.m4 -o -name autom4te.cache -o -name configure -o -name aclocal.m4 \) -exec \rm -rf {} \; -prune
53 aclocal -I config && \
54 libtoolize --force --copy && \
56 automake --foreign --add-missing --copy && \