source: releases/0.5.9/run_autotools @ 408

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

undid accidential changes in release 0.5.9 (BAD BAD BAD!)

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