2004-11-26 17:45:13 +00:00
|
|
|
dnl Available from the GNU Autoconf Macro Archive at:
|
|
|
|
dnl http://www.gnu.org/software/ac-archive/htmldoc/ax_check_glu.html
|
|
|
|
dnl
|
|
|
|
AC_DEFUN([AX_CHECK_GLU],
|
|
|
|
[AC_REQUIRE([AX_CHECK_GL])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_CXX])dnl
|
|
|
|
GLU_CFLAGS="${GL_CFLAGS}"
|
|
|
|
if test "X${with_apple_opengl_framework}" != "Xyes"; then
|
|
|
|
AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu],
|
|
|
|
[ax_cv_check_glu_libglu="no"
|
|
|
|
ax_save_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
|
|
|
|
ax_save_LIBS="${LIBS}"
|
|
|
|
LIBS=""
|
|
|
|
ax_check_libs="-lglu32 -lGLU"
|
|
|
|
for ax_lib in ${ax_check_libs}; do
|
|
|
|
if test X$ax_compiler_ms = Xyes; then
|
|
|
|
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
|
|
|
|
else
|
|
|
|
ax_try_lib="${ax_lib}"
|
|
|
|
fi
|
2020-11-14 16:23:54 +00:00
|
|
|
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
|
2004-11-26 17:45:13 +00:00
|
|
|
#
|
|
|
|
# libGLU typically links with libstdc++ on POSIX platforms. However,
|
|
|
|
# setting the language to C++ means that test program source is named
|
|
|
|
# "conftest.cc"; and Microsoft cl doesn't know what to do with such a
|
|
|
|
# file.
|
|
|
|
#
|
|
|
|
AC_LANG_PUSH([C++])
|
|
|
|
if test X$ax_compiler_ms = Xyes; then
|
|
|
|
AC_LANG_PUSH([C])
|
|
|
|
fi
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[
|
|
|
|
# if HAVE_WINDOWS_H && defined(_WIN32)
|
|
|
|
# include <windows.h>
|
|
|
|
# endif
|
|
|
|
# include <GL/glu.h>]],
|
|
|
|
[[gluBeginCurve(0)]])],
|
2020-11-14 16:23:54 +00:00
|
|
|
[ax_cv_check_glu_libglu="${ax_try_lib}"; break])
|
2004-11-26 17:45:13 +00:00
|
|
|
if test X$ax_compiler_ms = Xyes; then
|
|
|
|
AC_LANG_POP([C])
|
|
|
|
fi
|
|
|
|
AC_LANG_POP([C++])
|
|
|
|
done
|
|
|
|
LIBS=${ax_save_LIBS}
|
|
|
|
CPPFLAGS=${ax_save_CPPFLAGS}])
|
|
|
|
if test "X${ax_cv_check_glu_libglu}" = "Xno"; then
|
|
|
|
no_glu="yes"
|
|
|
|
GLU_CFLAGS=""
|
|
|
|
GLU_LIBS=""
|
|
|
|
else
|
|
|
|
GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST([GLU_CFLAGS])
|
|
|
|
AC_SUBST([GLU_LIBS])
|
|
|
|
])
|