Skip to content
Snippets Groups Projects
Commit 88dede08 authored by William Welliver's avatar William Welliver
Browse files

GLUT: just do all of the -framework GLUT tests first before deciding whether...

GLUT: just do all of the -framework GLUT tests first before deciding whether to test for non Quartz GLUT.
parent 688093dd
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,46 @@ AC_ARG_WITH(GLUT, [ --without-GLUT no support for GLUT],[without_GLUT=yes], ...@@ -11,6 +11,46 @@ AC_ARG_WITH(GLUT, [ --without-GLUT no support for GLUT],[without_GLUT=yes],
if test x$without_GLUT = xyes; then if test x$without_GLUT = xyes; then
AUTO="" AUTO=""
else else
DO_IF_OS(Darwin,
[
# MaxOS X
# NOTE: These tests may need to move to the main configure script.
# cf comments in the Darwin section of the main configure script.
AC_SYS_COMPILER_FLAG(-framework GLUT, framework_GLUT, LDFLAGS)
AC_SYS_COMPILER_FLAG(-framework GLUT, framework_GLUT, CPPFLAGS)
])
AC_CHECK_HEADERS(GLUT/glut.h)
# FIXME: Ought to just check -lobjc, since -framework GLUT is checked above.
AC_MSG_CHECKING(for glutSolidTeapot in GLUT.framework)
AC_CACHE_VAL(pike_cv_framework_GLUT, [
oldLIBS="$LIBS"
LIBS="-framework GLUT -lobjc $LIBS"
AC_TRY_LINK([
#ifdef HAVE_GLUT_GLUT_H
#include <GLUT/glut.h>
#else
#ifdef HAVE_GL_GLUT_H
#include <GL/glut.h>
#endif /* HAVE_GL_GLUT_H */
#endif /* HAVE_GLUT_GLUT_H */
], [ glutSolidTeapot(1.0) ],
[ pike_cv_framework_GLUT=yes ], [ pike_cv_framework_GLUT=no ])
LIBS="$oldLIBS"
])
if test x"$pike_cv_framework_GLUT" = "xyes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
if test x"$ac_cv_header_GLUT_glut_h$pike_cv_framework_GLUT" = "xyesyes"; then
AC_DEFINE_UNQUOTED(HAVE_LIBGLUT)
LIBS="-framework GLUT -lobjc $LIBS"
AUTO=auto.o
PIKE_FEATURE(GLUT,[yes (framework GLUT)])
else
AC_PATH_XTRA() AC_PATH_XTRA()
# The variables from the PATH_XTRA macro are missnamed... # The variables from the PATH_XTRA macro are missnamed...
# #
...@@ -28,27 +68,12 @@ else ...@@ -28,27 +68,12 @@ else
AC_CHECK_HEADERS(GL/glut.h) AC_CHECK_HEADERS(GL/glut.h)
DO_IF_OS(Darwin,
[
# MaxOS X
# NOTE: These tests may need to move to the main configure script.
# cf comments in the Darwin section of the main configure script.
AC_SYS_COMPILER_FLAG(-framework GLUT, framework_GLUT, LDFLAGS)
AC_SYS_COMPILER_FLAG(-framework GLUT, framework_GLUT, CPPFLAGS)
])
AC_CHECK_HEADERS(GLUT/glut.h)
CPPFLAGS="$CPPFLAGS $X_CFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LIBS="$X_EXTRA_LIBS $LIBS" LIBS="$X_EXTRA_LIBS $LIBS"
LDFLAGS="$LDFLAGS $X_LIBS $X_PRE_LIBS" LDFLAGS="$LDFLAGS $X_LIBS $X_PRE_LIBS"
AC_CHECK_LIB(X11, XDrawPoint) AC_CHECK_LIB(X11, XDrawPoint)
AC_CHECK_LIB(Xext, XShmPutImage) AC_CHECK_LIB(Xext, XShmPutImage)
AC_CHECK_LIB(Xmu, XmuStandardColormap) AC_CHECK_LIB(Xmu, XmuStandardColormap)
AC_CHECK_LIB(GL, glOrtho)
AC_CHECK_LIB(OpenGL, glOrtho)
AC_CHECK_LIB(MesaGL, glOrtho)
AC_CHECK_LIB(GLU, gluCylinder)
AC_CHECK_LIB(MesaGLU, gluCylinder)
AC_CHECK_LIB(Xinput, XOpenDevice) AC_CHECK_LIB(Xinput, XOpenDevice)
AC_CHECK_LIB(Xi, XOpenDevice) AC_CHECK_LIB(Xi, XOpenDevice)
...@@ -74,35 +99,7 @@ else ...@@ -74,35 +99,7 @@ else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
fi fi
# FIXME: Ought to just check -lobjc, since -framework GLUT is checked above. if test x"$ac_cv_header_GL_glut_h$pike_cv_lib_glut" = "xyesyes"; then
AC_MSG_CHECKING(for glutSolidTeapot in GLUT.framework)
AC_CACHE_VAL(pike_cv_framework_GLUT, [
oldLIBS="$LIBS"
LIBS="-framework GLUT -lobjc $LIBS"
AC_TRY_LINK([
#ifdef HAVE_GLUT_GLUT_H
#include <GLUT/glut.h>
#else
#ifdef HAVE_GL_GLUT_H
#include <GL/glut.h>
#endif /* HAVE_GL_GLUT_H */
#endif /* HAVE_GLUT_GLUT_H */
], [ glutSolidTeapot(1.0) ],
[ pike_cv_framework_GLUT=yes ], [ pike_cv_framework_GLUT=no ])
LIBS="$oldLIBS"
])
if test x"$pike_cv_framework_GLUT" = "xyes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
if test x"$ac_cv_header_GLUT_glut_h$pike_cv_framework_GLUT" = "xyesyes"; then
AC_DEFINE_UNQUOTED(HAVE_LIBGLUT)
LIBS="-framework GLUT -lobjc $LIBS"
AUTO=auto.o
PIKE_FEATURE(GLUT,[yes (framework GLUT)])
elif test x"$ac_cv_header_GL_glut_h$pike_cv_lib_glut" = "xyesyes"; then
AC_DEFINE_UNQUOTED(HAVE_LIBGLUT) AC_DEFINE_UNQUOTED(HAVE_LIBGLUT)
LIBS="-lglut $LIBS" LIBS="-lglut $LIBS"
AUTO=auto.o AUTO=auto.o
...@@ -112,6 +109,14 @@ else ...@@ -112,6 +109,14 @@ else
PIKE_FEATURE_NODEP(GLUT) PIKE_FEATURE_NODEP(GLUT)
fi fi
fi
AC_CHECK_LIB(GL, glOrtho)
AC_CHECK_LIB(OpenGL, glOrtho)
AC_CHECK_LIB(MesaGL, glOrtho)
AC_CHECK_LIB(GLU, gluCylinder)
AC_CHECK_LIB(MesaGLU, gluCylinder)
# Check for availability of some functions that aren't present in # Check for availability of some functions that aren't present in
# all versions of GLUT (they are missing in eg AIX 4.3). # all versions of GLUT (they are missing in eg AIX 4.3).
AC_CHECK_FUNCS([glutEnterGameMode glutForceJoystickFunc glutGameModeGet \ AC_CHECK_FUNCS([glutEnterGameMode glutForceJoystickFunc glutGameModeGet \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment