AC_PREREQ(2.50)

AC_INIT(OGRE_REFAPP, 0.10.0)
AM_INIT_AUTOMAKE([1.6.1 foreign no-installinfo no-installman subdir-objects])
AM_CONFIG_HEADER(ReferenceAppLayer/include/config.h)

AC_CANONICAL_TARGET

dnl Check for programs
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL

AM_PROG_LIBTOOL

dnl GCC ersion check
if test x$GCC = xyes; then
    AC_MSG_CHECKING([version 3.x of gcc])
    if test -n "`$CC --version 2>&1|grep '3.'`"; then
        AC_DEFINE(EXT_HASH,, Use old STL hash options)
        AC_MSG_RESULT(yes);
    else
        AC_MSG_RESULT(no)!
    fi
fi

dnl Other stuff we need
PKG_CHECK_MODULES(OGRE, OGRE)
AC_LANG_PUSH([C++])
AC_CHECK_LIB([ode], [main], [], AC_MSG_ERROR([Can't find libode]))
AC_LANG_POP([C++])
AC_CHECK_LIB(m, pow)
AC_CHECK_LIB(z, gzopen)
AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF,,snprintf))
AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF,,vsnprintf))

dnl Create the makefiles
AC_CONFIG_FILES([Makefile \
    ReferenceAppLayer/Makefile \
    ReferenceAppLayer/src/Makefile \
    ReferenceAppLayer/include/Makefile \
	BspCollision/Makefile \
	BspCollision/src/Makefile 
	
    ])

AC_OUTPUT
