# # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # use strict; for my $path (@INC) { next if $path =~ m,/PerlGcc$,; # Skip our Config.pm, we want to load official one my $config = "$path/Config.pm"; # $path is an alias to @INC member, do not change it next unless -e $config; require $config; last; } my $obj = tied %Config::Config; # Take reference to the underlying Config::Config hash %$obj = %Config::Config; # Some Config::Config values are computed. This expands whole hash and stores $obj->{cc} = 'gcc'; $obj->{ccname} = 'gcc'; $obj->{ld} = 'gcc'; $obj->{ccversion} = 'GNU gcc'; $obj->{d_attribut} = 'define'; $obj->{i_sunmath} = 'undef'; $obj->{cpprun} =~ s/^cc/gcc/; $obj->{cppstdin} =~ s/^cc/gcc/; $obj->{cccdlflags} =~ s/(^|\s)-KPIC($|\s)/$1-fPIC$2/; $obj->{optimize} =~ s/(^|\s)-xO\d+($|\s)/$1-O2 $2/; $obj->{optimize} =~ s/(?:^|\s)-xspace(?:$|\s)//; $obj->{optimize} =~ s/(?:^|\s)-xildoff(?:$|\s)//; $obj->{optimize} .= ' -fno-strict-aliasing'; $obj->{lddlflags} .= ' -fPIC'; $obj->{lddlflags} =~ s/(^|\s)-G($|\s)/$1-shared$2/; $obj->{ldflags} .= ' -fPIC'; for (keys(%$obj)) { next unless m/^config_arg/; $obj->{$_} =~ s/-Dcc=cc/-Dcc=gcc/; $obj->{$_} =~ s/-Doptimize=-xO\d+/-Doptimize=-O2/; } 1;