bug-gawk
[Top][All Lists]
Advanced

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

RE: AWKPATH and AWKLIBPATH: default values different from documentation


From: Jannick
Subject: RE: AWKPATH and AWKLIBPATH: default values different from documentation (gawk 5.0.1)
Date: Sun, 23 Feb 2020 12:39:42 +0100

Hi Andy,

On Sat, 22 Feb 2020 15:36:12 -0500, Andrew J. Schorr wrote:
> Hi Jannick,
>
> On Sat, Feb 22, 2020 at 08:41:39PM +0100, Jannick wrote:
> > Let me take the conclusion one step further:  the default values of
> > AWKPATH and AWKLIBPATH are baked into gawk at compile-time and are
> > governed by 'prefix' at configure-time (which could optionally be
> > overridden at make/compile-time).  At install-time another value for
> > 'prefix' (e.g., /usr) could be used which might differ from the one
> > effectively used at compile-time.  The setting I am coming from was
> > that 'prefix' is set to '/usr' at configure-time and not changed later
> > on.  So there are at least three times to be careful about which value
> > 'prefix' has; different values can cause the issue raised.
>
> I'm confused. As far as I can tell, the prefix is set once when configure
runs.
> After that, it is baked in by the compilation. So why are there three
times to
> be careful?

I think the usual way is - as you point out - that prefix is set once at
configure-time: either explicitly on the command line or CONFIG_SITE does it
for you or configure sets the default value '/usr/local' if no one does it.
In this case everything is consistent. Running ./configure -h shows you the
values ./configure uses if prefix is not given on the command line.  What I
am trying to say is that prefix as at configure-time COULD be overridden in
the two steps afterwards (make && make install - if you wish to split them
up):
- make prefix=/path1 ... compiles AWKPATH and AWKLIBPATH into gawk using
path1
- make install DESTDIR=/destdir prefix=/path2 ... sets the parent directory
of the bin directory gawk will be installed into

Why did this idea come to my mind?  If prefix is /usr/local at
configure-time and left untouched when running make to compile and install,
then gawk will be (physically) installed in $(DESTDIR)/usr/local/bin
together with its siblings created by the install-exec-hook (cf.
Makefile.am).  In other words gawk could then not reside in the standard
directory /usr/bin.  If gawk does however sit in /usr/bin - which for gawk
as bedrock program might well be - and it is only make which reigns over the
installed package structure, then it seems very unlikely that prefix
remained untouched.

Now, on my system prefix is set to /usr at configure-time and remains
'untouched' as defined before.  With this, gawk itself ends up in /usr/bin,
however it causes the difference to the documented default values of AWKPATH
and AWKLIBPATH which - as the documentation says, too - can "vary depending
on how gawk was built".   Having said all that I decided to define AWKPATH
and AWKLIBPATH as environment variables now to have things nicely ordered
below /usr/local.

> Regards,
> Andy

I hope this could clarify.

Regards,
J.




reply via email to

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