From 9f984908405342e87e3a244d3241cfa9bf972302 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sun, 9 Apr 2023 21:31:04 +0200 Subject: [PATCH] Port configure script to C99 --- R-rJava-configure-c99.patch | 33 +++++++++++++++++++++++++++++++++ R-rJava.spec | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 R-rJava-configure-c99.patch diff --git a/R-rJava-configure-c99.patch b/R-rJava-configure-c99.patch new file mode 100644 index 0000000..799ee45 --- /dev/null +++ b/R-rJava-configure-c99.patch @@ -0,0 +1,33 @@ +Avoid implicit int in inline keyword check. + +This prevents the check from going wrong with future compilers which +do not support implicit ints. + +Submitted upstream: + +diff --git a/rJava/configure b/rJava/configure +index 4858bc30fa9610b3..41dd6c9fe27617c8 100755 +--- a/rJava/configure ++++ b/rJava/configure +@@ -3624,7 +3624,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + static inline int foo(int a, int b); +-static f = 1; ++static int f = 1; + static inline int foo(int a, int b) { return a+b; } + int main(void) { + return foo(f,-1); +diff --git a/rJava/configure.ac b/rJava/configure.ac +index 79a175f46be77cf7..14090b77b9fb22c5 100644 +--- a/rJava/configure.ac ++++ b/rJava/configure.ac +@@ -104,7 +104,7 @@ AS_MESSAGE([checking whether ${CC} supports static inline...]) + can_inline=no + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + static inline int foo(int a, int b); +-static f = 1; ++static int f = 1; + static inline int foo(int a, int b) { return a+b; } + int main(void) { + return foo(f,-1); diff --git a/R-rJava.spec b/R-rJava.spec index 955d3f3..19475cb 100644 --- a/R-rJava.spec +++ b/R-rJava.spec @@ -10,6 +10,7 @@ Summary: Low-Level R to Java Interface License: LGPL-2.1-only URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packvers}#/%{packname}_%{packvers}.tar.gz +Patch0: R-rJava-configure-c99.patch BuildRequires: R-devel >= 3.6.0 Recommends: %{name}-javadoc = %{version}-%{release} @@ -29,6 +30,7 @@ Javadoc for %{name} %prep %setup -q -c -n %{packname} +%patch -P 0 -p1 rm %{packname}/inst/jri/*.jar %build