Message forwarded from Danalien

Andras Mantia amantia at kde.org
Sun Dec 7 12:11:46 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 06 December 2003 15:16, Dan Jensen wrote:
> On Saturday 06 December 2003 11:58, Andras wrote:
> > I do something like this to detect if KDE is 3.1.9x or older in a
> > configure.in.in:
> >
> > KDE_VERSION=""
> > AC_MSG_CHECKING(for KDE version)
> > KDE_VERSION=`kde-config --version | grep KDE`
> > AC_MSG_RESULT("$KDE_VERSION")
> > if test "x`echo $KDE_VERSION | grep 3.1.9`" = "x"; then
> >     echo "The KDE version is too old, WYSIWYG mode disabled!"
> > fi
>
> dear, andras.
>
> What you are doing there, is an 'explicit version check'. Meaning, that if
> the user got anything else that's higher than the version you are 'greping'
> for, it'll still *bork bork*, (like 3.2.0 , 3.2.1, ... 4.1.0 ;-) ...),
Of course the check must be adapted as soon as KDE 3.2 is labeled as KDE 3.2. 
But it will work for all KDE 3.2.x versions if you grep for "3.2". I don't 
know if it's enough for you, but surely enough for me. It's not usable to 
check for example KDE 3.2.2 or newer. In that case you can write a small test 
programs which returns 1 if KDE version > the requested one or 0 in another 
case. You need in configure.in.in something like this (not tested):
AC_DEFUN(KDE_VERSION_TEST_PROGRAM,
[
#include <kdeversion.h>

int main(int argc,char **argv)
{
#if KDE_IS_VERSION(3, 2, 2)
  return 1;
#else
  return 0;
#endif
])

AC_MSG_CHECKING(for KDE version)
AC_TRY_RUN(KDE_VERSION_TEST_PROGRAM,
        echo " (should be OK)",
        echo " (not so good)"
        AC_MSG_ERROR(" You need KDE 3.2.2 or newer."),
        echo " (not so good)"
        AC_MSG_ERROR(" You need KDE 3.2.2 or newer.")
)

Anyway, I re-read the original mail and I see that you already have a 
solution, the only problem is that it's not in the admin dir. :-)

Andras

> and 
> at the same time give the illusion that it works fine with anyting lower,
> but the matter of the fact is that it's *borking* because it didn't find
> the exact version you are greping for ;-).
>
> And nothing we could use, as we are bound to have people useing not exact
> the same version of kde in the future (some, 3.2.0, other 3.2.1 other
> 3.2.2...4.1.0 :) etc).
>
> Our way, we set a 'barrier' that their kde version has to pass, if it does
> then fine, else, they'll get a message to update to atleast equal or a
> higher version then what is required.
>
>
> //danalien

- -- 
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE/0xkMTQdfac6L/08RAgKMAJwOODfZRhj/Wz966BsWOG4UDbZjbACfdeFz
WqECFgXoFOwA3oxMjCAMndE=
=jM3o
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list