autoconf
[Top][All Lists]
Advanced

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

Re: working and AUX dirs while running configure


From: Harlan Stenn
Subject: Re: working and AUX dirs while running configure
Date: Tue, 21 Jun 2011 02:42:47 -0700

Eric wrote:
> On 06/20/2011 04:26 PM, Harlan Stenn wrote:
>> I have the need (or at least a strong desire) to run config.guess
>> (and therefore config.sub) from some scripts that I invoke from
>> inside 'configure'.
>>
>> I'm noticing that the "current directory" seems to be the srcdir if I
>> put this code just after "common initial stuff", and in the builddir
>> if I put this code a bit later.
> 
> How have you come to this conclusion?

I was beating my head against this problem for many hours last night,
and I was echoing various things (like the output of pwd and ls) along
the way, and seeing what happened when I moved the fragments to
different places in my configure.ac .

> By default, running path/to/configure does not change directories
> during the configure run, unless you added a chdir call somewhere in
> your configure.ac snippets, so it might help to post a minimal
> configure.ac that demonstrates the problem you seem to be observing.

That's what I thought, and I am *very* careful to only do a 'cd' in a
subshell to avoid problems.  (I forgot about the subshell on my first
attempt, and that totally hosed configure; I immiediately noticed this
and fixed it.)

As for a minimal example, that will be Fun - as you might have guessed,
I'm doing this with NTP, and I'm implementing a new mechanism to let
folks specify their (local) policy as to what directory each program
should be installed in (legacy was always bin/ but most should arguably
go in sbin/), what man section the man pages should go in (1, 1m, or 8),
and finally the choice of installing man pages with .man or .mdoc tags.

The autoconf macro I use to help choose the filename runs a script that
wants to call config.guess, and on this *one* machine, in spite of
everything I have seen, it says it cannot find config.guess.

I'll beat on this problem again perhaps tomorrow.

>> Regardless, the PATH does not contain AC_CONFIG_AUX_DIR, and I even
>> if it did, that path is generally "not rooted" so it's not all that
>> easy to use because it is srcdir-relative and depending on where I am
>> in 'configure', I may be in the srcdir and I may be in the builddir.
> 
> You are always in the builddir during 'configure' - the whole point of
> running path/to/configure is to configure the current working
> directory as a builddir in relation to path/to/ where configure
> resides.  Meanwhile, $(srcdir)/build-aux/config.guess should always be
> a working means of invoking auxiliary scripts during configure,
> assuming that you used AC_CONFIG_AUX_DIR to set up build-aux as the
> location for config.guess and friends.

That's what I thought, and it's also what I expected, and it's what I
saw on every machine I used except one.  Sadly, that one machine is my
primary build/distribution machine.

I have long noticed strange behavior on this machine - it has a "twin"
where things pretty much always work as expected, but this machine is
just ... different, and I do not control this machine and cannot wipe it
and see if a reload will help.

>> I'm also aware that some folks may have shell RC files that will re-set
>> the PATH when a subshell is spawned, which makes this all even trickier.
>>
>> I'm looking for a good solution here.
> 
> It's hard to know what else to suggest without first seeing what you
> have tried.

I'll send more later, after I have a chance to dig in to this again.  It
will probably be another day or so.

H



reply via email to

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