summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configh.in3
-rw-r--r--configure.in1
-rw-r--r--src/glut_compatability.cxx6
3 files changed, 6 insertions, 4 deletions
diff --git a/configh.in b/configh.in
index 0596dbc9f..4e73833dc 100644
--- a/configh.in
+++ b/configh.in
@@ -288,9 +288,10 @@
#endif /* !HAVE_STRTOLL */
/*
- * Do we have the dlsym() function?
+ * Do we have the dlsym() function and header?
*/
+#undef HAVE_DLFCN_H
#undef HAVE_DLSYM
/*
diff --git a/configure.in b/configure.in
index 1d9d576c6..de77c1fd7 100644
--- a/configure.in
+++ b/configure.in
@@ -440,6 +440,7 @@ AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
dnl Check for dlopen/dlsym...
AC_SEARCH_LIBS(dlsym, dl, AC_DEFINE(HAVE_DLSYM))
+AC_CHECK_HEADER(dlfcn.h, AC_DEFINE(HAVE_DLFCN_H))
dnl Check for audio libraries...
AUDIOLIBS=""
diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx
index 47079905d..0f768a4dc 100644
--- a/src/glut_compatability.cxx
+++ b/src/glut_compatability.cxx
@@ -43,9 +43,9 @@
# define GLX_GLXEXT_LEGACY
# include <GL/glx.h>
# endif // HAVE_GLXGETPROCADDRESSARB
-# ifdef HAVE_DLSYM
+# ifdef HAVE_DLFCN_H
# include <dlfcn.h>
-# endif // HAVE_DLSYM
+# endif // HAVE_DLFCN_H
# define MAXWINDOWS 32
static Fl_Glut_Window *windows[MAXWINDOWS+1];
@@ -443,7 +443,7 @@ GLUTproc glutGetProcAddress(const char *procName) {
# ifdef WIN32
return (GLUTproc)wglGetProcAddress((LPCSTR)procName);
-# elif defined(HAVE_DLSYM)
+# elif defined(HAVE_DLSYM) && defined(HAVE_DLFCN_H)
char symbol[1024];
snprintf(symbol, sizeof(symbol), "_%s", procName);