source: branches/pre-1.0/run_autotools @ 748

Last change on this file since 748 was 96, checked in by andreasw, 14 years ago

run_autotools script will now stop on error

  • Property svn:executable set to *
File size: 2.8 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
52if test $# != 0; then
53  dirs="$*"
54else
55  pos_dirs=`find . -name configure.ac | sed -e s%/configure.ac%%g`
56  dirs=
57  for dir in $pos_dirs; do
58    if test -r $dir/configure.ac; then
59      dirs="$dirs $dir"
60    fi
61  done
62fi
63echo Running autotools in $dirs
64
65currdir=`pwd`
66if test -r $currdir/BuildTools/coin.m4; then
67  toolsdir=$currdir/BuildTools
68else
69  echo Cannot find BuildTools directory.
70  exit
71fi
72
73echo Copying autotools scripts into this directory
74cp $toolsdir/config.guess $toolsdir/config.sub $toolsdir/depcomp $toolsdir/install-sh $toolsdir/ltmain.sh $toolsdir/missing .
75
76if test x$AUTOTOOLS_DIR = x; then
77  AUTOTOOLS_DIR=$HOME
78fi
79
80for dir in $dirs; do
81  (if test -r $dir/configure.ac; then
82     cd $dir
83     echo creating acinclude.m4 in $dir
84     cat $AUTOTOOLS_DIR/share/aclocal/libtool.m4 $toolsdir/coin.m4> acinclude.m4
85     echo running aclocal in $dir
86     if test -d m4; then
87       aclocal -I m4 || exit -1
88     else
89       aclocal || exit -1
90     fi
91     if grep AC_CONFIG_HEADER configure.ac >/dev/null 2>&1; then
92       echo running autoheader in $dir
93       autoheader || exit -1
94     fi
95     echo running automake in $dir
96     automake || exit -1
97     echo running autoconf in $dir
98     autoconf || exit -1
99   else
100     echo "*** No configure.ac file in $dir - SKIPPING! ***"
101   fi
102   )
103done
Note: See TracBrowser for help on using the repository browser.