I'm trying to build the latest elfutils release 0.191.  The configure
help says:

  ZSTD_COMPRESS_CFLAGS
              C compiler flags for ZSTD_COMPRESS, overriding pkg-config
  ZSTD_COMPRESS_LIBS
              linker flags for ZSTD_COMPRESS, overriding pkg-config

but the last part of these statements is misleading, in that pkg-config
is not used to find zstd headers and libraries.

It seems to be used only to check the version of zstd after it's been
found in some other way, which seems a bit dangerous (how do we know
the version provided via pkg-config is the same version used via the
above flags?)

Setting PKG_CONFIG_PATH to the right place find the pkg-config
definition as expected:

  $ PKG_CONFIG_PATH=/my/zstd/lib/pkgconfig \
      pkg-config --cflags libzstd
  -I/my/zstd/include

but configure does not:

  $ PKG_CONFIG_PATH=/my/zstd/lib/pkgconfig \
      configure --with-zstd
    ...
  checking for library containing gzdirect... -lz
  checking for library containing BZ2_bzdopen... no
  checking for library containing lzma_auto_decoder... no
  checking for library containing ZSTD_decompress... no
  configure: error: missing -lzstd for --with-zstd


Checking configure.ac it seems that elfutils uses the locally defined
macro eu_ZIPLIB, and this doesn't consult pkg-config.

Reply via email to