Skip to content

Commit e3f9bd2

Browse files
committed
Trial balloon: Use full path to GLUT framework on Apple platforms.
1 parent c26b4ee commit e3f9bd2

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
2.7.0.9
22
--------
3-
* Windows/Linux: The GLUT package compiles without any additional GLUT library now.
3+
* The GLUT package compiles without any additional library/framework now.
44
* Windows: We search for a native freeglut DLL, a MinGW freeglut DLL and a classic GLUT DLL, in that order.
55

66
2.7.0.8

GLUT.cabal

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ library
103103
else
104104
cpp-options: "-DCALLCONV=ccall"
105105
cc-options: "-DUSE_DLSYM"
106-
if os(darwin)
107-
frameworks: GLUT
108106

109107
executable BOGLGP01-OnYourOwn1
110108
if !flag(BuildExamples)

cbits/HsGLUT.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ 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+
5157
void*
5258
hs_GLUT_getProcAddress(const char *name)
5359
{
@@ -56,7 +62,7 @@ hs_GLUT_getProcAddress(const char *name)
5662

5763
if (firstTime) {
5864
firstTime = 0;
59-
handle = dlopen("libglut.so", RTLD_LAZY);
65+
handle = dlopen(FILENAME, RTLD_LAZY | RTLD_GLOBAL);
6066
}
6167

6268
return handle ? dlsym(handle, name) : NULL;

0 commit comments

Comments
 (0)