~ubuntu-branches/ubuntu/intrepid/config-manager/intrepid

« back to all changes in this revision

Viewing changes to bootstrap.sh

  • Committer: Bazaar Package Importer
  • Author(s): Anand Kumria
  • Date: 2004-01-14 02:46:24 UTC
  • Revision ID: james.westby@ubuntu.com-20040114024624-x9lrmmjqcpc7fip1
Tags: upstream-0.1p53
ImportĀ upstreamĀ versionĀ 0.1p53

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# Used to setup the configure.in, autoheader and Makefile.in's if configure
 
3
# has not been generated. This script is only needed for developers when
 
4
# configure has not been run, or if a Makefile.am in a non-configured directory
 
5
# has been updated
 
6
 
7
# DO NOT ALTER next line
 
8
# arch-tag: c714f9db-4c43-4b92-9624-7fd40d7a30fc
 
9
#
 
10
 
 
11
# Autotool versions preferred. To override either edit the script
 
12
# to match the versions you want to use, or set the variables on
 
13
# the command line like "env acver=.. amver=... ./bootstrap.sh"
 
14
acversions="${acver:-2.58 2.57 2.53 2.52}"
 
15
amversions="${amver:-1.8 1.7 1.6 1.5}"
 
16
 
 
17
check_version()
 
18
{
 
19
  eval $2 --version 2>/dev/null | grep -i "$1.*$3" >/dev/null
 
20
}
 
21
 
 
22
find_version()
 
23
{
 
24
  tool=$1
 
25
  found="NOT_FOUND"
 
26
  shift
 
27
  versions="$*"
 
28
  for version in $versions; do
 
29
    for variant in "" "-${version}" "`echo $version | sed -e 's/\.//g'`"; do
 
30
      if check_version $tool ${tool}${variant} $version; then
 
31
        found="${variant}"
 
32
        break
 
33
      fi
 
34
    done
 
35
    if [ "x$found" != "xNOT_FOUND" ]; then
 
36
      break
 
37
    fi
 
38
  done
 
39
  if [ "x$found" = "xNOT_FOUND" ]; then
 
40
    echo "WARNING: Cannot find $tool version $versions" >&2
 
41
    echo "Trying `$tool --version | head -1`" >&2
 
42
    found=""
 
43
  fi
 
44
  echo $found
 
45
}
 
46
 
 
47
bootstrap() {
 
48
  if "$@"; then
 
49
    true # Everything OK
 
50
  else
 
51
    echo "$1 failed"
 
52
    echo "Autotool bootstrapping failed. You will need to investigate and correct" ;
 
53
    echo "before you can develop on this source tree" 
 
54
    exit 1
 
55
  fi
 
56
}
 
57
 
 
58
 
 
59
# Adjust paths of required autool packages
 
60
amver=`find_version automake ${amversions}`
 
61
acver=`find_version autoconf ${acversions}`
 
62
 
 
63
 
 
64
# Set environment variable to tell automake which autoconf to use.
 
65
AUTOCONF="autoconf${acver}" ; export AUTOCONF
 
66
 
 
67
 
 
68
for dir in \
 
69
        "." \
 
70
        libgetopt
 
71
do
 
72
    if (test -d $dir); then
 
73
    if (
 
74
        echo "Bootstrapping $dir"
 
75
        cd ./$dir
 
76
        # Make sure cfgaux exists
 
77
        mkdir -p cfgaux
 
78
        # Bootstrap the autotool subsystems
 
79
        bootstrap aclocal$amver
 
80
        #workaround for Automake 1.5
 
81
        if grep m4_regex aclocal.m4 >/dev/null; then
 
82
            perl -i.bak -p -e 's/m4_patsubst/m4_bpatsubst/g; s/m4_regexp/m4_bregexp/g;' aclocal.m4
 
83
        fi
 
84
        bootstrap autoheader$acver
 
85
        bootstrap libtoolize --automake
 
86
        bootstrap automake$amver --foreign --add-missing
 
87
        bootstrap autoconf$acver ); then
 
88
            : # OK
 
89
        else
 
90
            exit 1
 
91
        fi
 
92
    fi
 
93
done
 
94
 
 
95
echo "Autotool bootstrapping complete."