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

Commit 5b166e9

Browse files
committedSep 27, 2016
install freeglut to auto, not sitebin; ignore when found in sitebin
This prevents the freeglut we install from interfering with other versions of the library on the system, and prevents the freeglut from OpenGL.pm to interfere with ours.
1 parent 954f4e3 commit 5b166e9

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed
 

‎Makefile.PL

+15-4
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,15 @@ if ($IS_W32API || (($^O eq 'MSWin32') && !$IS_CYGWIN)) # Win32
449449
#
450450
## $EXES = ['FreeGLUT/freeglut.dll'];
451451
{
452-
system $^X , qw[-MExtUtils::Command -e mkpath --], qw[blib/bin];
453-
system $^X , qw[-MExtUtils::Command -e cp --], qw[FreeGLUT/freeglut.dll blib/bin/freeglut.dll];
452+
system $^X , qw[-MExtUtils::Command -e mkpath --], qw[blib/arch/auto/OpenGL];
453+
system $^X , qw[-MExtUtils::Command -e cp --], qw[FreeGLUT/freeglut.dll blib/arch/auto/OpenGL/freeglut.dll];
454+
my @other_installs = grep { -e "$_\\freeglut.dll" } split /;/, $ENV{PATH};
455+
if(@other_installs) {
456+
print "\n" ;
457+
print "XXX Other freeglut.dll installed in $_\n" for @other_installs;
458+
print "Please verify whether the other found dll(s) are from older OpenGL.pm installs, and delete them if so!\n\n\n";
459+
sleep 2;
460+
}
454461
}
455462

456463
}
@@ -698,6 +705,10 @@ sub get_libs
698705
my $lib = $libs->{$key};
699706
next if (!-e "$path/$lib");
700707
$lib =~ s/\.dll$//i;
708+
if ( $lib eq "freeglut" ) {
709+
my @p = split m@[/\\]@, $Config{installsitebin};
710+
next if $path eq join "/", @p or $path eq join "\\", @p;
711+
}
701712
# print " $key: $lib\n";
702713
$found->{$key} = $lib;
703714
last;
@@ -707,7 +718,7 @@ sub get_libs
707718
# Install FreeGLUT if not found
708719
if (!$found->{FREEGLUT32} and !$IS_STRAWBERRY)
709720
{
710-
my $dll_dir = $Config{installsitebin};
721+
my $dll_dir = "utils";
711722

712723
my $exec;
713724
if ($IS_W32API)
@@ -860,7 +871,7 @@ sub get_extensions
860871
print "glversion: $exec\n" if ($verbose);
861872
my $stat = `$exec`;
862873
print "\n$stat\n\n" if ($verbose);
863-
874+
unlink "utils/freeglut.dll" or die "could not remove temporary freeglut: $!" if -f "utils/freeglut.dll";
864875

865876
# Parse glversion.txt file
866877
if ( !defined(open(GLDATA,$glv_file)) ) {

0 commit comments

Comments
 (0)
This repository has been archived.