Acme-MITHALDU-BleedingOpenGL
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
next if (!$found_libs->{$key});
$DEFS .= " -DHAVE_$key";
print " $key = '$found_libs->{$key}'\n" if ($verbose);
}
# Configure MakeMaker
my($LIBS,$OPTS,$CLEAN,$LDFROM);
my $EXES = [];
my $DYNS = {};
if ($IS_W32API || (($^O eq 'MSWin32') && !$IS_CYGWIN)) # Win32
{
my $glut_lib = '-lopengl32 -lglu32 ';
if ($interface_lib eq 'GLUT')
{
$glut_lib .= '-lglut32';
}
elsif ($interface_lib eq 'FREEGLUT' and $IS_STRAWBERRY)
{
$glut_lib .= '-lglut';
}
else
{
$glut_lib .= '-LFreeGLUT -lfreeglut';
}
if ($IS_MINGW) # MINGW
{
$LDFROM = $glut_lib;
}
elsif ($IS_W32API) # CYGWIN W32API
{
my $glut = ($found_libs->{FREEGLUT32}) ? $found_libs->{FREEGLUT32} : $found_libs->{GLUT32};
$LIBS = "-L/usr/lib/w32api $glut_lib";
$LDFROM = $glut_lib;
### $INCS = '-I/usr/include/w32api';
$INCS = '-I/usr/include/opengl';
$DEFS .= " -DHAVE_W32API";
$DYNS = { OTHERLDFLAGS => '-Wl,--exclude-symbols,'."\x7F".$glut.'_NULL_THUNK_DATA' };
}
else # Windows VC6
{
$LIBS = $glut_lib;
$OPTS = "/ogity /GDs";
}
# Using a dll as EXES is incorrect for EU::MM, since the EXES here mean
# perl scripts and not windows binaries or DLLs. This puts the DLL in
# blib/bin from whence it should be installed correctly. It is not
# clear that this step is even needed since the freeglut.dll is installed
# by this Makefile.PL if no FreeGLUT is found.
#
## $EXES = ['FreeGLUT/freeglut.dll'];
{
system $^X , qw[-MExtUtils::Command -e mkpath --], qw[blib/arch/auto/Acme/MITHALDU/BleedingOpenGL];
system $^X , qw[-MExtUtils::Command -e cp --], qw[FreeGLUT/freeglut.dll blib/arch/auto/Acme/MITHALDU/BleedingOpenGL/freeglut.dll];
my @other_installs = grep { -e "$_\\freeglut.dll" } split /;/, $ENV{PATH};
if(@other_installs) {
print "\n" ;
print "XXX Other freeglut.dll installed in $_\n" for @other_installs;
print "Please verify whether the other found dll(s) are from older OpenGL.pm installs, and delete them if so!\n\n\n";
sleep 2;
}
}
}
elsif ($interface_lib eq 'AGL') # Mac OS X
{
$INCS = ""; # no include flags required: Apple gcc will automatically pick up the system frameworks
$DEFS .= " -DHAVE_AGL_GLUT -Wno-deprecated-declarations "; # So we know we have glutWMCloseFunc() and glutCheckLoop()
$DYNS = { OTHERLDFLAGS => "-framework OpenGL -framework GLUT" };
}
else # Everyone else
{
my @includes = qw
{
-I/usr/include
-I/usr/include
-I/usr/X11R6/include
-I/opt/X11/include
-I/usr/local/include
-I/usr/openwin/include
-I/opt/csw/include
-I/usr/local/freeglut/include
};
$INCS = "@includes";
# Test for obfuscated GLX
# quite often GLX is in -lGL... Test for GL/glx.h instead...
my $out = cfile_text('GL/glx.h');
# The cpp would not let this macro through. Check for something else
# that still exists after the cpp pass. a typedef, or type would work
my $has_glx = ($out =~ m|GLXContext|);
if ($has_glx)
{
#delete($found_libs->{GLX});
$DEFS .= " -DHAVE_GLX";
}
elsif (!$found_libs->{GLX} && $verbose)
{
print "GLX not found (neither library, nor headers).";
}
# Test for obfuscated Freeglut
# quite often Freeglut is in -lglut... Test for GL/freeglut.h instead...
$out = cfile_text('GL/freeglut.h');
# The cpp would not let this macro through. Check for something else
# that still exists after the cpp pass. a typedef, or type would work
my $has_freeglut = ($out =~ m|glutMainLoopEvent|);
if ($has_freeglut)
{
#delete($found_libs->{GLX});
$DEFS .= " -DHAVE_FREEGLUT -DHAVE_FREEGLUT_H";
$found_libs->{FREEGLUT}="glut";
}
( run in 4.623 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )