1#! /bin/sh
2
3echo "buildconf: checking installation..."
4res=0
5
6# any python
7python=${PYTHON-`build/PrintPath python3 python2 python`}
8if test -z "$python"; then
9  echo "buildconf: python not found."
10  echo "           You need python installed"
11  echo "           to build APR from SVN."
12  res=1
13else
14  py_version=`$python -c 'import sys; print(sys.version)' 2>&1|sed 's/ .*//;q'`
15  echo "buildconf: python version $py_version (ok)"
16fi
17
18# autoconf 2.59 or newer
19ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'`
20if test -z "$ac_version"; then
21  echo "buildconf: autoconf not found."
22  echo "           You need autoconf version 2.59 or newer installed"
23  echo "           to build APR from SVN."
24  res=1
25else
26  IFS=.; set $ac_version; IFS=' '
27  if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then
28    echo "buildconf: autoconf version $ac_version found."
29    echo "           You need autoconf version 2.59 or newer installed"
30    echo "           to build APR from SVN."
31    res=1
32  else
33    echo "buildconf: autoconf version $ac_version (ok)"
34  fi
35fi
36
37# Sample libtool --version outputs:
38# ltmain.sh (GNU libtool) 1.3.3 (1.385.2.181 1999/07/02 15:49:11)
39# ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a
40# output is multiline from 1.5 onwards
41
42# Require libtool 1.4 or newer
43libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14`
44lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
45if test -z "$lt_pversion"; then
46  echo "buildconf: libtool not found."
47  echo "           You need libtool version 1.4 or newer installed"
48  echo "           to build APR from SVN."
49  res=1
50else
51  lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
52  IFS=.; set $lt_version; IFS=' '
53  lt_status="good"
54  if test "$1" = "1"; then
55    if test "$2" -lt "4"; then
56      lt_status="bad"
57    fi
58  fi
59  if test $lt_status = "good"; then
60    echo "buildconf: libtool version $lt_pversion (ok)"
61  else
62    echo "buildconf: libtool version $lt_pversion found."
63    echo "           You need libtool version 1.4 or newer installed"
64    echo "           to build APR from SVN."
65    res=1
66  fi
67fi
68
69exit $res
70
71