[Top][All Lists]

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

Re: Conditionally overriding variables set by Autoconf

From: Marius Bakke
Subject: Re: Conditionally overriding variables set by Autoconf
Date: Wed, 15 Jul 2020 16:48:53 +0200

Hi Karl,

Karl Berry <> writes:

> Hi Marius,
> warning: pkglibdir was already defined in condition
>     TRUE, which includes condition USE_VERSION_LINKS ...
> All I can think of to do is introduce a new variable in each branch, and
> define the "built-in" variables outside the conditional.  Unfortunately
> this means reproducing Automake's defaults, as far as I can see.  As in
> this for (and minimal below):
> mypkglibdir = $(versiondir)$(libdir)/ganeti
> else
> mypkglibdir = $(libdir)/@PACKAGE@
> endif
> pkglibdir = $(mypkglibdir)
> I suspect there is a cleaner way, but I don't have the brains to see
> what it is. I hope someone else here does ... --best, karl.
> --- ---
> AC_INIT([amin], [0.0], [])
> AM_INIT_AUTOMAKE([foreign])
> AC_CONFIG_FILES([Makefile])

Thanks a lot for the feedback and minimal reproducer.  Ludovic Court├Ęs
came up with a slightly cleaner workaround in a different thread[0]:

  pkglibdir =
  pkglibdir += foo
  pkglibdir += bar

...which almost works, but when doing:

  bindir =
  bindir += $(BINDIR)
The $(bindir) variable contains a stray whitespace before the actual
path, resolving to ' /usr/local/bin', which in turn breaks
install-binSCRIPTS because it quotes the installation variables.

Tricky stuff!  :-)


Attachment: signature.asc
Description: PGP signature

reply via email to

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