Updated to latest OpenGL test macros versions.

This commit is contained in:
Andrey Kiselev 2005-06-23 11:46:47 +00:00
parent 9a8e13c032
commit aa4f24915e

View File

@ -120,7 +120,7 @@ EOF
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Available from the GNU Autoconf Macro Archive at: dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/ax_check_gl.html dnl http://www.gnu.org/software/ac-archive/ax_check_gl.html
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
AC_DEFUN([AX_CHECK_GL], AC_DEFUN([AX_CHECK_GL],
[AC_REQUIRE([AC_PATH_X])dnl [AC_REQUIRE([AC_PATH_X])dnl
@ -137,10 +137,15 @@ AC_ARG_WITH([apple-opengl-framework],
if test "X$with_apple_opengl_framework" = "Xyes"; then if test "X$with_apple_opengl_framework" = "Xyes"; then
AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1], AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
[Use the Apple OpenGL framework.]) [Use the Apple OpenGL framework.])
GL_CFLAGS="-framework OpenGL" GL_LIBS="-framework OpenGL"
else else
GL_CFLAGS="${PTHREAD_CFLAGS}" AC_LANG_PUSH(C)
GL_LIBS="${PTHREAD_LIBS} -lm"
AX_LANG_COMPILER_MS
if test X$ax_compiler_ms = Xno; then
GL_CFLAGS="${PTHREAD_CFLAGS}"
GL_LIBS="${PTHREAD_LIBS} -lm"
fi
# #
# Use x_includes and x_libraries if they have been set (presumably by # Use x_includes and x_libraries if they have been set (presumably by
@ -155,8 +160,6 @@ else
fi fi
fi fi
AC_LANG_PUSH(C)
AC_CHECK_HEADERS([windows.h]) AC_CHECK_HEADERS([windows.h])
AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl], AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl],
@ -166,20 +169,20 @@ else
ax_save_LIBS="${LIBS}" ax_save_LIBS="${LIBS}"
LIBS="" LIBS=""
ax_check_libs="-lopengl32 -lGL" ax_check_libs="-lopengl32 -lGL"
for ax_lib in ${ax_check_libs}; do for ax_lib in ${ax_check_libs}; do
if test "X$CC" = "Xcl"; then if test X$ax_compiler_ms = Xyes; then
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else else
ax_try_lib="${ax_lib}" ax_try_lib="${ax_lib}"
fi fi
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
AC_TRY_LINK([ AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
# if HAVE_WINDOWS_H && defined(_WIN32) # if HAVE_WINDOWS_H && defined(_WIN32)
# include <windows.h> # include <windows.h>
# endif # endif
# include <GL/gl.h> # include <GL/gl.h>]],
], [[glBegin(0)]])],
[glBegin(0)],
[ax_cv_check_gl_libgl="${ax_try_lib}"; break]) [ax_cv_check_gl_libgl="${ax_try_lib}"; break])
done done
LIBS=${ax_save_LIBS} LIBS=${ax_save_LIBS}
@ -201,10 +204,11 @@ AC_SUBST([GL_LIBS])
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Available from the GNU Autoconf Macro Archive at: dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/ax_check_glu.html dnl http://www.gnu.org/software/ac-archive/ax_check_glu.html
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
AC_DEFUN([AX_CHECK_GLU], AC_DEFUN([AX_CHECK_GLU],
[AC_REQUIRE([AX_CHECK_GL])dnl [AC_REQUIRE([AX_CHECK_GL])dnl
AC_REQUIRE([AC_PROG_CXX])dnl
GLU_CFLAGS="${GL_CFLAGS}" GLU_CFLAGS="${GL_CFLAGS}"
if test "X${with_apple_opengl_framework}" != "Xyes"; then if test "X${with_apple_opengl_framework}" != "Xyes"; then
AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu], AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu],
@ -215,7 +219,7 @@ if test "X${with_apple_opengl_framework}" != "Xyes"; then
LIBS="" LIBS=""
ax_check_libs="-lglu32 -lGLU" ax_check_libs="-lglu32 -lGLU"
for ax_lib in ${ax_check_libs}; do for ax_lib in ${ax_check_libs}; do
if test "X$CC" = "Xcl"; then if test X$ax_compiler_ms = Xyes; then
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else else
ax_try_lib="${ax_lib}" ax_try_lib="${ax_lib}"
@ -227,25 +231,27 @@ if test "X${with_apple_opengl_framework}" != "Xyes"; then
# "conftest.cc"; and Microsoft cl doesn't know what to do with such a # "conftest.cc"; and Microsoft cl doesn't know what to do with such a
# file. # file.
# #
if test "X$CXX" != "Xcl"; then AC_LANG_PUSH([C++])
AC_LANG_PUSH([C++]) if test X$ax_compiler_ms = Xyes; then
AC_LANG_PUSH([C])
fi fi
AC_TRY_LINK([ AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
# if HAVE_WINDOWS_H && defined(_WIN32) # if HAVE_WINDOWS_H && defined(_WIN32)
# include <windows.h> # include <windows.h>
# endif # endif
# include <GL/glu.h> # include <GL/glu.h>]],
], [[gluBeginCurve(0)]])],
[gluBeginCurve(0)],
[ax_cv_check_glu_libglu="${ax_try_lib}"; break]) [ax_cv_check_glu_libglu="${ax_try_lib}"; break])
if test "X$CXX" != "Xcl"; then if test X$ax_compiler_ms = Xyes; then
AC_LANG_POP([C++]) AC_LANG_POP([C])
fi fi
AC_LANG_POP([C++])
done done
LIBS=${ax_save_LIBS} LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}]) CPPFLAGS=${ax_save_CPPFLAGS}])
if test "X${ax_cv_check_glu_libglu}" = "Xno"; then if test "X${ax_cv_check_glu_libglu}" = "Xno"; then
no_gl="yes" no_glu="yes"
GLU_CFLAGS="" GLU_CFLAGS=""
GLU_LIBS="" GLU_LIBS=""
else else
@ -258,23 +264,25 @@ AC_SUBST([GLU_LIBS])
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Available from the GNU Autoconf Macro Archive at: dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/ax_check_glut.html dnl http://www.gnu.org/software/ac-archive/ax_check_glut.html
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
AC_DEFUN([AX_CHECK_GLUT], AC_DEFUN([AX_CHECK_GLUT],
[AC_REQUIRE([AX_CHECK_GLU])dnl [AC_REQUIRE([AX_CHECK_GLU])dnl
AC_REQUIRE([AC_PATH_XTRA])dnl AC_REQUIRE([AC_PATH_XTRA])dnl
if test "X$with_apple_opengl_framework" = "Xyes"; then if test "X$with_apple_opengl_framework" = "Xyes"; then
GLUT_CFLAGS="-framework GLUT ${GLU_CFLAGS}" GLUT_CFLAGS="${GLU_CFLAGS}"
GLUT_LIBS="-lobjc ${GL_LIBS}" GLUT_LIBS="-framework GLUT -lobjc ${GL_LIBS}"
else else
GLUT_CFLAGS=${GLU_CFLAGS} GLUT_CFLAGS=${GLU_CFLAGS}
GLUT_LIBS=${GLU_LIBS}
# #
# If X is present, assume GLUT depends on it. # If X is present, assume GLUT depends on it.
# #
if test "X${no_x}" != "Xyes"; then if test "X${no_x}" != "Xyes"; then
GLUT_LIBS="${X_PRE_LIBS} -lXmu -lXi ${X_EXTRA_LIBS} ${GLU_LIBS}" GLUT_LIBS="${X_PRE_LIBS} -lXmu -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"
fi fi
AC_LANG_PUSH(C) AC_LANG_PUSH(C)
@ -288,19 +296,19 @@ else
LIBS="" LIBS=""
ax_check_libs="-lglut32 -lglut" ax_check_libs="-lglut32 -lglut"
for ax_lib in ${ax_check_libs}; do for ax_lib in ${ax_check_libs}; do
if test "X$CC" = "Xcl"; then if test X$ax_compiler_ms = Xyes; then
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else else
ax_try_lib="${ax_lib}" ax_try_lib="${ax_lib}"
fi fi
LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
AC_TRY_LINK([ AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
# if HAVE_WINDOWS_H && defined(_WIN32) # if HAVE_WINDOWS_H && defined(_WIN32)
# include <windows.h> # include <windows.h>
# endif # endif
# include <GL/glut.h> # include <GL/glut.h>]],
], [[glutMainLoop()]])],
[glutMainLoop()],
[ax_cv_check_glut_libglut="${ax_try_lib}"; break]) [ax_cv_check_glut_libglut="${ax_try_lib}"; break])
done done