56
56
print " \n run as `perl Makefile.PL help` to show user options\n " ;
57
57
}
58
58
59
- our $verbose = 0;
60
- # Get debugging flags
61
- if ( grep { if (m / ^verbose/ i ) { $verbose ++; 1; } else { 0; } } @ARGV ) {
62
- @ARGV = grep { !m / ^verbose/ i } @ARGV ;
63
- }
59
+ our $verbose = grep m / ^verbose/ i , @ARGV ; # Get debugging flags
64
60
print " \$ verbose set to $verbose " . ($verbose ? " " : " - enable by running as `perl Makefile.PL verbose`" );
65
61
print " \n\n " ;
66
62
@@ -74,7 +70,7 @@ our $IS_W32API = ($IS_CYGWIN && grep { m/^interface=(W32API|WGL)/i } @ARGV );
74
70
print " Build platform \$ IS_W32API==$IS_W32API \n " if $IS_W32API and $verbose ;
75
71
76
72
our $INCS ;
77
- our $NO_LGCC = grep /^NO_LGCC$/ , @ARGV ; @ARGV = grep !/^NO_LGCC $/ , @ARGV ;
73
+ our $NO_LGCC = grep /^NO_LGCC$/ , @ARGV ;
78
74
79
75
my $prepare_success = eval {
80
76
# Look for available libs
@@ -143,9 +139,7 @@ my $build_config =
143
139
!defined ($OPTS ) ? () : (OPTIMIZE => $OPTS ),
144
140
};
145
141
146
- print " MakeMaker configuration:\n DEFINE=$DEFS \n INC=$INCS \n LIBS=$LIBS \n\n " if $verbose ;
147
-
148
- close (CONF) if (open (CONF," >" , " lib/OpenGL/Config.pm" )); # empty Config.pm
142
+ WriteConfigPM( $build_config ); # generate final Config.pm
149
143
WriteMakefile(
150
144
NAME => ' OpenGL' ,
151
145
VERSION_FROM => ' lib/OpenGL.pm' ,
@@ -191,7 +185,6 @@ WriteMakefile(
191
185
%$build_config ,
192
186
INC => $INCS . ' -I' .curdir(),
193
187
); # Generate the Makefile
194
- WriteConfigPM( $build_config ); # Regenerate final Config.pm
195
188
196
189
if ($found_libs -> {GLX } && $ENV {TERM } !~ / ^xterm/ ) {
197
190
print " \n This configuration should be built under an X11 shell\n\n " ;
@@ -476,8 +469,6 @@ sub get_interface_lib {
476
469
if @interface_opts > 1;
477
470
($interface_lib ) = @interface_opts ;
478
471
print " User set interface to $interface_lib \n " if $verbose && !$fallback ;
479
- # Strip out interface args
480
- @$argv_ref = grep { !m / ^interface=/ i } @$argv_ref ;
481
472
return $interface_lib ;
482
473
}
483
474
# Otherwise use available defaults
@@ -650,8 +641,8 @@ sub get_defines {
650
641
sub WriteConfigPM
651
642
{
652
643
my ($config ) = @_ ;
653
- die " Unable to write to Config.pm\n " if ( !open (CONFIGPM , " >" , " lib/OpenGL/Config.pm" )) ;
654
- print CONFIGPM q
644
+ die " Unable to write to Config.pm\n " if !open my $fh , " >" , " lib/OpenGL/Config.pm" ;
645
+ print $fh q
655
646
{
656
647
# This is the Perl OpenGL build configuration file.
657
648
# It contains the final OpenGL build arguments from
@@ -664,11 +655,10 @@ sub WriteConfigPM
664
655
require Data::Dumper;
665
656
# Ensure deterministic output
666
657
{ no warnings; $Data::Dumper::Sortkeys = 1; }
667
- print CONFIGPM Data::Dumper-> Dump( [$config ], [qw( OpenGL::Config) ] );
668
- print CONFIGPM qq
658
+ print $fh Data::Dumper-> Dump( [$config ], [qw( OpenGL::Config) ] );
659
+ print $fh qq
669
660
{
670
661
1;
671
662
__END__
672
663
};
673
- close(CONFIGPM);
674
664
}
0 commit comments