Skip to content

Commit

Permalink
record R_SYSTEM_ABI in the Makefile, not on etc/Renviron
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@84790 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Jul 30, 2023
1 parent 03d4f7b commit 95525be
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions doc/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
\item There is some support for building with Intel's LLVM-based
compilers on \samp{x86_64} Linux, such as (C) \command{icx}, (C++)
\command{ipcx} and (Fortran) \command{ifx} from oneAPI 2023.x.0.

\item Enviroment variable \env{R_SYSTEM_ABI} is no longer used and
so no longer recorded in \file{etc/Renviron} (it is not on Windows
and was only ever used when preparing package \pkg{tools}).
}
}

Expand Down
3 changes: 0 additions & 3 deletions etc/Renviron.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ SED=${SED-'@SED@'}
## Prefer a tar that can automagically read compressed archives
TAR=${TAR-'@TAR@'}

## System and compiler types.
R_SYSTEM_ABI='@R_SYSTEM_ABI@'

## Strip shared objects and static libraries.
R_STRIP_SHARED_LIB=${R_STRIP_SHARED_LIB-'@STRIP_SHARED_LIB@'}
R_STRIP_STATIC_LIB=${R_STRIP_STATIC_LIB-'@STRIP_STATIC_LIB@'}
Expand Down
7 changes: 5 additions & 2 deletions src/library/tools/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ R_EXE = R_ENABLE_JIT=0 TZ=UTC $(top_builddir)/bin/R --vanilla --no-echo
## For people who do make -C ../src/library/tools
update:
@$(MAKE) all
@$(MAKE) mklazycomp
@R_SYSTEM_ABI='@R_SYSTEM_ABI@' $(MAKE) mklazycomp

## This is deliberately conservative: -nt seems to work differently in some shells
## We first use mkdesc2 (with date) to install the DESCRIPTION, then re-install
Expand All @@ -47,12 +47,14 @@ mkR: mkR1
include $(top_srcdir)/share/make/basepkg.mk

## Note that R_COMPILER_SUPPRESS_ALL is now on by default
$(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R $(top_srcdir)/share/licenses/license.db
## Depends on Makefile for @R_SYSTEM_ABI@
$(top_builddir)/library/$(pkg)/R/$(pkg).rdb: Makefile all.R $(top_srcdir)/share/licenses/license.db
@$(ECHO) "byte-compiling package '$(pkg)'"
@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg)
@(cat $(srcdir)/R/makeLazyLoad.R; \
$(ECHO) "makeLazyLoading(\"$(pkg)\")") | \
_R_COMPILE_PKGS_=1 R_COMPILER_SUPPRESS_ALL=1 \
R_SYSTEM_ABI='@R_SYSTEM_ABI@' \
R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null

Rsimple: mkR mkRsimple
Expand All @@ -61,6 +63,7 @@ Rlazy: mkR mkRsimple
@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg)
@(cat $(srcdir)/R/makeLazyLoad.R; \
$(ECHO) "makeLazyLoading(\"$(pkg)\")") | \
R_SYSTEM_ABI='@R_SYSTEM_ABI@' \
R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null

Rlazycomp: mkR mkRsimple mklazycomp
1 change: 1 addition & 0 deletions src/library/tools/Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ all:
include $(top_srcdir)/share/make/basepkg.mk

## Note that R_COMPILER_SUPPRESS_ALL is now on by default
## What on Unix is R_SYSTEM_ABI is hard-coded in R/sotools.R
$(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R $(top_srcdir)/share/licenses/license.db
@$(ECHO) "byte-compiling package '$(pkg)'"
@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg)
Expand Down
2 changes: 2 additions & 0 deletions src/library/tools/R/sotools.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ read_symbols_from_object_file <- function(f)
tab
}

## only used during installation to create system_ABI
get_system_ABI <- if(.Platform$OS.type == "windows") {
function() c(system = "windows", CC = "gcc", CXX = "g++",
F77 = "gfortran", FC = "gfortran")
} else {
function()
{
## env variable formerly in etc/Renviron, now in ../Makefile
s <- Sys.getenv("R_SYSTEM_ABI")
if((s == "") || (substr(s, 1L, 1L) %in% c("@", "?")))
return(character())
Expand Down

0 comments on commit 95525be

Please sign in to comment.