Skip to content
Prev 7279 / 12125 Next

[R-pkg-devel] windows and configure scripts

On Fri, Aug 6, 2021 at 3:47 PM Tim Keitt <tkeitt at gmail.com> wrote:
IMHO it's ultimately up to you. Do what makes your life easier as a
package maintainer. If your package can be successfully configured
using only Makevars, then that's probably simplest. If Windows needs
special help, then it might be reasonable to have a separate
Makevars.win file. If you need to perform some extra introspection
about the user's machine, then you probably want a pair of configure
and configure.win scripts.
Since Makevars is just a Makefile, it is processed by make. Executed
shell commands then depend on what shell make has been configured to
use. That defaults to /bin/sh, but R installations might be configured
to use a different shell instead. If you look within $(R
RHOME)/etc/Makeconf you'll probably see something like:

    SHELL = /bin/sh

But that might differ on different platforms. (I don't immediately
recall how this is handled on Windows)

I don't quite understand your question re: "is make the interpreter
here?" -- make interprets Makefiles, which, while looking similar to
shell scripts, are their own thing. Recipes are effectively just
specially adorned shell commands, so while they are still interpreted
by make per-se, it does so by sending those commands to a shell for
execution. See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
for the nitty gritty details.
I think you would have to consult with the CRAN maintainers to be sure
(assuming your question is whether CRAN would accept packages using
GNU extensions only on Windows). While the toolchain on Windows is
GNU-based and so GNU extensions are supported by the toolchain, it is
theoretically possible (although, to me, very unlikely) this could
change in the future.