Skip to content
Newer
Older
100644 30 lines (24 sloc) 608 Bytes
6cdb886 @sekimura added embed_util.pl to get perl_LIBS and perl_LDFLAGS from ExtUtils:E…
authored Feb 27, 2010
1 use strict;
2 use warnings;
3
4 use ExtUtils::Embed;
5 use Getopt::Long qw(:config bundling);
6
7 GetOptions(
8 'libs' => sub { cmd_libs() },
9 'ldflags' => sub { cmd_ldflags() },
10 );
11
12 sub cmd_ldflags {
13 my ($ldflags, undef) = _parse_ldopts();
14 print $ldflags;
15 }
16
17 sub cmd_libs {
18 my (undef, $libs) = _parse_ldopts();
19 print $libs;
20 }
21
22 sub _parse_ldopts {
23 my $ldopts = ExtUtils::Embed::ldopts();
24 chomp $ldopts;
25 my @items = split(/\s+/, $ldopts);
26 my $ldflags = join(' ', grep {$_ !~ /^-l/} @items);
27 my $libs = join(' ', grep {$_ =~ /^-l/} @items);
28 return ($ldflags, $libs);
29 }
Something went wrong with that request. Please try again.