[R-pkg-devel] Alternative to ifeq for Makevars

Josiah Parry jo@|@h@p@rry @end|ng |rom gm@||@com
Fri Nov 8 20:44:15 CET 2024


Thanks, Ivan!

Do you know of any good documentation on the use of Makevars.in with
configure?
The @VARNAME@ syntax is quite confusing and isn't explained in WRE from
what I can tell.

On Fri, Nov 8, 2024 at 11:33 AM Ivan Krylov <ikrylov using disroot.org> wrote:

> В Fri, 8 Nov 2024 11:21:16 -0800
> Josiah Parry <josiah.parry using gmail.com> пишет:
>
> > I want to conditionally set the value of CRAN_FLAGS like so in my
> > Makevars files
> >
> > ifeq ($(NOT_CRAN), false)
> >   CRAN_FLAGS = -j 2 --offline
> > else
> >   CRAN_FLAGS =
> > endif
>
> Unless a better approach surfaces (detect the environment variable in
> the configure script and generate src/Makevars from src/Makevars.in?),
> you may be interested in the following movfuscator-like
> POSIX-compatible trick: https://nullprogram.com/blog/2016/04/30/
>
> EXTRA_FLAGS_true =
> EXTRA_FLAGS_ = -j 2 --offline
> EXTRA_FLAGS = $(EXTRA_FLAGS_$(NOT_CRAN))
>
> (This one is untested, sorry.)
>
> --
> Best regards,
> Ivan
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list