From: Charles McGarvey Date: Fri, 18 Jan 2013 05:53:56 +0000 (-0700) Subject: use cbuilder for cc and dlext X-Git-Tag: v0.03~4 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=23f5d71553692b5d53978eedeb8a7323a14ba988;p=chaz%2Fp5-Alien-ZMQ use cbuilder for cc and dlext --- diff --git a/inc/My/Build.pm b/inc/My/Build.pm index 8c7d987..33bfc2b 100644 --- a/inc/My/Build.pm +++ b/inc/My/Build.pm @@ -65,6 +65,7 @@ sub ACTION_code { sub probe_zeromq { my $self = shift; my $cb = $self->cbuilder; + my %config = $cb->get_config; my $src = "test-$$.c"; open my $SRC, ">$src"; @@ -125,13 +126,12 @@ END my ($inc_version, $lib_version) = $out =~ /(\d\.\d\.\d) (\d\.\d\.\d)/; # query the compiler for include and library search paths - my $cc = $ENV{CC} || "cc"; push @lib_search, map { my $path = $_; $path =~ s/^.+ =?//; $path =~ s/\n.*$//; -d $path ? realpath($path) : (); - } split /:/, `$cc -print-search-dirs`; + } split /:/, `$config{cc} -print-search-dirs`; push @inc_search, map { my $path = $_; $path =~ s/lib(32|64)?$/include/; @@ -140,11 +140,7 @@ END # search for the header and library files my ($inc_dir) = grep { -f catfile($_, "zmq.h") } @inc_search; - my ($lib_dir) = grep { - -f catfile($_, "libzmq.so") || - -f catfile($_, "libzmq.dylib") || - -f catfile($_, "libzmq.dll") - } @lib_search; + my ($lib_dir) = grep { -f catfile($_, $cb->lib_file("libzmq")) } @lib_search; ( inc_version => $inc_version,