pkg-config: PKG_PROG_PKG_CONFIG: command not found
Asked Answered
H

2

8

I get the following error

./configure: line 11162: PKG_PROG_PKG_CONFIG: command not found

when this is code is executed in (kivy-ios/tools-build-sdlmixer.sh)

if [ ! -f libtremor/tremor/.libs/libvorbisidec.a ]; then
        try cd libtremor/tremor
        echo > asm_arm.h
        CC="$ARM_CC" AR="$ARM_AR" \
        LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS" \
        OGG_CFLAGS="-I../../libogg/include" \
        OGG_LDFLAGS="-L../../libogg/src/.libs" \
        PKG_CONFIG_LIBDIR="../../libogg" \
        ACLOCAL_FLAGS="-I $DESTROOT/share/aclocal -I `aclocal --print-ac-dir`" ./autogen.sh \
            --prefix=$DESTROOT \
                --disable-shared \
                --host=arm-apple-darwin \
                --enable-static=yes \
                --enable-shared=no
        try make
        try make install
        try cd ../..
fi

My pkg-config application is in my PATH (/usr/local/bin). I've also tried exporting PKG_CONFIG_PATH on my command line to /usr/local/bin/pkg-config and /usr/local/lib/pkgconfig. I've tried exporting LD_LIBRARY_PATH to various paths as well (not sure where it should point to tbh), and that doesn't seem to help either.

I read something about multiple aclocal directories on my system, which could be problematic, but its not clear to me how to resolve that or determine its the issue.

This linux build newbie (on OSX) appreciates any help.

Herr answered 13/6, 2013 at 14:37 Comment(0)
S
7

When that script calls autogen.sh, aclocal is failing to find pkg.m4, an M4 macro package that comes with pkg-config and provides the PKG_PROG_PKG_CONFIG macro. Where is pkg-config installed, and what directories is aclocal searching?

Swizzle answered 14/6, 2013 at 10:38 Comment(3)
which pkg-config returns /usr/local/bin/pkg-config. echo $PKG_PROG_PKG_CONFIG is not set. find /usr -name "pkg.m4" returns the following: /usr/local/share/aclocal/pkg.m4 /usr/X11/share/aclocal/pkg.m4. How do I tell which dirs aclocal is searching?Herr
So I added another -I to my directory containing pkg.m4, that seems to have gotten me around the problem, although I presume this is indicative of a deeper issue.Herr
You can set the aclocal path by your own ACLOCAL_PATH=/usr/local/share/aclocal ./autogen.shHaya
G
3

Had the same issue with linux Alpine for an DockerImage.

Solved it by installing autoconf, automake and pkgconf:

apk --update add autoconf automake build-base libtool nasm pkgconf
Gigi answered 6/2, 2021 at 13:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.