1 | #!/bin/sh |
---|
2 | |
---|
3 | ver_autoconf='2.59' |
---|
4 | ver_automake='1.9.6' |
---|
5 | ver_libtool='1.5.22' |
---|
6 | EGREP='grep -E' |
---|
7 | |
---|
8 | # Check if the correct version of the autotools is used |
---|
9 | if test x$AUTOTOOLS_DIR = x; then |
---|
10 | AUTOTOOLS_DIR=$HOME |
---|
11 | fi |
---|
12 | |
---|
13 | grep_version=`echo $ver_autoconf | sed -e 's/\\./\\\\\\./g'` |
---|
14 | autoconf --version > confauto.out 2>&1 |
---|
15 | if $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 |
---|
19 | fi |
---|
20 | rm -f confauto.out |
---|
21 | autoconf_dir=`which autoconf | sed -e 's=/autoconf=='` |
---|
22 | autoconf_dir=`cd $autoconf_dir; pwd` |
---|
23 | if test $autoconf_dir = `cd $AUTOTOOLS_DIR/bin; pwd`; then :; else |
---|
24 | echo autoconf is not picked up from the correct location |
---|
25 | exit |
---|
26 | fi |
---|
27 | |
---|
28 | grep_version=`echo $ver_automake | sed -e 's/\\./\\\\\\./g'` |
---|
29 | automake --version > confauto.out 2>&1 |
---|
30 | if $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 |
---|
34 | fi |
---|
35 | rm -f confauto.out |
---|
36 | autoconf_dir=`which automake | sed -e 's=/automake=='` |
---|
37 | autoconf_dir=`cd $autoconf_dir; pwd` |
---|
38 | if test $autoconf_dir = `cd $AUTOTOOLS_DIR/bin; pwd`; then :; else |
---|
39 | echo automake is not picked up from the correct location |
---|
40 | exit |
---|
41 | fi |
---|
42 | |
---|
43 | grep_version=`echo $ver_libtool | sed -e 's/\\./\\\\\\./g'` |
---|
44 | ltfile=$AUTOTOOLS_DIR/share/libtool/ltmain.sh |
---|
45 | if test -r $ltfile; then :; else |
---|
46 | echo Cannot file $ltfile |
---|
47 | fi |
---|
48 | if $EGREP $grep_version $ltfile >/dev/null 2>&1; then :; else |
---|
49 | echo You are not using the correct verion of libtool |
---|
50 | fi |
---|
51 | |
---|
52 | if test $# != 0; then |
---|
53 | dirs="$*" |
---|
54 | else |
---|
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 |
---|
62 | fi |
---|
63 | echo Running autotools in $dirs |
---|
64 | |
---|
65 | currdir=`pwd` |
---|
66 | if test -r $currdir/BuildTools/coin.m4; then |
---|
67 | toolsdir=$currdir/BuildTools |
---|
68 | else |
---|
69 | echo Cannot find BuildTools directory. |
---|
70 | exit |
---|
71 | fi |
---|
72 | |
---|
73 | echo Copying autotools scripts into this directory |
---|
74 | cp $toolsdir/config.guess $toolsdir/config.sub $toolsdir/depcomp $toolsdir/install-sh $toolsdir/ltmain.sh $toolsdir/missing . |
---|
75 | |
---|
76 | if test x$AUTOTOOLS_DIR = x; then |
---|
77 | AUTOTOOLS_DIR=$HOME |
---|
78 | fi |
---|
79 | |
---|
80 | for 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 | ) |
---|
103 | done |
---|