1 eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}'
2 & eval 'exec perl -w -S $0 $argv:q'
4 # ********************************************************************
5 # ace_install_pkgconfig.pl - Creates *.pc files for pkg-config in the
6 # installed location, based on the *.pc.in
7 # files from the source tree, with @foo@
8 # variables replaced with their values.
9 # Called from the MPC-generated makefiles.
10 # ********************************************************************
15 my ($prefix, $libdir, $libs, $destdir, $version, %custom);
16 GetOptions
('prefix=s' => \
$prefix, 'libdir=s' => \
$libdir, 'libs=s' => \
$libs,
17 'destdir=s' => \
$destdir,
18 'version=s' => \
$version, 'custom=s' => \
%custom);
20 my %subs = ('LIBS' => $libs, 'VERSION' => $version, 'exec_prefix' => $prefix,
21 'prefix' => $prefix, 'includedir' => "$prefix/include",
22 'libdir' => "$prefix/$libdir");
24 for my $k (keys %custom) {
25 $subs{$k} = $custom{$k};
28 my $pcdir = "${destdir}$prefix/$libdir/pkgconfig";
29 if (scalar @ARGV && ! -d
$pcdir) {
33 for my $file (@ARGV) {
34 open IN
, $file or die $file . ": $!";
37 open OUT
, ">$pcdir/$pcfile";
39 s/@(\w+)@/exists $subs{$1} ? $subs{$1} : $&/ge;