18

I have Ubuntu 13.10 32 bit system. Recently when I try to to compile by running ./autogen.sh and ./configure I get

 PKG_PROG_PKG_CONFIG: command not found

error. I have libtool installed. I have three aclocal files in usr/share/ like alocal, aclocal-1.13 and aclocal-1.4

How can I fix that alocal error?

EDIT:

Some time ago I compiled latest version of automake from source and installed it because a source code needed recent version of automake to run configure process. Since then whenever I run standard ./autogen and /configure commands in source directory to generate makefile I get

  PKG_PROG_PKG_CONFIG: command not found

error

  find /usr -name "pkg.m4"

gives me

  /usr/share/aclocal/pkg.m4

and

  aclocal --print-ac-dir

gives me

  /usr/local/share/aclocal
11
  • is the pkg-config package installed? does the file /usr/share/aclocal/pkg.m4 exist on your system? May 18, 2014 at 14:03
  • What are you trying to compile?
    – jobin
    May 18, 2014 at 14:35
  • @steeldriver find /usr -name "pkg.m4" gives me /usr/share/aclocal/pkg.m4
    – kenn
    May 18, 2014 at 15:55
  • @Jobin I am trying to compile this: codeload.github.com/blazt/submarine/zip/master
    – kenn
    May 18, 2014 at 15:56
  • What does aclocal --print-ac-dir say? May 18, 2014 at 16:01

1 Answer 1

26

The PKG_PROG_PKG_CONFIG variable refers to a macro pkg.m4 that is provided as part of the pkg-config package, so the first thing to check is that pkg-config is installed and that the macro file is in the default location (and is readable, of course)

dpkg -l pkg-config

ls -l /usr/share/aclocal/pkg.m4

If that checks out, then the question becomes why is aclocal not finding it? You can check where aclocal is configured to look for third-party m4 files using the --print-ac-dir switch i.e.

aclocal --print-ac-dir

If that's not the same as the location above, it suggests there is a non-standard version of automake on your system - if you can't resolve that, then a possible workaround is to set or export the ACLOCAL_PATH environment variable before running the autogen.sh script e.g.

ACLOCAL_PATH=/usr/share/aclocal ./autogen.sh

or

export ACLOCAL_PATH=/usr/share/aclocal
./autogen.sh
./configure

See the macro search path section of the GNU automake manual.

1
  • Or, PKG_PROG_PKG_CONFIG could come from a typo in a variable assignment, e.g. PKG_PROG_PKG_CONFIG<space>=... instead of PKG_PROG_PKG_CONFIG=.... grep "PKG_PROG_PKG_CONFIG " on your files.
    – waltinator
    May 22, 2014 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .