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()
|
2014-08-14 20:52:32 +00:00
|
|
|
{
|
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
|
2006-08-21 01:44:03 +00:00
|
|
|
desired=`echo $2 | awk -F. '{print $1*100+$2}'`
|
2005-11-16 22:17:01 +00:00
|
|
|
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
|
|
|
|
|
2014-08-14 20:52:32 +00:00
|
|
|
if [ "$foundit" != yes ]; then
|
2005-10-19 14:46:26 +00:00
|
|
|
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";
|
2006-02-16 01:59:45 +00:00
|
|
|
if version=`($cmdline 2>/dev/null)` 2>/dev/null; then
|
|
|
|
echo >/dev/null
|
|
|
|
else
|
2006-01-30 11:23:27 +00:00
|
|
|
version="0";
|
|
|
|
fi
|
2005-10-19 14:46:26 +00:00
|
|
|
if [ -n "${version}" ]; then
|
2006-08-21 01:44:03 +00:00
|
|
|
version=`echo $version | awk '{ for (i=1;i<=NF;i++) { split($i,j,"."); m=j[1]*100+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
|
|
|
## --------------------------------------------------------------------------------
|
2014-08-14 20:52:32 +00:00
|
|
|
## 'MAIN' starts here
|
2005-11-16 22:17:01 +00:00
|
|
|
## --------------------------------------------------------------------------------
|
|
|
|
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!";
|
2009-09-23 17:16:24 +00:00
|
|
|
echo "If you have a newer version, set the environment variable 'MAKE' to its path";
|
2005-11-16 22:17:01 +00:00
|
|
|
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
|
2006-10-17 21:51:17 +00:00
|
|
|
## solaris m4 works fine
|
|
|
|
if test -f /usr/ccs/bin/m4
|
|
|
|
then
|
|
|
|
echo >/dev/null
|
2008-05-23 19:24:20 +00:00
|
|
|
elif check_version gm4 1.4; then
|
|
|
|
have_gm4=yes;
|
2014-08-14 20:52:32 +00:00
|
|
|
else
|
2006-10-17 21:51:17 +00:00
|
|
|
echo "Couldn't find a new-enough version of 'm4', please install one!";
|
2009-09-23 17:16:24 +00:00
|
|
|
echo "If you have a newer version, set the environment variable 'M4' to its path";
|
2006-10-17 21:51:17 +00:00
|
|
|
exit 1;
|
|
|
|
fi
|
2005-11-16 22:17:01 +00:00
|
|
|
# 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
|
|
|
|
2009-09-23 17:16:24 +00:00
|
|
|
if check_version autoreconf 2.58; then
|
2005-11-16 22:17:01 +00:00
|
|
|
echo >/dev/null
|
|
|
|
else
|
2009-09-23 17:16:24 +00:00
|
|
|
echo "Couldn't find a new-enough version of 'autoreconf', please install one!";
|
2005-11-16 22:17:01 +00:00
|
|
|
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!";
|
2009-09-23 17:16:24 +00:00
|
|
|
echo "If you have a newer version, set the environment variable 'AUTOMAKE' and 'ACLOCAL' to its path";
|
2005-11-16 22:17:01 +00:00
|
|
|
exit 1;
|
|
|
|
# build_lsc_aux "automake-1.8.5"
|
|
|
|
fi
|
2009-09-23 17:16:24 +00:00
|
|
|
if check_version libtoolize 1.5; then
|
|
|
|
echo >/dev/null
|
|
|
|
else
|
|
|
|
echo "Couldn't find a new-enough version of 'libtoolize', please install one!";
|
|
|
|
echo "If you have a newer version, set the environment variable 'LIBTOOLIZE' to its path";
|
|
|
|
exit 1;
|
|
|
|
fi
|
2005-10-19 14:46:26 +00:00
|
|
|
|
2009-09-23 17:16:24 +00:00
|
|
|
## ---------- now run autoreconf
|
2009-09-18 18:22:25 +00:00
|
|
|
cmdline="autoreconf -i";
|
2014-08-14 20:52:32 +00:00
|
|
|
## -- if _autosetup was invoked with -f run autoreconf with -f to force a recreation of all files
|
2014-08-18 07:08:59 +00:00
|
|
|
if [ "$1" == "-f" ]; then
|
2014-08-14 20:52:32 +00:00
|
|
|
cmdline="autoreconf -i -f";
|
|
|
|
fi
|
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"
|
|
|
|
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
|