Print this page
3900 illumos will not build against gcc compiled perl

*** 19,34 **** # CDDL HEADER END # # # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # ! require 5.8.4; use strict; use warnings; use ExtUtils::MakeMaker; # # Compare OS versions. # sub cmp_os_ver --- 19,36 ---- # CDDL HEADER END # # # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + # Copyright (c) 2013 Racktop Systems. # ! require 5.0010; use strict; use warnings; use ExtUtils::MakeMaker; + use Config; # # Compare OS versions. # sub cmp_os_ver
*** 47,59 **** my $rel = qx{uname -r}; chomp($rel); my $arch = qx{uname -p}; chomp($arch); my $pver = sprintf('%vd', $^V); # Figure out the appropriate Config.pm. Use an older version if necessary. ! my $perlarch = ($arch eq "sparc") ? "sun4-solaris-64int":"i86pc-solaris-64int"; ! ! my $configpm = "/usr/perl5/$pver/lib/$perlarch/Config.pm"; if (! -f $configpm) { my $p = "config/$pver"; my $dh; opendir($dh, $p) || die("Can't read directory $_: $!\n"); my $old_rel = (sort(cmp_os_ver --- 49,59 ---- my $rel = qx{uname -r}; chomp($rel); my $arch = qx{uname -p}; chomp($arch); my $pver = sprintf('%vd', $^V); # Figure out the appropriate Config.pm. Use an older version if necessary. ! my $configpm = $Config{'archlibexp'} . "/Config.pm"; if (! -f $configpm) { my $p = "config/$pver"; my $dh; opendir($dh, $p) || die("Can't read directory $_: $!\n"); my $old_rel = (sort(cmp_os_ver
*** 81,90 **** --- 81,125 ---- close CONFIGPM; close CONFIGPM_OUT; $configpm = "Config.pm"; } + # Figure out the appropriate Config_heavy.pl. Use an older version if necessary. + my $configpl = $Config{'archlibexp'} . "/Config_heavy.pl"; + if (! -f $configpl) { + my $p = "config/$pver"; + my $dh; + opendir($dh, $p) || die("Can't read directory $_: $!\n"); + my $old_rel = (sort(cmp_os_ver + grep(-d "$p/$_" && $_ =~ /^\d[\d.]+\d$/, readdir($dh))))[-1]; + closedir($dh); + if (defined($old_rel)) { + print(STDERR "Warning: No config file for OS version $rel, " . + "using $old_rel file\n"); + $rel = $old_rel; + $configpl = "config/$pver/$rel/$arch/Config_heavy.pl"; + } else { + die("Unsupported version of Perl/OS/Architecture " . + "$pver/$rel/$arch\n"); + } + } else { + open CONFIGPL, "<", $configpl or die $!; + open CONFIGPL_OUT, ">", "Config_heavy.pl" or die $!; + while(<CONFIGPL>) { + if (/^cccdlflags=/) { + print CONFIGPL_OUT "cccdlflags='-fPIC'\n"; + } elsif (/^optimize=/) { + print CONFIGPL_OUT "optimize='-O2 -fno-strict-aliasing'\n"; + } else { + print CONFIGPL_OUT $_; + } + } + close CONFIGPL; + close CONFIGPL_OUT; + $configpl = "Config_heavy.pl"; + } + our %man1pods; # Only install the pods for onn-ON builds. if (! exists($ENV{CODEMGR_WS}) && ! exists($ENV{ENVCPPFLAGS1})) { $man1pods{'pod/perlgcc.pod'} = '$(INST_MAN1DIR)/perlgcc.$(MAN1EXT)'; }
*** 92,101 **** WriteMakefile( NAME => 'Sun::Solaris::PerlGcc', VERSION_FROM => 'perlgcc.PL', PL_FILES => { 'perlgcc.PL' => 'perlgcc' }, EXE_FILES => [ 'perlgcc' ], ! PM => { $configpm => '$(INST_LIBDIR)/PerlGcc/Config.pm' }, MAN1PODS => \%man1pods, MAN3PODS => { }, # Stop autopodification. clean => { FILES => 'perlgcc' }, ); --- 127,137 ---- WriteMakefile( NAME => 'Sun::Solaris::PerlGcc', VERSION_FROM => 'perlgcc.PL', PL_FILES => { 'perlgcc.PL' => 'perlgcc' }, EXE_FILES => [ 'perlgcc' ], ! PM => { $configpm => '$(INST_LIBDIR)/PerlGcc/Config.pm', ! $configpl => '$(INST_LIBDIR)/PerlGcc/Config_heavy.pl' }, MAN1PODS => \%man1pods, MAN3PODS => { }, # Stop autopodification. clean => { FILES => 'perlgcc' }, );