2016-02-29 00:28:37 +00:00
|
|
|
#!/bin/sh
|
2003-06-06 19:00:42 +00:00
|
|
|
## $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='
|
2016-02-29 00:28:37 +00:00
|
|
|
' ECHO_T=' ' ;;
|
2005-10-19 14:46:26 +00:00
|
|
|
*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
|
|
|
## ----------------------------------------------------------------------
|
2016-02-29 00:28:37 +00:00
|
|
|
## Check that given command $1 has version >= $2
|
|
|
|
## Full path $3 may be specified in order to skip command search.
|
2005-10-19 14:46:26 +00:00
|
|
|
## 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
|
2016-02-29 00:28:37 +00:00
|
|
|
fullpath=${3:-`command -v "$name"`};
|
2005-10-19 14:46:26 +00:00
|
|
|
if [ -x "$fullpath" ]; then
|
2016-02-27 08:16:06 +00:00
|
|
|
foundit=yes;
|
2005-10-19 14:46:26 +00:00
|
|
|
fi
|
|
|
|
|
2014-08-14 20:52:32 +00:00
|
|
|
if [ "$foundit" != yes ]; then
|
2016-02-27 08:16:06 +00:00
|
|
|
echo "Didn't find application";
|
|
|
|
version=0
|
|
|
|
success=no
|
2005-10-19 14:46:26 +00:00
|
|
|
else
|
2016-02-27 08:16:06 +00:00
|
|
|
cmdline="$fullpath --version";
|
|
|
|
if version=`($cmdline 2>/dev/null)` 2>/dev/null; then
|
|
|
|
echo >/dev/null
|
|
|
|
else
|
|
|
|
version="0";
|
|
|
|
fi
|
|
|
|
if [ -n "${version}" ]; then
|
|
|
|
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; } } }'`
|
|
|
|
if [ -z "$version" ]; then version=0; fi
|
|
|
|
success=`echo "$version" "$desired" | awk '{ if ($1 >= $2) { print "yes";} else {print "no";}} '`
|
|
|
|
else
|
|
|
|
version=0
|
|
|
|
success=no
|
|
|
|
fi
|
2005-10-19 14:46:26 +00:00
|
|
|
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...
|
2016-02-29 00:28:37 +00:00
|
|
|
if ! check_version make 3.79 "$MAKE"; then
|
|
|
|
echo "Couldn't find a new-enough version of GNU 'make', please install one!";
|
|
|
|
echo "If you have a newer version, set the environment variable 'MAKE' to its path";
|
|
|
|
exit 1;
|
2005-11-16 22:17:01 +00:00
|
|
|
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
|
2016-02-29 00:28:37 +00:00
|
|
|
if ! check_version m4 1.4 "$M4" && [ ! -f /usr/ccs/bin/m4 ] && ! check_version gm4 1.4; then
|
|
|
|
echo "Couldn't find a new-enough version of 'm4', please install one!";
|
|
|
|
echo "If you have a newer version, set the environment variable 'M4' to its path";
|
|
|
|
exit 1;
|
2005-11-16 22:17:01 +00:00
|
|
|
fi
|
2005-01-17 15:25:27 +00:00
|
|
|
|
2016-02-29 00:28:37 +00:00
|
|
|
if ! check_version pkg-config 0.15; then
|
2005-11-16 22:17:01 +00:00
|
|
|
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
|
|
|
|
2016-02-29 00:28:37 +00:00
|
|
|
if ! check_version autoreconf 2.58; then
|
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
|
2016-02-29 00:28:37 +00:00
|
|
|
if ! check_version automake 1.8 "$AUTOMAKE"; then
|
2005-11-16 22:17:01 +00:00
|
|
|
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
|
2016-02-29 00:28:37 +00:00
|
|
|
if ! check_version libtoolize 1.5 "$LIBTOOLIZE"; then
|
2009-09-23 17:16:24 +00:00
|
|
|
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:25:53 +00:00
|
|
|
if [ "$1" = "-f" ]; then
|
2014-08-14 20:52:32 +00:00
|
|
|
cmdline="autoreconf -i -f";
|
|
|
|
fi
|
2016-02-29 00:28:37 +00:00
|
|
|
|
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
|