From 40f77e44bbe8b8103dce6c46724c64b3e8c8e721 Mon Sep 17 00:00:00 2001 From: Ryota Suzuki Date: Tue, 17 Nov 2026 17:11:10 +0900 Subject: [PATCH 1/3] Fix JRI build paths on Windows --- configure.win | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.win b/configure.win index f72c921..841e28a 100644 --- a/configure.win +++ b/configure.win @@ -22,7 +22,7 @@ echo " JAVA_HOME=$JAVA_HOME" echo "JAVA_HOME:=$JAVA_HOME" > src/Makevars.java -if [ -e jri/configure.win ]; then +if [ -e src/jri/configure.win ]; then echo "=== Building JRI ===" CONFIGURED=1 export CONFIGURED @@ -33,21 +33,21 @@ if [ -e jri/configure.win ]; then export R_HOME export RHOME export JAVA_HOME - cd jri + cd src/jri sh configure.win make BR=$? - cd .. + cd ../.. if [ $BR = 0 ]; then echo "=== JRI built ===" mkdir -p inst/jri # also copy into R_ARCH is present to avoid overwriting different archs if [ -n "${R_ARCH}" ]; then mkdir -p inst/jri${R_ARCH} - cp jri/src/jri.dll inst/jri${R_ARCH}/ + cp src/jri/src/jri.dll inst/jri${R_ARCH}/ fi # yet still install into JRI in case users get confused - cp -r jri/run.bat jri/src/jri.dll jri/src/JRI.jar jri/examples inst/jri/ + cp -r src/jri/run.bat src/jri/src/jri.dll src/jri/src/JRI.jar src/jri/examples inst/jri/ else echo "**** WARNING: JRI could NOT be built" >&2 if [ -z "$IGNORE" ]; then From d002383ebcfa7203941344600d725dabff3cb478 Mon Sep 17 00:00:00 2001 From: Ryota Suzuki Date: Tue, 17 Nov 2026 17:49:13 +0900 Subject: [PATCH 2/3] Fix JRI compilation on Windows with R 4.6 --- src/jri/src/Rdecl.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/jri/src/Rdecl.h b/src/jri/src/Rdecl.h index abe9913..87024d5 100644 --- a/src/jri/src/Rdecl.h +++ b/src/jri/src/Rdecl.h @@ -6,13 +6,23 @@ #include +/* some have been added to R 4.6.0 */ +#if R_VERSION >= R_Version(4,6,0) + +/* Rinterface.h is not available on Windows */ +#ifndef Win32 #define R_INTERFACE_PTRS 1 #define CSTACK_DEFNS 1 #include /* R_ReadConsole since 4.6.0 */ +#endif -/* some have been added to R 4.6.0 */ -#if R_VERSION >= R_Version(4,6,0) #include /* run_Rmainloop (since 4.6.0), Rf_initialize_R (since 2.4.0) */ + +/* required on Windows (since 4.6.0) */ +#ifdef Win32 +int R_ReadConsole(const char *, unsigned char *, int, int); +#endif + #else void run_Rmainloop(void); /* main/main.c */ int R_ReadConsole(char*, unsigned char*, int, int); /* include/Defn.h */ From 17174b2e3196127a9e5bb4a8242ef73e8f140d0f Mon Sep 17 00:00:00 2001 From: Ryota Suzuki Date: Tue, 17 Nov 2026 19:20:55 +0900 Subject: [PATCH 3/3] Preserve Rinterface.h inclusion on Unix --- src/jri/src/Rdecl.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jri/src/Rdecl.h b/src/jri/src/Rdecl.h index 87024d5..0c9338f 100644 --- a/src/jri/src/Rdecl.h +++ b/src/jri/src/Rdecl.h @@ -6,9 +6,6 @@ #include -/* some have been added to R 4.6.0 */ -#if R_VERSION >= R_Version(4,6,0) - /* Rinterface.h is not available on Windows */ #ifndef Win32 #define R_INTERFACE_PTRS 1 @@ -16,6 +13,8 @@ #include /* R_ReadConsole since 4.6.0 */ #endif +/* some have been added to R 4.6.0 */ +#if R_VERSION >= R_Version(4,6,0) #include /* run_Rmainloop (since 4.6.0), Rf_initialize_R (since 2.4.0) */ /* required on Windows (since 4.6.0) */