1#! /bin/sh
2
3# Licensed to the Apache Software Foundation (ASF) under one or more
4# contributor license agreements.  See the NOTICE file distributed with
5# this work for additional information regarding copyright ownership.
6# The ASF licenses this file to You under the Apache License, Version 2.0
7# (the "License"); you may not use this file except in compliance with
8# the License.  You may obtain a copy of the License at
9#
10#     http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17
18
19echo "buildconf: checking installation..."
20
21# any python
22python=${PYTHON-`build/PrintPath python3 python2 python`}
23if test -z "$python"; then
24echo "buildconf: python not found."
25echo "           You need python installed"
26echo "           to build Tomcat Native from SVN."
27exit 1
28else
29py_version=`$python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'`
30echo "buildconf: python version $py_version (ok)"
31fi
32
33# autoconf 2.50 or newer
34ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'`
35if test -z "$ac_version"; then
36echo "buildconf: autoconf not found."
37echo "           You need autoconf version 2.50 or newer installed"
38echo "           to build Tomcat Native from SVN."
39exit 1
40fi
41IFS=.; set $ac_version; IFS=' '
42if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then
43echo "buildconf: autoconf version $ac_version found."
44echo "           You need autoconf version 2.50 or newer installed"
45echo "           to build Tomcat Native from SVN."
46exit 1
47else
48echo "buildconf: autoconf version $ac_version (ok)"
49fi
50
51# Sample libtool --version outputs:
52# ltmain.sh (GNU libtool) 1.3.3 (1.385.2.181 1999/07/02 15:49:11)
53# ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a
54# output is multiline from 1.5 onwards
55
56# Require libtool 1.4 or newer
57libtool=`build/PrintPath glibtool libtool libtool15 libtool14`
58lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
59if test -z "$lt_pversion"; then
60echo "buildconf: libtool not found."
61echo "           You need libtool version 1.4 or newer installed"
62echo "           to build Tomcat Native from SVN."
63exit 1
64fi
65lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
66IFS=.; set $lt_version; IFS=' '
67lt_status="good"
68if test "$1" = "1"; then
69   if test "$2" -lt "4"; then
70      lt_status="bad"
71   fi
72fi
73if test $lt_status = "good"; then
74   echo "buildconf: libtool version $lt_pversion (ok)"
75   exit 0
76fi
77
78echo "buildconf: libtool version $lt_pversion found."
79echo "           You need libtool version 1.4 or newer installed"
80echo "           to build Tomcat Native from SVN."
81
82exit 1
83