No error reporting when pkg-config missing in depends build #8228

issue laanwj openend this issue on June 20, 2016
  1. laanwj commented at 10:10 am on June 20, 2016: member

    I was building on a fresh Ubuntu 14.04 VM. Apparently I forgot to install PKG_CONFIG.

    0cd depends
    1make HOST=x86_64-w64-mingw32 NO_QT=1 NO_UPNP=1 -j6
    2cd ..
    3./automake.sh
    4./configure --enable-reduce-exports --prefix=`pwd`/depends/x86_64-w64-mingw32
    5make -j10
    

    The linking step subsequently failed with an error about missing symbols. The immediate cause was trivial: -levent -lopenssl wasn’t being passed to the linker.

    After investigating somewhat deeper it appears this is a result from missing pkg-config. AFAIK the only indication of an error was during configure:

    0./configure: line 17775: PKG_PROG_PKG_CONFIG: command not found
    

    However, this was not fatal so I missed it the first time around. It should be a fatal error.

    After installing the pkg-config package and re-running autogen.sh and configure, everything is working as expected.

  2. laanwj added the label Docs and Output on Jun 20, 2016
  3. laanwj added the label Build system on Jun 20, 2016
  4. paveljanik commented at 7:31 am on June 22, 2016: contributor
    I’ll take care of this, together with libtool checks (#7530).
  5. paveljanik commented at 4:36 pm on June 22, 2016: contributor
    0PKG_PROG_PKG_CONFIG: command not found
    

    means that the pkg-config’s pkg.m4 was not installed when running autoreconf. This means that we have to check for pkg-config in the ./autogen.sh step (in addition to the PKG_PROG_PKG_CONFIG macro itself in the configure.ac). How do you like this one-liner?

     0diff --git a/configure.ac b/configure.ac
     1index 97af58b..6007861 100644
     2--- a/configure.ac
     3+++ b/configure.ac
     4@@ -81,6 +81,7 @@ AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files)
     5
     6 dnl pkg-config check.
     7 PKG_PROG_PKG_CONFIG
     8+m4_pattern_forbid([^PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG macro not expanded, please install pkg-config])
     9
    10 # Enable wallet
    11 AC_ARG_ENABLE([wallet],
    

    With this change, the output without pkg-config installed is:

    0...
    1configure.ac:83: error: PKG_PROG_PKG_CONFIG macro not expanded, please install pkg-config
    2      If this token and others are legitimate, please use m4_pattern_allow.
    3      See the Autoconf documentation.
    4autoreconf: /usr/bin/autoconf failed with exit status: 1
    5bitcoin@linux-fx0x:~/bitcoin> 
    
  6. paveljanik referenced this in commit 5d79863525 on Jun 22, 2016
  7. laanwj closed this on Jul 8, 2016

  8. MarcoFalke 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: 2024-12-26 03:12 UTC

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