| 1 |
#!/bin/sh |
|---|
| 2 |
# Run this to set up the build system: configure, makefiles, etc. |
|---|
| 3 |
# (based on the version in enlightenment's cvs) |
|---|
| 4 |
|
|---|
| 5 |
package="sweep" |
|---|
| 6 |
|
|---|
| 7 |
olddir=`pwd` |
|---|
| 8 |
srcdir=`dirname $0` |
|---|
| 9 |
test -z "$srcdir" && srcdir=. |
|---|
| 10 |
|
|---|
| 11 |
cd "$srcdir" |
|---|
| 12 |
DIE=0 |
|---|
| 13 |
|
|---|
| 14 |
ACLOCAL_FLAGS="-I $srcdir/m4" |
|---|
| 15 |
|
|---|
| 16 |
echo -n "checking for autoconf ... " |
|---|
| 17 |
result="yes" |
|---|
| 18 |
(autoconf --version) < /dev/null > /dev/null 2>&1 || { |
|---|
| 19 |
echo |
|---|
| 20 |
echo "You must have autoconf installed to compile $package." |
|---|
| 21 |
echo "Download the appropriate package for your distribution," |
|---|
| 22 |
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" |
|---|
| 23 |
result="no" |
|---|
| 24 |
DIE=1 |
|---|
| 25 |
} |
|---|
| 26 |
echo $result |
|---|
| 27 |
|
|---|
| 28 |
VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/" |
|---|
| 29 |
VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/" |
|---|
| 30 |
VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//" |
|---|
| 31 |
|
|---|
| 32 |
# do we need automake? |
|---|
| 33 |
if test -r Makefile.am; then |
|---|
| 34 |
AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am` |
|---|
| 35 |
AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP` |
|---|
| 36 |
if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then |
|---|
| 37 |
AM_NEEDED="" |
|---|
| 38 |
fi |
|---|
| 39 |
if test -z $AM_NEEDED; then |
|---|
| 40 |
echo -n "checking for automake ... " |
|---|
| 41 |
AUTOMAKE=automake |
|---|
| 42 |
ACLOCAL=aclocal |
|---|
| 43 |
if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then |
|---|
| 44 |
echo "yes" |
|---|
| 45 |
else |
|---|
| 46 |
echo "no" |
|---|
| 47 |
AUTOMAKE= |
|---|
| 48 |
fi |
|---|
| 49 |
else |
|---|
| 50 |
echo -n "checking for automake $AM_NEEDED or later ... " |
|---|
| 51 |
majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ` |
|---|
| 52 |
minneeded=`echo $AM_NEEDED | $VERSIONMKMIN` |
|---|
| 53 |
for am in automake-$AM_NEEDED automake$AM_NEEDED \ |
|---|
| 54 |
automake automake-1.7 automake-1.8 automake-1.9 automake-1.10; do |
|---|
| 55 |
($am --version < /dev/null > /dev/null 2>&1) || continue |
|---|
| 56 |
ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP` |
|---|
| 57 |
maj=`echo $ver | $VERSIONMKMAJ` |
|---|
| 58 |
min=`echo $ver | $VERSIONMKMIN` |
|---|
| 59 |
if test $maj -eq $majneeded -a $min -ge $minneeded; then |
|---|
| 60 |
AUTOMAKE=$am |
|---|
| 61 |
echo $AUTOMAKE |
|---|
| 62 |
break |
|---|
| 63 |
fi |
|---|
| 64 |
done |
|---|
| 65 |
test -z $AUTOMAKE && echo "no" |
|---|
| 66 |
echo -n "checking for aclocal $AM_NEEDED or later ... " |
|---|
| 67 |
for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \ |
|---|
| 68 |
aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do |
|---|
| 69 |
($ac --version < /dev/null > /dev/null 2>&1) || continue |
|---|
| 70 |
ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP` |
|---|
| 71 |
maj=`echo $ver | $VERSIONMKMAJ` |
|---|
| 72 |
min=`echo $ver | $VERSIONMKMIN` |
|---|
| 73 |
if test $maj -eq $majneeded -a $min -ge $minneeded; then |
|---|
| 74 |
ACLOCAL=$ac |
|---|
| 75 |
echo $ACLOCAL |
|---|
| 76 |
break |
|---|
| 77 |
fi |
|---|
| 78 |
done |
|---|
| 79 |
test -z $ACLOCAL && echo "no" |
|---|
| 80 |
fi |
|---|
| 81 |
test -z $AUTOMAKE || test -z $ACLOCAL && { |
|---|
| 82 |
echo |
|---|
| 83 |
echo "You must have automake installed to compile $package." |
|---|
| 84 |
echo "Download the appropriate package for your distribution," |
|---|
| 85 |
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" |
|---|
| 86 |
exit 1 |
|---|
| 87 |
} |
|---|
| 88 |
fi |
|---|
| 89 |
|
|---|
| 90 |
echo -n "checking for libtool ... " |
|---|
| 91 |
for LIBTOOLIZE in libtoolize glibtoolize nope; do |
|---|
| 92 |
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break |
|---|
| 93 |
done |
|---|
| 94 |
if test x$LIBTOOLIZE = xnope; then |
|---|
| 95 |
echo "nope." |
|---|
| 96 |
LIBTOOLIZE=libtoolize |
|---|
| 97 |
else |
|---|
| 98 |
echo $LIBTOOLIZE |
|---|
| 99 |
fi |
|---|
| 100 |
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { |
|---|
| 101 |
echo |
|---|
| 102 |
echo "You must have libtool installed to compile $package." |
|---|
| 103 |
echo "Download the appropriate package for your system," |
|---|
| 104 |
echo "or get the source from one of the GNU ftp sites" |
|---|
| 105 |
echo "listed in http://www.gnu.org/order/ftp.html" |
|---|
| 106 |
DIE=1 |
|---|
| 107 |
} |
|---|
| 108 |
|
|---|
| 109 |
echo -n "checking for pkg-config ... " |
|---|
| 110 |
result="yes" |
|---|
| 111 |
(pkg-config --version) < /dev/null > /dev/null 2>&1 || { |
|---|
| 112 |
echo |
|---|
| 113 |
echo "You must have pkg-config installed to compile $package." |
|---|
| 114 |
echo "Download the appropriate package for your distribution." |
|---|
| 115 |
result="no" |
|---|
| 116 |
DIE=1 |
|---|
| 117 |
} |
|---|
| 118 |
echo $result |
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
if test "$DIE" -eq 1; then |
|---|
| 122 |
exit 1 |
|---|
| 123 |
fi |
|---|
| 124 |
|
|---|
| 125 |
if test -z "$*"; then |
|---|
| 126 |
echo "I am going to run ./configure with no arguments - if you wish " |
|---|
| 127 |
echo "to pass any to it, please specify them on the $0 command line." |
|---|
| 128 |
fi |
|---|
| 129 |
|
|---|
| 130 |
echo "Generating configuration files for $package, please wait...." |
|---|
| 131 |
|
|---|
| 132 |
echo " $ACLOCAL $ACLOCAL_FLAGS" |
|---|
| 133 |
$ACLOCAL $ACLOCAL_FLAGS || exit 1 |
|---|
| 134 |
echo " $LIBTOOLIZE --automake" |
|---|
| 135 |
$LIBTOOLIZE --automake || exit 1 |
|---|
| 136 |
echo " autoheader" |
|---|
| 137 |
autoheader || exit 1 |
|---|
| 138 |
echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS" |
|---|
| 139 |
$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1 |
|---|
| 140 |
echo " autoconf" |
|---|
| 141 |
autoconf || exit 1 |
|---|
| 142 |
|
|---|
| 143 |
cd $olddir |
|---|
| 144 |
#$srcdir/configure --enable-maintainer-mode "$@" && echo |
|---|