aboutsummaryrefslogtreecommitdiffstats
path: root/macros
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>1998-08-27 04:42:02 +0800
committerMartin Baulig <martin@src.gnome.org>1998-08-27 04:42:02 +0800
commit11500f35b99946b1df9ed2cc0065fc32bb923585 (patch)
treeb9eb37ee09932075114dcba07fa2d762d66e748e /macros
parent00098c1abe26a5006bc6df5ff81973b27c7c650a (diff)
downloadgsoc2013-evolution-11500f35b99946b1df9ed2cc0065fc32bb923585.tar
gsoc2013-evolution-11500f35b99946b1df9ed2cc0065fc32bb923585.tar.gz
gsoc2013-evolution-11500f35b99946b1df9ed2cc0065fc32bb923585.tar.bz2
gsoc2013-evolution-11500f35b99946b1df9ed2cc0065fc32bb923585.tar.lz
gsoc2013-evolution-11500f35b99946b1df9ed2cc0065fc32bb923585.tar.xz
gsoc2013-evolution-11500f35b99946b1df9ed2cc0065fc32bb923585.tar.zst
gsoc2013-evolution-11500f35b99946b1df9ed2cc0065fc32bb923585.zip
Make it work with a brain-dead /bin/sh and a brain-dead /bin/test.
1998-08-26 Martin Baulig <martin@home-of-linux.org> * gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): Make it work with a brain-dead /bin/sh and a brain-dead /bin/test. svn path=/trunk/; revision=342
Diffstat (limited to 'macros')
-rw-r--r--macros/ChangeLog3
-rw-r--r--macros/gnome-libgtop-check.m456
2 files changed, 56 insertions, 3 deletions
diff --git a/macros/ChangeLog b/macros/ChangeLog
index e62301dac7..26c70823e2 100644
--- a/macros/ChangeLog
+++ b/macros/ChangeLog
@@ -1,5 +1,8 @@
1998-08-26 Martin Baulig <martin@home-of-linux.org>
+ * gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): Make it work
+ with a brain-dead /bin/sh and a brain-dead /bin/test.
+
* gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): Use `AC_MSG_WARN'
if LibGTop cannot be found and the `fail' argument is not given.
diff --git a/macros/gnome-libgtop-check.m4 b/macros/gnome-libgtop-check.m4
index a8fbfb6d74..6510f0f3f9 100644
--- a/macros/gnome-libgtop-check.m4
+++ b/macros/gnome-libgtop-check.m4
@@ -61,15 +61,65 @@ AC_DEFUN([GNOME_LIBGTOP_HOOK],
fi
AC_PATH_PROG(LIBGTOP_CONFIG, libgtop-config, no)
- min_libgtop_version=ifelse([$1], ,0.25.0,$1)
+ dnl IMPORTANT NOTICE:
+ dnl If you increase this number here, this means that *ALL*
+ dnl modules will require the new version, even if they explicitly
+ dnl give a lower number in their `configure.in' !!!
+ real_min_libgtop_version=0.25.0
+ min_libgtop_version=ifelse([$1], ,$real_min_libgtop_version,$1)
+ dnl I know, the following code looks really ugly, but if you want
+ dnl to make changes, please test it with a brain-dead /bin/sh and
+ dnl with a brain-dead /bin/test (not all shells/tests support the
+ dnl `<' operator to compare strings, that's why I convert everything
+ dnl into numbers and test them).
+ min_libgtop_major=`echo $min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ min_libgtop_minor=`echo $min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ min_libgtop_micro=`echo $min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ test x$min_libgtop_micro = x && min_libgtop_micro=0
+ real_min_libgtop_major=`echo $real_min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ real_min_libgtop_minor=`echo $real_min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ real_min_libgtop_micro=`echo $real_min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ test x$real_min_libgtop_micro = x && real_min_libgtop_micro=0
+ dnl You cannot require a version less then $real_min_libgtop_version,
+ dnl so you don't need to update each `configure.in' when it's increased.
+ if test $real_min_libgtop_major -gt $min_libgtop_major ; then
+ min_libgtop_major=$real_min_libgtop_major
+ min_libgtop_minor=$real_min_libgtop_minor
+ min_libgtop_micro=$real_min_libgtop_micro
+ elif test $real_min_libgtop_major = $min_libgtop_major ; then
+ if test $real_min_libgtop_minor -gt $min_libgtop_minor ; then
+ min_libgtop_minor=$real_min_libgtop_minor
+ min_libgtop_micro=$real_min_libgtop_micro
+ elif test $real_min_libgtop_minor = $min_libgtop_minor ; then
+ if test $real_min_libgtop_micro -gt $min_libgtop_micro ; then
+ min_libgtop_micro=$real_min_libgtop_micro
+ fi
+ fi
+ fi
+ min_libgtop_version="$min_libgtop_major.$min_libgtop_minor.$min_libgtop_micro"
AC_MSG_CHECKING(for libgtop - version >= $min_libgtop_version)
no_libgtop=""
if test "$LIBGTOP_CONFIG" = "no" ; then
no_libgtop=yes
else
configfile=`$LIBGTOP_CONFIG --config`
- libgtop_version=`$LIBGTOP_CONFIG --version | sed -e 's,pre.*,,'`
- test $libgtop_version \< $min_libgtop_version && no_libgtop=yes
+ libgtop_major_version=`$LIBGTOP_CONFIG --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ libgtop_minor_version=`$LIBGTOP_CONFIG --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ libgtop_micro_version=`$LIBGTOP_CONFIG --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ test $libgtop_major_version != $min_libgtop_major && no_libgtop=yes
+ test $libgtop_minor_version -lt $min_libgtop_minor && no_libgtop=yes
+ if test $libgtop_minor_version = $min_libgtop_minor ; then
+ test $libgtop_micro_version -lt $min_libgtop_micro && no_libgtop=yes
+ fi
. $configfile
fi
if test x$no_libgtop = x ; then