On Tue, 12 May 2015, Diego Biurrun wrote:

On Tue, May 12, 2015 at 12:34:25AM +0200, Luca Barbato wrote:
On 11/05/15 23:09, Diego Biurrun wrote:
On Wed, May 06, 2015 at 01:37:31PM +0200, Luca Barbato wrote:
Useful to have `make config` work with custom pkgconf path.
---
 configure | 6 ++++++
 1 file changed, 6 insertions(+)

Foo=value1 BAR=value2 /path/to/configure ...

See the patch comment. the idea is to provide a mean to configure once
and then just do make config to reconfigure.

This will only work if you happen to reconfigure inside the same shell
where the exports still exist.

I'm not sure what you're trying to say here - yes, if you don't do things as in this patch, you'd need to set up the variables again. With this patch, the configure parameters that are saved in config.mak, which are reused in "make config", would persist this environment assuming that the user (me) would use it for setting them.

This is a brittle hack and should be done outside of configure.

Hack? Yes, maybe - also convenient. Brittle in which way?

Just run a short shell script that sets up your environment as you need it.

That's what I do today, but Luca suggested this to ease my (and apparently his) workflow.

When you have literally dozens of different configurations, all with potentially different buildroots, I prefer libs which are detected via plain cflags/ldflags over pkg-config, because for cflags/ldflags I can set --extra-cflags=-I/some/build/root/include etc, and when I need to reconfigure, I just do "make config".

With pkg-config, I need to run the right shell script to set up PKG_CONFIG_LIBDIR/PKG_CONFIG_PATH for this particular configuration, which is one step more than when relying solely on configure parameters (such as --extra-cflags) that are brought in automatically when doing "make config".

To this, Luca investigated and noted that pkg-config lacks a command line parameter that does the equivalent of setting PKG_CONFIG_LIBDIR/PATH, so it really has to be set via the environment (otherwise it could be brought in via --pkg-config-flags). By allowing preserving the extra environment variables that need to be set while configuring in a configure parameter, it can all be rerun via a plain "make config", which would simplify my workflow a little bit. Yes, it's not much, running a shell script is no huge task, but when it's something you do often, it would reduce the burden.

For cases where I need to add some particular cross-env's bin dir to $PATH, I would still need to keep using a env setup shellscript (because the suggested configure parameter would only work within configure, not within make), but it would at least save me some work in some setups.

But if you think it's a hack, I'll keep on feeling that using pkg-config for libs is slightly more work than when relying on include/lib paths (except for the cases with libraries with transitive dependencies where pkg-config is a must), for my use cases and workflows.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to