Port configure script to C99

This commit is contained in:
Florian Weimer 2023-04-09 21:31:04 +02:00
parent ec39553796
commit 9f98490840
2 changed files with 35 additions and 0 deletions

View File

@ -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: <https://github.com/s-u/rJava/pull/305>
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);

View File

@ -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