2003-06-06 19:00:42 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## $Id$
|
|
|
|
|
2005-10-19 14:46:26 +00:00
|
|
|
## ---------- some portability checks/adjustments [stolen from configure] ----------
|
|
|
|
## 'echo -n' is not portable..
|
|
|
|
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
|
|
|
|
*c*,-n*) ECHO_N= ECHO_C='
|
|
|
|
' ECHO_T=' ' ;;
|
|
|
|
*c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
|
|
|
|
*) ECHO_N= ECHO_C='\c' ECHO_T= ;;
|
|
|
|
esac
|
|
|
|
##----------
|
2003-06-06 19:00:42 +00:00
|
|
|
|
2005-10-19 14:46:26 +00:00
|
|
|
## ----------------------------------------------------------------------
|
|
|
|
## Check that given command $1 has version >= $2.$3
|
|
|
|
## return 0 if ok, 1 too old or not found (-> shell conventions).
|
|
|
|
## ----------------------------------------------------------------------
|
|
|
|
check_version()
|
2005-11-16 22:17:01 +00:00
|
|
|
{
|
|
|
|
dir=`pwd`
|
|
|
|
cd /tmp
|
|
|
|
foundit=
|
2005-10-19 14:46:26 +00:00
|
|
|
## get current version of $1
|
2005-11-16 22:17:01 +00:00
|
|
|
desired=$2
|
|
|
|
echo $ECHO_N "Checking version of '$1' >= $desired... $ECHO_C"
|
|
|
|
name=$1
|
|
|
|
fullpath=`type $name | awk '{ print $(NF) }'`;
|
2005-10-19 14:46:26 +00:00
|
|
|
if [ -x "$fullpath" ]; then
|
|
|
|
foundit=yes;
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$foundit" != yes ]; then
|
|
|
|
echo "Didn't find application";
|
2005-11-16 22:17:01 +00:00
|
|
|
version=0
|
|
|
|
success=no
|
2005-10-19 14:46:26 +00:00
|
|
|
else
|
2006-01-30 11:23:27 +00:00
|
|
|
cmdline="$fullpath --version";
|
|
|
|
if ! version=`($cmdline 2>/dev/null)` 2>/dev/null; then
|
|
|
|
version="0";
|
|
|
|
fi
|
2005-10-19 14:46:26 +00:00
|
|
|
if [ -n "${version}" ]; then
|
2005-11-16 22:17:01 +00:00
|
|
|
version=`echo $version | awk '{ for (i=1;i<=NF;i++) { split($i,j,"."); m=j[1]"."j[2] ; if ((m*1)>0) { print m ; break; } } }'`
|
2006-01-30 11:23:27 +00:00
|
|
|
if [ -z "$version" ]; then version=0; fi
|
|
|
|
success=`echo "$version" "$desired" | awk '{ if ($1 >= $2) { print "yes";} else {print "no";}} '`
|
2005-10-19 14:46:26 +00:00
|
|
|
else
|
|
|
|
version=0
|
2005-11-16 22:17:01 +00:00
|
|
|
success=no
|
2005-10-19 14:46:26 +00:00
|
|
|
fi
|
|
|
|
fi
|
2005-11-16 22:17:01 +00:00
|
|
|
cd $dir
|
2005-04-28 22:04:32 +00:00
|
|
|
|
2005-11-16 22:17:01 +00:00
|
|
|
if [ $success = "yes" ] ; then
|
|
|
|
echo "succeeded. ($version)"
|
|
|
|
return 0;
|
2005-10-19 14:46:26 +00:00
|
|
|
else
|
2005-11-16 22:17:01 +00:00
|
|
|
echo "failed. ($version)"
|
|
|
|
return 1;
|
2005-10-19 14:46:26 +00:00
|
|
|
fi
|
|
|
|
} ## check_version()
|
|
|
|
|
|
|
|
|
2005-11-16 22:17:01 +00:00
|
|
|
## --------------------------------------------------------------------------------
|
|
|
|
## 'MAIN' starts here
|
|
|
|
## --------------------------------------------------------------------------------
|
|
|
|
echo "Bootstrapping configure script and makefiles:"
|
2003-06-06 19:00:42 +00:00
|
|
|
|
2005-11-16 22:17:01 +00:00
|
|
|
## ---------- first check santity of the installed versions of the build-system
|
2006-01-30 11:23:27 +00:00
|
|
|
## in case there's GNU drop-in tools available, set these
|
2005-10-19 14:46:26 +00:00
|
|
|
|
2006-01-30 11:23:27 +00:00
|
|
|
## some sorry systems don't have proper GNU-make...
|
2005-11-16 22:17:01 +00:00
|
|
|
if check_version make 3.79; then
|
|
|
|
echo >/dev/null
|
|
|
|
else
|
|
|
|
if check_version gmake 3.79; then
|
2006-01-30 11:23:27 +00:00
|
|
|
have_gmake=yes;
|
2005-11-16 22:17:01 +00:00
|
|
|
else
|
|
|
|
echo "Couldn't find a new-enough version of GNU 'make', please install one!";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
fi
|
2005-04-28 22:04:32 +00:00
|
|
|
|
2005-11-16 22:17:01 +00:00
|
|
|
## FreeBSD's m4 seems to be broken? Download a fresh one
|
|
|
|
if check_version m4 1.4; then
|
|
|
|
echo >/dev/null
|
|
|
|
else
|
|
|
|
echo "Couldn't find a new-enough version of 'm4', please install one!";
|
|
|
|
exit 1;
|
|
|
|
# build_lsc_aux "m4-1.4.1"
|
|
|
|
fi
|
2005-01-17 15:25:27 +00:00
|
|
|
|
2005-11-16 22:17:01 +00:00
|
|
|
if check_version pkg-config 0.15; then
|
|
|
|
echo >/dev/null
|
|
|
|
else
|
|
|
|
echo "Couldn't find a new-enough version of 'pkg-config', please install one!";
|
|
|
|
exit 1;
|
|
|
|
# build_lsc_aux "pkgconfig-0.15.0"
|
|
|
|
fi
|
2005-10-19 14:46:26 +00:00
|
|
|
|
2005-11-16 22:17:01 +00:00
|
|
|
if check_version autoconf 2.58; then
|
|
|
|
echo >/dev/null
|
|
|
|
else
|
|
|
|
echo "Couldn't find a new-enough version of 'autoconf', please install one!";
|
|
|
|
echo "If you have a newer version, set the environment-variable 'AUTOCONF' to its path";
|
|
|
|
exit 1;
|
|
|
|
# build_lsc_aux "autoconf-2.59"
|
|
|
|
fi
|
|
|
|
if check_version automake 1.8; then
|
|
|
|
echo >/dev/null
|
|
|
|
else
|
|
|
|
echo "Couldn't find a new-enough version of 'automake', please install one!";
|
|
|
|
echo "If you have a newer version, set the environment-variable 'AUTOMAKE' to its path";
|
|
|
|
exit 1;
|
|
|
|
# build_lsc_aux "automake-1.8.5"
|
|
|
|
fi
|
2005-10-19 14:46:26 +00:00
|
|
|
|
2005-11-16 22:17:01 +00:00
|
|
|
## ---------- ok, now run aclocal, automake, autohead and autoconf
|
|
|
|
cmdline="aclocal -I m4 && autoheader && automake && autoconf";
|
2005-10-19 14:46:26 +00:00
|
|
|
echo "$cmdline"
|
|
|
|
if eval $cmdline; then
|
|
|
|
echo "Done, now run ./configure"
|
|
|
|
echo " ./configure -C to enable caching"
|
|
|
|
echo " ./configure --enable-maintainer-mode to enable maintainer depedencies"
|
|
|
|
exit 0
|
2003-07-11 22:10:05 +00:00
|
|
|
else
|
2005-01-17 15:25:27 +00:00
|
|
|
echo "Something failed .... please check error-message and re-run when fixed."
|
|
|
|
echo "exiting..."
|
|
|
|
exit 1
|
2003-07-11 22:10:05 +00:00
|
|
|
fi
|