autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PKG_CHECK_MODULES: bug or I don't know something?


From: Ralf Wildenhues
Subject: Re: PKG_CHECK_MODULES: bug or I don't know something?
Date: Sun, 18 Jun 2006 19:17:41 +0200
User-agent: Mutt/1.5.11+cvs20060403

Hello Evgeniy,

* Evgeniy Dushistov wrote on Sun, Jun 18, 2006 at 05:42:28PM CEST:
> 
> if one_option; then
> ...
> PKG_CHECK_MODULES(APP, lib_a)
> ...
> elif another_option; then
> ...
> PKG_CHECK_MODULES(APP, lib_b)
> ...
> else
> ...
> PKG_CHECK_MODULES(APP, lib_a)
> ...
> fi
> 
> only first PKG_CHECK_MODULES works fine,

Yes.  PKG_CHECK_MODULES apparently uses AC_REQUIRE to pull in some
required macros; the version on my system requires the
PKG_PROG_PKG_CONFIG macro.  Several alternatives to fix this for you,
in decreasing order of cleanliness:

- Wait for Autoconf-2.60, then use
    AS_IF([one_option],
      [...
       PKG_CHECK_MODULES(APP, lib_a)
      ],
      [another_option],
      [...
       PKG_CHECK_MODULES(APP, lib_b)
      ],
      [...
      PKG_CHECK_MODULES(APP, lib_a)
      ])

- Call the required macro PKG_PROG_PKG_CONFIG beforehand,
  unconditionally.  (This breaks if a newer version of the macro
  PKG_CHECK_MODULES has a different set of required macros.)

- Make sure the first expansion of PKG_CHECK_MODULES in your script is
  not inside a shell conditional, but called unconditionally (e.g., you
  could check for an unrelated library).

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]