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 | # 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 | |
---|
55 | if test $# != 0; then |
---|
56 | dirs="$*" |
---|
57 | else |
---|
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 |
---|
67 | fi |
---|
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 | |
---|
72 | pos_dirs=$dirs |
---|
73 | if 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 |
---|
92 | fi |
---|
93 | |
---|
94 | echo Running autotools in $dirs |
---|
95 | |
---|
96 | currdir=`pwd` |
---|
97 | if test -r $currdir/BuildTools/coin.m4; then |
---|
98 | toolsdir=$currdir/BuildTools |
---|
99 | else |
---|
100 | echo Cannot find BuildTools directory. |
---|
101 | exit |
---|
102 | fi |
---|
103 | |
---|
104 | echo Copying autotools scripts into this directory |
---|
105 | cp $toolsdir/config.guess $toolsdir/config.sub $toolsdir/depcomp $toolsdir/install-sh $toolsdir/ltmain.sh $toolsdir/missing . |
---|
106 | |
---|
107 | if test x$AUTOTOOLS_DIR = x; then |
---|
108 | AUTOTOOLS_DIR=$HOME |
---|
109 | fi |
---|
110 | |
---|
111 | for 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 | ) |
---|
134 | done |
---|