diff options
| -rw-r--r-- | configh.in | 6 | ||||
| -rw-r--r-- | configure.in | 3 | ||||
| -rw-r--r-- | src/glut_compatability.cxx | 12 |
3 files changed, 21 insertions, 0 deletions
diff --git a/configh.in b/configh.in index 45c5c7b79..0596dbc9f 100644 --- a/configh.in +++ b/configh.in @@ -288,5 +288,11 @@ #endif /* !HAVE_STRTOLL */ /* + * Do we have the dlsym() function? + */ + +#undef HAVE_DLSYM + +/* * End of "$Id$". */ diff --git a/configure.in b/configure.in index ab6180f0d..70e9064d4 100644 --- a/configure.in +++ b/configure.in @@ -433,6 +433,9 @@ fi AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL)) +dnl Check for dlopen/dlsym... +AC_SEARCH_LIBS(dlsym, dl, AC_DEFINE(HAVE_DLSYM)) + dnl Check for audio libraries... AUDIOLIBS="" diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx index 7b8832f43..47079905d 100644 --- a/src/glut_compatability.cxx +++ b/src/glut_compatability.cxx @@ -43,6 +43,9 @@ # define GLX_GLXEXT_LEGACY # include <GL/glx.h> # endif // HAVE_GLXGETPROCADDRESSARB +# ifdef HAVE_DLSYM +# include <dlfcn.h> +# endif // HAVE_DLSYM # define MAXWINDOWS 32 static Fl_Glut_Window *windows[MAXWINDOWS+1]; @@ -439,8 +442,17 @@ int glutDeviceGet(GLenum type) { GLUTproc glutGetProcAddress(const char *procName) { # ifdef WIN32 return (GLUTproc)wglGetProcAddress((LPCSTR)procName); + +# elif defined(HAVE_DLSYM) + char symbol[1024]; + + snprintf(symbol, sizeof(symbol), "_%s", procName); + + return (GLUTproc)dlsym(RTLD_DEFAULT, symbol); + # elif defined(HAVE_GLXGETPROCADDRESSARB) return (GLUTproc)glXGetProcAddressARB((const GLubyte *)procName); + # else return (GLUTproc)0; # endif // WIN32 |
