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
This commit is contained in:
Michael R Sweet 2007-02-05 03:20:30 +00:00
parent 502f83219d
commit 1c61b1297d
3 changed files with 39 additions and 24 deletions

View File

@ -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
@ -67,6 +67,14 @@
#undef HAVE_GL_GLU_H
/*
* HAVE_GLXGETPROCADDRESSARB:
*
* Do you have the OpenGL glXGetProcAddressARB() function?
*/
#undef HAVE_GLXGETPROCADDRESSARB
/*
* USE_COLORMAP:
*

View File

@ -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)

View File

@ -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