summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2007-02-05 03:20:30 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2007-02-05 03:20:30 +0000
commit1c61b1297d761c2f536a48f98fce7e6c2746f258 (patch)
tree6a39f443c880daf310c9cc96bd2c84c723f7652f
parent502f83219ddb31190530647732d86fb49fe9c9df (diff)
Fix glXGetProcAddressARB() usage and support for POSIX threads on HP-UX 11.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5660 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--configh.in10
-rw-r--r--configure.in42
-rw-r--r--src/glut_compatability.cxx11
3 files changed, 39 insertions, 24 deletions
diff --git a/configh.in b/configh.in
index bb5ae15b6..45c5c7b79 100644
--- a/configh.in
+++ b/configh.in
@@ -4,7 +4,7 @@
* Configuration file for the Fast Light Tool Kit (FLTK).
* @configure_input@
*
- * Copyright 1998-2005 by Bill Spitzak and others.
+ * Copyright 1998-2007 by Bill Spitzak and others.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -68,6 +68,14 @@
#undef HAVE_GL_GLU_H
/*
+ * HAVE_GLXGETPROCADDRESSARB:
+ *
+ * Do you have the OpenGL glXGetProcAddressARB() function?
+ */
+
+#undef HAVE_GLXGETPROCADDRESSARB
+
+/*
* USE_COLORMAP:
*
* Setting this to zero will save a good deal of code (especially for
diff --git a/configure.in b/configure.in
index a3f2a54eb..c7afef0a2 100644
--- a/configure.in
+++ b/configure.in
@@ -5,7 +5,7 @@ dnl "$Id$"
dnl
dnl Configuration script for the Fast Light Tool Kit (FLTK).
dnl
-dnl Copyright 1998-2006 by Bill Spitzak and others.
+dnl Copyright 1998-2007 by Bill Spitzak and others.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Library General Public
@@ -543,22 +543,24 @@ have_pthread=no
if test "x$enable_threads" = xyes; then
AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H))
- AC_CHECK_LIB(pthread, pthread_create)
+ AC_CHECK_FUNC(pthread_create,
+ have_pthread=yes,
+ [AC_CHECK_LIB(pthread, pthread_create)
- if test "x$ac_cv_lib_pthread_pthread_create" = xyes -a x$ac_cv_header_pthread_h = xyes; then
- have_pthread=yes
- else
- dnl *BSD uses -pthread option...
- AC_MSG_CHECKING([for pthread_create using -pthread])
- SAVELIBS="$LIBS"
- LIBS="-pthread $LIBS"
- AC_TRY_LINK([#include <pthread.h>],
- [pthread_create(0, 0, 0, 0);],
- LIBS="-pthread $SAVELIBS"
- have_pthread=yes,
- LIBS="$SAVELIBS")
- AC_MSG_RESULT([$have_pthread])
- fi
+ if test "x$ac_cv_lib_pthread_pthread_create" = xyes -a x$ac_cv_header_pthread_h = xyes; then
+ have_pthread=yes
+ else
+ dnl *BSD uses -pthread option...
+ AC_MSG_CHECKING([for pthread_create using -pthread])
+ SAVELIBS="$LIBS"
+ LIBS="-pthread $LIBS"
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_create(0, 0, 0, 0);],
+ LIBS="-pthread $SAVELIBS"
+ have_pthread=yes,
+ LIBS="$SAVELIBS")
+ AC_MSG_RESULT([$have_pthread])
+ fi])
fi
dnl Define OS-specific stuff...
@@ -676,10 +678,12 @@ case $uname in
if test x$enable_gl != xno; then
AC_SEARCH_LIBS(dlopen, dl)
AC_CHECK_HEADER(GL/gl.h,
- AC_CHECK_LIB(GL, glXMakeCurrent, AC_DEFINE(HAVE_GL) GLLIB="-lGL", \
- AC_CHECK_LIB(MesaGL,glXMakeCurrent, AC_DEFINE(HAVE_GL) GLLIB=" -lMesaGL",,\
- -lm), \
+ AC_CHECK_LIB(GL, glXMakeCurrent, AC_DEFINE(HAVE_GL) GLLIB="-lGL",
+ AC_CHECK_LIB(MesaGL,glXMakeCurrent, AC_DEFINE(HAVE_GL) GLLIB=" -lMesaGL",,
+ -lm),
-lm)
+ AC_CHECK_LIB(GL, glXGetProcAddressARB,
+ AC_DEFINE(HAVE_GLXGETPROCADDRESSARB),, -lm)
)
AC_CHECK_HEADER(GL/glu.h,
AC_DEFINE(HAVE_GL_GLU_H)
diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx
index 836f0ad6a..7b8832f43 100644
--- a/src/glut_compatability.cxx
+++ b/src/glut_compatability.cxx
@@ -38,9 +38,12 @@
#include "flstring.h"
#if HAVE_GL
-#include <FL/glut.H>
-
-#define MAXWINDOWS 32
+# include <FL/glut.H>
+# ifdef HAVE_GLXGETPROCADDRESSARB
+# define GLX_GLXEXT_LEGACY
+# include <GL/glx.h>
+# endif // HAVE_GLXGETPROCADDRESSARB
+# define MAXWINDOWS 32
static Fl_Glut_Window *windows[MAXWINDOWS+1];
Fl_Glut_Window *glut_window;
@@ -437,7 +440,7 @@ GLUTproc glutGetProcAddress(const char *procName) {
# ifdef WIN32
return (GLUTproc)wglGetProcAddress((LPCSTR)procName);
# elif defined(HAVE_GLXGETPROCADDRESSARB)
- return (GLUTproc)glXGetProcAddressARB(procName);
+ return (GLUTproc)glXGetProcAddressARB((const GLubyte *)procName);
# else
return (GLUTproc)0;
# endif // WIN32