Skip to content

Commit

Permalink
Solaris related fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kmx committed Jun 1, 2011
1 parent 1e2151c commit d99a8ab
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions inc/My/Builder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ sub build_binaries {
$cxxflags .= ' -arch i386' if $Config{ccflags} =~ /-arch i386/;
$cxxflags .= ' -arch ppc' if $Config{ccflags} =~ /-arch ppc/;

### workaround for http://www.cpantesters.org/cpan/report/16e1fb62-8bc3-11e0-a7f7-6524785ebe45
#On solaris, some tools like 'ar' are not in the default PATH, but in /usr/???/bin
my $ar;
if ($^O eq 'solaris' && system('ar -V') < 0) {
for (qw[/usr/ccs/bin /usr/xpg4/bin /usr/sfw/bin /usr/xpg6/bin /usr/gnu/bin /opt/gnu/bin /usr/bin]) {
if (-x "$_/ar") {
$ar = "AR=$_/ar";
last;
}
}
}

print "Gonna read version info from $srcdir/Common/b2Settings.cpp\n";
open(DAT, "$srcdir/Common/b2Settings.cpp") || die;
my @raw=<DAT>;
Expand All @@ -189,6 +201,7 @@ sub build_binaries {
chdir $srcdir;
my @cmd = ($self->_get_make, '-f', $makefile, "PREFIX=$prefixdir", 'install');
push @cmd, "CXXFLAGS=$cxxflags" if $cxxflags;
push @cmd, "AR=$ar" if $ar;
#push @cmd, "CXX=g++"; ### the default in makefile.unix is 'c++' - here you can override it
printf("(cmd: %s)\n", join(' ', @cmd));
$self->do_system(@cmd) or die "###ERROR### [$?] during make ... ";
Expand Down

0 comments on commit d99a8ab

Please sign in to comment.