GithubHelp home page GithubHelp logo

pkgconf's Introduction

pkgconf test

pkgconf is a program which helps to configure compiler and linker flags for development libraries. It is similar to pkg-config from freedesktop.org.

libpkgconf is a library which provides access to most of pkgconf's functionality, to allow other tooling such as compilers and IDEs to discover and use libraries configured by pkgconf.

using pkgconf with autotools

Implementations of pkg-config, such as pkgconf, are typically used with the PKG_CHECK_MODULES autoconf macro. As far as we know, pkgconf is compatible with all known variations of this macro. pkgconf detects at runtime whether or not it was started as 'pkg-config', and if so, attempts to set program options such that its behaviour is similar.

In terms of the autoconf macro, it is possible to specify the PKG_CONFIG environment variable, so that you can test pkgconf without overwriting your pkg-config binary. Some other build systems may also respect the PKG_CONFIG environment variable.

To set the environment variable on the bourne shell and clones (i.e. bash), you can run:

$ export PKG_CONFIG=/usr/bin/pkgconf

comparison of pkgconf and pkg-config dependency resolvers

pkgconf builds an acyclic directed dependency graph. This allows for the user to more conservatively link their binaries -- which may be helpful in some environments, such as when prelink(1) is being used. As a result of building a directed dependency graph designed for the specific problem domain provided by the user, more accurate dependencies can be determined.

Current release versions of pkg-config, on the other hand, build a database of all known pkg-config files on the system before attempting to resolve dependencies, which is a considerably slower and less efficient design. Efforts have been made recently to improve this behaviour.

As of the 1.1 series, pkgconf also fully implements support for Provides rules, while pkg-config does not. pkg-config only provides the --print-provides functionality as a stub. There are other intentional implementation differences in pkgconf's dependency resolver versus pkg-config's dependency resolver in terms of completeness and correctness, such as, for example, how Conflicts rules are processed.

linker flags optimization

As previously mentioned, pkgconf makes optimizations to the linker flags in both the case of static and shared linking in order to avoid overlinking binaries and also simplifies the CFLAGS and LIBS output of the pkgconf tool for improved readability.

This functionality depends on the pkg-config module properly declaring its dependency tree instead of using Libs and Cflags fields to directly link against other modules which have pkg-config metadata files installed.

Doing so is discouraged by the freedesktop tutorial anyway.

compatibility with pkg-config

I really hate that I have to have this section, I like being a nice person, but we unfortunately have to say this because otherwise we get passive-aggressive people who try to argue with us about what pkg-config compatibility means.

We do not provide bug-level compatibility with pkg-config.

What that means is, if you feel that there is a legitimate regression versus pkg-config, do let us know, but also make sure that the .pc files are valid and follow the rules of the pkg-config tutorial, as most likely fixing them to follow the specified rules will solve the problem.

Additionally, we do not consider pkgconf doing what you tell it to do, in cases for which pkg-config fails to do so, to be a bug.

If, for example, you use environment variables such as PKG_CONFIG_SYSTEM_[INCLUDE|LIBRARY]_PATH and then find yourself surprised that pkgconf is stripping -I and -L flags relating to those paths, it is not a pkgconf problem -- pkgconf is doing exactly what you told it to do.

We will reject bugs like this, and if someone insists on fixing such a non-bug, this constitutes a violation of our Code of Conduct, which may be addressed by banning from this repository.

debug output

Please use only the stable interfaces to query pkg-config. Do not screen-scrape the output from --debug: this is sent to stderr for a reason, it is not intended to be scraped. The --debug output is not a stable interface, and should never be depended on as a source of information. If you need a stable interface to query pkg-config which is not covered, please get in touch.

compiling pkgconf and libpkgconf on UNIX

pkgconf is basically compiled the same way any other autotools-based project is compiled:

$ ./configure
$ make
$ sudo make install

If you are installing pkgconf into a custom prefix, such as /opt/pkgconf, you will likely want to define the default system includedir and libdir for your toolchain. To do this, use the --with-system-includedir and --with-system-libdir configure flags like so:

$ ./configure \
     --prefix=/opt/pkgconf \
     --with-system-libdir=/lib:/usr/lib \
     --with-system-includedir=/usr/include
$ make
$ sudo make install

compiling pkgconf and libpkgconf with Meson (usually for Windows)

pkgconf is compiled using Meson on Windows. In theory, you could also use Meson to build on UNIX, but this is not recommended at this time as pkgconf is typically built much earlier than Meson.

$ meson setup build -Dtests=disabled
$ meson compile -C build
$ meson install -C build

There are a few defines such as SYSTEM_LIBDIR, PKGCONFIGDIR and SYSTEM_INCLUDEDIR. However, on Windows, the default PKGCONFIGDIR value is usually overridden at runtime based on path relocation.

pkg-config symlink

If you want pkgconf to be used when you invoke pkg-config, you should install a symlink for this. We do not do this for you, as we believe it is better for vendors to make this determination themselves.

$ ln -sf pkgconf /usr/bin/pkg-config

release tarballs

Release tarballs are available at https://distfiles.ariadne.space/pkgconf/. Please only use the tarballs from distfiles.ariadne.space.

contacts

You can report bugs at https://github.com/pkgconf/pkgconf/issues.

There is a mailing list at https://lists.sr.ht/~kaniini/pkgconf.

You can contact us via IRC at #pkgconf at irc.oftc.net.

pkgconf's People

Contributors

alonbl avatar andrewshadura avatar annacrombie avatar bapt avatar bdrewery avatar breavyn avatar conan-kudo avatar dankegel avatar dcbaker avatar dg0yt avatar dwfreed avatar eli-schwartz avatar grobian avatar haampie avatar jdhore avatar kaniini avatar lazka avatar maxinbjohn avatar mgorny avatar nacho avatar nbraud avatar olf0 avatar orbea avatar plicease avatar stoeckmann avatar thesamesam avatar tingping avatar tonytheodore avatar vapier avatar vbraun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pkgconf's Issues

different behavior of pkg-config

pkg-config --at-least-version 1.0 "cairo-xlib "

pkg-config will return 0 and pkgconf will return 1. which may break some pkg check

incompatibility ?

when building latest obconf, i get this

checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for OPENBOX... Package obrender-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `obrender-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'obrender-3.0' found
configure: error: Package requirements (obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2) were not met:

there is a file /lib/pkgconfig/obrender-3.5.pc but not obrender-3.0.pc

i assume pkgconf misses to look for higher "versioned" files ?

icedtea7-2.3.2 fails with pkgconf due to not finding xproto

(sorry for too specific example, i have just not seen it anywhere else, feel free to stab me if its upstream stupidness, anyway)

with pkgconfig xproto is found, with pkgconf (latest git) not.

pc file looks like that:

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=${prefix}/include
includex11dir=${prefix}/include/X11

Name: Xproto
Description: Xproto headers
Version: 7.0.23
Cflags: -I${includedir}

what configure is doing is (thats what i at least see in config.log):
$PKG_CONFIG --exists --print-errors "xproto"
returncode of that is 0

the whole configure check is below, maybe you can figure out what what is broken, can't see anything wrong there.

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XPROTO" >&5
$as_echo_n "checking for XPROTO... " >&6; }

if test -n "$XPROTO_CFLAGS"; then
    pkg_cv_XPROTO_CFLAGS="$XPROTO_CFLAGS"
 elif test -n "$PKG_CONFIG"; then
    if test -n "$PKG_CONFIG" && \
    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xproto\""; } >&5
  ($PKG_CONFIG --exists --print-errors "xproto") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
  pkg_cv_XPROTO_CFLAGS=`$PKG_CONFIG --cflags "xproto" 2>/dev/null`
              test "x$?" != "x0" && pkg_failed=yes
else
  pkg_failed=yes
fi
 else
    pkg_failed=untried
fi
if test -n "$XPROTO_LIBS"; then
    pkg_cv_XPROTO_LIBS="$XPROTO_LIBS"
 elif test -n "$PKG_CONFIG"; then
    if test -n "$PKG_CONFIG" && \
    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xproto\""; } >&5
  ($PKG_CONFIG --exists --print-errors "xproto") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
  pkg_cv_XPROTO_LIBS=`$PKG_CONFIG --libs "xproto" 2>/dev/null`
              test "x$?" != "x0" && pkg_failed=yes
else
  pkg_failed=yes
fi
 else
    pkg_failed=untried
fi



if test $pkg_failed = yes; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }

if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
        _pkg_short_errors_supported=yes
else
        _pkg_short_errors_supported=no
fi
        if test $_pkg_short_errors_supported = yes; then
            XPROTO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xproto" 2>&1`
        else
            XPROTO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xproto" 2>&1`
        fi
    # Put the nasty error message in config.log where it belongs
    echo "$XPROTO_PKG_ERRORS" >&5

    XPROTO_FOUND=no
elif test $pkg_failed = untried; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
    XPROTO_FOUND=no
else
    XPROTO_CFLAGS=$pkg_cv_XPROTO_CFLAGS
    XPROTO_LIBS=$pkg_cv_XPROTO_LIBS
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
    XPROTO_FOUND=yes
fi
if test "x${XPROTO_FOUND}" = xno
then
  as_fn_error $? "Could not find Xproto headers - \
  Try installing xorg-x11-proto-devel." "$LINENO" 5
fi

simplify pkg_find() and friends

03:28:47 @mgorny nenolod: submitted a pull request with registry support
03:29:21 @mgorny nenolod: but i think you should consider splitting up that sprintf() and stuff into separate function

postprocess --cflags and --libs output

hi,

right now, we print --cflags and --libs output blindly which results in duplicate cflags/libs entries. this is not a huge deal in practice, but we should clean this up.

i think we should do this in main.c by splitting each fragment and inserting it into a hashtable once it's been printed.

Misspelled FSF address

Seems you need to update wording on the license or the address of FSF.

[ 4s] pkgconf.x86_64: W: incorrect-fsf-address /usr/share/aclocal/pkg.m4
[ 4s] The Free Software Foundation address in this file seems to be outdated or
[ 4s] misspelled. Ask upstream to update the address, or if this is a license file,
[ 4s] possibly the entire file with a new copy available from the FSF.

add modularity to pkg_queue_walk()

currently, pkg_queue_walk() is monolithic -- adding new ways to crunch the pkg-config data in the frontend involves modifying the function.

something like the following would be better:

{
   pkg_t world = { ... };
   pkg_queue_compile(queue, &world);
   pkg_traverse(&world, ...);
}

build system depends on gmake

it would be a good plan to replace the build infrastructure with something much simpler. hell, automake would work if we had to go that way.

MinGW: no alloca.h

On Windows, the alloca() function seems to be declared in <malloc.h>. Also, the comment states that it works on NT only and always returns ENOSYS on 9x.

Quotes are not correctly handled in cflags

cat /usr/local/libdata/pkgconfig/xmlsec1-openssl.pc prefix=/usr/local

exec_prefix=${prefix}
libdir=${exec_prefix}/libincludedir=${prefix}/include

Name: xmlsec1-openssl
Version: 1.2.18
Description: XML Security Library implements XML Signature and XML Encryption standards
Requires: libxml-2.0 >= 2.7.4 libxslt >= 1.0.20
Cflags: -DXMLSEC_CRYPTO="openssl" -D__XMLSEC_FUNCTION__=FUNCTION -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_DL_LIBLTDL=1, -I${prefix}/include/xmlsec1 -I/usr/include -DXMLSEC_OPENSSL_098=1 -DXMLSEC_CRYPTO_OPENSSL=1
Libs: -L${exec_prefix}/lib -lxmlsec1-openssl -lxmlsec1 -lltdl -L/usr/lib -lcrypto

pkg-config --cflags xmlsec1-openssl

-I/usr/local/include/libxml2 -I/usr/local/include -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=FUNCTION -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_DL_LIBLTDL=1, -I/usr/local/include/xmlsec1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_CRYPTO_OPENSSL=1 Libs: -L/usr/local/lib -lxmlsec1-openssl -lxmlsec1 -lltdl -lcrypto

pkg-config --libs xmlsec1-openssl

-L/usr/local/lib -lxml2 -lxslt -lz -liconv -lm

As you can see from the above output the value: -DXMLSEC_CRYPTO="openssl" is not being escaped/matched correctly, this needs to have the quotes remain in tact so that the compiler gets the flag: -DXMLSEC_CRYPTO="openssl"

Compile failure due to FORTIFY_SOURCE

The unconditional use of -D_FORTIFY_SOURCE=2 can lead to compile failures on older systems. It is also unclear why this should be unconditionally turned on. I would recommend removing it from Makefile.in, if you want it you can always specify it via CFLAGS/CPPFLAGS.

Example output of a failed built on an Itanium machine:

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for strlcpy... no
checking for strlcat... no
checking for strndup... yes
checking whether to enable strict mode... (cached) no
checking how to run the C preprocessor... cpp
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tests/run.sh
config.status: creating config.h
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  main.c -o main.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  cache.c -o cache.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  pkg.c -o pkg.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  bsdstubs.c -o bsdstubs.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  getopt_long.c -o getopt_long.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  fragment.c -o fragment.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  argvsplit.c -o argvsplit.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  fileio.c -o fileio.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  tuple.c -o tuple.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  dependency.c -o dependency.o
gcc -c -g -O2 -DLIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -DINCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DPKG_DEFAULT_PATH=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib/pkgconfig:/home/buildbot/build/sage/iras-1/sage_git/build/local/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/include\" -DSYSTEM_LIBDIR=\"/home/buildbot/build/sage/iras-1/sage_git/build/local/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -I.  queue.c -o queue.o
gcc  -o pkgconf main.o cache.o pkg.o bsdstubs.o getopt_long.o fragment.o argvsplit.o fileio.o tuple.o dependency.o queue.o
cache.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
cache.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
cache.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:110: multiple definition of `fgets_unlocked'
main.o:/usr/include/bits/stdio2.h:110: first defined here
cache.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
cache.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
cache.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
cache.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
cache.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
cache.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
cache.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
cache.o: In function `pread':
/usr/include/bits/unistd.h:53: multiple definition of `pread'
main.o:/usr/include/bits/unistd.h:53: first defined here
cache.o: In function `pread64':
/usr/include/bits/unistd.h:73: multiple definition of `pread64'
main.o:/usr/include/bits/unistd.h:73: first defined here
cache.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
cache.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
cache.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
cache.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
cache.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
cache.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
cache.o: In function `getlogin_r':
/usr/include/bits/unistd.h:188: multiple definition of `getlogin_r'
main.o:/usr/include/bits/unistd.h:188: first defined here
cache.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
cache.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
pkg.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
pkg.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
pkg.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:110: multiple definition of `fgets_unlocked'
main.o:/usr/include/bits/stdio2.h:110: first defined here
pkg.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
pkg.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
pkg.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
pkg.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
pkg.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
pkg.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
pkg.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
pkg.o: In function `pread':
/usr/include/bits/unistd.h:53: multiple definition of `pread'
main.o:/usr/include/bits/unistd.h:53: first defined here
pkg.o: In function `pread64':
/usr/include/bits/unistd.h:73: multiple definition of `pread64'
main.o:/usr/include/bits/unistd.h:73: first defined here
pkg.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
pkg.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
pkg.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
pkg.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
pkg.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
pkg.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
pkg.o: In function `getlogin_r':
/usr/include/bits/unistd.h:188: multiple definition of `getlogin_r'
main.o:/usr/include/bits/unistd.h:188: first defined here
pkg.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
pkg.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
bsdstubs.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
bsdstubs.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
bsdstubs.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
bsdstubs.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
bsdstubs.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
bsdstubs.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
bsdstubs.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
bsdstubs.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
bsdstubs.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
bsdstubs.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
bsdstubs.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
bsdstubs.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
bsdstubs.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
bsdstubs.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
bsdstubs.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
bsdstubs.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
bsdstubs.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
getopt_long.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
getopt_long.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
getopt_long.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:110: multiple definition of `fgets_unlocked'
main.o:/usr/include/bits/stdio2.h:110: first defined here
getopt_long.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
getopt_long.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
getopt_long.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
getopt_long.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
getopt_long.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
getopt_long.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
getopt_long.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
getopt_long.o: In function `pread':
/usr/include/bits/unistd.h:53: multiple definition of `pread'
main.o:/usr/include/bits/unistd.h:53: first defined here
getopt_long.o: In function `pread64':
/usr/include/bits/unistd.h:73: multiple definition of `pread64'
main.o:/usr/include/bits/unistd.h:73: first defined here
getopt_long.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
getopt_long.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
getopt_long.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
getopt_long.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
getopt_long.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
getopt_long.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
getopt_long.o: In function `getlogin_r':
/usr/include/bits/unistd.h:188: multiple definition of `getlogin_r'
main.o:/usr/include/bits/unistd.h:188: first defined here
getopt_long.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
getopt_long.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
fragment.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
fragment.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
fragment.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:110: multiple definition of `fgets_unlocked'
main.o:/usr/include/bits/stdio2.h:110: first defined here
fragment.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
fragment.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
fragment.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
fragment.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
fragment.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
fragment.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
fragment.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
fragment.o: In function `pread':
/usr/include/bits/unistd.h:53: multiple definition of `pread'
main.o:/usr/include/bits/unistd.h:53: first defined here
fragment.o: In function `pread64':
/usr/include/bits/unistd.h:73: multiple definition of `pread64'
main.o:/usr/include/bits/unistd.h:73: first defined here
fragment.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
fragment.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
fragment.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
fragment.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
fragment.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
fragment.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
fragment.o: In function `getlogin_r':
/usr/include/bits/unistd.h:188: multiple definition of `getlogin_r'
main.o:/usr/include/bits/unistd.h:188: first defined here
fragment.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
fragment.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
argvsplit.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
argvsplit.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
argvsplit.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:110: multiple definition of `fgets_unlocked'
main.o:/usr/include/bits/stdio2.h:110: first defined here
argvsplit.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
argvsplit.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
argvsplit.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
argvsplit.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
argvsplit.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
argvsplit.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
argvsplit.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
argvsplit.o: In function `pread':
/usr/include/bits/unistd.h:53: multiple definition of `pread'
main.o:/usr/include/bits/unistd.h:53: first defined here
argvsplit.o: In function `pread64':
/usr/include/bits/unistd.h:73: multiple definition of `pread64'
main.o:/usr/include/bits/unistd.h:73: first defined here
argvsplit.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
argvsplit.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
argvsplit.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
argvsplit.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
argvsplit.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
argvsplit.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
argvsplit.o: In function `getlogin_r':
/usr/include/bits/unistd.h:188: multiple definition of `getlogin_r'
main.o:/usr/include/bits/unistd.h:188: first defined here
argvsplit.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
argvsplit.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
fileio.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
fileio.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
fileio.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:110: multiple definition of `fgets_unlocked'
main.o:/usr/include/bits/stdio2.h:110: first defined here
fileio.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
fileio.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
fileio.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
fileio.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
fileio.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
fileio.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
fileio.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
fileio.o: In function `pread':
/usr/include/bits/unistd.h:53: multiple definition of `pread'
main.o:/usr/include/bits/unistd.h:53: first defined here
fileio.o: In function `pread64':
/usr/include/bits/unistd.h:73: multiple definition of `pread64'
main.o:/usr/include/bits/unistd.h:73: first defined here
fileio.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
fileio.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
fileio.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
fileio.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
fileio.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
fileio.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
fileio.o: In function `getlogin_r':
/usr/include/bits/unistd.h:188: multiple definition of `getlogin_r'
main.o:/usr/include/bits/unistd.h:188: first defined here
fileio.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
fileio.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
tuple.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
tuple.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
tuple.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:110: multiple definition of `fgets_unlocked'
main.o:/usr/include/bits/stdio2.h:110: first defined here
tuple.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
tuple.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
tuple.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
tuple.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
tuple.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
tuple.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
tuple.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
tuple.o: In function `pread':
/usr/include/bits/unistd.h:53: multiple definition of `pread'
main.o:/usr/include/bits/unistd.h:53: first defined here
tuple.o: In function `pread64':
/usr/include/bits/unistd.h:73: multiple definition of `pread64'
main.o:/usr/include/bits/unistd.h:73: first defined here
tuple.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
tuple.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
tuple.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
tuple.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
tuple.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
tuple.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
tuple.o: In function `getlogin_r':
/usr/include/bits/unistd.h:188: multiple definition of `getlogin_r'
main.o:/usr/include/bits/unistd.h:188: first defined here
tuple.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
tuple.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
dependency.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
dependency.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
dependency.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:110: multiple definition of `fgets_unlocked'
main.o:/usr/include/bits/stdio2.h:110: first defined here
dependency.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
dependency.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
dependency.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
dependency.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
dependency.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
dependency.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
dependency.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
dependency.o: In function `pread':
/usr/include/bits/unistd.h:53: multiple definition of `pread'
main.o:/usr/include/bits/unistd.h:53: first defined here
dependency.o: In function `pread64':
/usr/include/bits/unistd.h:73: multiple definition of `pread64'
main.o:/usr/include/bits/unistd.h:73: first defined here
dependency.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
dependency.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
dependency.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
dependency.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
dependency.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
dependency.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
dependency.o: In function `getlogin_r':
/usr/include/bits/unistd.h:188: multiple definition of `getlogin_r'
main.o:/usr/include/bits/unistd.h:188: first defined here
dependency.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
dependency.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
queue.o: In function `gets':
/usr/include/bits/stdio2.h:80: multiple definition of `gets'
main.o:/usr/include/bits/stdio2.h:80: first defined here
queue.o: In function `fgets':
/usr/include/bits/stdio2.h:94: multiple definition of `fgets'
main.o:/usr/include/bits/stdio2.h:94: first defined here
queue.o: In function `fgets_unlocked':
/usr/include/bits/stdio2.h:110: multiple definition of `fgets_unlocked'
main.o:/usr/include/bits/stdio2.h:110: first defined here
queue.o: In function `realpath':
/usr/include/bits/stdlib.h:33: multiple definition of `realpath'
main.o:/usr/include/bits/stdlib.h:33: first defined here
queue.o: In function `ptsname_r':
/usr/include/bits/stdlib.h:49: multiple definition of `ptsname_r'
main.o:/usr/include/bits/stdlib.h:49: first defined here
queue.o: In function `wctomb':
/usr/include/bits/stdlib.h:64: multiple definition of `wctomb'
main.o:/usr/include/bits/stdlib.h:64: first defined here
queue.o: In function `mbstowcs':
/usr/include/bits/stdlib.h:89: multiple definition of `mbstowcs'
main.o:/usr/include/bits/stdlib.h:89: first defined here
queue.o: In function `wcstombs':
/usr/include/bits/stdlib.h:110: multiple definition of `wcstombs'
main.o:/usr/include/bits/stdlib.h:110: first defined here
queue.o: In function `stpncpy':
/usr/include/bits/string3.h:156: multiple definition of `stpncpy'
main.o:/usr/include/bits/string3.h:156: first defined here
queue.o: In function `read':
/usr/include/bits/unistd.h:31: multiple definition of `read'
main.o:/usr/include/bits/unistd.h:31: first defined here
queue.o: In function `pread':
/usr/include/bits/unistd.h:53: multiple definition of `pread'
main.o:/usr/include/bits/unistd.h:53: first defined here
queue.o: In function `pread64':
/usr/include/bits/unistd.h:73: multiple definition of `pread64'
main.o:/usr/include/bits/unistd.h:73: first defined here
queue.o: In function `readlink':
/usr/include/bits/unistd.h:96: multiple definition of `readlink'
main.o:/usr/include/bits/unistd.h:96: first defined here
queue.o: In function `getcwd':
/usr/include/bits/unistd.h:111: multiple definition of `getcwd'
main.o:/usr/include/bits/unistd.h:111: first defined here
queue.o: In function `getwd':
/usr/include/bits/unistd.h:126: multiple definition of `getwd'
main.o:/usr/include/bits/unistd.h:126: first defined here
queue.o: In function `confstr':
/usr/include/bits/unistd.h:140: multiple definition of `confstr'
main.o:/usr/include/bits/unistd.h:140: first defined here
queue.o: In function `getgroups':
/usr/include/bits/unistd.h:155: multiple definition of `getgroups'
main.o:/usr/include/bits/unistd.h:155: first defined here
queue.o: In function `ttyname_r':
/usr/include/bits/unistd.h:172: multiple definition of `ttyname_r'
main.o:/usr/include/bits/unistd.h:172: first defined here
queue.o: In function `getlogin_r':
/usr/include/bits/unistd.h:188: multiple definition of `getlogin_r'
main.o:/usr/include/bits/unistd.h:188: first defined here
queue.o: In function `gethostname':
/usr/include/bits/unistd.h:205: multiple definition of `gethostname'
main.o:/usr/include/bits/unistd.h:205: first defined here
queue.o: In function `getdomainname':
/usr/include/bits/unistd.h:223: multiple definition of `getdomainname'
main.o:/usr/include/bits/unistd.h:223: first defined here
collect2: error: ld returned 1 exit status

Special case handling for -framework on MacOSX fails in some cases

Testing pkgconf-0.9.3.

Qt builds fine, but woe unto you if two different packages use the same framework, and you ask for both of their --libs.

Happiily, adding the single line to tests/run.sh demonstrates the problem:

run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs framework-1 framework-2"
"-F/usr/lib -framework framework-1 -framework framework-2"

This fails with

!!! Test 73 failed.
!!! $ PKG_CONFIG_PATH='/Users/dank/src/yobuild-builder/unified/btmp/pkgconf-0.9.3/tests/lib1' ./pkgconf --libs framework-1 framework-2
!!! -F/usr/lib -framework -framework framework-2 -framework framework-1
!!! expected '-F/usr/lib -framework framework-1 -framework framework-2' in output

Fix output when there are no --cflags or --libs to report

When pkgconf parses a package for its --cflags or --libs and finds none, it returns nothing. In contrast, pkg-config [1] returns a single blank char. Packages, like rrdtool [2], assume this latter behavior and fail to configure with pkgconf.

Refs.
[1] http://pkgconfig.freedesktop.org/wiki/
[2] http://oss.oetiker.ch/rrdtool/

X-Gentoo-Bug: 431170
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=431170
Signed-of-by: Anthony G. Basile [email protected]

'Package foo was not found' when version doesn't match

$ PKG_CONFIG_PATH=tests/lib1 ./pkgconf --exists 'foo > 1.2.3'; echo $?
Package foo was not found in the pkg-config search path.
Perhaps you should add the directory containing `foo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'foo' found
1

The message is unclear here. foo.pc actually exists but it is too old. To compare:

$ PKG_CONFIG_PATH=tests/lib1 pkg-config --exists 'foo > 1.2.3'; echo $?
1
+ [OK]

--libs error with Qt on Mac OS X

I run into the following problem with pkgconf, when build gnuplot with Qt bindings on Mac OS X. The build process failed with pkgconf but not with pkgconfig.

I will be glad to help if you need more information or detail.

Here is the output of pkgconf:

    $ pkg-config --libs QtCore
    -F/myprefix/usr/lib/qt4 -framework QtCore
    $ pkg-config --libs QtGui
    QtGui -F/myprefix/usr/lib/qt4 -framework QtCore

And the output of pkgconfig:

    $ pkg-config --libs QtCore
    -F/myprefix/usr/lib/qt4 -framework QtCore
    $ pkg-config --libs QtGui
    -F/muprefix/usr/lib/qt4 -framework QtGui -F/myprefix/usr/lib/qt4 -framework QtCore

Here are the content of the two related .pc files:

    $ cat /myprefix/usr/lib/pkgconfig/QtCore.pc
    prefix=/myprefix/usr
    exec_prefix=${prefix}
    libdir=${prefix}/lib/qt4
    includedir=${prefix}/include/qt4/QtCore
    qt_config=lex yacc warn_on uic resources sdk rez release ReleaseBuild Release build_pass qt warn_on release incremental global_init_link_order lib_version_first plugin_with_soname absolute_library_soname link_prl def_files_disabled exceptions no_mocdepend release stl qt_framework x86_64 release shared dll largefile stl mmx 3dnow sse sse2 sse3 ssse3 sse4_1 sse4_2 x86_64 absolute_library_soname dylib create_prl link_prl depend_includepath QTDIR_build nostrip release ReleaseBuild Release build_pass qt warn_on depend_includepath qmake_cache target_qt debug_and_release hide_symbols lib_bundle qt_no_framework_direct_includes qt_framework explicitlib create_pc create_libtool explicitlib release ReleaseBuild Release build_pass objective_c x86_64 no_autoqmake moc thread shared dll
    moc_location=${prefix}/bin/moc
    uic_location=${prefix}/bin/uic
    rcc_location=${prefix}/bin/rcc
    lupdate_location=${prefix}/bin/lupdate
    lrelease_location=${prefix}/bin/lrelease

    Name: Qtcore
    Description: Qtcore Library
    Version: 4.8.4
    Libs: -F${libdir} -framework QtCore
    Libs.private: -F/myprefix/usr/lib/qt4 -L/myprefix/usr/lib/qt4  -lgthread-2.0 -lglib-2.0 -lintl -L/myprefix/usr/lib/qt4 -lz -lm -framework ApplicationServices -framework CoreFoundation -framework Security
    Cflags: -DQT_SHARED -I/myprefix/usr/include/qt4 -I${includedir}
    $ cat /myprefix/usr/lib/pkgconfig/QtGui.pc
    prefix=/myprefix/usr
    exec_prefix=${prefix}
    libdir=${prefix}/lib/qt4
    includedir=${prefix}/include/qt4/QtGui
    qt_config=lex yacc warn_on uic resources sdk rez release ReleaseBuild Release build_pass qt warn_on release incremental global_init_link_order lib_version_first plugin_with_soname absolute_library_soname link_prl def_files_disabled exceptions no_mocdepend release stl qt_framework x86_64 release shared dll largefile stl mmx 3dnow sse sse2 sse3 sse4_1 sse4_2 x86_64 absolute_library_soname dylib create_prl link_prl depend_includepath QTDIR_build nostrip release ReleaseBuild Release build_pass qt warn_on depend_includepath qmake_cache target_qt debug_and_release hide_symbols lib_bundle qt_no_framework_direct_includes qt_framework explicitlib create_pc create_libtool explicitlib release ReleaseBuild Release build_pass objective_c x86_64 no_autoqmake moc thread shared dll
    moc_location=/myprefix/usr/bin/moc
    uic_location=/myprefix/usr/bin/uic
    rcc_location=/myprefix/usr/bin/rcc
    lupdate_location=/myprefix/usr/bin/lupdate
    lrelease_location=/myprefix/usr/bin/lrelease

    Name: Qtgui
    Description: Qtgui Library
    Version: 4.8.4
    Libs: -F${libdir} -framework QtGui
    Libs.private: -F/myprefix/gentoo/usr/lib/qt4 -L/myprefix/usr/lib/qt4 -F/myprefix/usr/lib/qt4 -L/myprefix/usr/lib/qt4 -framework QtCore -F/myprefix/usr/lib/qt4 -lgthread-2.0 -lglib-2.0 -lintl -framework Carbon -lz -framework AppKit -lpng -lz
    Cflags: -DQT_SHARED -I/myprefix/usr/include/qt4 -I${includedir}
    Requires: QtCore

Provide real distfiles

I'm planning to add pkgconf on the FreeBSD ports and use it by default instead of pkg-config (longer plan :)) for that we will need real distfiles for releases (available through the download link) because we need to make sure we are building packages out the the same distfile which may keep having the same checksum which is not the case of tag distfile on github.

Thanks for your work.

regards,
Bapt

Order of libs with (mis)configured Libs.private

Hi,

This is similar to #33 and #34, though it only happens with a seemingly misconfigured *.pc file. I've stripped down the offending files to:

Name: GraphicsMagick
Requires: libxml-2.0
Libs: -lGraphicsMagick
Libs.private: -llzma -lxml2

Name: libxml-2.0
Requires: liblzma
Libs: -lxml2

Name: liblzma
Libs: -llzma

and the resulting outputs are:

pkgconf GraphicsMagick --libs-only-l --static
-lGraphicsMagick -llzma -lxml2

pkg-config GraphicsMagick --libs-only-l --static
-lGraphicsMagick -llzma -lxml2 -llzma

GraphicsMagick populates Libs.private instead of relying on the traversal of requirements and it's easy enough to fix there, but it would be good if pkgconf could handle this (from the previous issues, it sounds like this should work).

This happens on both current master branch and 0.9.2.

Handling of Requires.private

Sebastian Ramacher (@sebastinas) writes:

So there are two cases where pkgconf behavior is not consistent with
that from pkg-config:

  • It treats Requires.Private the same as Requires.private which
    pkg-config does not.
  • It errors out if a package given in Requires.private is missing
    although --static is not passed on the command line. pkg-config does
    not fail in that case.

IMHO these issues need to be fixed if pkgconf wants to provide
/usr/bin/pkg-config.

For more details, see Debian bug #734491.

issues with static linking

Hi,

I try to cross-compile gtk+ 2.x and want to link it statically.
$ ./host_x86_64-linux-gnu/usr/bin/pkgconf --static --libs x11 xext xrender
-lX11 -lxcb -lXau -lXext -lXrender -L/usr/lib -lpthread
$ ./host_x86_64-linux-gnu/usr/bin/pkgconf --static --libs xext xrender x11
-lXext -lX11 -lxcb -lXau -lXrender -L/usr/lib -lpthread
$ ./host_x86_64-linux-gnu/usr/bin/pkgconf --static --libs xrender xext x11
-lXrender -lX11 -lxcb -lXau -lXext -L/usr/lib -lpthread

$ grep private target_qemu-arm_glibc/usr/lib/pkgconfig/{xext,x11,xrender}.pc
target_qemu-arm_glibc/usr/lib/pkgconfig/xext.pc:Requires.private: x11
target_qemu-arm_glibc/usr/lib/pkgconfig/x11.pc:Requires.private: xcb >= 1.1.92
target_qemu-arm_glibc/usr/lib/pkgconfig/x11.pc:Libs.private: -lpthread
target_qemu-arm_glibc/usr/lib/pkgconfig/xrender.pc:Requires.private: x11

In the first case the configure check for Xext will fail, in the second case this would work, but Xrender test will fail. in the third case I believe Xext will fail again. so how to solve
this? The pc files seems to be correct. -lX11 must be the last library.

Any idea?

best regards
Waldemar

FreeBSD: no alloca.h

FreeBSD (including/importantly Gentoo/FreeBSD) has no alloca.h either (see issue #18) so pkgconf fails to compile there as well. Since alloca() is no longer used in pkgconf, it seems that this include can simply be dropped.

waf incompatibility

this one is real...

/bin/pkg-config glib-2.0 --cflags --libs
Package --cflags was not found in the pkg-config search path.
Perhaps you should add the directory containing `--cflags.pc'
to the PKG_CONFIG_PATH environment variable
No package '--cflags' found

this is xmms2 0.8
apparently pkgconf expects the -- params first, which seems to be incompatible to pkg-config

implement PKG_CONFIG_TOP_BUILD_DIR

PKG_CONFIG_TOP_BUILD_DIR is an esoteric feature added recently to pkg-config. some automake-based buildsystem out there might need it, so we should implement it.

API audit and cleanup

ensure API is cleaned up, no functions outside pkg_, no structs outside pkg_ namespace.

building on mingw

Really nice program. I've been looking for a pkg-config replacement that doesn't require glib.

Tried building the application using mingw and msys. Had trouble compiling. It couldn't find alloca needed in pkg.c. Also noticed there's some code in the program to check the registry on Windows. Is there any way to optionally avoid the code so that it doesn't have to run? Maybe a flag or environment variable could be set to use (or avoid the registry)? Some Windows users like myself prefer to run portable apps and avoid registry calls if possible. Don't know if it'll format properly, but am adding a patch below that fixes the alloca issue and a problem I had with the makefile's default definition of -DPKG_DEFAULT_PATH (which also prevented compilation). If no environment variable is found for PKG_CONFIG_LIBDIR, this will look for the .pc files in ..\lib\pkgconfig. So, if I place the program in the /usr/local/bin directory within msys, it looks for the pkgconfig files within the msys directory under \usr\local\lib\pkgconfig.

diff -Naurp src/nenolod-pkgconf-b408a62/pkg.c tmp/nenolod-pkgconf-b408a62/pkg.c
--- src/nenolod-pkgconf-b408a62/pkg.c   2012-05-07 05:04:41 -0400
+++ tmp/nenolod-pkgconf-b408a62/pkg.c   
@@ -279,6 +279,12 @@ pkg_find(const char *name, unsigned int
    const char *env_path;
    pkg_t *pkg = NULL;
    FILE *f;
+#ifdef _WIN32   
+   char namebuf[MAX_PATH];
+   int i;
+   int loop;
+   size_t cnt;
+#endif   
 
    /* name might actually be a filename. */
    if (str_has_suffix(name, PKG_CONFIG_EXT))
@@ -303,7 +309,27 @@ pkg_find(const char *name, unsigned int
 
    env_path = getenv("PKG_CONFIG_LIBDIR");
    if (env_path == NULL)
+#ifndef _WIN32      
        env_path = PKG_DEFAULT_PATH;
+#else
+      GetModuleFileName (NULL, namebuf, MAX_PATH);
+      loop = 0;
+      cnt = strlen (namebuf);
+      for (i = cnt - 1; i >= 0; i--)
+      {
+         if (namebuf[i] == '\\')
+         {
+            loop++;
+            if (loop >= 2)
+            {
+               namebuf[i] = '\0';
+               strcat (namebuf, "\\lib\\pkgconfig");
+               env_path = namebuf;
+               break;
+            }
+         }   
+      }   
+#endif   
 
    if (!(flags & PKGF_ENV_ONLY))
    {
diff -Naurp src/nenolod-pkgconf-b408a62/pkg.h tmp/nenolod-pkgconf-b408a62/pkg.h
--- src/nenolod-pkgconf-b408a62/pkg.h   2012-05-07 05:04:41 -0400
+++ tmp/nenolod-pkgconf-b408a62/pkg.h   
@@ -32,6 +32,9 @@
 #include <stdlib.h>
 #include <stdbool.h>
 #include <string.h>
+#ifdef _WIN32
+#include <malloc.h>
+#endif
 
 #ifndef BUFSIZ
 #define BUFSIZ 65535

pkgconf invoked as pkg-config

Hi,

The README states:

pkgconf detects at runtime whether or not it was started as 'pkg-config', and if so, attempts to set program options such that its behaviour is similar

though I can't see any difference when called either way. Was this something that has since been removed or will it only be apparent in edge cases?

Thanks,

Tony

--keep-system-cflags should be the default if c compiler does not share same prefix

Testing pkgconf-0.9.3.

I have pkgconf installed to /opt/foo/bin/pkgconf,
and the C compiler is in /usr/bin/gcc.
I have a library in /opt/foo/include/foo.h and /opt/foo/lib/libfoo.a,
and its .pc file says

prefix=/opt/foo
includedir=${prefix}/include
Cflags: -I${includedir}

In this situation, pkgconf --cflags never outputs -I/opt/foo/include

which is pretty annoying. I apply https://gist.github.com/dankegel/6788768 to make --keep-system-foo the default. Perhaps a configure option would be appropriate.

Support PKG_CONFIG_LIBDIR

Per the manpage:

PKG_CONFIG_LIBDIR 
    Replaces the default pkg-config search directory.

I guess we should support it for compatibility.

pkg-config --cflags behaves different than freedesktops pkg-config

I am not sure if this is a bug really, but I am reporting it here for the record as it has influence on how some packages are built.

With freedesktop's pkg-config there is a single space returned:

$ echo "flags='$(pkg-config --cflags lua)'"
flags=' '

With pkgconf that space is missing.

rrdtool has a pretty stupid configure script:

   if test "$LUA_CFLAGS" = ""; then
      ...

which will result in a different result than freedesktop's pkg-config.

I am not sure how close you want follow freedesktops pkg-config.

Make SYSTEM_LIBDIR a list

On some systems, libdir may be not a single directory, but a list of multiple directories, as it's the case with Debian multiarch, see Debian bug #742634. Please accept a colon-separated list of directories as an argument to --with-system-libdir=.

Incorrect order of LIBS

I'm using MXE to cross-compile (and statically link to) FFmpeg and other libraries. On FreeBSD (which recently switched to pkgconf) the order of LIBS flags is incorrect which leads to numerous undefined reference to ... errors during linking. On Debian Sid (which uses pkg-config) the order is correct and linking works.

Relevant configure.ac snippet:

pkg_modules="libavformat >= 52.111 libavcodec >= 52.123 libavutil"
PKG_CHECK_MODULES(SPEK, [$pkg_modules])
AC_SUBST(SPEK_CFLAGS)
AC_SUBST(SPEK_LIBS)

LIBS with pkgconf, snippet from config.log:

pkg_cv_SPEK_LIBS='-L/home/alex/Projects/mxe/usr/i686-pc-mingw32/lib -lavutil -lm -lavcodec -lavicap32 -lws2_32 -lmingw32 -lSDLmain -lSDL -lwinmm -mwindows -liconv -luser32 -lgdi32 -ldxguid -lxvidcore -lx264 -lvpx -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -lspeex -lopencore-amrwb -lopencore-amrnb -lmp3lame -lavifil32 -lbz2 -lz -lpsapi -lavformat '

LIBS with pkg-config, snippet from config.log:

pkg_cv_SPEK_LIBS='-mwindows -L/home/alex/Projects/mxe/usr/i686-pc-mingw32/lib -lavformat -lavcodec -lavicap32 -lws2_32 -lmingw32 -lSDLmain -lSDL -liconv -luser32 -lgdi32 -lwinmm -ldxguid -lxvidcore -lx264 -lvpx -lvorbisenc -lvorbis -ltheoraenc -ltheoradec -logg -lspeex -lopencore-amrwb -lopencore-amrnb -lmp3lame -lavifil32 -lbz2 -lz -lpsapi -lavutil -lm  '

The correct dependency order is avformat โ†’ avcodec โ†’ avutil, with pkgconf it's reversed.

Please let me know if you need additional info.

Expansion not identical to pkg-config

libffi.pc:

prefix=/usr/src/ndk-standalone-12-arm/sysroot/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
toolexeclibdir=$(libdir)
includedir=${libdir}/libffi-3.1/include

Name: libffi
Description: Library supporting Foreign Function Interfaces
Version: 3.1
Libs: -L${toolexeclibdir} -lffi
Cflags: -I${includedir}
$ ./pkgconf libffi --libs
-L(libdir) -lffi
# causes bash error at link time 
$ pkg-config libffi --libs
-L$(libdir) -lffi 

--enable-strict

dalias suggested --enable-strict mode for disabling the permutation support and other workarounds.

this could be useful for finding broken build scripts like waf, which were passing arguments in a POSIXly-incorrect manner.

empty prefix causes -L flags to be omitted

fixed with 7cae28f (issue #44)

this caused build of glib to fail because it couldnt find -L for libffi:
/lib/pkgconfig/libffi.pc:
prefix=
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${libdir}/libffi-3.0.11/include
[...]

pkg-config being pkgconf:
root:/src$ pkg-config --libs-only-L libffi

[empty output]
pkg-config original:
root:/src$ pkg-config --libs-only-L libffi
-L/lib
[correct output]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.