On Tue, 9 Jun 2015, Diego Biurrun wrote:

On Wed, Jun 03, 2015 at 08:49:00PM +0300, Martin Storsjö wrote:
On Wed, 3 Jun 2015, Diego Biurrun wrote:
>On Tue, May 12, 2015 at 01:24:40PM +0300, Martin Storsjö wrote:
>>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?
>
>For starters, what happens if no env is provided?  What's with
>quoting?

You mean that the actual implementation of the patch isn't perfect yet -
yes, one such issue was fixed - is there anything else concrete that you
notice?

I think quoting is broken, as might be whitespace treatment.  I'd have to
study in detail.

Ok, that's a response I can relate to.

What I can say is that it smells like a far too naive approach to a problem that is decidedly less trivial than it seems.

Possibly

So instead of running that script manually, why not pimp up your cd command
to set up the environment for you?

Add the following shell alias

alias cd=mycd.sh

and then the following shell script

#!/bin/sh

case $@ in
 /path/to/repo1)
   export ENV1=value1
   export ENV2=value2
   cd $@
   ;;
 /path/to/repo2)
   export ENV1=othervalue1
   export ENV2=othervalue2
   cd $@
   ;;
 [...]
 *)
   cd $@
   ;;
esac

That should do the trick.

Sure, it probably would. I don't particularly like this approach, but mostly for subjective reasons. If that's the alternative, I'll rather keep doing things as I do right now.

(much more elegantly than autotools, where I'd love to
have the same "make config" feature as libav has).

I'm not sure what you are missing; autotools does automatically rerun
configure if necessary, unlike our build system.

Yes, that it does, but it lacks a command for me to manually trigger a reconfigure with the same parameters (e.g. when something else has changed, not the configure script or makefiles themselves). Also, with autoconf I often end up needing to set CC and CFLAGS via the env, which are lost in the process when reconfiguring later - on an automatic reconfigure they might not be set, while our configure can persist them nicely when they are set via --extra-cflags and --cc instead of picked from the env.

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

Reply via email to