[Kde-games-devel] Re: Check for libkdegames in configure

Andreas Beckermann b_mann at gmx.de
Fri Aug 8 16:53:20 CEST 2003


On Friday 08 August 2003 17:27, Andrea Bergia wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi everyone. I'm developing a small game, and I use libkdegames (for
> KStdGameActions). How can I check if it's installed in the ./configure
> script?

Hi
Add something like this to your configure.in.in:

AC_DEFUN(AC_CHECK_LIBKDEGAMES,
[
AC_MSG_CHECKING([for kstdgameaction.h])
AC_FIND_FILE(kstdgameaction.h, $kde_includes, kstdgameaction)
if test "$kstdgameaction" = NO ; then
  AC_MSG_RESULT([no])
  AC_MSG_ERROR([kstdgameaction.h was not found. Please install kdegames/
libkdegames first])
else
  AC_MSG_RESULT([$kstdgameaction])
fi
])
AC_CHECK_LIBKDEGAMES

As you can see this simply check for the existance of kstdgameaction.h

A more advanced version may be to check whether the library can actually be 
used to compile a program (i.e. try to link a small KDE program that uses 
libkdegames). But I think that would be totally overkill and of no real use. 
If you want to do it anyway, you may want to look at e.g. admin/acinclude.m4.
in how KDE does it for Qt. Or look through autoconf docs :)

CU
Andi


More information about the kde-games-devel mailing list