From 0bba19cd1f21f867c686c4148a4f7caca10e92fb Mon Sep 17 00:00:00 2001 From: hikerstk Date: Tue, 10 Mar 2009 04:48:28 +0000 Subject: [PATCH] Test if irrlicht needs -lXxf86vm when linking (note: this test is not perfect, feel free to improve!!) git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@3219 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- configure.ac | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 6d1758bb3..0575239c9 100644 --- a/configure.ac +++ b/configure.ac @@ -277,12 +277,9 @@ if test x$enable_irrlicht = xyes; then AC_ARG_WITH(irrlicht, [AS_HELP_STRING(--with-irrlicht=PREFIX, [specify the prefix path to irrlicht])]) if test "x$with_irrlicht" != "x" ; then - CPPFLAGS="${CPPFLAGS} -I$with_irrlicht/include/irrlicht" + CPPFLAGS="${CPPFLAGS} -I$with_irrlicht/include" fi AC_CHECK_HEADER(irrlicht.h, have_irrlicht_hdr=yes) - dnl how to use irr namespace here?? g++: 'irr' has not been declared - dnl AC_SEARCH_LIBS(createDevice, irrlicht, have_SDL_lib=yes) - if test x$have_irrlicht_hdr != xyes; then AC_MSG_ERROR([Can't find irrlicht installation, use --with-irrlicht...]) fi @@ -290,14 +287,30 @@ if test x$enable_irrlicht = xyes; then *-*-linux* ) irrlicht_LIBS="-L/$with_irrlicht/lib/Linux -lIrrlicht" ;; - esac - - case "${host}" in *darwin*|*macosx*) irrlicht_LIBS="-L/$with_irrlicht/lib/ -lIrrlicht" ;; esac + dnl Test if we need Xxf86vm. For now assume that if any problems + dnl occur with this simple program, it must be caused by this + dnl missing library. FIXME: better tests should be done here!! + dnl FIXME: this program when run prints out two lines (version numbers) to stdout + echo "checking for irrlicht libraries." + save_LIBS=$LIBS + LIBS="$LIBS $irrlicht_LIBS $opengl_LIBS" + AC_TRY_RUN([ + # include "irrlicht.h" + int main() { + irr::createDevice(irr::video::EDT_NULL); + return 0; + } + ], + , + irrlicht_LIBS="$irrlicht_LIBS -lXxf86vm" + ) + LIBS=$save_LIBS + fi dnl ======================================================