Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 955c2bf

Browse files
committed
Fix includes for Apple
1 parent 4f30a40 commit 955c2bf

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

Changes

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
Revision history for Perl extension OpenGL::GLU.
22

33
0.02_01 TBD
4-
4+
- Fix gl.h and glu.h includes for __APPLE__
5+
The Apple convention is <OpenGL/gl.h> and <OpenGL/glu.h>
6+
where OpenGL is the name of the framework.
57

68
0.02 2017-02-13 10:26:37-05:00
79
- Change minimum perl version to 5.8

GLU.xs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include "const-c.inc"
1717

18-
#if defined(HAVE_AGL_GLUT)
18+
#if defined(__APPLE__)
1919
#include <OpenGL/glu.h>
2020
#else
2121
#include <GL/glu.h>

Makefile.PL

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
use 5.008;
22
use ExtUtils::MakeMaker;
3-
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
4-
# the contents of the Makefile that is written.
5-
my $LIBS = '';
6-
if ($^O eq 'MSWin32') {
7-
$LIBS = '-lopengl32 -lglu32';
8-
} else {
9-
$LIBS = '-lGL -lGLU';
3+
use Devel::CheckOS qw(os_is);
4+
my ( $LIBS, $DYNS );
5+
6+
$LIBS = '';
7+
$DYNS = {};
8+
9+
if ( os_is( 'MSWin32' ) ) {
10+
$LIBS = '-lopengl32 -lglu32';
11+
}
12+
elsif ( os_is( 'Cygwin' ) ) {
13+
$LIBS = '-lGL -lGLU';
14+
}
15+
elsif ( os_is( 'MacOSX' ) ) {
16+
$DYNS = { 'OTHERLDFLAGS' => '-framework OpenGL' };
17+
}
18+
else {
19+
$LIBS = '-lGL -lGLU';
1020
}
1121

1222
WriteMakefile(
@@ -17,6 +27,7 @@ WriteMakefile(
1727
AUTHOR => 'chm@cpan.org',
1828
LICENSE => 'perl',
1929
LIBS => [$LIBS], # e.g., '-lm'
30+
'dynamic_lib' => $DYNS,
2031
DEFINE => '-DGL_OES_EGL_image=1', # e.g., '-DHAVE_SOMETHING'
2132
INC => '-I.', # e.g., '-I. -I/usr/include/other'
2233
# Un-comment this if you add C files to link with later:

gl_util.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
#include "XSUB.h"
44
#include "ppport.h"
55

6+
#if defined(__APPLE__)
7+
#include <OpenGL/gl.h>
8+
#else
69
#include <GL/gl.h>
10+
#endif
711

812
#ifndef GL_CMYK
913
#define GL_CMYK GL_CMYK_EXT

0 commit comments

Comments
 (0)