autogen.sh error: possibly undefined macro: PKG_CONFIG_LIBDIR #6432

issue SlimXin opened this issue on July 14, 2015
  1. SlimXin commented at 7:49 AM on July 14, 2015: none

    configure.ac:894: error: possibly undefined macro: PKG_CONFIG_LIBDIR

  2. laanwj added the label Build system on Jul 17, 2015
  3. laanwj commented at 7:47 PM on July 17, 2015: member

    Sounds like you need to install pkgconfig.

  4. eldiegocvl commented at 7:13 PM on July 27, 2015: none

    I have the same issue on CentOS 6.6 and pkgconfig is already installed: pkgconfig-0.23-9.1.el6.x86_64 already installed and latest version

  5. Klakurka commented at 8:23 PM on October 12, 2015: none

    I still run into this same issue on the latest master.

    I'm running CentOS 6.7. pkgconfig is installed.

  6. paveljanik commented at 7:46 AM on October 25, 2015: contributor

    Can you please paste full autogen.sh and configure output?

  7. laanwj commented at 12:06 PM on October 26, 2015: member

    Yes, need the line number, it can't be 864 anymore. Also need output of:

    autoconf --version
    automake --version
    m4 --version
    

    I guess it's triggered by this, but don't ask me what it does (looks like a no-op):

    PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
    unset PKG_CONFIG_LIBDIR
    PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
    

    @theuni can you take a look? Don't know what CentOS does differently.

  8. theuni commented at 4:46 AM on October 27, 2015: member

    The behavior is a bit kludgy, but that's there to un-export PKG_CONFIG_LIBDIR, since we export it for OSX (to help with finding brew paths). Exporting a new var breaks autoconf's caching because the env looks different before/after, and that causes all kinds of wonky problems.

    No clue why this would upset CentOS. I suppose we could guard that path so that we only unset what we ourselves export.

  9. theuni commented at 4:49 AM on October 27, 2015: member

    The above comment was assuming those lines were causing the issue. I'd say it's more likely that CentOS doesn't ship the pkgconfig m4 like other distros do, or pkg-config is too old.

  10. Klakurka commented at 3:42 AM on October 28, 2015: none

    autogen.sh output:

    libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
    libtoolize: copying file `build-aux/ltmain.sh'
    libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `build-aux/m4'.
    libtoolize: copying file `build-aux/m4/libtool.m4'
    libtoolize: copying file `build-aux/m4/ltoptions.m4'
    libtoolize: copying file `build-aux/m4/ltsugar.m4'
    libtoolize: copying file `build-aux/m4/ltversion.m4'
    libtoolize: copying file `build-aux/m4/lt~obsolete.m4'
    libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
    libtoolize: copying file `build-aux/ltmain.sh'
    libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `build-aux/m4'.
    libtoolize: copying file `build-aux/m4/libtool.m4'
    libtoolize: copying file `build-aux/m4/ltoptions.m4'
    libtoolize: copying file `build-aux/m4/ltsugar.m4'
    libtoolize: copying file `build-aux/m4/ltversion.m4'
    libtoolize: copying file `build-aux/m4/lt~obsolete.m4'
    libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
    libtoolize: copying file `build-aux/ltmain.sh'
    libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `build-aux/m4'.
    libtoolize: copying file `build-aux/m4/libtool.m4'
    libtoolize: copying file `build-aux/m4/ltoptions.m4'
    libtoolize: copying file `build-aux/m4/ltsugar.m4'
    libtoolize: copying file `build-aux/m4/ltversion.m4'
    libtoolize: copying file `build-aux/m4/lt~obsolete.m4'
    configure.ac:939: error: possibly undefined macro: PKG_CONFIG_LIBDIR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
    autoreconf: /usr/bin/autoconf failed with exit status: 1
    

    autoconf --version:

    autoconf (GNU Autoconf) 2.63
    Copyright (C) 2008 Free Software Foundation, Inc.
    License GPLv2+: GNU GPL version 2 or later
    <http://gnu.org/licenses/old-licenses/gpl-2.0.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
    Written by David J. MacKenzie and Akim Demaille.
    

    automake --version:

    automake (GNU automake) 1.11.1
    Copyright (C) 2009 Free Software Foundation, Inc.
    License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
    Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.
    

    m4 --version:

    m4 (GNU M4) 1.4.13
    Copyright (C) 2009 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
    Written by Rene' Seindal.
    

    Let me know if you need anything else.

  11. MarcoFalke commented at 8:57 PM on November 11, 2015: member

    Can reproduce what @Klakurka said on cbf9609 and CentOS release 6.7 (Final):

    configure.ac:957: error: possibly undefined macro: PKG_CONFIG_LIBDIR
    

    Which is this line: https://github.com/bitcoin/bitcoin/blob/cbf9609c71c6dca6efac8504dc9bd82f6b205cc9/configure.ac#L957

    Not sure but this diff seems to work around.

    diff --git a/configure.ac b/configure.ac
    index e8aea90..ec25aca 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -954,9 +954,9 @@ PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
     unset PKG_CONFIG_PATH
     PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP"
    
    -PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
    -unset PKG_CONFIG_LIBDIR
    -PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
    +#PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
    +#unset PKG_CONFIG_LIBDIR
    +#PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
    
     ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bign
     AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue])
    

    (Couldn't go further because configure complains about

    checking for EVENT... no
    configure: error: libevent not found.
    

    even though

    Package libevent-devel-1.4.13-4.el6.x86_64 already installed and latest version
    Package libevent-doc-1.4.13-4.el6.noarch already installed and latest version
    Package libevent-headers-1.4.13-4.el6.noarch already installed and latest version
    Package libevent-1.4.13-4.el6.x86_64 already installed and latest version
    

    )

    EDIT: I need libevent2, probably.

  12. laanwj commented at 8:29 AM on November 12, 2015: member

    I remember having a similar issue to what @MarcoFalke was having at some point, also worked around it by commenting out those lines. Some versions don't like this define-undefine dance.

  13. theuni commented at 8:46 AM on November 12, 2015: member

    Ok, I'll hide that so it's osx only.

  14. ayangliayangli commented at 8:21 AM on March 16, 2016: none

    @MarcoFalke , does it work when you use libevent2.0 libevent also can not found when i do that

  15. ayangliayangli commented at 9:08 AM on March 16, 2016: none

    it does not work when commenting those lines because it can not found libevent when config ... ... even if use libevent2.0

    config error checking for EVENT... no configure: error: libevent not found.

    can you give some better suggestion

    my env centos 6.5 + bitcoin core 0.12 @theuni @laanwj

  16. laanwj commented at 9:12 AM on March 16, 2016: member

    @yangllsdev if it is a different problem please open a new issue instead of commenting on this one, that's considered rude.

    You certainly need libevent 2.0+. But It looks to me that you have only the shared library installed and not the development headers. If you do have the libevent headers (event.h, evhttp.h etc) on your system and it doesn't detect them, please open a new issue.

  17. ayangliayangli commented at 11:56 AM on March 16, 2016: none

    @laanwj thanks i will try agin tomorrow thanks it is useful

  18. laanwj renamed this:
    bug for excuting autogen.sh
    autogen.sh error: possibly undefined macro: PKG_CONFIG_LIBDIR
    on Mar 16, 2016
  19. Zenitur commented at 9:17 AM on October 3, 2016: none
  20. laanwj assigned theuni on Oct 3, 2016
  21. kuzyakiev commented at 12:41 PM on November 12, 2017: none

    Have the same issue on CentOS 6.5 && bitcoin v0.15.1 autogen.sh output:

    build-aux/m4/libtool.m4:1022: _LT_SYS_MODULE_PATH_AIX is expanded from...
    build-aux/m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
    build-aux/m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
    build-aux/m4/libtool.m4:138: _LT_SETUP is expanded from...
    build-aux/m4/libtool.m4:67: LT_INIT is expanded from...
    configure.ac:78: the top level
    configure.ac:78: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
    ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
    ../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
    ../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
    build-aux/m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
    build-aux/m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
    build-aux/m4/libtool.m4:138: _LT_SETUP is expanded from...
    build-aux/m4/libtool.m4:67: LT_INIT is expanded from...
    configure.ac:78: the top level
    configure.ac:78: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
    ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
    ../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
    ../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
    build-aux/m4/libtool.m4:1022: _LT_SYS_MODULE_PATH_AIX is expanded from...
    build-aux/m4/libtool.m4:5343: _LT_LANG_CXX_CONFIG is expanded from...
    build-aux/m4/libtool.m4:785: _LT_LANG is expanded from...
    build-aux/m4/libtool.m4:768: LT_LANG is expanded from...
    build-aux/m4/libtool.m4:796: _LT_LANG_DEFAULT_CONFIG is expanded from...
    build-aux/m4/libtool.m4:138: _LT_SETUP is expanded from...
    build-aux/m4/libtool.m4:67: LT_INIT is expanded from...
    configure.ac:78: the top level
    configure.ac:1257: error: possibly undefined macro: PKG_CONFIG_LIBDIR
          If this token and others are legitimate, please use m4_pattern_allow.
          See the Autoconf documentation.
    autoreconf: /usr/local/bin/autoconf failed with exit status: 1
    

    autoconf --version

    autoconf (GNU Autoconf) 2.69
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+/Autoconf: GNU GPL version 3 or later
    <http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    

    automake --version

    automake (GNU automake) 1.11.1
    Copyright (C) 2009 Free Software Foundation, Inc.
    License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    

    m4 --version

    m4 (GNU M4) 1.4.13
    Copyright (C) 2009 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
    Written by Rene' Seindal.
    
  22. kuzyakiev commented at 12:45 PM on November 12, 2017: none

    Fixed with: #6602 (comment)

  23. laanwj closed this on Nov 13, 2017

  24. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me