[FFmpeg-trac] #3488(build system:new): require_pkg_config() dies with useless error message when pkg-config is missing

FFmpeg trac at avcodec.org
Sat Mar 22 17:59:34 CET 2014


#3488: require_pkg_config() dies with useless error message when pkg-config is
missing
-------------------------------------+-------------------------------------
             Reporter:  Actium       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  build        |                  Version:  git-
  system                             |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 == Summary of the bug: ==

 Enable an external library that is ./configure'd via require_pkg_config(),
 e.g. opus, with pkg-config '''not''' being installed. ./configure dies
 complaining that the library was "not found", although it is properly
 installed (after all everything works fine if pkg-config is installed).
 This error message is unhelpful if not misleading.

 Actually an appropriate error message gets generated
 {{{
 configure:2913:
 if ! $pkg_config --version >/dev/null 2>&1; then
     warn "$pkg_config not found, library detection may fail."
     pkg_config=false
 fi
 }}}
 but since warn() defers the output of warnings and require_pkg_config()
 dies too early
 {{{
 configure:1158: check_pkg_config "$@" || die "ERROR: $pkg not found"
 }}}
 the warning is only placed in config.log, but ~1.5k lines away from the
 "ERROR: $pkg not found" and thus quite difficult to stumble upon (I only
 found the warning after I started taking apart the configure script).


 == How to reproduce: ==

 {{{
 # aptitude purge pkg-config
 $ git clone --depth 1 git://source.ffmpeg.org/ffmpeg.git ffmpeg ; cd
 ffmpeg
 $ ./configure --enable-libopus
 ERROR: opus not found

 If you think configure made a mistake, make sure [...]
 }}}


 == Suggested fix ==

 Since $pkg_config is set to false if pkg-config is not available
 {{{
 configure:2914:
 if ! $pkg_config --version >/dev/null 2>&1; then
     warn "$pkg_config not found, library detection may fail."
     pkg_config=false
 fi
 }}}
 require_pkg_config() could easily be patched to die with a meaningful
 error message in that case (see attached patch).

 Alternatively die() could be modified to output deferred warnings or
 warn() could print messages immediately.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3488>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list