]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ofed/management/opensm/autogen.sh
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ofed / management / opensm / autogen.sh
1 #!/bin/bash
2
3 # We change dir since the later utilities assume to work in the project dir
4 cd ${0%*/*}
5
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
12     exit 1
13 elif [[ $ac_maj -eq 2 && $ac_min -lt 57 ]]; then
14     echo Min autoconf version is 2.57
15     exit 1
16 fi
17
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
25     exit 1
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"
28     exit 1
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"
31     exit 1
32 fi
33
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
41     exit 1
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"
44     exit 1
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"
47     exit 1
48 fi
49
50 # cleanup
51 find . \( -name Makefile.in -o -name aclocal.m4 -o -name autom4te.cache -o -name configure -o -name aclocal.m4 \) -exec \rm -rf {} \; -prune
52
53 aclocal -I config && \
54 libtoolize --force --copy && \
55 autoheader && \
56 automake --foreign --add-missing --copy && \
57 autoconf