Alt-ExtUtils-PkgConfig-PLICEASE

 view release on metacpan or  search on metacpan

lib/ExtUtils/PkgConfig.pm  view on Meta::CPAN


sub modversion
{
  my(undef, $modulename) = @_;
  my $package = _find($modulename);
  defined $package ? $package->version : undef;
}

sub cflags
{
  my(undef, $modulename) = @_;
  my $package = _find($modulename);
  defined $package ? $package->cflags : undef;
}

sub libs
{
  my(undef, $modulename) = @_;
  my $package = _find($modulename);
  defined $package ? $package->libs : undef;
}

sub static_libs
{
  my(undef, $modulename) = @_;
  my $package = _find($modulename);
  defined $package ? $package->libs_static : undef;
}

sub _compare_version
{
  PkgConfig::LibPkgConf::Util::compare_version(@_);
}

sub atleast_version
{
  my(undef, $modulename, $version) = @_;
  my $package = _find($modulename);
  $package && (_compare_version($version, $package->version) <= 0 )
  ? 1 : undef;
}

sub exact_version
{
  my(undef, $modulename, $version) = @_;
  my $package = _find($modulename);
  $package && (_compare_version($version, $package->version) == 0 )
  ? 1 : undef;
}

sub max_version
{
  my(undef, $modulename, $version) = @_;
  my $package = _find($modulename);
  $package && (_compare_version($version, $package->version) >= 0 )
  ? 1 : undef;
}

sub _escape
{
  my($fragment) = "$_[0]";
  $fragment =~ s/(\s)/\\$1/g;
  $fragment;
}

sub cflags_only_I
{
  my(undef, $modulename) = @_;
  my $package = _find($modulename);
  $package ? join(' ', map { _escape $_ } grep { $_->type eq 'I' } $package->list_cflags) . ' ' : undef;
}

sub cflags_only_other
{
  my(undef, $modulename) = @_;
  my $package = _find($modulename);
  $package ? join(' ', map { _escape $_ } grep { $_->type ne 'I' } $package->list_cflags) . ' ' : undef;
}

sub libs_only_L
{
  my(undef, $modulename) = @_;
  my $package = _find($modulename);
  $package ? join(' ', map { _escape $_ } grep { $_->type eq 'L' } $package->list_libs) . ' ' : undef;
}

sub libs_only_l
{
  my(undef, $modulename) = @_;
  my $package = _find($modulename);
  $package ? join(' ', map { _escape $_ } grep { $_->type eq 'l' } $package->list_libs) . ' ' : undef;
}

sub libs_only_other
{
  my(undef, $modulename) = @_;
  my $package = _find($modulename);
  $package ? join(' ', map { _escape $_ } grep { $_->type ne 'L' && $_->type ne 'l' } $package->list_libs) . ' ' : undef;
}

sub variable
{
  my(undef, $modulename, $key) = @_;
  my $package = _find($modulename);
  my $value;
  $value = $package->variable($key) if $package;
  $value;
}

# the "create_version_macros" and "write_version_macros" and the documentation
# below are distributed under this license:
#
# Copyright (c) 2003-2004, 2012-2013 by the gtk2-perl team (see the file
# AUTHORS)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU



( run in 1.452 second using v1.01-cache-2.11-cpan-b16cb0d3907 )