1ExtUtils::PkgConfig(3)User Contributed Perl DocumentationExtUtils::PkgConfig(3)
2
3
4

NAME

6       ExtUtils::PkgConfig - simplistic interface to pkg-config
7

SYNOPSIS

9        use ExtUtils::PkgConfig;
10
11        $package = 'gtk+-2.0';
12
13        %pkg_info = ExtUtils::PkgConfig->find ($package);
14        print "modversion:  $pkg_info{modversion}\n";
15        print "cflags:      $pkg_info{cflags}\n";
16        print "libs:        $pkg_info{libs}\n";
17
18        $modversion = ExtUtils::PkgConfig->modversion($package);
19
20        $libs = ExtUtils::PkgConfig->libs($package);
21
22        $cflags = ExtUtils::PkgConfig->cflags($package);
23
24        $cflags_only_I = ExtUtils::PkgConfig->cflags_only_I($package);
25
26        $cflags_only_other = ExtUtils::PkgConfig->cflags_only_other($package);
27
28        $libs_only_L = ExtUtils::PkgConfig->libs_only_L($package);
29
30        $libs_only_l = ExtUtils::PkgConfig->libs_only_l($package);
31
32        $libs_only_other = ExtUtils::PkgConfig->libs_only_other($package);
33
34        $static_libs = ExtUtils::PkgConfig->static_libs($package);
35
36        $var_value = ExtUtils::PkgConfig->variable($package, $var);
37
38        if (ExtUtils::PkgConfig->atleast_version($package,$version)) {
39           ...
40        }
41
42        if (ExtUtils::PkgConfig->exact_version($package,$version)) {
43           ...
44        }
45
46        if (ExtUtils::PkgConfig->max_version($package,$version)) {
47           ...
48        }
49

DESCRIPTION

51       The pkg-config program retrieves information about installed libraries,
52       usually for the purposes of compiling against and linking to them.
53
54       ExtUtils::PkgConfig is a very simplistic interface to this utility,
55       intended for use in the Makefile.PL of perl extensions which bind
56       libraries that pkg-config knows.  It is really just boilerplate code
57       that you would've written yourself.
58
59   USAGE
60       HASH = ExtUtils::PkgConfig->find (STRING, [STRING, ...])
61           Call pkg-config on the library specified by STRING (you'll have to
62           know what to use here).  The returned HASH contains the modversion,
63           cflags, and libs values under keys with those names. If multiple
64           STRINGS are passed they are attempted in the order they are given
65           till a working package is found.
66
67           If pkg-config fails to find a working STRING, this function croaks
68           with a message intended to be helpful to whomever is attempting to
69           compile your package.
70
71           For example:
72
73             *** can not find package bad1
74             *** check that it is properly installed and available
75             *** in PKG_CONFIG_PATH
76
77           or
78
79             *** can't find cflags for gtk+-2.0
80             *** is it properly installed and available in PKG_CONFIG_PATH?
81
82       STRING = ExtUtils::PkgConfig->create_version_macros (PACKAGE, STEM)
83           Create a set of version macros with the prefix STEM for the library
84           specified by PACKAGE.  The result is returned.
85
86           Example input would be "gtk+-2.0" for PACKAGE and "GTK" for STEM.
87
88       ExtUtils::PkgConfig->write_version_macros (FILE, PACKAGE, STEM,
89       [PACKAGE, STEM, ...])
90           Create one or more sets of version macros for the libraries and
91           prefixes specified by the PACKAGE and STEM pairs and write them to
92           the file FILE.  If it doesn't exist, FILE will be created.  If it
93           does exist, it will be overwritten.
94

SEE ALSO

96       ExtUtils::PkgConfig was designed to work with ExtUtils::Depends for
97       compiling the various modules of the gtk2-perl project.
98
99         L<ExtUtils::Depends>
100
101         L<http://gtk2-perl.sourceforge.net/>
102
103       This module is really just an interface to the pkg-config utility
104       program.  http://www.freedesktop.org/Software/pkgconfig
105

AUTHORS

107       muppet <scott at asofyet dot org>.
108
110       Copyright 2003-2004 by muppet, Ross McFarland, and the gtk2-perl team
111
112       This library is free software; you can redistribute it and/or modify it
113       under the terms of the Lesser General Public License (LGPL).  For more
114       information, see http://www.fsf.org/licenses/lgpl.txt
115
116
117
118perl v5.12.0                      2008-10-19            ExtUtils::PkgConfig(3)
Impressum