source: releases/0.5.5/run_autotools @ 303

Last change on this file since 303 was 215, checked in by andreasw, 14 years ago

making trunk (rev 214) the new stable version, still in 0.5

  • Property svn:executable set to *
File size: 3.5 KB
Line 
1#!/bin/sh
2
3ver_autoconf='2.59'
4ver_automake='1.9.6'
5ver_libtool='1.5.22'
6EGREP='grep -E'
7
8# Check if the correct version of the autotools is used
9if test x$AUTOTOOLS_DIR = x; then
10  AUTOTOOLS_DIR=$HOME
11fi
12
13grep_version=`echo  $ver_autoconf | sed -e 's/\\./\\\\\\./g'`
14autoconf --version > confauto.out 2>&1
15if $EGREP $grep_version confauto.out >/dev/null 2>&1; then :; else
16  echo You are not using the correct version of autoconf
17  rm -f confauto.out
18  exit
19fi
20rm -f confauto.out
21autoconf_dir=`which autoconf | sed -e 's=/autoconf=='`
22autoconf_dir=`cd $autoconf_dir; pwd`
23if test $autoconf_dir = `cd $AUTOTOOLS_DIR/bin; pwd`; then :; else
24  echo autoconf is not picked up from the correct location
25  exit
26fi
27
28grep_version=`echo  $ver_automake | sed -e 's/\\./\\\\\\./g'`
29automake --version > confauto.out 2>&1
30if $EGREP $grep_version confauto.out >/dev/null 2>&1; then :; else
31  echo You are not using the correct version of automake
32  rm -f confauto.out
33  exit
34fi
35rm -f confauto.out
36autoconf_dir=`which automake | sed -e 's=/automake=='`
37autoconf_dir=`cd $autoconf_dir; pwd`
38if test $autoconf_dir = `cd $AUTOTOOLS_DIR/bin; pwd`; then :; else
39  echo automake is not picked up from the correct location
40  exit
41fi
42
43grep_version=`echo  $ver_libtool | sed -e 's/\\./\\\\\\./g'`
44ltfile=$AUTOTOOLS_DIR/share/libtool/ltmain.sh
45if test -r $ltfile; then :; else
46  echo Cannot file $ltfile
47fi
48if $EGREP $grep_version $ltfile >/dev/null 2>&1; then :; else
49  echo You are not using the correct verion of libtool
50fi
51
52# Find directories which contain a file configure.ac. When all is said and
53# done, each entry in dirs will be of the form `./path/to/directory'
54
55if test $# != 0; then
56  dirs="$*"
57else
58  pos_dirs=`find . -name configure.ac | sed -e s%/configure.ac%%g`
59  dirs=
60  for dir in $pos_dirs; do
61    if test -r $dir/configure.ac; then
62      dirs="$dirs $dir"
63    else
64      echo "$dir/configure.ac doesn't appear to be a regular file; skipping."
65    fi
66  done
67fi
68
69# Now compare against the skip entries in COIN_SKIP_PROJECTS. To match the
70# entries we just collected, add `./' to the front of each skip entry.
71
72pos_dirs=$dirs
73if test x${COIN_SKIP_PROJECTS+set} = xset ; then
74  dirs=
75  for dir in $COIN_SKIP_PROJECTS ; do
76    skip_dirs="$skip_dirs ./$dir"
77  done
78  for dir in $pos_dirs ; do
79    skip=0
80    for skipdir in $skip_dirs ; do
81      if test $dir = $skipdir ; then
82        skip=1
83        break
84      fi
85    done
86    if test $skip = 0 ; then
87      dirs="$dirs $dir"
88    else
89      echo "$dir listed in COIN_SKIP_PROJECTS; skipping."
90    fi
91  done
92fi
93
94echo Running autotools in $dirs
95
96currdir=`pwd`
97if test -r $currdir/BuildTools/coin.m4; then
98  toolsdir=$currdir/BuildTools
99else
100  echo Cannot find BuildTools directory.
101  exit
102fi
103
104echo Copying autotools scripts into this directory
105cp $toolsdir/config.guess $toolsdir/config.sub $toolsdir/depcomp $toolsdir/install-sh $toolsdir/ltmain.sh $toolsdir/missing .
106
107if test x$AUTOTOOLS_DIR = x; then
108  AUTOTOOLS_DIR=$HOME
109fi
110
111for dir in $dirs; do
112  (if test -r $dir/configure.ac; then
113     cd $dir
114     echo creating acinclude.m4 in $dir
115     cat $AUTOTOOLS_DIR/share/aclocal/libtool.m4 $toolsdir/coin.m4> acinclude.m4
116     echo running aclocal in $dir
117     if test -d m4; then
118       aclocal -I m4 || exit -1
119     else
120       aclocal || exit -1
121     fi
122     if grep AC_CONFIG_HEADER configure.ac >/dev/null 2>&1; then
123       echo running autoheader in $dir
124       autoheader || exit -1
125     fi
126     echo running automake in $dir
127     automake || exit -1
128     echo running autoconf in $dir
129     autoconf || exit -1
130   else
131     echo "*** No configure.ac file in $dir - SKIPPING! ***"
132   fi
133   )
134done
Note: See TracBrowser for help on using the repository browser.