|
| 1 | +#!/bin/sh |
| 2 | +# |
| 3 | +# License: GNU General Public License (GPL) |
| 4 | +# Copyright 2001 horms <[email protected]> |
| 5 | +# (heavily mangled by alanr) |
| 6 | +# |
| 7 | +# bootstrap: set up the project and get it ready to make |
| 8 | +# |
| 9 | +# Basically, we run autoconf, automake and libtool in the |
| 10 | +# right way to get things set up for this environment. |
| 11 | +# |
| 12 | +# We also look and see if those tools are installed, and |
| 13 | +# tell you where to get them if they're not. |
| 14 | +# |
| 15 | +# Our goal is to not require dragging along anything |
| 16 | +# more than we need. If this doesn't work on your system, |
| 17 | +# (i.e., your /bin/sh is broken) send us a patch. |
| 18 | +# |
| 19 | +# This code loosely based on the corresponding named script in |
| 20 | +# enlightenment, and also on the sort-of-standard autoconf |
| 21 | +# bootstrap script. |
| 22 | + |
| 23 | +# Run this to generate all the initial makefiles, etc. |
| 24 | + |
| 25 | +testProgram() |
| 26 | +{ |
| 27 | + cmd=$1 |
| 28 | + |
| 29 | + if [ -z "$cmd" ]; then |
| 30 | + return 1; |
| 31 | + fi |
| 32 | + |
| 33 | + arch=`uname -s` |
| 34 | + |
| 35 | + # Make sure the which is in an if-block... on some platforms it throws exceptions |
| 36 | + # |
| 37 | + # The ERR trap is not executed if the failed command is part |
| 38 | + # of an until or while loop, part of an if statement, part of a && |
| 39 | + # or || list. |
| 40 | + if |
| 41 | + which $cmd </dev/null >/dev/null 2>&1 |
| 42 | + then |
| 43 | + : |
| 44 | + else |
| 45 | + return 1 |
| 46 | + fi |
| 47 | + |
| 48 | + # The GNU standard is --version |
| 49 | + if |
| 50 | + $cmd --version </dev/null >/dev/null 2>&1 |
| 51 | + then |
| 52 | + return 0 |
| 53 | + fi |
| 54 | + |
| 55 | + # Maybe it suppports -V instead |
| 56 | + if |
| 57 | + $cmd -V </dev/null >/dev/null 2>&1 |
| 58 | + then |
| 59 | + return 0 |
| 60 | + fi |
| 61 | + |
| 62 | + # Nope, the program seems broken |
| 63 | + return 1 |
| 64 | +} |
| 65 | + |
| 66 | +gnu="ftp://ftp.gnu.org/pub/gnu" |
| 67 | + |
| 68 | +for command in autoconf213 autoconf253 autoconf259 autoconf |
| 69 | +do |
| 70 | + if |
| 71 | + testProgram $command == 1 |
| 72 | + then |
| 73 | + autoconf=$command |
| 74 | + autoheader=`echo "$autoconf" | sed -e 's/autoconf/autoheader/'` |
| 75 | + autom4te=`echo "$autoconf" | sed -e 's/autoconf/autmo4te/'` |
| 76 | + autoreconf=`echo "$autoconf" | sed -e 's/autoconf/autoreconf/'` |
| 77 | + autoscan=`echo "$autoconf" | sed -e 's/autoconf/autoscan/'` |
| 78 | + autoupdate=`echo "$autoconf" | sed -e 's/autoconf/autoupdate/'` |
| 79 | + ifnames=`echo "$autoconf" | sed -e 's/autoconf/ifnames/'` |
| 80 | + fi |
| 81 | +done |
| 82 | + |
| 83 | +for command in automake14 automake-1.4 automake15 automake-1.5 automake17 automake-1.7 automake19 automake-1.9 automake-1.11 automake |
| 84 | +do |
| 85 | + if |
| 86 | + testProgram $command |
| 87 | + then |
| 88 | + : OK $pkg is installed |
| 89 | + automake=$command |
| 90 | + aclocal=`echo "$automake" | sed -e 's/automake/aclocal/'` |
| 91 | + fi |
| 92 | +done |
| 93 | + |
| 94 | +for command in libtool14 libtool15 libtool glibtool |
| 95 | +do |
| 96 | + URL=$gnu/$pkg/ |
| 97 | + if |
| 98 | + testProgram $command |
| 99 | + then |
| 100 | + libtool=$command |
| 101 | + libtoolize=`echo "$libtool" | sed -e 's/libtool/libtoolize/'` |
| 102 | + fi |
| 103 | +done |
| 104 | + |
| 105 | +if [ -z $autoconf ]; then |
| 106 | + echo You must have autoconf installed to compile the cluster-glue package. |
| 107 | + echo Download the appropriate package for your system, |
| 108 | + echo or get the source tarball at: $gnu/autoconf/ |
| 109 | + exit 1 |
| 110 | + |
| 111 | +elif [ -z $automake ]; then |
| 112 | + echo You must have automake installed to compile the cluster-glue package. |
| 113 | + echo Download the appropriate package for your system, |
| 114 | + echo or get the source tarball at: $gnu/automake/ |
| 115 | + exit 1 |
| 116 | + |
| 117 | +elif [ -z $libtool ]; then |
| 118 | + echo You must have libtool installed to compile the cluster-glue package. |
| 119 | + echo Download the appropriate package for your system, |
| 120 | + echo or get the source tarball at: $gnu/libtool/ |
| 121 | + exit 1 |
| 122 | +fi |
| 123 | + |
| 124 | +oneline() { |
| 125 | + read x; echo "$x" |
| 126 | +} |
| 127 | + |
| 128 | +LT_version=`$libtool --version | oneline | sed -e 's%^[^0-9]*%%' -e s'% .*%%'` |
| 129 | +LT_majvers=`echo "$LT_version" | sed -e 's%\..*%%'` |
| 130 | +LT_minvers=`echo "$LT_version" | sed -e 's%^[^.]*\.%%' ` |
| 131 | +LT_minnum=`echo "$LT_minvers" | sed -e 's%[^0-9].*%%'` |
| 132 | + |
| 133 | +if |
| 134 | + [ $LT_majvers -lt 1 ] || [ $LT_majvers = 1 -a $LT_minnum -lt 4 ] |
| 135 | +then |
| 136 | + echo "Minimum version of libtool is 1.4. You have $LT_version installed." |
| 137 | + exit 1 |
| 138 | +fi |
| 139 | + |
| 140 | +# Create local copies so that the incremental updates will work. |
| 141 | +rm -f ./autoconf ./automake ./autoheader ./libtool |
| 142 | +ln -s `which $libtool` ./libtool |
| 143 | +ln -s `which $autoconf` ./autoconf |
| 144 | +ln -s `which $automake` ./automake |
| 145 | +ln -s `which $autoheader` ./autoheader |
| 146 | + |
| 147 | +printf "$autoconf:\t" |
| 148 | +$autoconf --version | head -n 1 |
| 149 | + |
| 150 | +printf "$automake:\t" |
| 151 | +$automake --version | head -n 1 |
| 152 | + |
| 153 | +#rm -rf libltdl libltdl.tar |
| 154 | +#echo $libtoolize --ltdl --force --copy |
| 155 | +# Unset GREP_OPTIONS as any coloring can mess up the AC_CONFIG_AUX_DIR matching patterns |
| 156 | +#GREP_OPTIONS= $libtoolize --ltdl --force --copy |
| 157 | + |
| 158 | +arch=`uname -s` |
| 159 | +# Disable the errors on FreeBSD until a fix can be found. |
| 160 | +if [ ! "$arch" = "FreeBSD" ]; then |
| 161 | +set -e |
| 162 | +# |
| 163 | +# All errors are fatal from here on out... |
| 164 | +# The shell will complain and exit on any "uncaught" error code. |
| 165 | +# |
| 166 | +# |
| 167 | +# And the trap will ensure sure some kind of error message comes out. |
| 168 | +# |
| 169 | +trap 'echo ""; echo "$0 exiting due to error (sorry!)." >&2' 0 |
| 170 | +fi |
| 171 | + |
| 172 | +# Emulate the old --ltdl-tar option... |
| 173 | +# If the libltdl directory is required we will unpack it later |
| 174 | +#tar -cf libltdl.tar libltdl |
| 175 | +#rm -rf libltdl |
| 176 | + |
| 177 | +echo $aclocal $ACLOCAL_FLAGS |
| 178 | +$aclocal $ACLOCAL_FLAGS |
| 179 | + |
| 180 | +echo $automake --add-missing --include-deps --copy |
| 181 | +$automake --add-missing --include-deps --copy |
| 182 | + |
| 183 | +echo $autoconf |
| 184 | +$autoconf |
| 185 | + |
| 186 | +#test -f libtool.m4 || touch libtool.m4 |
| 187 | +#test -f ltdl.m4 || touch ltdl.m4 |
| 188 | + |
| 189 | +echo Now run ./configure |
| 190 | +trap '' 0 |
0 commit comments