Acme-MITHALDU-BleedingOpenGL
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
use strict;
use warnings;
use ExtUtils::MakeMaker;
use ExtUtils::Liblist;
use Data::Dumper;
use Config;
use Try::Tiny;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
# Supported windowing interfaces
our $is_valid_interface =
{
'AGL' => 'Default GLUT framework on Mac OS X',
'FREEGLUT' => 'FreeGLUT, preferred over GLUT',
'GLUT' => 'GLUT; often really FreeGLUT on Linux',
'GLX' => 'Default GLX+X11 on Linux; use XQuartz on Mac OS X',
'W32API' => 'Uses WGL+FreeGLUT on CYGWIN, instead of GLX+FreeGLUT',
'WGL' => 'Same as W32API',
};
# Makefile.PL Usage
sub Usage
{
print "\n@_\n\n";
print qq
{
USAGE: perl Makefile.PL [OPTIONS]
OPTIONS include:
help This help message
verbose Display additional status info, can be
repeated for more verbosity
dist=NO_EXCLUSIONS Build with no OpenGL Extension exclusions
interface=XFACE Build for a specific windowing interface
Currently supports:
};
print "\n";
foreach my $xface (sort keys %$is_valid_interface)
{
print substr(" $xface ",0,24).
"$is_valid_interface->{$xface}\n";
}
print "\n";
exit(0);
}
if (@ARGV and $ARGV[0] =~ m|^([-/]*)?h(elp)?|i)
{
Usage();
}
else
{
print "\nrun as `perl Makefile.PL help` to show user options\n";
}
our $verbose = 0;
our $IS_MINGW = 0;
our $IS_STRAWBERRY = 0;
Makefile.PL view on Meta::CPAN
-lX11
-lstdc++
-lm
};
#-lXIE
$LIBS = "@libdirs $libs @more_libs";
$DEFS .= " -DGL_GLEXT_LEGACY";
# Handle obfuscated gcc
my $no_lgcc = (grep /^NO_LGCC$/, @ARGV);
@ARGV = grep !/^NO_LGCC$/, @ARGV;
if (!$no_lgcc)
{
# This may be a gcc compiler in disguise.
# Should check for gccversion as well.
if ($Config{cc} ne 'gcc' && !$Config{gccversion})
{
my $gcclibdir;
my $gccout = `gcc -v 2>&1`;
if ($gccout =~ /specs from (.*)/) # gcc present
{
($gcclibdir = $1) =~ s,\bspecs\s*$,,;
$LIBS .= " -L$gcclibdir -lgcc";
print STDERR qq
{
#
### Non-gcc compiler, and gcc is present.
### Adding -lgcc as a dependency: your OpenGL libraries may be gcc-compiled.
### Use NO_LGCC command-line option to disable this.
#
};
}
}
}
}
# Check for gcc version 3.2.3 and turn off OPTIMIZE to work
# around compiler bug reported via cpan testers reports
if ( defined( $Config{gccversion} ) and $Config{gccversion} =~ /^3\.2\.3 / ) {
$OPTS = '-O0'; # turn off optimization for gcc 3.2.3
}
clean_incs( $INCS );
clean_libs( $LIBS );
# This is the final build configuration
my $build_config =
{
'NAME' => 'Acme::MITHALDU::BleedingOpenGL',
'VERSION_FROM'=> 'BleedingOpenGL.pm',
ABSTRACT => 'bleeding edge OpenGL experiments - you WILL get cut',
'PM' =>
{
'BleedingOpenGL.pm' => '$(INST_LIBDIR)/BleedingOpenGL.pm',
'Config.pm' => '$(INST_LIBDIR)/BleedingOpenGL/Config.pm'
},
'PREREQ_PM' => { 'Test::More' => 0, 'Import::Into' => 0, 'Try::Tiny' => 0 },
'AUTHOR' => "Chris Marshall ".'<chm at cpan dot org>',
'OBJECT' => '$(BASEEXT)$(OBJ_EXT) gl_util$(OBJ_EXT) pogl_const$(OBJ_EXT) pogl_gl_top$(OBJ_EXT) pogl_glu$(OBJ_EXT) pogl_rpn$(OBJ_EXT) pogl_matrix$(OBJ_EXT) pogl_glut$(OBJ_EXT) pogl_gl_Accu_GetM$(OBJ_EXT) pogl_gl_GetP_Pass$(OBJ_EXT) pogl_gl_Mult_Pro...
'XSPROTOARG' => '-noprototypes',
'DEFINE' => $DEFS,
'INC' => $INCS,
'LIBS' => $LIBS,
'dynamic_lib' => $DYNS,
'LDFROM' => '$(OBJECT) '.(defined($LDFROM)?$LDFROM:''),
'META_MERGE' => {
'meta-spec' => { version => 2 },
resources => {
homepage => 'https://github.com/wchristian/OpenGL.pm',
bugtracker => 'https://github.com/wchristian/OpenGL.pm/issues',
repository => {
type => 'git',
url => 'https://github.com/wchristian/OpenGL.pm.git',
web => 'https://github.com/wchristian/OpenGL.pm',
},
},
},
'EXE_FILES' => $EXES,
'OPTIMIZE' => $OPTS,
'clean' =>
{
FILES =>
"Config.pm ".
"utils/glversion.txt ".
"utils/glversion$Config{exe_ext} ".
"utils/glversion$Config{obj_ext}"
}
};
print "\nMakeMaker configuration:\n" if $verbose;
close(CONF) if (open(CONF,">Config.pm")); # Generate place-holder Config.pm
WriteMakefile( %$build_config ); # Generate the Makefile
WriteConfigPM( $build_config ); # Regenerate final Config.pm
if ($found_libs->{GLX} && $ENV{TERM} ne 'xterm')
{
print "\nThis configuration should be built under an X11 shell\n\n";
}
exit 0;
}
catch {
warn $_;
die "OS unsupported\n";
};
# test header files for extensions
sub cfile_text
{
my($filename) = @_;
# Use $Config{cpprun}, instead of $Config{cpp}. cpp is simply set to
# 'cpp' after Configure has run, which is not useful, since it lives
( run in 0.824 second using v1.01-cache-2.11-cpan-5a3173703d6 )