… | |
… | |
1171 | |
1171 | |
1172 | { |
1172 | { |
1173 | print "generating $PREFIX.ccopts... " |
1173 | print "generating $PREFIX.ccopts... " |
1174 | if $VERBOSE >= 1; |
1174 | if $VERBOSE >= 1; |
1175 | |
1175 | |
1176 | $ccopts = "$Config{ccflags} $Config{optimize} $Config{cppflags} -I\"$Config{archlibexp}/CORE\""; |
1176 | $ccopts = "$Config{ccflags} $Config{optimize} $Config{cppflags} -I$Config{archlibexp}/CORE"; |
1177 | $ccopts =~ s/([\(\)])/\\$1/g; |
1177 | $ccopts =~ s/([\(\)])/\\$1/g; |
1178 | |
1178 | |
1179 | open my $fh, ">$PREFIX.ccopts" |
1179 | open my $fh, ">$PREFIX.ccopts" |
1180 | or die "$PREFIX.ccopts: $!"; |
1180 | or die "$PREFIX.ccopts: $!"; |
1181 | print $fh $ccopts; |
1181 | print $fh $ccopts; |
… | |
… | |
1192 | $ldopts = $STATIC ? "-static " : ""; |
1192 | $ldopts = $STATIC ? "-static " : ""; |
1193 | |
1193 | |
1194 | $ldopts .= "$Config{ccdlflags} $Config{ldflags} @libs $Config{archlibexp}/CORE/$Config{libperl} $Config{perllibs}"; |
1194 | $ldopts .= "$Config{ccdlflags} $Config{ldflags} @libs $Config{archlibexp}/CORE/$Config{libperl} $Config{perllibs}"; |
1195 | |
1195 | |
1196 | my %seen; |
1196 | my %seen; |
1197 | $ldopts .= " $_" for reverse grep !$seen{$_}++, reverse ($extralibs =~ /(\S+)/g); |
1197 | $ldopts .= " $_" for reverse grep !$seen{$_}++, reverse +($extralibs =~ /(\S+)/g); |
1198 | |
1198 | |
1199 | for (@staticlibs) { |
1199 | for (@staticlibs) { |
1200 | $ldopts =~ s/(^|\s) (-l\Q$_\E) ($|\s)/$1-Wl,-Bstatic $2 -Wl,-Bdynamic$3/gx; |
1200 | $ldopts =~ s/(^|\s) (-l\Q$_\E) ($|\s)/$1-Wl,-Bstatic $2 -Wl,-Bdynamic$3/gx; |
1201 | } |
1201 | } |
1202 | |
1202 | |