Improve GLee detection.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10734 4a71c877-e1ca-e34f-864e-861f7616d084
master
Christian Ohm 2010-04-27 23:39:34 +00:00 committed by Git SVN Gateway
parent 91e4eabd51
commit a993c51db9
2 changed files with 16 additions and 9 deletions

View File

@ -318,17 +318,17 @@ system_glee=false
if test "x$host_os_mingw32" != "xyes" ; then
PKG_CHECK_MODULES([GLee], [glee >= 5.4.0], [system_glee=true], [system_glee=false])
if test "x$system_glee" = "xfalse" ; then
AC_CHECK_LIB([GLee], [GLeeInit], [system_glee=true], [system_glee=false])
if test "x$system_glee" = "xtrue" ; then
AX_EXT_HAVE_HEADER([GLee.h], [/usr/include/GL /usr/local/include/GL])
fi
AX_EXT_HAVE_HEADER([GLee.h], [/usr/local/include/GL /usr/include/GL])
save_cppflags="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${GLEE_H_CPPFLAGS}"
AC_CHECK_HEADER([GLee.h], [system_glee=true], [system_glee=false])
CPPFLAGS=${save_cppflags}
if test "x$system_glee" = "xtrue" ; then
AC_SUBST([GLee_CFLAGS], [${GLEE_H_CPPFLAGS}])
AC_SUBST([GLee_LIBS], [-lGLee])
AC_CHECK_LIB([GLee], [GLeeInit], [system_glee=true], [system_glee=false])
if test "x$system_glee" = "xtrue" ; then
AC_SUBST([GLee_CFLAGS], [${GLEE_H_CPPFLAGS}])
AC_SUBST([GLee_LIBS], [-lGLee])
fi
fi
fi
fi

View File

@ -1,5 +1,6 @@
# Heavily modified, to set a HEADER_H_CPPFLAGS variable (for a file called
# header.h) instead of modifying CFLAGS/CPPFLAGS directly.
# Heavily modified, to try without any added includes first, and to set a
# HEADER_H_CPPFLAGS variable (for a file called header.h) instead of modifying
# CFLAGS/CPPFLAGS directly.
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_ext_check_header.html
@ -38,10 +39,16 @@ AC_DEFUN([AX_EXT_HAVE_HEADER],
[AC_LANG_PUSH(C)
got="no"
hdr=`echo $1 | $as_tr_sh`
AC_CACHE_CHECK([for $1], [ext_cv_hashdr_${hdr}],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$1>])], [got="yes"], [got="no"]))
if test "x$got" = "xyes"; then
hdr=`echo $1 | $as_tr_cpp`
eval ${hdr}_CPPFLAGS=""
fi
for dir in $2; do
if test "x${got}" = "xno"; then
ext_hashdr_cvdir=`echo $dir | $as_tr_sh`
AC_CACHE_CHECK([for $1 library with -I$dir], [ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}],
AC_CACHE_CHECK([for $1 with -I$dir], [ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}],
[ext_have_hdr_save_cflags=${CFLAGS} CFLAGS="${CFLAGS} -I${dir}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$1>])],
[got="yes"; eval "ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}"="yes"],