File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 1+ 2.7.0.10
2+ --------
3+ * Mac OS X: Search public frameworks first, then system frameworks.
4+
152.7.0.9
26--------
37* The GLUT package compiles without any additional library/framework now.
Original file line number Diff line number Diff line change 11name : GLUT
2- version : 2.7.0.9
2+ version : 2.7.0.10
33synopsis : A binding for the OpenGL Utility Toolkit
44description :
55 A Haskell binding for the OpenGL Utility Toolkit, a window system independent
Original file line number Diff line number Diff line change @@ -48,12 +48,6 @@ hs_GLUT_getProcAddress(const char *name)
4848#include <stdlib.h>
4949#include <dlfcn.h>
5050
51- #ifdef __APPLE__
52- #define FILENAME "/System/Library/Frameworks/GLUT.framework/GLUT"
53- #else
54- #define FILENAME "libglut.so"
55- #endif
56-
5751void *
5852hs_GLUT_getProcAddress (const char * name )
5953{
@@ -62,7 +56,18 @@ hs_GLUT_getProcAddress(const char *name)
6256
6357 if (firstTime ) {
6458 firstTime = 0 ;
65- handle = dlopen (FILENAME , RTLD_LAZY | RTLD_GLOBAL );
59+
60+ #ifdef __APPLE__
61+ /* Try public framework path first. */
62+ handle = dlopen ("/Library/Frameworks/GLUT.framework/GLUT" , RTLD_LAZY | RTLD_GLOBAL );
63+
64+ /* If the public path failed, try the system framework path. */
65+ if (!handle ) {
66+ handle = dlopen ("/System/Library/Frameworks/GLUT.framework/GLUT" , RTLD_LAZY | RTLD_GLOBAL );
67+ }
68+ #else
69+ handle = dlopen ("libglut.so" , RTLD_LAZY | RTLD_GLOBAL );
70+ #endif
6671 }
6772
6873 return handle ? dlsym (handle , name ) : NULL ;
You can’t perform that action at this time.
0 commit comments