From 034f1d751b7eec6842ec76f187d1912904fb1252 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 30 Dec 2022 17:34:48 +1300 Subject: [PATCH 01/69] bump version to 1.0-8 --- src/rJava.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index c896b16..3e14582 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x010007 /* rJava v1.0-7 */ +#define RJAVA_VER 0x010008 /* rJava v1.0-8 */ /* important changes between versions: 3.0 - adds compiler From 503a4b7f67800fce07827fef81b5d55ed0a4123f Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 30 Dec 2022 17:40:39 +1300 Subject: [PATCH 02/69] try to prevent TCO in gcc sabotaging stack detection (#300) --- src/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.c b/src/init.c index 6805d71..c150231 100644 --- a/src/init.c +++ b/src/init.c @@ -572,14 +572,14 @@ static char* findBound(char *from, char *limit, int dir) than allocating large arrays on the C stack, both via definition and alloca. */ static SEXP RinitJVM_with_padding(SEXP par, intptr_t padding, char *last) { - char dummy[1]; + volatile char dummy[1]; /* reduce the risk that dummy will be optimized out */ dummy[0] = (char) (uintptr_t) &dummy; padding -= (last - dummy) * R_CStackDir; if (padding <= 0) return RinitJVM_real(par, 0); else - return RinitJVM_with_padding(par, padding, dummy); + return RinitJVM_with_padding(par, padding, (char*) dummy); } /* Run RinitJVM with the Java stack workaround */ From a51dc7829f44719f9abd17e7866c73f4b110d578 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 30 Dec 2022 17:59:16 +1300 Subject: [PATCH 03/69] Replace r-lib action so the check works --- .github/workflows/check.yaml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 7bbf2a7..fe85bb5 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -11,30 +11,37 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'windows-latest', 'macOS-10.15', 'ubuntu-20.04' ] + os: [ 'windows-2022', 'macOS-10.15', 'ubuntu-20.04' ] r: [ 'release' ] java: [ 8, 11 ] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master + - name: Install R + uses: s-u/R-actions/install@v1 with: r-version: ${{ matrix.r }} + tools: base - uses: actions/setup-java@v1 with: java-version: ${{ matrix.java }} - name: Build - run: "sh mkdist" - - - name: Info - run: "bash -c 'java -version && which java && echo $PATH && echo $JAVA_HOME'" + run: | + sh mkdist + java -version && which java && echo $PATH && echo $JAVA_HOME + shell: bash - name: Setup R Java support if: runner.os != 'Windows' - run: "echo export PATH=$PATH > reconf.sh; echo export JAVA_HOME=$JAVA_HOME >> reconf.sh; echo R CMD javareconf >> reconf.sh; sudo bash reconf.sh" + run: | + echo export PATH=$PATH > reconf.sh + echo export JAVA_HOME=$JAVA_HOME >> reconf.sh + echo R CMD javareconf >> reconf.sh + sudo bash reconf.sh + shell: bash - name: R CMD check (Windows) if: runner.os == 'Windows' From 6d362c1e804d85f699e61742e103df0b8634c489 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 30 Dec 2022 18:07:29 +1300 Subject: [PATCH 04/69] Update NEWS --- NEWS | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 8b90ea9..f05146a 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,13 @@ NEWS/ChangeLog for rJava -------------------------- -1.0-7 +1.0-8 + o attempt to prevent (close to) infinite loop in stack + detection due to unwanted tail call optimization by + gcc >= 11 if JDK older than Java 10 is used. (#300) + + +1.0-7 2022-04-29 o fix conversion from native encoding into UTF-16 (introduced in 1.0-2) to work correctly if the native encoding is neither UTF-8 nor Latin1. (#228) From f8b2cfbea63fec1a65a5eda742fe6560728b96c3 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Tue, 28 Nov 2023 11:33:13 +1300 Subject: [PATCH 05/69] bump version to 1.0-9 --- src/rJava.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index 3e14582..196421f 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x010008 /* rJava v1.0-8 */ +#define RJAVA_VER 0x010009 /* rJava v1.0-9 */ /* important changes between versions: 3.0 - adds compiler From a677b023e888682964c16aae06bc9a896cb435aa Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Tue, 28 Nov 2023 11:44:20 +1300 Subject: [PATCH 06/69] replace () with (void) in C decls --- jri/src/Rcallbacks.c | 8 ++++---- jri/src/Rcallbacks.h | 6 +++--- jri/src/Rinit.c | 10 +++++----- jri/src/Rinit.h | 2 +- jri/src/rjava.c | 6 +++--- jri/src/rjava.h | 6 +++--- src/Rglue.c | 12 ++++++------ src/init.c | 6 +++--- src/loader.c | 2 +- src/otables.c | 2 +- src/rJava.c | 10 +++++----- src/rJava.h | 6 +++--- src/registration.c | 2 +- src/tools.c | 6 +++--- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/jri/src/Rcallbacks.c b/jri/src/Rcallbacks.c index 39f0e3c..12f2597 100644 --- a/jri/src/Rcallbacks.c +++ b/jri/src/Rcallbacks.c @@ -37,7 +37,7 @@ /* this method is used rather for debugging purposes - it finds the correct JNIEnv for the current thread. we still have some threading issues to solve, becuase eenv!=env should never happen (uncontrolled), because concurrency issues arise */ static JavaVM *jvm=0; -JNIEnv *checkEnvironment() +JNIEnv *checkEnvironment(void) { JNIEnv *env; jsize l; @@ -170,12 +170,12 @@ void Re_WriteConsole(RCCONST char *buf, int len) } /* Indicate that input is coming from the console */ -void Re_ResetConsole() +void Re_ResetConsole(void) { } /* Stdio support to ensure the console file buffer is flushed */ -void Re_FlushConsole() +void Re_FlushConsole(void) { JNIEnv *lenv=checkEnvironment(); jri_checkExceptions(lenv, 1); @@ -192,7 +192,7 @@ void Re_FlushConsole() } /* Reset stdin if the user types EOF on the console. */ -void Re_ClearerrConsole() +void Re_ClearerrConsole(void) { } diff --git a/jri/src/Rcallbacks.h b/jri/src/Rcallbacks.h index 365ca85..dcb3eae 100644 --- a/jri/src/Rcallbacks.h +++ b/jri/src/Rcallbacks.h @@ -22,9 +22,9 @@ int Re_ReadConsole(RCCONST char *prompt, RCSIGN char *buf, int len, int addtohi void Re_Busy(int which); void Re_WriteConsole(RCCONST char *buf, int len); void Re_WriteConsoleEx(RCCONST char *buf, int len, int oType); -void Re_ResetConsole(); -void Re_FlushConsole(); -void Re_ClearerrConsole(); +void Re_ResetConsole(void); +void Re_FlushConsole(void); +void Re_ClearerrConsole(void); int Re_ChooseFile(int new, char *buf, int len); void Re_ShowMessage(RCCONST char *buf); void Re_read_history(char *buf); diff --git a/jri/src/Rinit.c b/jri/src/Rinit.c index 2341c5b..4a43208 100644 --- a/jri/src/Rinit.c +++ b/jri/src/Rinit.c @@ -85,7 +85,7 @@ int initR(int argc, char **argv) { return 0; } -void initRinside() { +void initRinside(void) { /* disable stack checking, because threads will thow it off */ R_CStackLimit = (uintptr_t) -1; } @@ -137,16 +137,16 @@ extern int UserBreak; #endif /* calls into the R DLL */ -extern char *getDLLVersion(); +extern char *getDLLVersion(void); extern void R_DefParams(Rstart); extern void R_SetParams(Rstart); extern void setup_term_ui(void); extern void ProcessEvents(void); extern void end_Rmainloop(void), R_ReplDLLinit(void); -extern int R_ReplDLLdo1(); +extern int R_ReplDLLdo1(void); extern void run_Rmainloop(void); -void myCallBack() +void myCallBack(void) { /* called during i/o, eval, graphics in ProcessEvents */ } @@ -284,7 +284,7 @@ int initR(int argc, char **argv) return 0; } -void initRinside() { +void initRinside(void) { /* disable stack checking, because threads will thow it off */ R_CStackLimit = (uintptr_t) -1; } diff --git a/jri/src/Rinit.h b/jri/src/Rinit.h index b3cc2f0..9963da5 100644 --- a/jri/src/Rinit.h +++ b/jri/src/Rinit.h @@ -2,6 +2,6 @@ #define __R_INIT__H__ int initR(int argc, char **argv); -void initRinside(); +void initRinside(void); #endif diff --git a/jri/src/rjava.c b/jri/src/rjava.c index 373d984..7573e3b 100644 --- a/jri/src/rjava.c +++ b/jri/src/rjava.c @@ -13,7 +13,7 @@ int *rjctrl = 0; typedef void(callbackfn)(void *); -int RJava_request_lock() { +int RJava_request_lock(void) { ptrlong buf[4]; int n; if (rjctrl && *rjctrl) return 2; @@ -24,7 +24,7 @@ int RJava_request_lock() { return (n == sizeof(ptrlong) && buf[0] == IPCC_LOCK_GRANTED) ? 1 : 0; } -int RJava_clear_lock() { +int RJava_clear_lock(void) { ptrlong buf[4]; buf[0] = IPCC_CLEAR_LOCK; return (write(ipcout, buf, sizeof(ptrlong)) == sizeof(ptrlong)) ? 1 : 0; @@ -44,7 +44,7 @@ void RJava_setup(int _in, int _out) { resin = _in; } -void RJava_init_ctrl() { +void RJava_init_ctrl(void) { ptrlong buf[4]; buf[0] = IPCC_CONTROL_ADDR; if (write(ipcout, buf, sizeof(ptrlong)) == sizeof(ptrlong) && diff --git a/jri/src/rjava.h b/jri/src/rjava.h index 19fd1b3..8fca0e8 100644 --- a/jri/src/rjava.h +++ b/jri/src/rjava.h @@ -10,10 +10,10 @@ #define IPCC_CALL_REQUEST 4 /* pars: */ #define IPCC_CONTROL_ADDR 5 /* ipc: request, res: */ -int RJava_request_lock(); -int RJava_clear_lock(); +int RJava_request_lock(void); +int RJava_clear_lock(void); /* int RJava_request_callback(callbackfn *fn, void *data); */ void RJava_setup(int _in, int _out); -void RJava_init_ctrl(); +void RJava_init_ctrl(void); #endif diff --git a/src/Rglue.c b/src/Rglue.c index 52f4035..ba02513 100644 --- a/src/Rglue.c +++ b/src/Rglue.c @@ -37,7 +37,7 @@ #endif /** returns TRUE if JRI has callback support compiled in or FALSE otherwise */ -REPC SEXP RJava_has_jri_cb() { +REPC SEXP RJava_has_jri_cb(void) { SEXP r = allocVector(LGLSXP, 1); #ifdef ENABLE_JRICB LOGICAL(r)[0] = 1; @@ -65,7 +65,7 @@ HIDE void rjprintf(char *fmt, ...) { #ifdef RJ_PROFILE #include -HIDE long time_ms() { +HIDE long time_ms(void) { #ifdef Win32 return 0; /* in Win32 we have no gettimeofday :( */ #else @@ -1067,7 +1067,7 @@ REPC SEXP RcreateArray(SEXP ar, SEXP cl) { /** check whether there is an exception pending and return the exception if any (NULL otherwise) */ -REPC SEXP RpollException() { +REPC SEXP RpollException(void) { JNIEnv *env=getJNIEnv(); jthrowable t; BEGIN_RJAVA_CALL @@ -1078,7 +1078,7 @@ END_RJAVA_CALL } /** clear any pending exceptions */ -REP void RclearException() { +REP void RclearException(void) { JNIEnv *env=getJNIEnv(); BEGIN_RJAVA_CALL (*env)->ExceptionClear(env); @@ -1125,9 +1125,9 @@ END_RJAVA_CALL return res; } -extern int existingJVMs(); /* init.c */ +extern int existingJVMs(void); /* init.c */ -REPC SEXP RgetJVMstate() { +REPC SEXP RgetJVMstate(void) { const char *names[] = { "initialized", "state", "" }; SEXP res = PROTECT(Rf_mkNamed(VECSXP, names)); const char *st = "unknown"; diff --git a/src/init.c b/src/init.c index c150231..44c1d1e 100644 --- a/src/init.c +++ b/src/init.c @@ -89,7 +89,7 @@ static void JNICALL exit_hook(int status) { exit(status); } -int existingJVMs() { +int existingJVMs(void) { jsize vms = 0; JavaVM *jvms[32]; return (JNI_GetCreatedJavaVMs(jvms, 32, &vms) >= 0) ? vms : 0; @@ -766,7 +766,7 @@ REP SEXP RinitJVM(SEXP par) { #endif } -REP void doneJVM() { +REP void doneJVM(void) { (*jvm)->DestroyJavaVM(jvm); jvm = 0; eenv = 0; @@ -778,7 +778,7 @@ REP void doneJVM() { * These classes and methods are the ones that are in rJava (RJavaTools, ...) * not java standard classes (Object, Class) */ -REPC SEXP initRJavaTools(){ +REPC SEXP initRJavaTools(void){ JNIEnv *env=getJNIEnv(); jclass c; diff --git a/src/loader.c b/src/loader.c index f1c08eb..6c00839 100644 --- a/src/loader.c +++ b/src/loader.c @@ -31,7 +31,7 @@ REPC SEXP RJava_set_class_loader(SEXP ldr) { return R_NilValue; } -REPC SEXP RJava_primary_class_loader() { +REPC SEXP RJava_primary_class_loader(void) { JNIEnv *env=getJNIEnv(); jclass cl = (*env)->FindClass(env, "RJavaClassLoader"); _dbg(Rprintf("RJava_primary_class_loader, cl = %x\n", (int) cl)); diff --git a/src/otables.c b/src/otables.c index 4e23a38..531aa79 100644 --- a/src/otables.c +++ b/src/otables.c @@ -8,7 +8,7 @@ /** * Returns the R_UnboundValue */ -HIDE SEXP R_getUnboundValue() { +HIDE SEXP R_getUnboundValue(void) { return(R_UnboundValue); } diff --git a/src/rJava.c b/src/rJava.c index c8ad140..294f0f2 100644 --- a/src/rJava.c +++ b/src/rJava.c @@ -11,7 +11,7 @@ int use_eenv = 1; /* cached environment. Do NOT use directly! Always use getJNIEnv()! */ JNIEnv *eenv; -static SEXP getCurrentCall() { +static SEXP getCurrentCall(void) { SEXP cexp, sys_calls = PROTECT(install("sys.calls")); cexp = PROTECT(lang1(sys_calls)); SEXP cl = eval(cexp, R_GetCurrentEnv()); @@ -132,14 +132,14 @@ HIDE void clx(JNIEnv *env) { } #ifdef JNI_CACHE -HIDE JNIEnv *getJNIEnvSafe(); -HIDE JNIEnv *getJNIEnv() { +HIDE JNIEnv *getJNIEnvSafe(void); +HIDE JNIEnv *getJNIEnv(void) { return (use_eenv)?eenv:getJNIEnvSafe(); } -HIDE JNIEnv *getJNIEnvSafe() +HIDE JNIEnv *getJNIEnvSafe(void) #else -HIDE JNIEnv *getJNIEnv() +HIDE JNIEnv *getJNIEnv(void) #endif { JNIEnv *env; diff --git a/src/rJava.h b/src/rJava.h index 196421f..c1953ad 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -82,7 +82,7 @@ void rjprintf(char *fmt, ...); /* in Rglue.c */ #ifdef RJ_PROFILE #define profStart() profilerTime=time_ms() #define _prof(X) X -long time_ms(); /* those are acutally in Rglue.c */ +long time_ms(void); /* those are acutally in Rglue.c */ void profReport(char *fmt, ...); #else #define profStart() @@ -123,7 +123,7 @@ extern int RJava_has_control; /* in rJava.c */ extern JNIEnv *eenv; /* should NOT be used since not thread-safe; use getJNIEnv instead */ -HIDE JNIEnv* getJNIEnv(); +HIDE JNIEnv* getJNIEnv(void); HIDE void ckx(JNIEnv *env); HIDE void clx(JNIEnv *env); @@ -175,7 +175,7 @@ HIDE void init_rJava(void); REPC SEXP newRJavaLookupTable(SEXP) ; -HIDE SEXP R_getUnboundValue() ; +HIDE SEXP R_getUnboundValue(void) ; HIDE SEXP rJavaLookupTable_objects(R_ObjectTable *) ; HIDE SEXP rJavaLookupTable_assign(const char * const, SEXP, R_ObjectTable * ) ; HIDE Rboolean rJavaLookupTable_canCache(const char * const, R_ObjectTable *) ; diff --git a/src/registration.c b/src/registration.c index 38f2302..bdad36d 100644 --- a/src/registration.c +++ b/src/registration.c @@ -3,7 +3,7 @@ /* only to avoid NOTEs from broken checks, never called */ -int dummy__() { +int dummy__(void) { return R_registerRoutines(0, 0, 0, 0, 0); } diff --git a/src/tools.c b/src/tools.c index 8d84012..5ee2670 100644 --- a/src/tools.c +++ b/src/tools.c @@ -106,7 +106,7 @@ REPC SEXP RidenticalRef(SEXP ref1, SEXP ref2) { } /** create a NULL external reference */ -REPC SEXP RgetNullReference() { +REPC SEXP RgetNullReference(void) { return R_MakeExternalPtr(0, R_NilValue, R_NilValue); } @@ -128,7 +128,7 @@ REPC SEXP RisAssignableFrom(SEXP cl1, SEXP cl2) { return r; } -REPC SEXP RJava_checkJVM() { +REPC SEXP RJava_checkJVM(void) { SEXP r = allocVector(LGLSXP, 1); LOGICAL(r)[0] = 0; if (!jvm || !getJNIEnv()) return r; @@ -138,7 +138,7 @@ REPC SEXP RJava_checkJVM() { extern int rJava_initialized; /* in callJNI.c */ -REPC SEXP RJava_needs_init() { +REPC SEXP RJava_needs_init(void) { SEXP r = allocVector(LGLSXP, 1); LOGICAL(r)[0] = rJava_initialized?0:1; return r; From b4f5e89703372607df2cf45adbb34f8e383cd5f3 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Tue, 28 Nov 2023 11:49:27 +1300 Subject: [PATCH 07/69] remove unused variables --- src/fields.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fields.c b/src/fields.c index 0329aad..a78f2af 100644 --- a/src/fields.c +++ b/src/fields.c @@ -88,7 +88,6 @@ static jclass inputToClass(JNIEnv *env, SEXP obj, jobject *jobj, int *is_local) if (o) cls = objectClass(env, o); else { /* this should be rare since is doesn't provide a way to specify the class loader */ - char *c = clnam; cls = findClass(env, clnam, oClassLoader); free(clnam); if (!cls) { @@ -146,7 +145,7 @@ REPC SEXP RgetField(SEXP obj, SEXP sig, SEXP name, SEXP trueclass) { jobject o = 0; SEXP e; const char *retsig, *fnam; - char *clnam = 0, *detsig = 0; + char *detsig = 0; jfieldID fid; jclass cls; int tc = asInteger(trueclass), cls_local = 0; From 5f7c3e857cee0b1a2481ebaa2655966ffb8804e0 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Tue, 28 Nov 2023 11:50:30 +1300 Subject: [PATCH 08/69] remove new_jrectRef as unused --- src/Rglue.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Rglue.c b/src/Rglue.c index ba02513..45bbcd4 100644 --- a/src/Rglue.c +++ b/src/Rglue.c @@ -896,6 +896,7 @@ static SEXP new_jarrayRef(JNIEnv *env, jobject a, const char *sig) { return oo; } +#if 0 /* FIXME: no longer used */ /** * Creates a reference to a rectangular java array. * @@ -920,6 +921,7 @@ static SEXP new_jrectRef(JNIEnv *env, jobject a, const char *sig, SEXP dim ) { UNPROTECT(1); /* oo */ return oo; } +#endif /* this does not take care of multi dimensional arrays properly */ From 43431b08acbe05ced87ee0a381d4dce68431b000 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Tue, 28 Nov 2023 11:50:44 +1300 Subject: [PATCH 09/69] update NEWS --- NEWS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f05146a..8b851c9 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,11 @@ NEWS/ChangeLog for rJava -------------------------- -1.0-8 +1.0-9 2023-11-28 + o clean up benign C warnings + + +1.0-8 2022-12-30 o attempt to prevent (close to) infinite loop in stack detection due to unwanted tail call optimization by gcc >= 11 if JDK older than Java 10 is used. (#300) From ba188d25e9a73bb486af8f89dd0771d32e0cc4a7 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Tue, 28 Nov 2023 12:29:51 +1300 Subject: [PATCH 10/69] replace sprintf with snprintf --- jri/src/Rinit.c | 8 ++++---- src/init.c | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/jri/src/Rinit.c b/jri/src/Rinit.c index 4a43208..04c142b 100644 --- a/jri/src/Rinit.c +++ b/jri/src/Rinit.c @@ -166,7 +166,7 @@ int myYesNoCancel(RCCONST char *s) char ss[128]; unsigned char a[3]; - sprintf(ss, "%s [y/n/c]: ", s); + snprintf(ss, sizeof(ss)-1, "%s [y/n/c]: ", s); Re_ReadConsole(ss, a, 3, 0); switch (a[0]) { case 'y': @@ -197,11 +197,11 @@ int initR(int argc, char **argv) HKEY k; int cvl; - sprintf(Rversion, "%s.%s", R_MAJOR, R_MINOR); + snprintf(Rversion, sizeof(Rversion)-1, "%s.%s", R_MAJOR, R_MINOR); cvl=strlen(R_MAJOR)+2; if(strncmp(getDLLVersion(), Rversion, cvl) != 0) { char msg[512]; - sprintf(msg, "Error: R.DLL version does not match (DLL: %s, expecting: %s)\n", getDLLVersion(), Rversion); + snprintf(msg, sizeof(msg)-1, "Error: R.DLL version does not match (DLL: %s, expecting: %s)\n", getDLLVersion(), Rversion); fprintf(stderr, msg); MessageBox(0, msg, "Version mismatch", MB_OK|MB_ICONERROR); return -1; @@ -228,7 +228,7 @@ int initR(int argc, char **argv) MessageBox(0, "R_HOME must be set or R properly installed (\\Software\\R-core\\R\\InstallPath registry entry must exist).\n", "Can't find R home", MB_OK|MB_ICONERROR); return -2; } - sprintf(rhb,"R_HOME=%s",RHome); + snprintf(rhb, sizeof(rhb)-1, "R_HOME=%s",RHome); putenv(rhb); } /* on Win32 this should set R_Home (in R_SetParams) as well */ diff --git a/src/init.c b/src/init.c index 44c1d1e..d2d4236 100644 --- a/src/init.c +++ b/src/init.c @@ -148,7 +148,9 @@ static int initJVM(const char *user_classpath, int opts, char **optv, int hooks, vm_args.ignoreUnrecognized = disableGuardPages ? JNI_FALSE : JNI_TRUE; classpath = (char*) calloc(24 + strlen(user_classpath), sizeof(char)); - sprintf(classpath, "-Djava.class.path=%s", user_classpath); + if (!classpath) + error("Cannot allocate memory for classpath"); + snprintf(classpath, (24 + strlen(user_classpath)) * sizeof(char), "-Djava.class.path=%s", user_classpath); vm_options[propNum++].optionString = classpath; From 00e8579067bf0bc813f59f55e84b41679a4e403a Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 29 Nov 2023 15:03:35 +1300 Subject: [PATCH 11/69] bump version to 1.0-10 --- src/rJava.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index c1953ad..63cf0b0 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x010009 /* rJava v1.0-9 */ +#define RJAVA_VER 0x01000a /* rJava v1.0-10 */ /* important changes between versions: 3.0 - adds compiler From fb6730e677adbd9036035d96d6618087e392346f Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 29 Nov 2023 15:12:22 +1300 Subject: [PATCH 12/69] fix error format --- src/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.c b/src/init.c index d2d4236..e11bc1b 100644 --- a/src/init.c +++ b/src/init.c @@ -731,7 +731,7 @@ static SEXP RinitJVM_jsw(SEXP par) { /* the message may be confusing when R_CStackLimit was set to -1 because the original stack size was too large */ REprintf("Rjava.init.warning: stack size reduced from unlimited to" - " %u bytes after JVM initialization.\n", newlim); + " %lu bytes after JVM initialization.\n", (unsigned long) newlim); bigloss = 1; } else { unsigned lost = (unsigned) (oldlim - newlim); From 77399f0a0627501e5a79f2bd199777ae1a3e752b Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 29 Nov 2023 15:13:11 +1300 Subject: [PATCH 13/69] documentation fixes --- man/javaImport.Rd | 2 +- man/jcall.Rd | 2 +- man/jnull.Rd | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/man/javaImport.Rd b/man/javaImport.Rd index 0a1c321..08653f3 100644 --- a/man/javaImport.Rd +++ b/man/javaImport.Rd @@ -19,7 +19,7 @@ An external pointer to a java specific \code{UserDefinedDatabase} object } \references{ \emph{User-Defined Tables in the R Search Path}. Duncan Temple Lang. December 4, 2001 - \url{http://www.omegahat.net/RObjectTables/} + \url{https://www.omegahat.net/RObjectTables/} } \author{ Romain Francois diff --git a/man/jcall.Rd b/man/jcall.Rd index 824780c..4f311b7 100644 --- a/man/jcall.Rd +++ b/man/jcall.Rd @@ -39,7 +39,7 @@ \item{interface}{This option is experimental and specifies the interface used for calling the Java method; the current implementation supports two interfaces: - \itemize{ + \describe{ \item{\code{"RcallMethod"}}{the default interface.} \item{\code{"RcallSyncMethod"}}{synchronized call of a method. This has similar effect as using \code{synchronize} in diff --git a/man/jnull.Rd b/man/jnull.Rd index 1836101..0831b04 100644 --- a/man/jnull.Rd +++ b/man/jnull.Rd @@ -34,8 +34,8 @@ is.jnull(x) Example: given the following method definitions of the class \code{A}: \itemize{ - \item{o}{public static void run(String a);} - \item{o}{public static void run(Double n);} + \item \code{public static void run(String a);} + \item \code{public static void run(Double n);} } Calling \code{.jcall("A",,"run",NULL)} is ambiguous, because it is unclear which method is to be used. Therefore rJava requires class From b40125c63527e8633ca8b07382ed129c24a1a526 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Thu, 30 Nov 2023 11:43:53 +1300 Subject: [PATCH 14/69] update NEWS --- NEWS | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 8b851c9..54808d1 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,12 @@ NEWS/ChangeLog for rJava -------------------------- +1.0-10 2023-11-30 + o minor documentation fixes + + o fix format specifier in an error message + + 1.0-9 2023-11-28 o clean up benign C warnings @@ -522,6 +528,7 @@ o fixed synchronization issues in both JRI and REngine + 0.7-0 2009-08-22 o fixed bug in $ getter of fields using old .jfield API @@ -547,6 +554,7 @@ o update to JRI 0.5-0 + 0.6-3 2009-06-14 o update to JRI 0.4-3 (adds REngine API, enhanced support for environments and references) @@ -555,6 +563,7 @@ o added lib.loc parameter to .jpackage() + 0.6-2 2009-01-26 o fix --enable-debug to really enable debug code @@ -563,8 +572,6 @@ suffers from PATH truncation bug (or PATH is truncated in general) -[0.6-branch is created as a stable branch -- see trunk for development] - 0.6-1 2008-12-23 o substitute $(JAVA_HOME) in configuration flags when necessary @@ -638,8 +645,6 @@ -0.4 branch has been branched off the trunk, see 0.4-branch for NEWS - 0.4-13 2007-01-14 o Fix Java-side memory leaks (temporary parameters to methods were not properly released, thanks to Erik van Barneveld for @@ -822,9 +827,18 @@ loop is unaware of the separate thread and can deadlock it. 0.3-6 2006-01-30 + 0.3-5 2006-01-02 + 0.3-4 2005-12-28 + 0.3-3 2005-12-20 -0.3 2005-12-19 [finalizers, arrays] -0.2 2005-09-03 [S4 classes] -0.1 2003-08-26 [initial release] + +0.3 2005-12-19 + o finalizers, arrays + +0.2 2005-09-03 + o S4 classes + +0.1 2003-08-26 + o initial release From f9aac11d33f27abbc2d6c1633f25aeb4ceaf1b67 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 1 Dec 2023 11:06:01 +1300 Subject: [PATCH 15/69] fix callJNI error/warning calls --- src/callJNI.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/callJNI.c b/src/callJNI.c index 7b26c35..46a3df7 100644 --- a/src/callJNI.c +++ b/src/callJNI.c @@ -30,9 +30,9 @@ HIDE void* errJNI(const char *err, ...) { msg[511]=0; vsnprintf(msg, 511, err, ap); #ifdef RJ_DEBUG - Rf_warning(msg); + Rf_warning("%s", msg); #else - Rf_error(msg); + Rf_error("%s", msg); /* this never returns and is just a fallback in case ckx doesn't return */ #endif va_end(ap); From 46b3ff0c719c22de25b39613efdabbf970f187a8 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 1 Dec 2023 11:06:15 +1300 Subject: [PATCH 16/69] add internal docs --- man/rJava-internal.Rd | 80 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 man/rJava-internal.Rd diff --git a/man/rJava-internal.Rd b/man/rJava-internal.Rd new file mode 100644 index 0000000..b1c9c23 --- /dev/null +++ b/man/rJava-internal.Rd @@ -0,0 +1,80 @@ +\name{rJava-internal} +\alias{rJava-internal} +\alias{.jaddLibrary} +\alias{.jclass} +\alias{.jclass.boolean} +\alias{.jclass.double} +\alias{.jclass.float} +\alias{.jclass.int} +\alias{.jclass.void} +\alias{.jclassClass} +\alias{.jclassObject} +\alias{.jclassRef} +\alias{.jclassString} +\alias{.jfindClass} +\alias{.jfirst} +\alias{.jidenticalRef} +\alias{.jinherits} +\alias{.jinit.merge.error} +\alias{.jmergeClassPath} +\alias{.jmkref} +\alias{.jniInitialized} +\alias{.joptions} +\alias{.jproperty} +\alias{.jrcall} +\alias{.jrmLibrary} +\alias{.jsetJConvertor} +\alias{.jsetRConvertor} +\alias{.jstrVal} +\alias{.jzeroRef} +\alias{.r2j} +\alias{.rJava.base.path} +\title{ + Internal functions and constants +} +\description{ + The following functions are either internal or are not officially part + of the API and therefore may changes in the future. +} +\usage{ +.jaddLibrary(name, path, class.loader = .rJava.class.loader) +.jclass(o, true = TRUE) +.jclassRef(x, silent = FALSE) +.jfindClass(cl, silent = FALSE, class.loader = .rJava.class.loader) +.jfirst(libname, pkgname) +.jidenticalRef(a, b) +.jinherits(o, cl, class.loader = .rJava.class.loader) +.jmergeClassPath(cp) +.jmkref(jobj, jclass = "java/lang/Object") +.joptions(...) +.jproperty(key) +.jrcall(o, method, ..., simplify = TRUE, class.loader = .rJava.class.loader) +.jrmLibrary(name) +.jsetJConvertor(java.class, fn) +.jsetRConvertor(r.class, fn) +.jstrVal(obj) +.r2j(x, engine = NULL, convert = TRUE) +} +\arguments{ + \item{name}{string, name of the library} + \item{path}{string, path} + \item{class.loader}{class loader object} + \item{o}{Java object} + \item{x}{Java object} + \item{cl}{string, class name (or Java class name object)} + \item{libname}{string, library location} + \item{pkgname}{string, package name} + \item{a}{Java object} + \item{b}{Java object} + \item{cp}{string, class path} + \item{jobj}{Java object} + \item{simplify}{logical} + \item{java.class}{string, class name} + \item{fn}{convertor function} + \item{r.convertor}{string, R class} + \item{obj}{Java object} + \item{engine}{Java engine object, if \code{NULL} uses the main engine} + \item{convert}{logical} + \item{\dots}{additional parameters} +} +\keyword{internal} From 1f1d4f612fbec29011a5e0b72c4177b3a892ff11 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 8 Dec 2023 16:04:20 +1300 Subject: [PATCH 17/69] bump verison to 1.0-11 --- src/rJava.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index 63cf0b0..6f731f3 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x01000a /* rJava v1.0-10 */ +#define RJAVA_VER 0x01000b /* rJava v1.0-11 */ /* important changes between versions: 3.0 - adds compiler From 82f938ddc257fa8a6e5d1a775c5bfcce075d9dca Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 8 Dec 2023 17:00:34 +1300 Subject: [PATCH 18/69] dispatch on S3 superclasses in reflection API native type conversion (#317) --- R/reflection.R | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/R/reflection.R b/R/reflection.R index 7ae2394..3876307 100644 --- a/R/reflection.R +++ b/R/reflection.R @@ -22,15 +22,19 @@ } ### this list maps R class names to Java class names for which the constructor does the necessary conversion (for use in .jrcall) -.class.to.jclass <- c(character= "java/lang/String", - jbyte = "java/lang/Byte", - integer = "java/lang/Integer", - numeric = "java/lang/Double", - logical = "java/lang/Boolean", - jlong = "java/lang/Long", - jchar = "java/lang/Character", - jshort = "java/lang/Short", - jfloat = "java/lang/Float") +### The order matters in case an object inherits from multiple (S3) classes - then the first one +### in the list is picked. +.class.to.jclass <- c( + jlong = "java/lang/Long", + jchar = "java/lang/Character", + jshort = "java/lang/Short", + jfloat = "java/lang/Float", + jbyte = "java/lang/Byte", + integer = "java/lang/Integer", + numeric = "java/lang/Double", + logical = "java/lang/Boolean", + character= "java/lang/String" +) ### Java classes that have a corresponding primitive type and thus a corresponding TYPE field to use with scalars .primitive.classes = c("java/lang/Byte", "java/lang/Integer", "java/lang/Double", "java/lang/Boolean", @@ -47,12 +51,15 @@ else if (is.null(a)) .jnull() else if (is.raw(a)) .jarray(a, dispatch=FALSE) ## raw is always [B else { - cm <- match(class(a)[1], names(.class.to.jclass)) - if (!any(is.na(cm))) { - if (length(a) == 1) { + ## check all classes (in S3 case, see #317) + cm <- match(class(a), names(.class.to.jclass)) + if (!all(is.na(cm))) { ## at least one subclass matches + cm <- min(cm, na.rm=TRUE) ## pick the lowest (i.e. in precedence of the order above) + ## scalar? then create directly + if (length(a) == 1) { y <- .jnew(.class.to.jclass[cm], a) if (.class.to.jclass[cm] %in% .primitive.classes) attr(y, "primitive") <- TRUE - y + y } else .jarray(a, dispatch = FALSE) } else { stop("Sorry, parameter type `", class(a)[1] ,"' is ambiguous or not supported.") From a7d9d20d9a92609c2ad38c1bb025932e81dbfd7c Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 8 Dec 2023 17:08:08 +1300 Subject: [PATCH 19/69] remove JavaDoc in dist due to security issues (#303) --- mkdist | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkdist b/mkdist index 1fe0733..6da35ff 100644 --- a/mkdist +++ b/mkdist @@ -158,8 +158,9 @@ mkdir -p inst/java/boot cd src/java make clean make compile -echo "Generate javadoc documentation" -make javadoc +# do not generate javadoc (see #303) +#echo "Generate javadoc documentation" +#make javadoc cd ../.. echo "Copy compiled Java classes ..." # copy all complied Java classes and sources From 56973123e820b019f93cb59edb0ef0ed7d001082 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 8 Dec 2023 17:13:25 +1300 Subject: [PATCH 20/69] update NEWS --- NEWS | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/NEWS b/NEWS index 54808d1..54b172d 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,19 @@ NEWS/ChangeLog for rJava -------------------------- +1.0-11 + o dispatch on superclasses when converting native types in + the reflection API (J/.jrcall). Please note that it is + safer to use the native API than to rely on reflection + conversions so packages are encouraged to use the native API + which is much faster and type-safe. (#317) + + o remove JavaDoc from the distribution tar ball due to + security issues (#303). Note that JavaDoc can be generated + from the source package by running `make javadoc` in the + `src/java` directory. + + 1.0-10 2023-11-30 o minor documentation fixes From 7fd5769edcf79696326281b5c6ea2c9fe7762bfd Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 8 Dec 2023 18:01:55 +1300 Subject: [PATCH 21/69] fix RJavaArrayIterator.java to work with more than two dimensions correctly (#5) --- src/java/RJavaArrayIterator.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/java/RJavaArrayIterator.java b/src/java/RJavaArrayIterator.java index 3b0df62..c5c3789 100644 --- a/src/java/RJavaArrayIterator.java +++ b/src/java/RJavaArrayIterator.java @@ -71,6 +71,7 @@ protected Object next( ){ index[i] = 0 ; } else{ index[i] = index[i] + 1 ; + break; } } From 2b5aa501654bb25605a14029c132d3bc50462a48 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 8 Dec 2023 18:04:37 +1300 Subject: [PATCH 22/69] update NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 54b172d..3d976b3 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,10 @@ from the source package by running `make javadoc` in the `src/java` directory. + o bugfix: .jarray(..., dispatch=TRUE) was generating nested + arrays with incorrect content if the input array had more than + two dimensions. (#5) + 1.0-10 2023-11-30 o minor documentation fixes From f10d64dd97c9eb81c97999c72a4bd99442b047ad Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Sat, 9 Dec 2023 12:09:19 +1300 Subject: [PATCH 23/69] fix IGNORE env var typo in configure.win (closes #304) --- configure.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.win b/configure.win index cd1b09a..f72c921 100644 --- a/configure.win +++ b/configure.win @@ -50,7 +50,7 @@ if [ -e jri/configure.win ]; then cp -r jri/run.bat jri/src/jri.dll jri/src/JRI.jar jri/examples inst/jri/ else echo "**** WARNING: JRI could NOT be built" >&2 - if [ -z "$INGORE" ]; then + if [ -z "$IGNORE" ]; then echo "Set IGNORE=1 if you want to build rJava anyway." exit 1 fi From a92d95cf4985b318c7b498c456b6b060e11f5542 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Sat, 9 Dec 2023 12:10:22 +1300 Subject: [PATCH 24/69] update NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 3d976b3..36fbe9e 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ arrays with incorrect content if the input array had more than two dimensions. (#5) + o the IGNORE env var was misspelled in configure.win. (#304) + 1.0-10 2023-11-30 o minor documentation fixes From 225be3c99ae2e2f287a02259cc6df6e73bcb0e91 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sun, 9 Apr 2023 21:17:52 +0200 Subject: [PATCH 25/69] configure: Avoid implicit int in inline keyword check This prevents the check from going wrong with future compilers which do not support implicit ints. --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 4858bc3..41dd6c9 100755 --- a/configure +++ b/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/configure.ac b/configure.ac index 79a175f..14090b7 100644 --- a/configure.ac +++ b/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); From ce7954582523083db183970f0b03808e35fdbe75 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 26 Jan 2024 11:22:33 +1300 Subject: [PATCH 26/69] fix typo --- man/rJava-internal.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/rJava-internal.Rd b/man/rJava-internal.Rd index b1c9c23..c6439ed 100644 --- a/man/rJava-internal.Rd +++ b/man/rJava-internal.Rd @@ -71,7 +71,7 @@ \item{simplify}{logical} \item{java.class}{string, class name} \item{fn}{convertor function} - \item{r.convertor}{string, R class} + \item{r.class}{string, R class} \item{obj}{Java object} \item{engine}{Java engine object, if \code{NULL} uses the main engine} \item{convert}{logical} From 9d2a16a1573719ec1f32d207509033c66c14d56a Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 26 Jan 2024 11:23:29 +1300 Subject: [PATCH 27/69] adapt to changed Win32 API in R 4.2.0 --- NEWS | 7 ++++++- jri/src/Rcallbacks.h | 3 ++- jri/src/Rinit.c | 23 ++++++++++++++++++----- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 36fbe9e..1215e0d 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,12 @@ NEWS/ChangeLog for rJava -------------------------- -1.0-11 +1.0-12 + o Win32: minor changes to adapt to (undocumented) API changes in + R 4.2.0. + + o Win32: warn if R_HOME path is too long. + o dispatch on superclasses when converting native types in the reflection API (J/.jrcall). Please note that it is safer to use the native API than to rely on reflection diff --git a/jri/src/Rcallbacks.h b/jri/src/Rcallbacks.h index dcb3eae..a244e7d 100644 --- a/jri/src/Rcallbacks.h +++ b/jri/src/Rcallbacks.h @@ -12,7 +12,8 @@ #else #define RCCONST const #endif -#ifdef WIN32 +/* ReadConsole API has been changed (unannounced and undocumented!) for Windows in r81626 */ +#if defined (WIN32) && (R_VERSION < R_Version(4,2,0)) #define RCSIGN #else #define RCSIGN unsigned diff --git a/jri/src/Rinit.c b/jri/src/Rinit.c index 04c142b..b6f75c9 100644 --- a/jri/src/Rinit.c +++ b/jri/src/Rinit.c @@ -163,10 +163,17 @@ void myCallBack(void) int myYesNoCancel(RCCONST char *s) { - char ss[128]; - unsigned char a[3]; - - snprintf(ss, sizeof(ss)-1, "%s [y/n/c]: ", s); + char ss[192]; + RCSIGN char a[3]; + unsigned int l = (unsigned int) strlen(s); + + if (l + 12 > sizeof(ss)) { + memcpy(ss, s, sizeof(ss) - 15); + strcpy(ss + sizeof(ss) - 15, "... [y/n/c]: "); + } else { + memcpy(ss, s, l); + strcpy(ss + l, " [y/n/c]: "); + } Re_ReadConsole(ss, a, 3, 0); switch (a[0]) { case 'y': @@ -228,7 +235,13 @@ int initR(int argc, char **argv) MessageBox(0, "R_HOME must be set or R properly installed (\\Software\\R-core\\R\\InstallPath registry entry must exist).\n", "Can't find R home", MB_OK|MB_ICONERROR); return -2; } - snprintf(rhb, sizeof(rhb)-1, "R_HOME=%s",RHome); + strcpy(rhb, "R_HOME="); + if (strlen(RHome) > sizeof(rhb) - 9) { + fprintf(stderr, "R_HOME path is too long!\n"); + MessageBox(0, "R_HOME path it too long! Install R in a different location.\n", "R home path is too long", MB_OK|MB_ICONERROR); + return -2; + } + strcpy(rhb + 7, RHome); putenv(rhb); } /* on Win32 this should set R_Home (in R_SetParams) as well */ From e0628b8c0d454cf06bf48509e7abba716eba58dc Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 26 Jan 2024 11:24:09 +1300 Subject: [PATCH 28/69] force output type --- src/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.c b/src/init.c index e11bc1b..d44d92d 100644 --- a/src/init.c +++ b/src/init.c @@ -194,7 +194,7 @@ static int initJVM(const char *user_classpath, int opts, char **optv, int hooks, return -2; /* perhaps this VM does not allow disabling guard pages */ if (res != 0) - error("Cannot create Java virtual machine (%d)", res); + error("Cannot create Java virtual machine (JNI_CreateJavaVM returned %ld)", (long int) res); if (!eenv) error("Cannot obtain JVM environment"); From 12ba0c4eb4376faf256608ce73178b839fcba993 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 26 Jan 2024 11:25:15 +1300 Subject: [PATCH 29/69] update NEWS --- NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1215e0d..969574a 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,9 @@ NEWS/ChangeLog for rJava -------------------------- -1.0-12 +1.0-12 2024-01-26 o Win32: minor changes to adapt to (undocumented) API changes in - R 4.2.0. + R 4.2.0. o Win32: warn if R_HOME path is too long. From cf6b51e699c34e83bde0b2f82d4553ed92dfaa34 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 8 Mar 2024 09:14:59 +1300 Subject: [PATCH 30/69] Update GitHub action --- .github/workflows/check.yaml | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index fe85bb5..6b150ce 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -11,15 +11,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'windows-2022', 'macOS-10.15', 'ubuntu-20.04' ] + os: [ 'windows-2022', 'macOS-13', 'macOS-14', 'ubuntu-22.04' ] r: [ 'release' ] java: [ 8, 11 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install R - uses: s-u/R-actions/install@v1 + uses: s-u/R-actions/install@v2 with: r-version: ${{ matrix.r }} tools: base @@ -43,24 +43,4 @@ jobs: sudo bash reconf.sh shell: bash - - name: R CMD check (Windows) - if: runner.os == 'Windows' - run: "bash -c 'R CMD check --no-multiarch --no-manual ../rJava_*.tar.gz'" - - - name: R CMD check (Linux) - if: runner.os == 'Linux' - run: "bash -c 'xvfb-run R CMD check --no-manual ../rJava_*.tar.gz'" - - - name: R CMD check (macOS) - if: runner.os == 'macOS' - run: "bash -c 'NOAWT=1 R CMD check --no-manual ../rJava_*.tar.gz'" - - - name: Show install log - run: "bash -c 'if [ -e rJava.Rcheck/00install.out ]; then cat rJava.Rcheck/00install.out; fi'" - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@master - with: - name: ${{ runner.os }}-r${{ matrix.r }}-j${{ matrix.java }}-results - path: rJava.Rcheck + - uses: s-u/R-actions/pkg-check@v2 From d58548c08ead76bd93e4c3c7f3ef474d6e7b341f Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 8 Mar 2024 09:21:58 +1300 Subject: [PATCH 31/69] GitHub action: run mkdist in pkg-check --- .github/workflows/check.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 6b150ce..d757d7d 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -28,12 +28,6 @@ jobs: with: java-version: ${{ matrix.java }} - - name: Build - run: | - sh mkdist - java -version && which java && echo $PATH && echo $JAVA_HOME - shell: bash - - name: Setup R Java support if: runner.os != 'Windows' run: | @@ -44,3 +38,5 @@ jobs: shell: bash - uses: s-u/R-actions/pkg-check@v2 + with: + build-script: sh mkdist From 345223d53c201c342a9af49577295810fa5d7105 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 8 Mar 2024 09:35:15 +1300 Subject: [PATCH 32/69] GHA: update setup-java to work on arm64 and set NOAWT --- .github/workflows/check.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index d757d7d..a8efccd 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -5,6 +5,8 @@ name: check jobs: check: runs-on: ${{ matrix.os }} + env: + NOAWT: 1 name: ${{ matrix.os }}, R ${{ matrix.r }}, Java ${{ matrix.java }} @@ -24,8 +26,9 @@ jobs: r-version: ${{ matrix.r }} tools: base - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v4 with: + distribution: 'zulu' java-version: ${{ matrix.java }} - name: Setup R Java support From f05bb59a6a3459ae8743bbb00178d6d234deba7c Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 12 May 2025 08:24:14 +1200 Subject: [PATCH 33/69] bump verison to 1.0-13 --- src/rJava.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index 6f731f3..bcdfb9a 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x01000b /* rJava v1.0-11 */ +#define RJAVA_VER 0x01000d /* rJava v1.0-13 */ /* important changes between versions: 3.0 - adds compiler From f02bb4fe3f666fc169afde06a484e5071bb30e98 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 12 May 2025 09:10:57 +1200 Subject: [PATCH 34/69] don't change java.parameters option, but set defaults in .jinit instead (closes #341) --- R/jfirst.R | 4 ---- R/jinit.R | 17 ++++++++++++++++- man/jinit.Rd | 17 +++++++++++------ 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/R/jfirst.R b/R/jfirst.R index faa8dbd..8f40142 100644 --- a/R/jfirst.R +++ b/R/jfirst.R @@ -46,10 +46,6 @@ for (x in .delayed.variables) assign(x, NULL, .env) assign(".jniInitialized", FALSE, .env) - # default JVM initialization parameters - if (is.null(getOption("java.parameters"))) - options("java.parameters"="-Xmx512m") - ## S4 classes update - all classes are created earlier in classes.R, but jobjRef's prototype is only valid after the dylib is loaded setClass("jobjRef", representation(jobj="externalptr", jclass="character"), prototype=list(jobj=.jzeroRef, jclass="java/lang/Object"), where=.env) } diff --git a/R/jinit.R b/R/jinit.R index e622edc..736fc8e 100644 --- a/R/jinit.R +++ b/R/jinit.R @@ -10,7 +10,7 @@ .Call(RJava_needs_init) ## initialization -.jinit <- function(classpath=NULL, parameters=getOption("java.parameters"), ..., silent=FALSE, force.init=FALSE) { +.jinit <- function(classpath=NULL, parameters=getOption("java.parameters", NA), ..., silent=FALSE, force.init=FALSE) { running.classpath <- character() if (!.need.init()) { running.classpath <- .jclassPath() @@ -23,6 +23,21 @@ } } + # default JVM initialization parameters + # Up until 1.0-12 jfirst (=onLoad) set java.parameters to -Xmx512m to increase the heap + # size, so parameters was always -Xmx512m unless the user set java.parameters or parameters. + # We now leave the java.parameters alone and only set the default heap size if + # java.parameters is not set -- with mostly the same effect. + # (NB: JVMs have changed the default from 256Mb to 25% of available memory in some cases, + # thus the default is becoming less important nowadays.) + # We also increase the default heap size since machines using R are unlikely + # to be starved for RAM. Note that the meaning of NULL has changed to "none" + # since 1.0-13. + if (any(is.na(parameters))) + parameters <- "-Xmx1g" + if (is.null(parameters)) + parameters <- character() + ## determine path separator path.sep <- .Platform$path.sep diff --git a/man/jinit.Rd b/man/jinit.Rd index 3ff89a1..4f9d88d 100644 --- a/man/jinit.Rd +++ b/man/jinit.Rd @@ -11,8 +11,8 @@ \code{.jvmState() returns the state of the current JVM.} } \usage{ -.jinit(classpath = NULL, parameters = getOption("java.parameters"), ..., -silent = FALSE, force.init = FALSE) +.jinit(classpath = NULL, parameters = getOption("java.parameters", NA), ..., + silent = FALSE, force.init = FALSE) .jvmState() } \arguments{ @@ -25,7 +25,10 @@ silent = FALSE, force.init = FALSE) the virtual machine. They are implementation dependent and apply to JDK version 1.2 or higher only. Please note that each parameter must be in a separate element of the array, you cannot use a - space-separated string with multiple parameters.} + space-separated string with multiple parameters. The value of + \code{NA} means "use rJava default" which is \code{"-Xmx1g"} + currently. \code{NULL} is equivalent to \code{character()}. + } \item{...}{Other optional Java initialization parameters (implementation-dependent).} \item{silent}{If set to \code{TRUE} no warnings are issued.} \item{force.init}{If set to \code{TRUE} JVM is re-initialized even if @@ -89,15 +92,17 @@ silent = FALSE, force.init = FALSE) rare and problematic in either case. Behavior of rJava functions other than \code{.jinit} and \code{.jvmState} is undefined unless \code{.jvmState()$initialized} is \code{TRUE}. + + NOTE: \code{.jinit()} can be called implicitly by other functions such + as \code{\link{.jpackage}} or \code{\link{J}}. } \seealso{ \code{\link{.jpackage}} } \examples{ \dontrun{ -## set heap size limit to 512MB (see java -X) and -## use "myClasses.jar" as the class path -.jinit(classpath="myClasses.jar", parameters="-Xmx512m") +## set heap size limit to 512MB (see java -X) +.jinit(parameters="-Xmx512m") .jvmState() } } From ef046ea7698ff0ae9a701fe48eceb4ee54befc3f Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 12 May 2025 09:12:28 +1200 Subject: [PATCH 35/69] update NEWS --- NEWS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NEWS b/NEWS index 969574a..1ae534f 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,18 @@ NEWS/ChangeLog for rJava -------------------------- +1.0-13 + o The default Java parameters have changed from -Xmx512m to + -Xmx1g and will be only set by .jinit() if the java.parameters + option is not set (and no parameters are specified). (#341) + Previously, the java.parameters option would be set on load + (if not present), now it is not changed by rJava at all and + left to the user. + + o .jinit() interprets parameters=NA as "use rJava default" (see + above) and NULL is a shorthand for character(). + + 1.0-12 2024-01-26 o Win32: minor changes to adapt to (undocumented) API changes in R 4.2.0. From 8c9618e4149fe1ebfb48c43f55cb5d0d4904e6c3 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 08:40:51 +1300 Subject: [PATCH 36/69] bump version to 1.0-14 --- src/rJava.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index bcdfb9a..6c50085 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x01000d /* rJava v1.0-13 */ +#define RJAVA_VER 0x01000e /* rJava v1.0-14 */ /* important changes between versions: 3.0 - adds compiler @@ -27,6 +27,25 @@ #include #include +#include + +/* R API compatibility re-mapping */ +#if (R_VERSION >= R_Version(2,0,0)) +/* EXTPTR */ +#ifdef EXTPTR_PTR +#undef EXTPTR_PTR +#endif +#define EXTPTR_PTR(X) R_ExternalPtrAddr(X) +#ifdef EXTPTR_PROT +#undef EXTPTR_PROT +#endif +#define EXTPTR_PROT(X) R_ExternalPtrProtected(X) +#ifdef EXTPTR_TAG +#undef EXTPTR_TAG +#endif +#define EXTPTR_TAG(X) R_ExternalPtrTag(X) +#endif + /* flags used in function declarations: HIDE - hidden (used internally in rJava only) From 57f2c5045ebabbf1eabba9a47cbfc32c004549ad Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 08:43:49 +1300 Subject: [PATCH 37/69] update NEWS --- NEWS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1ae534f..1848f35 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,11 @@ NEWS/ChangeLog for rJava -------------------------- -1.0-13 +1.0-14 2026-01-19 + o adjust to renamed R API + + +1.0-13 2024-05-12 o The default Java parameters have changed from -Xmx512m to -Xmx1g and will be only set by .jinit() if the java.parameters option is not set (and no parameters are specified). (#341) From 5b69017423899ef333ef2d2b340587d37456c8d1 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 08:52:29 +1300 Subject: [PATCH 38/69] GHA: update available runners --- .github/workflows/check.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index a8efccd..58a2cde 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -13,8 +13,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ 'windows-2022', 'macOS-13', 'macOS-14', 'ubuntu-22.04' ] - r: [ 'release' ] + os: [ macos-14, macos-15-intel, windows-2022, ubuntu-22.04, ubuntu-24.04 ] + r: [ devel ] java: [ 8, 11 ] steps: @@ -40,6 +40,6 @@ jobs: sudo bash reconf.sh shell: bash - - uses: s-u/R-actions/pkg-check@v2 + - uses: s-u/R-actions/pkg-check@master with: build-script: sh mkdist From 7988863a0498f6acb490fa81d4e823f0954eb0ab Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 11:48:50 +1300 Subject: [PATCH 39/69] add R deps missing on ubuntu-24.04 runners --- .github/workflows/check.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 58a2cde..350d708 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -43,3 +43,4 @@ jobs: - uses: s-u/R-actions/pkg-check@master with: build-script: sh mkdist + debian-deps: libpcre2-dev liblzma-dev libbz2-dev libdeflate-dev From 92e3905745579f0a135187a7202109b7b77dda29 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 11:58:42 +1300 Subject: [PATCH 40/69] add EXTPTR compatibility re-maps --- src/rJava.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/rJava.h b/src/rJava.h index 6c50085..e0f1883 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -78,6 +78,21 @@ #include "config.h" +/* R 4.0.1 broke EXTPTR_PTR ABI so re-map it to safety at the small expense of speed */ +#ifdef EXTPTR_PTR +#undef EXTPTR_PTR +#endif +#define EXTPTR_PTR(X) R_ExternalPtrAddr(X) +/* PROT/TAG are safe so far, but just to make sure ... */ +#ifdef EXTPTR_PROT +#undef EXTPTR_PROT +#endif +#define EXTPTR_PROT(X) R_ExternalPtrProtected(X) +#ifdef EXTPTR_TAG +#undef EXTPTR_TAG +#endif +#define EXTPTR_TAG(X) R_ExternalPtrTag(X) + #ifdef MEMPROF #include #include From 9d912e2633787e1c5aff2e4bc4bd15e8e0c025ce Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 12:00:11 +1300 Subject: [PATCH 41/69] add protection fixes --- src/Rglue.c | 78 ++++++++++++++++++++++------------------------------- src/rJava.c | 25 +++++++++-------- 2 files changed, 46 insertions(+), 57 deletions(-) diff --git a/src/Rglue.c b/src/Rglue.c index 45bbcd4..c76da2f 100644 --- a/src/Rglue.c +++ b/src/Rglue.c @@ -7,23 +7,6 @@ #include #include #include "rjstring.h" - -/* R 4.0.1 broke EXTPTR_PTR ABI so re-map it to safety at - the small expense of speed */ -#ifdef EXTPTR_PTR -#undef EXTPTR_PTR -#endif -#define EXTPTR_PTR(X) R_ExternalPtrAddr(X) -/* PROT/TAG are safe so far, but just to make sure ... */ -#ifdef EXTPTR_PROT -#undef EXTPTR_PROT -#endif -#define EXTPTR_PROT(X) R_ExternalPtrProtected(X) -#ifdef EXTPTR_TAG -#undef EXTPTR_TAG -#endif -#define EXTPTR_TAG(X) R_ExternalPtrTag(X) - #include /* max supported # of parameters to Java methods */ @@ -197,7 +180,7 @@ HIDE void deserializeSEXP(SEXP o) { /* Note: currently we don't remove the serialized content, because it was created explicitly using .jcache to allow repeated saving. Once this is handled by a hook, we shall remove it. However, to assure compatibility TAG is always NULL for now, so we do clear the cache if TAG is non-null for future use. */ if (EXTPTR_TAG(o) != R_NilValue) { /* remove the serialized raw vector */ - SETCDR(o, R_NilValue); /* Note: this is abuse of the API since it uses the fact that PROT is stored in CDR */ + R_SetExternalPtrTag(o, R_NilValue); } } } @@ -259,7 +242,9 @@ static int Rpar2jvalue(JNIEnv *env, SEXP par, jvalue *jpar, sig_buffer_t *sig, i SEXP p=par; SEXP e; int jvpos=0; - int i=0; +#ifdef RJ_DEBUG + int i = 0; +#endif while (p && TYPEOF(p)==LISTSXP && (e=CAR(p))) { /* skip all named arguments */ @@ -432,7 +417,9 @@ static int Rpar2jvalue(JNIEnv *env, SEXP par, jvalue *jpar, sig_buffer_t *sig, i _dbg(rjprintf(" (ignoring)\n")); } } +#ifdef RJ_DEBUG i++; +#endif p=CDR(p); } fintmpo(tmpo); @@ -453,7 +440,8 @@ static void Rfreejpars(JNIEnv *env, jobject *tmpo) { HIDE jvalue R1par2jvalue(JNIEnv *env, SEXP par, sig_buffer_t *sig, jobject *otr) { jobject tmpo[4] = {0, 0}; jvalue v[4]; - int p = Rpar2jvalue(env, CONS(par, R_NilValue), v, sig, 2, tmpo); + int p = Rpar2jvalue(env, PROTECT(CONS(par, R_NilValue)), v, sig, 2, tmpo); + UNPROTECT(1); /* this should never happen, but just in case - we can only assume responsibility for one value ... */ if (p != 1 || (tmpo[0] && tmpo[1])) { Rfreejpars(env, tmpo); @@ -717,8 +705,11 @@ REPE SEXP RcallSyncMethod(SEXP par) { e = RcallMethod(par); - if ((*env)->MonitorExit(env, o) != JNI_OK) + if ((*env)->MonitorExit(env, o) != JNI_OK) { + PROTECT(e); REprintf("Rglue.SERIOUS PROBLEM: MonitorExit failed, subsequent calls may cause a deadlock!\n"); + UNPROTECT(1); + } return e; } @@ -832,14 +823,13 @@ static SEXP getObjectClassName(JNIEnv *env, jobject o) { /** creates a new jobjRef object. If klass is NULL then the class is determined from the object (if also o=NULL then the class is set to java/lang/Object) */ HIDE SEXP new_jobjRef(JNIEnv *env, jobject o, const char *klass) { - SEXP oo = NEW_OBJECT(MAKE_CLASS("jobjRef")); + SEXP oo = PROTECT(NEW_OBJECT(PROTECT(MAKE_CLASS("jobjRef")))); if (!inherits(oo, "jobjRef")) error("unable to create jobjRef object"); - PROTECT(oo); SET_SLOT(oo, install("jclass"), - klass?mkString(klass):getObjectClassName(env, o)); - SET_SLOT(oo, install("jobj"), j2SEXP(env, o, 1)); - UNPROTECT(1); + PROTECT(klass ? mkString(klass) : getObjectClassName(env, o))); + SET_SLOT(oo, install("jobj"), PROTECT(j2SEXP(env, o, 1))); + UNPROTECT(4); return oo; } @@ -851,13 +841,12 @@ HIDE SEXP new_jobjRef(JNIEnv *env, jobject o, const char *klass) { * @param cl Class instance */ HIDE SEXP new_jclassName(JNIEnv *env, jobject/*Class*/ cl ) { - SEXP oo = NEW_OBJECT(MAKE_CLASS("jclassName")); + SEXP oo = PROTECT(NEW_OBJECT(PROTECT(MAKE_CLASS("jclassName")))); if (!inherits(oo, "jclassName")) error("unable to create jclassName object"); - PROTECT(oo); - SET_SLOT(oo, install("name"), getName(env, cl) ); - SET_SLOT(oo, install("jobj"), new_jobjRef( env, cl, "java/lang/Class" ) ); - UNPROTECT(1); + SET_SLOT(oo, install("name"), PROTECT(getName(env, cl)) ); + SET_SLOT(oo, install("jobj"), PROTECT(new_jobjRef( env, cl, "java/lang/Class" )) ); + UNPROTECT(4); return oo; } @@ -875,24 +864,22 @@ HIDE SEXP getName( JNIEnv *env, jobject/*Class*/ cl){ if (sl) (*env)->GetStringUTFRegion(env, r, 0, sl, cn); char *c=cn; while(*c) { if (*c=='.') *c='/'; c++; } - SEXP res = PROTECT( mkString(cn ) ); + SEXP res = mkString(cn); releaseObject(env, r); - UNPROTECT(1); /* res */ return res; } static SEXP new_jarrayRef(JNIEnv *env, jobject a, const char *sig) { /* it is too tedious to try to do this in C, so we use 'new' R function instead */ /* SEXP oo = eval(LCONS(install("new"),LCONS(mkString("jarrayRef"),R_NilValue)), R_GlobalEnv); */ - SEXP oo = NEW_OBJECT(MAKE_CLASS("jarrayRef")); + SEXP oo = PROTECT(NEW_OBJECT(PROTECT(MAKE_CLASS("jarrayRef")))); /* .. and set the slots in C .. */ if (! IS_JARRAYREF(oo) ) error("unable to create an array"); - PROTECT(oo); - SET_SLOT(oo, install("jobj"), j2SEXP(env, a, 1)); - SET_SLOT(oo, install("jclass"), mkString(sig)); - SET_SLOT(oo, install("jsig"), mkString(sig)); - UNPROTECT(1); + SET_SLOT(oo, install("jobj"), PROTECT(j2SEXP(env, a, 1))); + SET_SLOT(oo, install("jclass"), PROTECT(mkString(sig))); + SET_SLOT(oo, install("jsig"), PROTECT(mkString(sig))); + UNPROTECT(5); return oo; } @@ -908,17 +895,16 @@ static SEXP new_jarrayRef(JNIEnv *env, jobject a, const char *sig) { static SEXP new_jrectRef(JNIEnv *env, jobject a, const char *sig, SEXP dim ) { /* it is too tedious to try to do this in C, so we use 'new' R function instead */ /* SEXP oo = eval(LCONS(install("new"),LCONS(mkString("jrectRef"),R_NilValue)), R_GlobalEnv); */ - SEXP oo = NEW_OBJECT(MAKE_CLASS("jrectRef")); + SEXP oo = PROTECT(NEW_OBJECT(PROTECT(MAKE_CLASS("jrectRef")))); /* .. and set the slots in C .. */ if (! IS_JRECTREF(oo) ) error("unable to create an array"); - PROTECT(oo); - SET_SLOT(oo, install("jobj"), j2SEXP(env, a, 1)); - SET_SLOT(oo, install("jclass"), mkString(sig)); - SET_SLOT(oo, install("jsig"), mkString(sig)); + SET_SLOT(oo, install("jobj"), PROTECT(j2SEXP(env, a, 1))); + SET_SLOT(oo, install("jclass"), PROTECT(mkString(sig))); + SET_SLOT(oo, install("jsig"), PROTECT(mkString(sig))); SET_SLOT(oo, install("dimension"), dim); - UNPROTECT(1); /* oo */ + UNPROTECT(5); /* oo + slots */ return oo; } #endif @@ -1092,7 +1078,7 @@ REPC SEXP javaObjectCache(SEXP o, SEXP what) { error("invalid object"); if (TYPEOF(what) == RAWSXP || what == R_NilValue) { /* set PROT to the serialization of NULL */ - SETCDR(o, what); + R_SetExternalPtrProtected(o, what); return what; } if (TYPEOF(what) == LGLSXP) diff --git a/src/rJava.c b/src/rJava.c index 294f0f2..33bd33d 100644 --- a/src/rJava.c +++ b/src/rJava.c @@ -43,9 +43,9 @@ HIDE void throwR(SEXP msg, SEXP jobj, SEXP clazzes) { setAttrib(cond, R_NamesSymbol, names); setAttrib(cond, R_ClassSymbol, clazzes); - UNPROTECT(2); /* clazzes, names */ - eval(LCONS(install("stop"), CONS(cond, R_NilValue)), R_GlobalEnv); - UNPROTECT(1); /* cond */ + UNPROTECT(1); /* names */ + eval(PROTECT(LCONS(install("stop"), PROTECT(CONS(cond, R_NilValue)))), R_GlobalEnv); + UNPROTECT(3); /* cond + eval-pars */ } /* check for exceptions and throw them to R level */ @@ -63,7 +63,7 @@ HIDE void ckx(JNIEnv *env) { /* env is valid and an exception occurred */ /* we create the jobj first, because the exception may in theory disappear after being cleared, yet this can be (also in theory) risky as it uses further JNI calls ... */ - xobj = j2SEXP(env, x, 0); + xobj = PROTECT(j2SEXP(env, x, 0)); if (!rj_RJavaTools_Class) { REprintf("ERROR: Java exception occurred during rJava bootstrap - see stderr for Java stack trace.\n"); (*env)->ExceptionDescribe(env); @@ -71,7 +71,7 @@ HIDE void ckx(JNIEnv *env) { (*env)->ExceptionClear(env); /* grab the list of class names (without package path) */ - SEXP clazzes = rj_RJavaTools_Class ? PROTECT( getSimpleClassNames_asSEXP( (jobject)x, (jboolean)1 ) ) : R_NilValue; + SEXP clazzes = PROTECT( rj_RJavaTools_Class ? getSimpleClassNames_asSEXP( (jobject)x, (jboolean)1 ) : R_NilValue ); /* ok, now this is a critical part that we do manually to avoid recursion */ { @@ -97,7 +97,7 @@ HIDE void ckx(JNIEnv *env) { /* convert full class name to JNI notation */ char *cn = strdup(c), *d = cn; while (*d) { if (*d == '.') *d = '/'; d++; } - xclass = mkString(cn); + xclass = PROTECT(mkString(cn)); free(cn); (*env)->ReleaseStringUTFChars(env, cname, c); } @@ -114,15 +114,20 @@ HIDE void ckx(JNIEnv *env) { (*env)->DeleteLocalRef(env, x); /* construct the jobjRef */ - xr = PROTECT(NEW_OBJECT(MAKE_CLASS("jobjRef"))); + xr = PROTECT(NEW_OBJECT(PROTECT(MAKE_CLASS("jobjRef")))); + if (!xclass) xclass = PROTECT(mkString("java/lang/Throwable")); if (inherits(xr, "jobjRef")) { - SET_SLOT(xr, install("jclass"), xclass ? xclass : mkString("java/lang/Throwable")); + SET_SLOT(xr, install("jclass"), xclass); SET_SLOT(xr, install("jobj"), xobj); } /* and off to R .. (we're keeping xr and clazzes protected) */ throwR(msg, xr, clazzes); - /* throwR never returns so don't even bother ... */ + /* should not return, but just in case ... */ + + /* protect stack: xobj, clz, msg, xcl, xr + mk_class */ + /* (it may confuse the UP checker since the order does vary by path, but the count is the same) */ + UNPROTECT(6); } /* clear any pending exceptions */ @@ -162,8 +167,6 @@ HIDE JNIEnv *getJNIEnv(void) } if (env && !eenv) eenv=env; - /* if (eenv!=env) - fprintf(stderr, "Warning! eenv=%x, but env=%x - different environments encountered!\n", eenv, env); */ return env; } From 63a8eef254beaebb3e0348df7b091e0822a60578 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 12:01:23 +1300 Subject: [PATCH 42/69] modenrize DESCRIPTION --- DESCRIPTION | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e70cfc6..1b7c4aa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,9 @@ Package: rJava Version: (populated by mkdist!) Title: Low-Level R to Java Interface -Author: Simon Urbanek -Maintainer: Simon Urbanek +Author: Simon Urbanek [aut, cre, cph] (https://urbanek.nz, ) +Maintainer: Simon Urbanek +Authors@R: person("Simon", "Urbanek", role=c("aut","cre","cph"), email="Simon.Urbanek@r-project.org", comment=c("https://urbanek.nz", ORCID="0000-0003-2297-1732")) Depends: R (>= 3.6.0), methods Description: Low-level interface to Java VM very much like .C/.Call and friends. Allows creation of objects, calling methods and accessing fields. License: LGPL-2.1 From 72baf513c176d9058a504aa684972fa5b0dad092 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 12:01:33 +1300 Subject: [PATCH 43/69] update NEWS --- NEWS | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1848f35..47ed0b2 100644 --- a/NEWS +++ b/NEWS @@ -2,10 +2,14 @@ -------------------------- 1.0-14 2026-01-19 - o adjust to renamed R API + o Minor changes to replace EXTPTR macros with API calls globally. + o Added Authors@R and ORCID. -1.0-13 2024-05-12 + o Add some protection fixes. + + +1.0-13 2025-05-12 o The default Java parameters have changed from -Xmx512m to -Xmx1g and will be only set by .jinit() if the java.parameters option is not set (and no parameters are specified). (#341) From 4afc2b2c92a6436afcee3aeee01e5c3f1e401759 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 13:14:57 +1300 Subject: [PATCH 44/69] use new ObjectTable.h in R 4.6.0+ --- src/rJava.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rJava.h b/src/rJava.h index e0f1883..45a5c22 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -25,9 +25,12 @@ #include #include -#include - #include +#if (R_VERSION >= R_Version(4,6,0)) +#include +#else +#include +#endif /* R API compatibility re-mapping */ #if (R_VERSION >= R_Version(2,0,0)) From d5a9526ac185a08a4af810732726adc082672e75 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 13:17:50 +1300 Subject: [PATCH 45/69] bump version to 1.0-15 --- src/rJava.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index 45a5c22..c0ca8c7 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x01000e /* rJava v1.0-14 */ +#define RJAVA_VER 0x01000f /* rJava v1.0-15 */ /* important changes between versions: 3.0 - adds compiler From d03e1cad65ec6f899c767d0121b14d31aba01d46 Mon Sep 17 00:00:00 2001 From: Valentino Pinna Date: Wed, 12 Nov 2025 14:49:39 +0100 Subject: [PATCH 46/69] Fix #345. Allow J() convenience call on all versions of Java 6+ --- src/java/RJavaTools.java | 158 ++++++++++++++++++++++++++++++--------- 1 file changed, 124 insertions(+), 34 deletions(-) diff --git a/src/java/RJavaTools.java b/src/java/RJavaTools.java index 3b52c85..6890b56 100644 --- a/src/java/RJavaTools.java +++ b/src/java/RJavaTools.java @@ -17,13 +17,20 @@ // You should have received a copy of the GNU General Public License // along with rJava. If not, see . -import java.lang.reflect.Method ; -import java.lang.reflect.Field ; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodHandles.Lookup; +import java.lang.reflect.AccessibleObject; import java.lang.reflect.Constructor ; +import java.lang.reflect.Executable; +import java.lang.reflect.Field ; import java.lang.reflect.InvocationTargetException ; -import java.lang.reflect.Modifier ; import java.lang.reflect.Member ; - +import java.lang.reflect.Method ; +import java.lang.reflect.Modifier ; +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.Deque; +import java.util.HashSet; import java.util.Vector ; @@ -35,6 +42,23 @@ */ public class RJavaTools { + /* dual path for Java 8 and 9+ to check actual accessibility */ + private static final Method CAN_ACCESS; + /* Java 8 accessibility checker */ + private static final Lookup LOOKUP = MethodHandles.publicLookup(); + + static { + Method canAccess = null; + try { + canAccess = Executable.class.getMethod("canAccess", Object.class); + } catch (NoSuchMethodException e) { + // Java 8- + } catch (SecurityException e) { + // Java 8- + } + CAN_ACCESS = canAccess; + } + /** * Returns an inner class of the class with the given simple name * @@ -328,7 +352,97 @@ public static boolean hasMethod(Object o, String name) { return classHasMethod(o.getClass(), name, false); } + /** + * Tests whether a given executable is accessible without actually calling {@link AccessibleObject#isAccessible()} which is unreliable. + * + * @param executable the given method/constructor + * @param o the target object + * @return true if the method can be accessed from RJavaTools + */ + public static boolean canAccess(Executable executable, Object o){ + try { + if (CAN_ACCESS != null) { + /* Java 9+ path */ + return (boolean) (Boolean) CAN_ACCESS.invoke(executable, o); + } else { + /* Java 8 path */ + if (executable instanceof Method) + LOOKUP.unreflect((Method) executable); + else + LOOKUP.unreflectConstructor((Constructor) executable); + return true; + } + } catch (Exception e) { + return false; + } + } + /** + * Resolves a bridge method to the override one + * @param bridgeMethod the potentially bridge method + * @return a method that isn't a bridge method + */ + public static Method resolveBridge(Method bridgeMethod) { + // accounts for bridge methods which may have slightly different parameters + Method best = null; + if (bridgeMethod.isBridge()) { + Class[] bridgeParams = bridgeMethod.getParameterTypes(); + // look for non-bridge methods in the same class that accepts wider parameters + nextMethod: + for (Method method: bridgeMethod.getDeclaringClass().getDeclaredMethods()) { + if (!method.isBridge() && !method.isSynthetic() && method.getName().equals(bridgeMethod.getName()) + && method.getParameterCount() == bridgeMethod.getParameterCount()) { + Class[] testParams = method.getParameterTypes(); + // Bridge params should be supertypes of target params (erasure widening). + for (int i = 0; i < testParams.length; i++) { + if (!testParams[i].isAssignableFrom(bridgeParams[i])) continue nextMethod; + } + if (bridgeMethod.getReturnType().isAssignableFrom(method.getReturnType()) && (best == null || isMoreSpecific(method, best))) best = method; + } + } + } + + return best == null ? bridgeMethod : best; + } + + /** + * Finds a mathod that accepts the given instance and is accessible from RJavaTools class. + *

Avoids calling isAccessible/setAccessible that fails on Java 17+ + * + * @param method The most specific, possibly non-accessible, method + * @param target the instance upon which the method is being invoked (null for static) + * @return + */ + public static Method findAccessible(Method method, Object target) { + if (canAccess(method, target)) return method; + + Deque> supers = new ArrayDeque>(); + HashSet> visited = new HashSet>(); + supers.add(target.getClass()); + + while (!supers.isEmpty()) { + Class c = supers.pop(); + if (visited.add(c)) { + Method superMethod; + try { + // first update the method to be non-bridge + method = resolveBridge(method); + superMethod = c.getMethod(method.getName(), method.getParameterTypes()); + /* if an accessible executable is found stop here */ + if (canAccess(superMethod, target)) return superMethod; + if (!c.isInterface() && !c.isArray()) supers.add(c.getSuperclass()); + if (!c.isArray()) supers.addAll(Arrays.asList(c.getInterfaces())); + } catch (NoSuchMethodException e1) { + /* executable not found in current class (and any of its ancestors) */ + } catch (SecurityException e1) { + /* executable not found in current class (and any of its ancestors) */ + } + } + } + + /* No accessible executable found, fail later on invoke/newInstance */ + return method; + } /** * Object creator. Find the best constructor based on the parameter classes @@ -343,25 +457,12 @@ public static Object newInstance( Class o_clazz, Object[] args, Class[] clazzes Constructor cons = getConstructor( o_clazz, clazzes, is_null ); - /* enforcing accessibility (workaround for bug 128) */ - boolean access = cons.isAccessible(); - if (!access) { - try { /* since JDK-17 this may fail */ - cons.setAccessible( true ); - } catch (Throwable e) { - access = true; /* nothing we can do, just let it fail below */ - } - } - Object o; try{ o = cons.newInstance( args ) ; } catch( InvocationTargetException e){ /* the target exception is much more useful than the reflection wrapper */ - throw e.getTargetException() ; - } finally{ - if (!access) - cons.setAccessible( access ); + throw e.getCause() ; } return o; } @@ -377,32 +478,21 @@ static boolean[] arg_is_null(Object[] args){ /** * Invoke a method of a given class - *

First the appropriate method is resolved by getMethod and - * then invokes the method + *

First the appropriate method is resolved by getMethod. + *

Then, if the method is not accessible, tries to find an accessible equivalent. + *

Finally it invokes the method */ public static Object invokeMethod( Class o_clazz, Object o, String name, Object[] args, Class[] clazzes) throws Throwable { Method m = getMethod( o_clazz, name, clazzes, arg_is_null(args) ); - - /* enforcing accessibility (workaround for bug 128) */ - boolean access = m.isAccessible(); - if (!access) { - try { /* since JDK-17 this may fail */ - m.setAccessible( true ); - } catch (Throwable e) { - access = true; /* nothing we can do, fail later with proper error ... */ - } - } + m = findAccessible(m, o); Object out; try{ out = m.invoke( o, args ) ; } catch( InvocationTargetException e){ /* the target exception is much more useful than the reflection wrapper */ - throw e.getTargetException() ; - } finally{ - if (!access) - m.setAccessible( access ); + throw e.getCause() ; } return out ; } From e28ebb6d3f95587576b8ae51cfd5a69574e4d494 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 13:39:15 +1300 Subject: [PATCH 47/69] move jri to src/jri --- .gitmodules | 2 +- configure.ac | 2 +- mkdist | 44 +++++++++--------- src/Makevars.in | 10 ++-- {jri => src/jri}/LGPL.txt | 0 {jri => src/jri}/LICENSE | 0 {jri => src/jri}/Makefile.all | 0 {jri => src/jri}/Makefile.in | 0 {jri => src/jri}/Makefile.win | 0 {jri => src/jri}/Makevars.win | 0 {jri => src/jri}/Mutex.java | 0 {jri => src/jri}/NEWS | 0 {jri => src/jri}/RBool.java | 0 {jri => src/jri}/RConsoleOutputStream.java | 0 {jri => src/jri}/README | 0 {jri => src/jri}/REXP.java | 0 {jri => src/jri}/REngine | 0 {jri => src/jri}/RFactor.java | 0 {jri => src/jri}/RList.java | 0 {jri => src/jri}/RMainLoopCallbacks.java | 0 {jri => src/jri}/RVector.java | 0 {jri => src/jri}/Rengine.java | 0 {jri => src/jri}/bootstrap/Boot.java | 0 .../jri}/bootstrap/DelegatedClassLoader.java | 0 .../bootstrap/DelegatedURLClassLoader.java | 0 {jri => src/jri}/bootstrap/JRIBootstrap.c | 0 {jri => src/jri}/bootstrap/JRIBootstrap.h | 0 {jri => src/jri}/bootstrap/JRIBootstrap.java | 0 .../jri}/bootstrap/JRIClassLoader.java | 0 {jri => src/jri}/bootstrap/Makefile | 0 {jri => src/jri}/bootstrap/mft | 0 {jri => src/jri}/configure | 0 {jri => src/jri}/configure.ac | 0 {jri => src/jri}/configure.win | 0 {jri => src/jri}/examples/rtest.java | 0 {jri => src/jri}/examples/rtest2.java | 0 {jri => src/jri}/mkdist | 0 {jri => src/jri}/package-info.java | 0 {jri => src/jri}/run.in | 0 {jri => src/jri}/src/Makefile.all | 0 {jri => src/jri}/src/Makefile.in | 0 {jri => src/jri}/src/Makefile.win | 0 {jri => src/jri}/src/Rcallbacks.c | 0 {jri => src/jri}/src/Rcallbacks.h | 0 {jri => src/jri}/src/Rdecl.h | 0 {jri => src/jri}/src/Rengine.c | 0 {jri => src/jri}/src/Rinit.c | 0 {jri => src/jri}/src/Rinit.h | 0 {jri => src/jri}/src/config.h.in | 0 {jri => src/jri}/src/globals.c | 0 {jri => src/jri}/src/globals.h | 0 {jri => src/jri}/src/h2ic | 0 {jri => src/jri}/src/jri.c | 0 {jri => src/jri}/src/jri.h | 0 {jri => src/jri}/src/rjava.c | 0 {jri => src/jri}/src/rjava.h | 0 {jri => src/jri}/src/rjstring.c | 0 {jri => src/jri}/src/rjstring.h | 0 {jri => src/jri}/src/win32/Makefile | 0 {jri => src/jri}/src/win32/findjava.c | 0 {jri => src/jri}/src/win32/jvm.def | 0 {jri => src/jri}/src/win32/jvm64.def | 0 {jri => src/jri}/tools/config.guess | 0 {jri => src/jri}/tools/config.sub | 0 {jri => src/jri}/tools/getsp.class | Bin {jri => src/jri}/tools/getsp.java | 0 {jri => src/jri}/tools/install-sh | 0 {jri => src/jri}/tools/mkinstalldirs | 0 {jri => src/jri}/version | 0 69 files changed, 29 insertions(+), 29 deletions(-) rename {jri => src/jri}/LGPL.txt (100%) rename {jri => src/jri}/LICENSE (100%) rename {jri => src/jri}/Makefile.all (100%) rename {jri => src/jri}/Makefile.in (100%) rename {jri => src/jri}/Makefile.win (100%) rename {jri => src/jri}/Makevars.win (100%) rename {jri => src/jri}/Mutex.java (100%) rename {jri => src/jri}/NEWS (100%) rename {jri => src/jri}/RBool.java (100%) rename {jri => src/jri}/RConsoleOutputStream.java (100%) rename {jri => src/jri}/README (100%) rename {jri => src/jri}/REXP.java (100%) rename {jri => src/jri}/REngine (100%) rename {jri => src/jri}/RFactor.java (100%) rename {jri => src/jri}/RList.java (100%) rename {jri => src/jri}/RMainLoopCallbacks.java (100%) rename {jri => src/jri}/RVector.java (100%) rename {jri => src/jri}/Rengine.java (100%) rename {jri => src/jri}/bootstrap/Boot.java (100%) rename {jri => src/jri}/bootstrap/DelegatedClassLoader.java (100%) rename {jri => src/jri}/bootstrap/DelegatedURLClassLoader.java (100%) rename {jri => src/jri}/bootstrap/JRIBootstrap.c (100%) rename {jri => src/jri}/bootstrap/JRIBootstrap.h (100%) rename {jri => src/jri}/bootstrap/JRIBootstrap.java (100%) rename {jri => src/jri}/bootstrap/JRIClassLoader.java (100%) rename {jri => src/jri}/bootstrap/Makefile (100%) rename {jri => src/jri}/bootstrap/mft (100%) rename {jri => src/jri}/configure (100%) rename {jri => src/jri}/configure.ac (100%) rename {jri => src/jri}/configure.win (100%) rename {jri => src/jri}/examples/rtest.java (100%) rename {jri => src/jri}/examples/rtest2.java (100%) rename {jri => src/jri}/mkdist (100%) rename {jri => src/jri}/package-info.java (100%) rename {jri => src/jri}/run.in (100%) rename {jri => src/jri}/src/Makefile.all (100%) rename {jri => src/jri}/src/Makefile.in (100%) rename {jri => src/jri}/src/Makefile.win (100%) rename {jri => src/jri}/src/Rcallbacks.c (100%) rename {jri => src/jri}/src/Rcallbacks.h (100%) rename {jri => src/jri}/src/Rdecl.h (100%) rename {jri => src/jri}/src/Rengine.c (100%) rename {jri => src/jri}/src/Rinit.c (100%) rename {jri => src/jri}/src/Rinit.h (100%) rename {jri => src/jri}/src/config.h.in (100%) rename {jri => src/jri}/src/globals.c (100%) rename {jri => src/jri}/src/globals.h (100%) rename {jri => src/jri}/src/h2ic (100%) rename {jri => src/jri}/src/jri.c (100%) rename {jri => src/jri}/src/jri.h (100%) rename {jri => src/jri}/src/rjava.c (100%) rename {jri => src/jri}/src/rjava.h (100%) rename {jri => src/jri}/src/rjstring.c (100%) rename {jri => src/jri}/src/rjstring.h (100%) rename {jri => src/jri}/src/win32/Makefile (100%) rename {jri => src/jri}/src/win32/findjava.c (100%) rename {jri => src/jri}/src/win32/jvm.def (100%) rename {jri => src/jri}/src/win32/jvm64.def (100%) rename {jri => src/jri}/tools/config.guess (100%) rename {jri => src/jri}/tools/config.sub (100%) rename {jri => src/jri}/tools/getsp.class (100%) rename {jri => src/jri}/tools/getsp.java (100%) rename {jri => src/jri}/tools/install-sh (100%) rename {jri => src/jri}/tools/mkinstalldirs (100%) rename {jri => src/jri}/version (100%) diff --git a/.gitmodules b/.gitmodules index c5f09a9..70d6d4f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "jri/REngine"] - path = jri/REngine + path = src/jri/REngine url = https://github.com/s-u/REngine.git diff --git a/configure.ac b/configure.ac index 14090b7..afcb9be 100644 --- a/configure.ac +++ b/configure.ac @@ -382,7 +382,7 @@ if test "${want_jri}" = yes; then export JAVA_HOME JAVA_CPPFLAGS JAVA_LIBS JAVA_LD_LIBRARY_PATH JAVA JAVAC JAVAH JAR CONFIGURED=1 export CONFIGURED - AC_CONFIG_SUBDIRS(jri) + AC_CONFIG_SUBDIRS(src/jri) else AC_MSG_RESULT([no]) fi diff --git a/mkdist b/mkdist index 6da35ff..2574b31 100644 --- a/mkdist +++ b/mkdist @@ -22,9 +22,9 @@ mkdir /tmp/rJava echo "Copying package base ..." cp -r . /tmp/rJava -if [ -e "${SWD}/jri/mkdist" ]; then - JRI="${SWD}/jri" - rm -rf /tmp/rJava/jri +if [ -e "${SWD}/src/jri/mkdist" ]; then + JRI="${SWD}/src/jri" + rm -rf /tmp/rJava/src/jri echo "Embedded JRI: ${JRI}" fi @@ -38,7 +38,7 @@ rm -f /tmp/rJava/README.md cd /tmp/rJava if [ "$1" = "-c" ]; then - rm -f configure tools/install-sh jri/configure + rm -f configure tools/install-sh src/jri/configure fi if [ -e /tmp/rJava/configure ]; then @@ -72,9 +72,9 @@ echo "Removing CVS/SVN and backup files ..." rm -rf `find . -name CVS -or -name .svn -or -name \*~` ## since we merged JRI and rJava trees we no longer support ORG builds -if [ ! -e jri/configure ]; then - if [ -e "${SWD}/jri/mkdist" ]; then - DEFAULTJRI="${SWD}/jri" +if [ ! -e src/jri/configure ]; then + if [ -e "${SWD}/src/jri/mkdist" ]; then + DEFAULTJRI="${SWD}/src/jri" fi : ${JRI=$DEFAULTJRI} if [ ! -e "$JRI" ]; then @@ -96,35 +96,35 @@ if [ ! -e jri/configure ]; then echo "*** ERROR: Cannot get JRI distro!" exit 1 fi - rm -rf jri JRI ${SWD}/JRI_* + rm -rf jri src/jri JRI ${SWD}/JRI_* #mkdir jri 2> /dev/null > /dev/null cd /tmp/rJava - tar fvxz $jf + tar fvxz $jf -C src else - tar fxz $JRI + tar fxz $JRI -C src fi - if [ -e jri/JRI ]; then + if [ -e src/jri/JRI ]; then rm -rf 1 - mv jri 1 - mv 1/JRI jri + mv src/jri 1 + mv 1/JRI src/jri rm -rf 1 fi - if [ ! -e jri/Makefile.in ]; then - if [ -e JRI/Makefile.in ]; then - mv JRI jri + if [ ! -e src/jri/Makefile.in ]; then + if [ -e src/JRI/Makefile.in ]; then + mv src/JRI src/jri else echo "*** ERROR: jri is not correctly set up." exit 1 fi fi - if [ -e jri/Makefile.in -a -e JRI/Makefile.in ]; then + if [ -e src/jri/Makefile.in -a -e src/JRI/Makefile.in ]; then # case-insensitive fs - but we need lower case *sigh* - mv JRI 1 - mv 1 jri + mv src/JRI 1 + mv 1 src/jri fi fi -DEFAULTRENG="${SWD}/jri/REngine" +DEFAULTRENG="${SWD}/src/jri/REngine" if [ ! -e "$DEFAULTRENG/Makefile" ]; then echo "*** WARNING *** cannot find REngine sources, the distribution will NOT include REngine!" else @@ -169,7 +169,7 @@ cp src/java/*.java inst/java # move RJavaClassLoader into boot area since it will be loaded by the system class loader mv inst/java/RJavaClassLoader* inst/java/boot # move javadoc directory -mv src/java/javadoc inst/javadoc +if [ -e src/java/javadoc ]; then mv src/java/javadoc inst/javadoc; fi echo "Updating version ..." cd /tmp/rJava @@ -193,7 +193,7 @@ fi echo "Creating package ..." cd .. rm -f `find rJava -name ._\*` -rm -rf rJava/.git* rJava/jri/REngine/.git* +rm -rf rJava/.git* rJava/src/jri/REngine/.git* rm -f rJava/version R CMD build rJava cd ${SWD} diff --git a/src/Makevars.in b/src/Makevars.in index e911ddc..f59c622 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -5,13 +5,13 @@ JAVA_HOME=@JAVA_HOME@ # make SHLIB believe that we know better what the objects are #OBJECTS=Rglue.o callJNI.o initJNI.o rJava.o jri.o jri_glue.o -all: $(SHLIB) @WANT_JRI_TRUE@ jri +all: $(SHLIB) @WANT_JRI_TRUE@ build-jri -.PHONY: all +.PHONY: all build-jri # this is a hack to force SHLIB to run our sub-make -jri: - (cd ../jri && $(MAKE)) +build-jri: + (cd jri && $(MAKE)) -@mkdir -p ../inst/jri - @(cp -r ../jri/src/JRI.jar ../jri/*jri.* ../jri/run ../jri/examples ../inst/jri/) + @(cp -r jri/src/JRI.jar jri/*jri.* jri/run jri/examples ../inst/jri/) diff --git a/jri/LGPL.txt b/src/jri/LGPL.txt similarity index 100% rename from jri/LGPL.txt rename to src/jri/LGPL.txt diff --git a/jri/LICENSE b/src/jri/LICENSE similarity index 100% rename from jri/LICENSE rename to src/jri/LICENSE diff --git a/jri/Makefile.all b/src/jri/Makefile.all similarity index 100% rename from jri/Makefile.all rename to src/jri/Makefile.all diff --git a/jri/Makefile.in b/src/jri/Makefile.in similarity index 100% rename from jri/Makefile.in rename to src/jri/Makefile.in diff --git a/jri/Makefile.win b/src/jri/Makefile.win similarity index 100% rename from jri/Makefile.win rename to src/jri/Makefile.win diff --git a/jri/Makevars.win b/src/jri/Makevars.win similarity index 100% rename from jri/Makevars.win rename to src/jri/Makevars.win diff --git a/jri/Mutex.java b/src/jri/Mutex.java similarity index 100% rename from jri/Mutex.java rename to src/jri/Mutex.java diff --git a/jri/NEWS b/src/jri/NEWS similarity index 100% rename from jri/NEWS rename to src/jri/NEWS diff --git a/jri/RBool.java b/src/jri/RBool.java similarity index 100% rename from jri/RBool.java rename to src/jri/RBool.java diff --git a/jri/RConsoleOutputStream.java b/src/jri/RConsoleOutputStream.java similarity index 100% rename from jri/RConsoleOutputStream.java rename to src/jri/RConsoleOutputStream.java diff --git a/jri/README b/src/jri/README similarity index 100% rename from jri/README rename to src/jri/README diff --git a/jri/REXP.java b/src/jri/REXP.java similarity index 100% rename from jri/REXP.java rename to src/jri/REXP.java diff --git a/jri/REngine b/src/jri/REngine similarity index 100% rename from jri/REngine rename to src/jri/REngine diff --git a/jri/RFactor.java b/src/jri/RFactor.java similarity index 100% rename from jri/RFactor.java rename to src/jri/RFactor.java diff --git a/jri/RList.java b/src/jri/RList.java similarity index 100% rename from jri/RList.java rename to src/jri/RList.java diff --git a/jri/RMainLoopCallbacks.java b/src/jri/RMainLoopCallbacks.java similarity index 100% rename from jri/RMainLoopCallbacks.java rename to src/jri/RMainLoopCallbacks.java diff --git a/jri/RVector.java b/src/jri/RVector.java similarity index 100% rename from jri/RVector.java rename to src/jri/RVector.java diff --git a/jri/Rengine.java b/src/jri/Rengine.java similarity index 100% rename from jri/Rengine.java rename to src/jri/Rengine.java diff --git a/jri/bootstrap/Boot.java b/src/jri/bootstrap/Boot.java similarity index 100% rename from jri/bootstrap/Boot.java rename to src/jri/bootstrap/Boot.java diff --git a/jri/bootstrap/DelegatedClassLoader.java b/src/jri/bootstrap/DelegatedClassLoader.java similarity index 100% rename from jri/bootstrap/DelegatedClassLoader.java rename to src/jri/bootstrap/DelegatedClassLoader.java diff --git a/jri/bootstrap/DelegatedURLClassLoader.java b/src/jri/bootstrap/DelegatedURLClassLoader.java similarity index 100% rename from jri/bootstrap/DelegatedURLClassLoader.java rename to src/jri/bootstrap/DelegatedURLClassLoader.java diff --git a/jri/bootstrap/JRIBootstrap.c b/src/jri/bootstrap/JRIBootstrap.c similarity index 100% rename from jri/bootstrap/JRIBootstrap.c rename to src/jri/bootstrap/JRIBootstrap.c diff --git a/jri/bootstrap/JRIBootstrap.h b/src/jri/bootstrap/JRIBootstrap.h similarity index 100% rename from jri/bootstrap/JRIBootstrap.h rename to src/jri/bootstrap/JRIBootstrap.h diff --git a/jri/bootstrap/JRIBootstrap.java b/src/jri/bootstrap/JRIBootstrap.java similarity index 100% rename from jri/bootstrap/JRIBootstrap.java rename to src/jri/bootstrap/JRIBootstrap.java diff --git a/jri/bootstrap/JRIClassLoader.java b/src/jri/bootstrap/JRIClassLoader.java similarity index 100% rename from jri/bootstrap/JRIClassLoader.java rename to src/jri/bootstrap/JRIClassLoader.java diff --git a/jri/bootstrap/Makefile b/src/jri/bootstrap/Makefile similarity index 100% rename from jri/bootstrap/Makefile rename to src/jri/bootstrap/Makefile diff --git a/jri/bootstrap/mft b/src/jri/bootstrap/mft similarity index 100% rename from jri/bootstrap/mft rename to src/jri/bootstrap/mft diff --git a/jri/configure b/src/jri/configure similarity index 100% rename from jri/configure rename to src/jri/configure diff --git a/jri/configure.ac b/src/jri/configure.ac similarity index 100% rename from jri/configure.ac rename to src/jri/configure.ac diff --git a/jri/configure.win b/src/jri/configure.win similarity index 100% rename from jri/configure.win rename to src/jri/configure.win diff --git a/jri/examples/rtest.java b/src/jri/examples/rtest.java similarity index 100% rename from jri/examples/rtest.java rename to src/jri/examples/rtest.java diff --git a/jri/examples/rtest2.java b/src/jri/examples/rtest2.java similarity index 100% rename from jri/examples/rtest2.java rename to src/jri/examples/rtest2.java diff --git a/jri/mkdist b/src/jri/mkdist similarity index 100% rename from jri/mkdist rename to src/jri/mkdist diff --git a/jri/package-info.java b/src/jri/package-info.java similarity index 100% rename from jri/package-info.java rename to src/jri/package-info.java diff --git a/jri/run.in b/src/jri/run.in similarity index 100% rename from jri/run.in rename to src/jri/run.in diff --git a/jri/src/Makefile.all b/src/jri/src/Makefile.all similarity index 100% rename from jri/src/Makefile.all rename to src/jri/src/Makefile.all diff --git a/jri/src/Makefile.in b/src/jri/src/Makefile.in similarity index 100% rename from jri/src/Makefile.in rename to src/jri/src/Makefile.in diff --git a/jri/src/Makefile.win b/src/jri/src/Makefile.win similarity index 100% rename from jri/src/Makefile.win rename to src/jri/src/Makefile.win diff --git a/jri/src/Rcallbacks.c b/src/jri/src/Rcallbacks.c similarity index 100% rename from jri/src/Rcallbacks.c rename to src/jri/src/Rcallbacks.c diff --git a/jri/src/Rcallbacks.h b/src/jri/src/Rcallbacks.h similarity index 100% rename from jri/src/Rcallbacks.h rename to src/jri/src/Rcallbacks.h diff --git a/jri/src/Rdecl.h b/src/jri/src/Rdecl.h similarity index 100% rename from jri/src/Rdecl.h rename to src/jri/src/Rdecl.h diff --git a/jri/src/Rengine.c b/src/jri/src/Rengine.c similarity index 100% rename from jri/src/Rengine.c rename to src/jri/src/Rengine.c diff --git a/jri/src/Rinit.c b/src/jri/src/Rinit.c similarity index 100% rename from jri/src/Rinit.c rename to src/jri/src/Rinit.c diff --git a/jri/src/Rinit.h b/src/jri/src/Rinit.h similarity index 100% rename from jri/src/Rinit.h rename to src/jri/src/Rinit.h diff --git a/jri/src/config.h.in b/src/jri/src/config.h.in similarity index 100% rename from jri/src/config.h.in rename to src/jri/src/config.h.in diff --git a/jri/src/globals.c b/src/jri/src/globals.c similarity index 100% rename from jri/src/globals.c rename to src/jri/src/globals.c diff --git a/jri/src/globals.h b/src/jri/src/globals.h similarity index 100% rename from jri/src/globals.h rename to src/jri/src/globals.h diff --git a/jri/src/h2ic b/src/jri/src/h2ic similarity index 100% rename from jri/src/h2ic rename to src/jri/src/h2ic diff --git a/jri/src/jri.c b/src/jri/src/jri.c similarity index 100% rename from jri/src/jri.c rename to src/jri/src/jri.c diff --git a/jri/src/jri.h b/src/jri/src/jri.h similarity index 100% rename from jri/src/jri.h rename to src/jri/src/jri.h diff --git a/jri/src/rjava.c b/src/jri/src/rjava.c similarity index 100% rename from jri/src/rjava.c rename to src/jri/src/rjava.c diff --git a/jri/src/rjava.h b/src/jri/src/rjava.h similarity index 100% rename from jri/src/rjava.h rename to src/jri/src/rjava.h diff --git a/jri/src/rjstring.c b/src/jri/src/rjstring.c similarity index 100% rename from jri/src/rjstring.c rename to src/jri/src/rjstring.c diff --git a/jri/src/rjstring.h b/src/jri/src/rjstring.h similarity index 100% rename from jri/src/rjstring.h rename to src/jri/src/rjstring.h diff --git a/jri/src/win32/Makefile b/src/jri/src/win32/Makefile similarity index 100% rename from jri/src/win32/Makefile rename to src/jri/src/win32/Makefile diff --git a/jri/src/win32/findjava.c b/src/jri/src/win32/findjava.c similarity index 100% rename from jri/src/win32/findjava.c rename to src/jri/src/win32/findjava.c diff --git a/jri/src/win32/jvm.def b/src/jri/src/win32/jvm.def similarity index 100% rename from jri/src/win32/jvm.def rename to src/jri/src/win32/jvm.def diff --git a/jri/src/win32/jvm64.def b/src/jri/src/win32/jvm64.def similarity index 100% rename from jri/src/win32/jvm64.def rename to src/jri/src/win32/jvm64.def diff --git a/jri/tools/config.guess b/src/jri/tools/config.guess similarity index 100% rename from jri/tools/config.guess rename to src/jri/tools/config.guess diff --git a/jri/tools/config.sub b/src/jri/tools/config.sub similarity index 100% rename from jri/tools/config.sub rename to src/jri/tools/config.sub diff --git a/jri/tools/getsp.class b/src/jri/tools/getsp.class similarity index 100% rename from jri/tools/getsp.class rename to src/jri/tools/getsp.class diff --git a/jri/tools/getsp.java b/src/jri/tools/getsp.java similarity index 100% rename from jri/tools/getsp.java rename to src/jri/tools/getsp.java diff --git a/jri/tools/install-sh b/src/jri/tools/install-sh similarity index 100% rename from jri/tools/install-sh rename to src/jri/tools/install-sh diff --git a/jri/tools/mkinstalldirs b/src/jri/tools/mkinstalldirs similarity index 100% rename from jri/tools/mkinstalldirs rename to src/jri/tools/mkinstalldirs diff --git a/jri/version b/src/jri/version similarity index 100% rename from jri/version rename to src/jri/version From 371c0360bcbd82b6a0455d87d043f1c9cef0b606 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 13:39:55 +1300 Subject: [PATCH 48/69] update autoconf artifacts --- configure | 3501 +++++++++++++++++++++------------------ src/config.h.in | 19 +- src/jri/configure | 695 ++++---- src/jri/src/config.h.in | 2 +- 4 files changed, 2238 insertions(+), 1979 deletions(-) diff --git a/configure b/configure index 41dd6c9..12aab97 100755 --- a/configure +++ b/configure @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for rJava 0.8. +# Generated by GNU Autoconf 2.72 for rJava 0.8. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,63 +17,65 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,43 +92,27 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -153,26 +133,28 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -187,42 +169,54 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -230,14 +224,22 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi ;; +esac +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -254,26 +256,28 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +# out after a failed 'exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: Simon.Urbanek@r-project.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -294,6 +298,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -325,7 +330,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -334,7 +339,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -373,16 +378,18 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -390,16 +397,18 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -413,9 +422,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -442,7 +451,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -475,6 +484,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -486,7 +497,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -500,6 +511,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -513,6 +528,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -524,9 +545,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -551,10 +572,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -842,9 +857,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -997,6 +1012,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1046,9 +1070,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1062,9 +1086,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1092,8 +1116,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1101,16 +1125,16 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1126,7 +1150,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1134,7 +1158,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1151,7 +1175,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1190,7 +1214,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1219,7 +1243,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1247,7 +1271,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rJava 0.8 to adapt to many kinds of systems. +'configure' configures rJava 0.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1261,11 +1285,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1273,10 +1297,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1287,6 +1311,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1349,9 +1374,8 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CPP C preprocessor -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . @@ -1370,9 +1394,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1400,7 +1424,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1408,7 +1433,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1418,9 +1443,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF rJava configure 0.8 -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.72 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1437,14 +1462,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1452,192 +1477,24 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + ac_retval=1 ;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_try_run - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------------------ ## -## Report this to Simon.Urbanek@r-project.org ## -## ------------------------------------------ ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel +} # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- @@ -1646,49 +1503,56 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { #ifndef $as_decl_name #ifdef __cplusplus @@ -1702,19 +1566,24 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + ;; +esac fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_decl +} # ac_fn_check_decl # ac_fn_c_try_link LINENO # ----------------------- @@ -1722,14 +1591,14 @@ $as_echo "$ac_res" >&6; } ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1737,20 +1606,22 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1761,14 +1632,78 @@ fi as_fn_set_status $ac_retval } # ac_fn_c_try_link + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status ;; +esac +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by rJava $as_me 0.8, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -1801,8 +1736,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -1837,7 +1776,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -1872,11 +1811,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -1887,8 +1828,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -1912,7 +1853,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -1920,14 +1861,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -1935,15 +1876,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -1951,8 +1892,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1966,65 +1907,50 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2032,61 +1958,395 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (char **p, int i) +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +/* Does the compiler advertise C99 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +// See if C++-style comments work. + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); +extern void free (void *); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +/* Does the compiler advertise C11 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -2096,11 +2356,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' + and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2116,34 +2377,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/config.h" -ac_aux_dir= -for ac_dir in tools "$srcdir"/tools; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in tools \"$srcdir\"/tools" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - # find R home and set CC/CFLAGS @@ -2166,82 +2399,100 @@ fi ## enable threads, i.e. Java is running is a separate thread # Check whether --enable-threads was given. -if test "${enable_threads+set}" = set; then : +if test ${enable_threads+y} +then : enableval=$enable_threads; want_threads="${enableval}" -else - want_threads=no +else case e in #( + e) want_threads=no ;; +esac fi ## enable JNI-cache # Check whether --enable-jni-cache was given. -if test "${enable_jni_cache+set}" = set; then : +if test ${enable_jni_cache+y} +then : enableval=$enable_jni_cache; want_jni_cache="${enableval}" -else - want_jni_cache=no +else case e in #( + e) want_jni_cache=no ;; +esac fi ## enable JRI # Check whether --enable-jri was given. -if test "${enable_jri+set}" = set; then : +if test ${enable_jri+y} +then : enableval=$enable_jri; want_jri="${enableval}" -else - want_jri=auto +else case e in #( + e) want_jri=auto ;; +esac fi ## enable headless # Check whether --enable-headless was given. -if test "${enable_headless+set}" = set; then : +if test ${enable_headless+y} +then : enableval=$enable_headless; want_headless="${enableval}" -else - want_headless=auto +else case e in #( + e) want_headless=auto ;; +esac fi ## enable -Xrs support # Check whether --enable-Xrs was given. -if test "${enable_Xrs+set}" = set; then : +if test ${enable_Xrs+y} +then : enableval=$enable_Xrs; want_xrs="${enableval}" -else - want_xrs=auto +else case e in #( + e) want_xrs=auto ;; +esac fi ## enable dynloaded JVM # Check whether --enable-dynload was given. -if test "${enable_dynload+set}" = set; then : +if test ${enable_dynload+y} +then : enableval=$enable_dynload; want_dynload="${enableval}" -else - want_dynload=auto +else case e in #( + e) want_dynload=auto ;; +esac fi ## enable debug flags # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : +if test ${enable_debug+y} +then : enableval=$enable_debug; want_debug="${enableval}" -else - want_debug=no +else case e in #( + e) want_debug=no ;; +esac fi ## enable memory profiling # Check whether --enable-mem-profile was given. -if test "${enable_mem_profile+set}" = set; then : +if test ${enable_mem_profile+y} +then : enableval=$enable_mem_profile; want_memprof="${enableval}" -else - want_memprof=debug +else case e in #( + e) want_memprof=debug ;; +esac fi ## enable callbacks (experimental) # Check whether --enable-callbacks was given. -if test "${enable_callbacks+set}" = set; then : +if test ${enable_callbacks+y} +then : enableval=$enable_callbacks; want_callbacks="${enableval}" -else - want_callbacks=no +else case e in #( + e) want_callbacks=no ;; +esac fi @@ -2253,6 +2504,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2261,38 +2521,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2301,38 +2567,44 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2340,8 +2612,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2354,38 +2626,44 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2394,12 +2672,13 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -2407,15 +2686,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2431,18 +2714,19 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2453,38 +2737,44 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2497,38 +2787,44 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2540,34 +2836,140 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2577,7 +2979,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -2585,7 +2987,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -2597,9 +2999,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -2620,13 +3022,14 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -2641,12 +3044,12 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -2657,48 +3060,52 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -2708,15 +3115,16 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -2725,9 +3133,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -2737,8 +3147,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -2746,10 +3156,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -2757,39 +3167,41 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -2803,11 +3215,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -2816,31 +3229,34 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -2850,30 +3266,36 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -2881,558 +3303,244 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Checks for libraries. - -# Checks for header files. - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +int +main (void) +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi else - ac_cv_header_stdc=no + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - +$ac_c_conftest_c11_program _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - +$ac_c_conftest_c99_program _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} +$ac_c_conftest_c89_program _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac fi +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + -fi +# Checks for libraries. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 -$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if ${ac_cv_header_sys_wait_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +# Checks for header files. + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -3444,7 +3552,7 @@ else #endif int -main () +main (void) { int s; wait (&s); @@ -3453,63 +3561,85 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_sys_wait_h=yes -else - ac_cv_header_sys_wait_h=no +else case e in #( + e) ac_cv_header_sys_wait_h=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 -$as_echo "$ac_cv_header_sys_wait_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then -$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + -fi -done -for ac_header in string.h sys/time.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes +then : + printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi # Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __cplusplus @@ -3522,7 +3652,7 @@ main () /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. + /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -3550,7 +3680,7 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; @@ -3566,59 +3696,27 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_const=yes -else - ac_cv_c_const=no +else case e in #( + e) ac_cv_c_const=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +printf "%s\n" "#define const /**/" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports static inline..." >&5 -$as_echo "$as_me: checking whether ${CC} supports static inline..." >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports static inline..." >&5 +printf "%s\n" "$as_me: checking whether ${CC} supports static inline..." >&6;} can_inline=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3631,29 +3729,31 @@ int main(void) { } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : can_inline=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${can_inline}" >&5 -$as_echo "${can_inline}" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${can_inline}" >&5 +printf "%s\n" "${can_inline}" >&6; } if test "${can_inline}" = yes; then -$as_echo "#define HAVE_STATIC_INLINE 1" >>confdefs.h +printf "%s\n" "#define HAVE_STATIC_INLINE 1" >>confdefs.h fi ### from R m4/R.m4 - needed to hack R 2.9.x -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setjmp.h is POSIX.1 compatible" >&5 -$as_echo_n "checking whether setjmp.h is POSIX.1 compatible... " >&6; } -if ${r_cv_header_setjmp_posix+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setjmp.h is POSIX.1 compatible" >&5 +printf %s "checking whether setjmp.h is POSIX.1 compatible... " >&6; } +if test ${r_cv_header_setjmp_posix+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { sigjmp_buf b; sigsetjmp(b, 0); @@ -3662,37 +3762,121 @@ siglongjmp(b, 1); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : r_cv_header_setjmp_posix=yes -else - r_cv_header_setjmp_posix=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else case e in #( + e) r_cv_header_setjmp_posix=no ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $r_cv_header_setjmp_posix" >&5 -$as_echo "$r_cv_header_setjmp_posix" >&6; } -ac_fn_c_check_decl "$LINENO" "sigsetjmp" "ac_cv_have_decl_sigsetjmp" "#include -" -if test "x$ac_cv_have_decl_sigsetjmp" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r_cv_header_setjmp_posix" >&5 +printf "%s\n" "$r_cv_header_setjmp_posix" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SIGSETJMP $ac_have_decl +int +main (void) +{ +(void) strchr; + ; + return 0; +} _ACEOF -ac_fn_c_check_decl "$LINENO" "siglongjmp" "ac_cv_have_decl_siglongjmp" "#include -" -if test "x$ac_cv_have_decl_siglongjmp" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SIGLONGJMP $ac_have_decl + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See 'config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "sigsetjmp" "ac_cv_have_decl_sigsetjmp" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sigsetjmp" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_SIGSETJMP $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "siglongjmp" "ac_cv_have_decl_siglongjmp" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_siglongjmp" = xyes +then : + ac_have_decl=1 +else case e in #( + e) ac_have_decl=0 ;; +esac +fi +printf "%s\n" "#define HAVE_DECL_SIGLONGJMP $ac_have_decl" >>confdefs.h if test "$ac_cv_have_decl_sigsetjmp" = no; then r_cv_header_setjmp_posix=no @@ -3702,12 +3886,12 @@ if test "$ac_cv_have_decl_siglongjmp" = no; then fi if test "${r_cv_header_setjmp_posix}" = yes; then -$as_echo "#define HAVE_POSIX_SETJMP 1" >>confdefs.h +printf "%s\n" "#define HAVE_POSIX_SETJMP 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Java support in R" >&5 -$as_echo_n "checking Java support in R... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Java support in R" >&5 +printf %s "checking Java support in R... " >&6; } R_JAVA_HOME=`"${RBIN}" CMD config JAVA_HOME` : ${JAVA_HOME="${R_JAVA_HOME}"} if test -z "${JAVA_HOME}"; then @@ -3728,14 +3912,14 @@ fi : ${JAVA_CPPFLAGS=`"${RBIN}" CMD config JAVA_CPPFLAGS|sed 's/ERROR:.*//'`} : ${JAVA_LIBS=`"${RBIN}" CMD config JAVA_LIBS|sed 's/ERROR:.*//'`} -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: present: +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: present: interpreter : '${JAVA}' archiver : '${JAR}' compiler : '${JAVAC}' header prep.: '${JAVAH}' cpp flags : '${JAVA_CPPFLAGS}' java libs : '${JAVA_LIBS}'" >&5 -$as_echo "present: +printf "%s\n" "present: interpreter : '${JAVA}' archiver : '${JAR}' compiler : '${JAVAC}' @@ -3773,8 +3957,8 @@ if test `echo foo | sed -e 's:foo:bar:'` = bar; then JAVA_LIBS0=`echo ${JAVA_LIBS} | sed -e 's:$(JAVA_HOME):'${JAVA_HOME}':g'` JAVA_LD_LIBRARY_PATH0=`echo ${JAVA_LD_LIBRARY_PATH} | sed -e 's:$(JAVA_HOME):'${JAVA_HOME}':g'` else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: sed is not working properly - the configuration may fail" >&5 -$as_echo "$as_me: WARNING: sed is not working properly - the configuration may fail" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: sed is not working properly - the configuration may fail" >&5 +printf "%s\n" "$as_me: WARNING: sed is not working properly - the configuration may fail" >&2;} JAVA_CPPFLAGS0="${JAVA_CPPFLAGS}" JAVA_LIBS0="${JAVA_LIBS}" JAVA_LD_LIBRARY_PATH0="${JAVA_LD_LIBRARY_PATH}" @@ -3791,37 +3975,37 @@ if test "x$OSNAME" = xDarwin; then export DYLD_FALLBACK_LIBRARY_PATH fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Java run-time works" >&5 -$as_echo_n "checking whether Java run-time works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Java run-time works" >&5 +printf %s "checking whether Java run-time works... " >&6; } if "$JAVA" -classpath tools getsp; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } as_fn_error $? "Java interpreter '$JAVA' does not work" "$LINENO" 5 fi has_xrs="$want_xrs" if test x"$has_xrs" = xauto; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Xrs is supported" >&5 -$as_echo_n "checking whether -Xrs is supported... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Xrs is supported" >&5 +printf %s "checking whether -Xrs is supported... " >&6; } if "$JAVA" -Xrs -classpath tools getsp; then has_xrs=yes else has_xrs=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${has_xrs}" >&5 -$as_echo "${has_xrs}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${has_xrs}" >&5 +printf "%s\n" "${has_xrs}" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Xrs will be used" >&5 -$as_echo_n "checking whether -Xrs will be used... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${has_xrs}" >&5 -$as_echo "${has_xrs}" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Xrs will be used" >&5 +printf %s "checking whether -Xrs will be used... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${has_xrs}" >&5 +printf "%s\n" "${has_xrs}" >&6; } if test x"$has_xrs" = xyes; then -$as_echo "#define HAVE_XRS 1" >>confdefs.h +printf "%s\n" "#define HAVE_XRS 1" >>confdefs.h fi @@ -3836,10 +4020,10 @@ fi if test x"$use_dynload" != xyes; then use_dynload=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether JVM will be loaded dynamically" >&5 -$as_echo_n "checking whether JVM will be loaded dynamically... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${use_dynload}" >&5 -$as_echo "${use_dynload}" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether JVM will be loaded dynamically" >&5 +printf %s "checking whether JVM will be loaded dynamically... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${use_dynload}" >&5 +printf "%s\n" "${use_dynload}" >&6; } if test "x${use_dynload}" = xyes; then USE_DYNLOAD_TRUE= USE_DYNLOAD_FALSE='#' @@ -3849,8 +4033,8 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether JNI programs can be compiled" >&5 -$as_echo_n "checking whether JNI programs can be compiled... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether JNI programs can be compiled" >&5 +printf %s "checking whether JNI programs can be compiled... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3862,26 +4046,29 @@ int main(void) { } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - as_fn_error $? "Cannot compile a simple JNI program. See config.log for details. +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else case e in #( + e) as_fn_error $? "Cannot compile a simple JNI program. See config.log for details. Make sure you have Java Development Kit installed and correctly registered in R. If in doubt, re-run \"R CMD javareconf\" as root. -" "$LINENO" 5 +" "$LINENO" 5 ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether JNI programs run" >&5 -$as_echo_n "checking whether JNI programs run... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: don't know (cross-compiling)" >&5 -$as_echo "don't know (cross-compiling)" >&6; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether JNI programs run" >&5 +printf %s "checking whether JNI programs run... " >&6; } +if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: don't know (cross-compiling)" >&5 +printf "%s\n" "don't know (cross-compiling)" >&6; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -3892,26 +4079,30 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - as_fn_error $? "Unable to run a simple JNI program. Make sure you have configured R with Java support (see R documentation) and check config.log for failure reason." "$LINENO" 5 +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else case e in #( + e) as_fn_error $? "Unable to run a simple JNI program. Make sure you have configured R with Java support (see R documentation) and check config.log for failure reason." "$LINENO" 5 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking JNI data types" >&5 -$as_echo_n "checking JNI data types... " >&6; } -if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking JNI data types" >&5 +printf %s "checking JNI data types... " >&6; } +if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -3920,23 +4111,26 @@ int main(void) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -else - as_fn_error $? "One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this." "$LINENO" 5 +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } +else case e in #( + e) as_fn_error $? "One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this." "$LINENO" 5 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi if test "${want_jri}" = auto; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether JRI should be compiled (autodetect)" >&5 -$as_echo_n "checking whether JRI should be compiled (autodetect)... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${has_R_shlib}" >&5 -$as_echo "${has_R_shlib}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether JRI should be compiled (autodetect)" >&5 +printf %s "checking whether JRI should be compiled (autodetect)... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${has_R_shlib}" >&5 +printf "%s\n" "${has_R_shlib}" >&6; } want_jri=${has_R_shlib} fi if test "x${want_jri}" = xyes; then @@ -3948,31 +4142,31 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether debugging output should be enabled" >&5 -$as_echo_n "checking whether debugging output should be enabled... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether debugging output should be enabled" >&5 +printf %s "checking whether debugging output should be enabled... " >&6; } if test "${want_debug}" = yes; then JAVA_CPPFLAGS="-g -DRJ_DEBUG ${JAVA_CPPFLAGS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memory profiling is desired" >&5 -$as_echo_n "checking whether memory profiling is desired... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether memory profiling is desired" >&5 +printf %s "checking whether memory profiling is desired... " >&6; } if test "${want_memprof}" = debug; then want_memprof="${want_debug}" fi if test "${want_memprof}" = yes; then -$as_echo "#define MEMPROF 1" >>confdefs.h +printf "%s\n" "#define MEMPROF 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3983,63 +4177,63 @@ fi use_threads=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether threads support is requested" >&5 -$as_echo_n "checking whether threads support is requested... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether threads support is requested" >&5 +printf %s "checking whether threads support is requested... " >&6; } if test "${want_threads}" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether threads can be enabled" >&5 -$as_echo_n "checking whether threads can be enabled... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether threads can be enabled" >&5 +printf %s "checking whether threads can be enabled... " >&6; } # check whether we can add THREADS support # we don't want to run full AC_CANONICAL_HOST, all we care about is OS X if test "x$OSNAME" = xDarwin; then use_threads=yes -$as_echo "#define THREADS 1" >>confdefs.h +printf "%s\n" "#define THREADS 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${use_threads}" >&5 -$as_echo "${use_threads}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${use_threads}" >&5 +printf "%s\n" "${use_threads}" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi ## enable callbacks if desired -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether callbacks support is requested" >&5 -$as_echo_n "checking whether callbacks support is requested... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether callbacks support is requested" >&5 +printf %s "checking whether callbacks support is requested... " >&6; } if test "${want_callbacks}" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } if test "${want_jri}" != yes; then as_fn_error $? "Callbacks support can be only enabled if JRI is enabled as well." "$LINENO" 5 fi -$as_echo "#define ENABLE_JRICB 1" >>confdefs.h +printf "%s\n" "#define ENABLE_JRICB 1" >>confdefs.h else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether JNI cache support is requested" >&5 -$as_echo_n "checking whether JNI cache support is requested... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether JNI cache support is requested" >&5 +printf %s "checking whether JNI cache support is requested... " >&6; } if test "${want_jni_cache}" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } if test "${use_threads}" = yes; then as_fn_error $? "Threads and JNI cache cannot be used at the same time, because JNI cache is by definition not thread-safe. Please disable either option." "$LINENO" 5 fi -$as_echo "#define JNI_CACHE 1" >>confdefs.h +printf "%s\n" "#define JNI_CACHE 1" >>confdefs.h else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether headless init is enabled" >&5 -$as_echo_n "checking whether headless init is enabled... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether headless init is enabled" >&5 +printf %s "checking whether headless init is enabled... " >&6; } if test "${want_headless}" = auto; then want_headless=no ## only Darwin defaults to headless @@ -4047,30 +4241,30 @@ if test "${want_headless}" = auto; then want_headless=yes fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${want_headless}" >&5 -$as_echo "${want_headless}" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${want_headless}" >&5 +printf "%s\n" "${want_headless}" >&6; } if test "${want_headless}" = yes; then -$as_echo "#define USE_HEADLESS_INIT 1" >>confdefs.h +printf "%s\n" "#define USE_HEADLESS_INIT 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether JRI is requested" >&5 -$as_echo_n "checking whether JRI is requested... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether JRI is requested" >&5 +printf %s "checking whether JRI is requested... " >&6; } if test "${want_jri}" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } export R_HOME export JAVA_HOME JAVA_CPPFLAGS JAVA_LIBS JAVA_LD_LIBRARY_PATH JAVA JAVAC JAVAH JAR CONFIGURED=1 export CONFIGURED -subdirs="$subdirs jri" +subdirs="$subdirs src/jri" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi ac_config_files="$ac_config_files src/Makevars" @@ -4087,8 +4281,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -4104,8 +4298,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -4118,14 +4312,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -4135,15 +4329,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -4157,8 +4351,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -4175,7 +4369,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -4199,8 +4393,8 @@ fi ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -4223,63 +4417,65 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -4288,13 +4484,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -4303,43 +4492,27 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -4352,9 +4525,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -4385,22 +4558,25 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -4408,16 +4584,18 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -4444,7 +4622,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -4466,6 +4644,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -4479,6 +4661,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -4490,9 +4678,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -4520,7 +4708,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -4529,7 +4717,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -4573,10 +4761,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -4592,7 +4782,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by rJava $as_me 0.8, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4623,7 +4813,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -4650,14 +4840,16 @@ $config_headers Report bugs to ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ rJava config.status 0.8 -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -4694,15 +4886,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -4710,23 +4902,23 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -4747,7 +4939,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -4761,7 +4953,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -4778,7 +4970,7 @@ do "src/Makevars") CONFIG_FILES="$CONFIG_FILES src/Makevars" ;; "R/zzz.R") CONFIG_FILES="$CONFIG_FILES R/zzz.R" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -4788,8 +4980,8 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -4797,7 +4989,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -4821,7 +5013,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -4979,13 +5171,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -5095,7 +5287,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -5117,33 +5309,33 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -5160,7 +5352,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -5184,9 +5376,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -5239,8 +5431,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -5253,7 +5445,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -5282,9 +5474,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -5300,20 +5492,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -5393,7 +5585,7 @@ if test "$no_recursion" != yes; then ;; *) case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac @@ -5403,7 +5595,7 @@ if test "$no_recursion" != yes; then # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" @@ -5424,17 +5616,17 @@ if test "$no_recursion" != yes; then test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" - $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 - $as_echo "$ac_msg" >&6 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 + printf "%s\n" "$ac_msg" >&6 as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -5464,17 +5656,15 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" - # Check for guested configure; otherwise get Cygnus style configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.in"; then - # This should be Cygnus configure. - ac_sub_configure=$ac_aux_dir/configure else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 -$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 +printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi @@ -5487,8 +5677,8 @@ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 -$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +printf "%s\n" "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || @@ -5499,7 +5689,8 @@ $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cach done fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + diff --git a/src/config.h.in b/src/config.h.in index 061556a..2bd7e26 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -3,20 +3,17 @@ /* define if callbacks support is enabled. */ #undef ENABLE_JRICB -/* Define to 1 if you have the declaration of `siglongjmp', and to 0 if you +/* Define to 1 if you have the declaration of 'siglongjmp', and to 0 if you don't. */ #undef HAVE_DECL_SIGLONGJMP -/* Define to 1 if you have the declaration of `sigsetjmp', and to 0 if you +/* Define to 1 if you have the declaration of 'sigsetjmp', and to 0 if you don't. */ #undef HAVE_DECL_SIGSETJMP /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - /* Define if you have POSIX.1 compatible sigsetjmp/siglongjmp. */ #undef HAVE_POSIX_SETJMP @@ -26,6 +23,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -77,17 +77,16 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Set if threading support should be enabled. */ #undef THREADS -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - /* Set if headless mode is to be used when starting the JVM */ #undef USE_HEADLESS_INIT -/* Define to empty if `const' does not conform to ANSI C. */ +/* Define to empty if 'const' does not conform to ANSI C. */ #undef const diff --git a/src/jri/configure b/src/jri/configure index 52b313d..30bd7a8 100755 --- a/src/jri/configure +++ b/src/jri/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for JRI 0.3. +# Generated by GNU Autoconf 2.72 for JRI 0.3. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -17,7 +17,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -26,12 +25,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -103,7 +103,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -133,15 +133,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -149,12 +148,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -172,8 +172,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -186,14 +187,15 @@ test -x / || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -226,12 +228,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -253,7 +256,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -273,7 +276,8 @@ $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -312,14 +316,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -388,11 +384,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -406,21 +403,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -494,6 +484,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -542,7 +534,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -554,9 +545,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -581,10 +572,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -871,7 +864,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1084,7 +1077,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1100,7 +1093,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1130,8 +1123,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1139,7 +1132,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1189,7 +1182,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1257,7 +1250,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1285,7 +1278,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures JRI 0.3 to adapt to many kinds of systems. +'configure' configures JRI 0.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1299,11 +1292,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1311,10 +1304,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1364,7 +1357,7 @@ Some influential environment variables: CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . @@ -1432,9 +1425,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF JRI configure 0.3 -generated by GNU Autoconf 2.71 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1473,11 +1466,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1496,8 +1490,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1505,10 +1499,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1548,11 +1544,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1594,12 +1591,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1631,7 +1629,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by JRI $as_me 0.3, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -1877,10 +1875,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -1916,9 +1914,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -1932,6 +1928,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -1959,16 +1970,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2018,7 +2032,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2084,6 +2097,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2105,7 +2120,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -2297,8 +2312,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -2326,12 +2342,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2340,18 +2356,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2367,11 +2383,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -2402,15 +2418,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -2437,14 +2454,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -2552,8 +2570,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2575,7 +2593,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -2597,8 +2616,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2620,7 +2639,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -2655,8 +2675,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2678,7 +2698,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -2700,8 +2721,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -2740,7 +2761,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -2764,8 +2786,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2787,7 +2809,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -2813,8 +2836,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2836,7 +2859,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -2874,8 +2898,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2897,7 +2921,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -2919,8 +2944,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2942,7 +2967,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -2971,10 +2997,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3046,8 +3072,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -3067,7 +3093,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -3078,8 +3104,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -3088,13 +3115,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -3118,10 +3146,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -3131,11 +3159,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3151,6 +3180,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -3190,26 +3221,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3241,16 +3273,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -3261,8 +3295,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3279,12 +3313,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -3302,8 +3338,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -3321,8 +3357,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3337,8 +3373,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3355,12 +3391,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -3387,8 +3426,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3405,25 +3444,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -3433,8 +3475,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3451,25 +3493,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -3479,8 +3524,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3497,25 +3542,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -3610,8 +3658,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_JAVA_PROG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $JAVA_PROG in +else case e in #( + e) case $JAVA_PROG in [\\/]* | ?:[\\/]*) ac_cv_path_JAVA_PROG="$JAVA_PROG" # Let the user override the test with a path. ;; @@ -3636,6 +3684,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi JAVA_PROG=$ac_cv_path_JAVA_PROG @@ -3661,8 +3710,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_JAVAC+y} then : printf %s "(cached) " >&6 -else $as_nop - case $JAVAC in +else case e in #( + e) case $JAVAC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. ;; @@ -3687,6 +3736,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi JAVAC=$ac_cv_path_JAVAC @@ -3711,8 +3761,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_JAVAH+y} then : printf %s "(cached) " >&6 -else $as_nop - case $JAVAH in +else case e in #( + e) case $JAVAH in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAH="$JAVAH" # Let the user override the test with a path. ;; @@ -3737,6 +3787,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi JAVAH=$ac_cv_path_JAVAH @@ -3761,8 +3812,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_JAR+y} then : printf %s "(cached) " >&6 -else $as_nop - case $JAR in +else case e in #( + e) case $JAR in [\\/]* | ?:[\\/]*) ac_cv_path_JAR="$JAR" # Let the user override the test with a path. ;; @@ -3787,6 +3838,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi JAR=$ac_cv_path_JAR @@ -3992,20 +4044,21 @@ printf "%s\n" "no" >&6; } as_fn_error $? "Java not found. Please install JDK 1.4 or later, make sure that the binaries are on the PATH and re-try. If that doesn't work, set JAVA_HOME correspondingly." "$LINENO" 5 fi -as_ac_File=`printf "%s\n" "ac_cv_file_${JAVA_HOME}/include/jni.h" | $as_tr_sh` +as_ac_File=`printf "%s\n" "ac_cv_file_${JAVA_HOME}/include/jni.h" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${JAVA_HOME}/include/jni.h" >&5 printf %s "checking for ${JAVA_HOME}/include/jni.h... " >&6; } if eval test \${$as_ac_File+y} then : printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && +else case e in #( + e) test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "${JAVA_HOME}/include/jni.h"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" -fi +fi ;; +esac fi eval ac_res=\$$as_ac_File { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -4013,21 +4066,22 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes" then : JNI_H="${JAVA_HOME}/include" -else $as_nop - as_ac_File=`printf "%s\n" "ac_cv_file_${JAVA_HOME}/jni.h" | $as_tr_sh` +else case e in #( + e) as_ac_File=`printf "%s\n" "ac_cv_file_${JAVA_HOME}/jni.h" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${JAVA_HOME}/jni.h" >&5 printf %s "checking for ${JAVA_HOME}/jni.h... " >&6; } if eval test \${$as_ac_File+y} then : printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && +else case e in #( + e) test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "${JAVA_HOME}/jni.h"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" -fi +fi ;; +esac fi eval ac_res=\$$as_ac_File { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -4035,21 +4089,22 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes" then : JNI_H="${JAVA_HOME}" -else $as_nop - as_ac_File=`printf "%s\n" "ac_cv_file_${JAVA_HOME}/../include/jni.h" | $as_tr_sh` +else case e in #( + e) as_ac_File=`printf "%s\n" "ac_cv_file_${JAVA_HOME}/../include/jni.h" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${JAVA_HOME}/../include/jni.h" >&5 printf %s "checking for ${JAVA_HOME}/../include/jni.h... " >&6; } if eval test \${$as_ac_File+y} then : printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && +else case e in #( + e) test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "${JAVA_HOME}/../include/jni.h"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" -fi +fi ;; +esac fi eval ac_res=\$$as_ac_File { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -4057,18 +4112,21 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes" then : JNI_H="${JAVA_HOME}/../include" -else $as_nop - as_fn_error $? "Cannot compile JNI programs, check jri/config.log for details. +else case e in #( + e) as_fn_error $? "Cannot compile JNI programs, check jri/config.log for details. Please make sure you have a proper JDK installed. Use --disable-jri when you install rJava and don't need JRI. " "$LINENO" 5 - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi @@ -4081,20 +4139,21 @@ JAVA_INC="-I${JNI_H}" # at least as of now - 01/2004) jac_found_md=no for mddir in . linux solaris ppc irix alpha aix hp-ux genunix cygwin win32 freebsd; do -as_ac_File=`printf "%s\n" "ac_cv_file_${JNI_H}/$mddir/jni_md.h" | $as_tr_sh` +as_ac_File=`printf "%s\n" "ac_cv_file_${JNI_H}/$mddir/jni_md.h" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${JNI_H}/$mddir/jni_md.h" >&5 printf %s "checking for ${JNI_H}/$mddir/jni_md.h... " >&6; } if eval test \${$as_ac_File+y} then : printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && +else case e in #( + e) test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "${JNI_H}/$mddir/jni_md.h"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" -fi +fi ;; +esac fi eval ac_res=\$$as_ac_File { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -4141,8 +4200,9 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - as_fn_error $? "Cannot compile a simple JNI program. See config.log for details." "$LINENO" 5 +else case e in #( + e) as_fn_error $? "Cannot compile a simple JNI program. See config.log for details." "$LINENO" 5 ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -4154,12 +4214,12 @@ export LD_LIBRARY_PATH printf %s "checking whether JNI programs can be run... " >&6; } if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -4173,13 +4233,15 @@ if ac_fn_c_try_run "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "Cannot run a simple JNI program - probably your jvm library is in non-standard location or JVM is unsupported. See config.log for details." "$LINENO" 5 + as_fn_error $? "Cannot run a simple JNI program - probably your jvm library is in non-standard location or JVM is unsupported. See config.log for details." "$LINENO" 5 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -4187,12 +4249,12 @@ fi printf %s "checking JNI data types... " >&6; } if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -4205,11 +4267,13 @@ if ac_fn_c_try_run "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } -else $as_nop - as_fn_error $? "One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this." "$LINENO" 5 +else case e in #( + e) as_fn_error $? "One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this." "$LINENO" 5 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -4275,9 +4339,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } DEFFLAGS="${DEFFLAGS} -DRIF_HAS_CSTACK" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -4298,9 +4363,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } DEFFLAGS="${DEFFLAGS} -DRIF_HAS_RSIGHAND" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -4344,8 +4410,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -4375,14 +4441,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -4472,7 +4538,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -4481,12 +4546,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -4558,7 +4624,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -4587,7 +4653,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -4627,11 +4692,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -4645,11 +4711,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -4732,9 +4799,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -4815,10 +4882,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -4834,7 +4903,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by JRI $as_me 0.3, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4865,7 +4934,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -4898,10 +4967,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ JRI config.status 0.3 -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -4960,8 +5029,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -4969,8 +5038,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -5023,7 +5092,7 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "run") CONFIG_FILES="$CONFIG_FILES run" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -5042,7 +5111,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -5066,7 +5135,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -5224,13 +5293,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -5340,7 +5409,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -5362,19 +5431,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -5498,7 +5567,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -5527,9 +5596,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" diff --git a/src/jri/src/config.h.in b/src/jri/src/config.h.in index d1c4686..cdedc70 100644 --- a/src/jri/src/config.h.in +++ b/src/jri/src/config.h.in @@ -51,7 +51,7 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS From fcf28eceac80fb149c3737e1e911605f25b8042d Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 13:46:19 +1300 Subject: [PATCH 49/69] update NEWS --- NEWS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 47ed0b2..8754ad9 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,13 @@ NEWS/ChangeLog for rJava -------------------------- +1.0-15 + o Avoid access issues in Java 17+ (thanks to Valentino Pinna!) + when using reflection API: J() (#345) + + o Move JRI sources to src/jri to avoid the top level warning. + + 1.0-14 2026-01-19 o Minor changes to replace EXTPTR macros with API calls globally. From 0d054a4622051baf3894c78a8975abc17de33116 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Mon, 19 Jan 2026 14:57:52 +1300 Subject: [PATCH 50/69] autodetect lowest possible target --- src/java/Makefile | 5 ++++- src/jri/REngine | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/java/Makefile b/src/java/Makefile index 4ac3e6a..cef4fed 100644 --- a/src/java/Makefile +++ b/src/java/Makefile @@ -1,5 +1,8 @@ JAVA_SRC=$(wildcard *.java) -JFLAGS=-source 1.6 -target 1.6 +ifeq ($(JTARGET),) +JTARGET:=$(shell for i in 1.6 8 11 17; do if javac -source $$i -target $$i RJavaTools.java >/dev/null 2>&1; then echo $$i; break; fi; done) +endif +JFLAGS=-source $(JTARGET) -target $(JTARGET) JAVAC=javac JAVA=java JAVADOC=javadoc diff --git a/src/jri/REngine b/src/jri/REngine index d6f5c84..4455acb 160000 --- a/src/jri/REngine +++ b/src/jri/REngine @@ -1 +1 @@ -Subproject commit d6f5c84bd7af9a2207673d495cad9b82d459effb +Subproject commit 4455acba2ec859bc3e51df285e54ff40d823271d From 30dae398aeacfe4f90579d4012faf75090888032 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 11 Mar 2026 15:01:42 +1300 Subject: [PATCH 51/69] Revert d03e1ca (#345) which causes rev.dep. failure --- src/java/RJavaTools.java | 158 +++++++++------------------------------ 1 file changed, 34 insertions(+), 124 deletions(-) diff --git a/src/java/RJavaTools.java b/src/java/RJavaTools.java index 6890b56..3b52c85 100644 --- a/src/java/RJavaTools.java +++ b/src/java/RJavaTools.java @@ -17,20 +17,13 @@ // You should have received a copy of the GNU General Public License // along with rJava. If not, see . -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodHandles.Lookup; -import java.lang.reflect.AccessibleObject; -import java.lang.reflect.Constructor ; -import java.lang.reflect.Executable; +import java.lang.reflect.Method ; import java.lang.reflect.Field ; +import java.lang.reflect.Constructor ; import java.lang.reflect.InvocationTargetException ; -import java.lang.reflect.Member ; -import java.lang.reflect.Method ; import java.lang.reflect.Modifier ; -import java.util.ArrayDeque; -import java.util.Arrays; -import java.util.Deque; -import java.util.HashSet; +import java.lang.reflect.Member ; + import java.util.Vector ; @@ -42,23 +35,6 @@ */ public class RJavaTools { - /* dual path for Java 8 and 9+ to check actual accessibility */ - private static final Method CAN_ACCESS; - /* Java 8 accessibility checker */ - private static final Lookup LOOKUP = MethodHandles.publicLookup(); - - static { - Method canAccess = null; - try { - canAccess = Executable.class.getMethod("canAccess", Object.class); - } catch (NoSuchMethodException e) { - // Java 8- - } catch (SecurityException e) { - // Java 8- - } - CAN_ACCESS = canAccess; - } - /** * Returns an inner class of the class with the given simple name * @@ -352,97 +328,7 @@ public static boolean hasMethod(Object o, String name) { return classHasMethod(o.getClass(), name, false); } - /** - * Tests whether a given executable is accessible without actually calling {@link AccessibleObject#isAccessible()} which is unreliable. - * - * @param executable the given method/constructor - * @param o the target object - * @return true if the method can be accessed from RJavaTools - */ - public static boolean canAccess(Executable executable, Object o){ - try { - if (CAN_ACCESS != null) { - /* Java 9+ path */ - return (boolean) (Boolean) CAN_ACCESS.invoke(executable, o); - } else { - /* Java 8 path */ - if (executable instanceof Method) - LOOKUP.unreflect((Method) executable); - else - LOOKUP.unreflectConstructor((Constructor) executable); - return true; - } - } catch (Exception e) { - return false; - } - } - /** - * Resolves a bridge method to the override one - * @param bridgeMethod the potentially bridge method - * @return a method that isn't a bridge method - */ - public static Method resolveBridge(Method bridgeMethod) { - // accounts for bridge methods which may have slightly different parameters - Method best = null; - if (bridgeMethod.isBridge()) { - Class[] bridgeParams = bridgeMethod.getParameterTypes(); - // look for non-bridge methods in the same class that accepts wider parameters - nextMethod: - for (Method method: bridgeMethod.getDeclaringClass().getDeclaredMethods()) { - if (!method.isBridge() && !method.isSynthetic() && method.getName().equals(bridgeMethod.getName()) - && method.getParameterCount() == bridgeMethod.getParameterCount()) { - Class[] testParams = method.getParameterTypes(); - // Bridge params should be supertypes of target params (erasure widening). - for (int i = 0; i < testParams.length; i++) { - if (!testParams[i].isAssignableFrom(bridgeParams[i])) continue nextMethod; - } - if (bridgeMethod.getReturnType().isAssignableFrom(method.getReturnType()) && (best == null || isMoreSpecific(method, best))) best = method; - } - } - } - - return best == null ? bridgeMethod : best; - } - - /** - * Finds a mathod that accepts the given instance and is accessible from RJavaTools class. - *

Avoids calling isAccessible/setAccessible that fails on Java 17+ - * - * @param method The most specific, possibly non-accessible, method - * @param target the instance upon which the method is being invoked (null for static) - * @return - */ - public static Method findAccessible(Method method, Object target) { - if (canAccess(method, target)) return method; - - Deque> supers = new ArrayDeque>(); - HashSet> visited = new HashSet>(); - supers.add(target.getClass()); - - while (!supers.isEmpty()) { - Class c = supers.pop(); - if (visited.add(c)) { - Method superMethod; - try { - // first update the method to be non-bridge - method = resolveBridge(method); - superMethod = c.getMethod(method.getName(), method.getParameterTypes()); - /* if an accessible executable is found stop here */ - if (canAccess(superMethod, target)) return superMethod; - if (!c.isInterface() && !c.isArray()) supers.add(c.getSuperclass()); - if (!c.isArray()) supers.addAll(Arrays.asList(c.getInterfaces())); - } catch (NoSuchMethodException e1) { - /* executable not found in current class (and any of its ancestors) */ - } catch (SecurityException e1) { - /* executable not found in current class (and any of its ancestors) */ - } - } - } - - /* No accessible executable found, fail later on invoke/newInstance */ - return method; - } /** * Object creator. Find the best constructor based on the parameter classes @@ -457,12 +343,25 @@ public static Object newInstance( Class o_clazz, Object[] args, Class[] clazzes Constructor cons = getConstructor( o_clazz, clazzes, is_null ); + /* enforcing accessibility (workaround for bug 128) */ + boolean access = cons.isAccessible(); + if (!access) { + try { /* since JDK-17 this may fail */ + cons.setAccessible( true ); + } catch (Throwable e) { + access = true; /* nothing we can do, just let it fail below */ + } + } + Object o; try{ o = cons.newInstance( args ) ; } catch( InvocationTargetException e){ /* the target exception is much more useful than the reflection wrapper */ - throw e.getCause() ; + throw e.getTargetException() ; + } finally{ + if (!access) + cons.setAccessible( access ); } return o; } @@ -478,21 +377,32 @@ static boolean[] arg_is_null(Object[] args){ /** * Invoke a method of a given class - *

First the appropriate method is resolved by getMethod. - *

Then, if the method is not accessible, tries to find an accessible equivalent. - *

Finally it invokes the method + *

First the appropriate method is resolved by getMethod and + * then invokes the method */ public static Object invokeMethod( Class o_clazz, Object o, String name, Object[] args, Class[] clazzes) throws Throwable { Method m = getMethod( o_clazz, name, clazzes, arg_is_null(args) ); - m = findAccessible(m, o); + + /* enforcing accessibility (workaround for bug 128) */ + boolean access = m.isAccessible(); + if (!access) { + try { /* since JDK-17 this may fail */ + m.setAccessible( true ); + } catch (Throwable e) { + access = true; /* nothing we can do, fail later with proper error ... */ + } + } Object out; try{ out = m.invoke( o, args ) ; } catch( InvocationTargetException e){ /* the target exception is much more useful than the reflection wrapper */ - throw e.getCause() ; + throw e.getTargetException() ; + } finally{ + if (!access) + m.setAccessible( access ); } return out ; } From 0565536bab7061ab430812bc5f0af4c6acff8a57 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 11 Mar 2026 15:03:33 +1300 Subject: [PATCH 52/69] remove #345 from NEWS since it had to be reverted --- NEWS | 3 --- 1 file changed, 3 deletions(-) diff --git a/NEWS b/NEWS index 8754ad9..112c9ed 100644 --- a/NEWS +++ b/NEWS @@ -2,9 +2,6 @@ -------------------------- 1.0-15 - o Avoid access issues in Java 17+ (thanks to Valentino Pinna!) - when using reflection API: J() (#345) - o Move JRI sources to src/jri to avoid the top level warning. From 99383ecbef3cac2f263ea3b818843a0f37024874 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 6 Mar 2026 16:01:33 +1300 Subject: [PATCH 53/69] add compatibility re-maps for EXTPTR_PTR and ENCLOS in JRI --- src/jri/src/Rengine.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/jri/src/Rengine.c b/src/jri/src/Rengine.c index 4a053de..d298bdd 100644 --- a/src/jri/src/Rengine.c +++ b/src/jri/src/Rengine.c @@ -21,6 +21,22 @@ LibExtern int R_interrupts_pending; #define RS_ParseVector(A,B,C) R_ParseVector(A,B,C,R_NilValue) #endif +/* R API compatibility re-mapping */ +#if (R_VERSION >= R_Version(2,0,0)) +/* EXTPTR */ +#ifdef EXTPTR_PTR +#undef EXTPTR_PTR +#endif +#define EXTPTR_PTR(X) R_ExternalPtrAddr(X) +#endif + +#if (R_VERSION >= R_Version(2,5,0)) +#ifdef ENCLOS +#undef ENCLOS +#endif +#define ENCLOS(X) R_ParentEnv(X) +#endif + #include "Rcallbacks.h" #include "Rinit.h" #include "globals.h" From ea984515fc6bbb7e8abbe909f745e91d2545128c Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 11 Mar 2026 15:11:41 +1300 Subject: [PATCH 54/69] update NEWS --- NEWS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 112c9ed..4e92a6c 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,11 @@ NEWS/ChangeLog for rJava -------------------------- -1.0-15 +1.0-15 2026-03-11 o Move JRI sources to src/jri to avoid the top level warning. + o Add compatibility re-maps in JRI for R 4.5.0+ + 1.0-14 2026-01-19 o Minor changes to replace EXTPTR macros with API calls globally. From dba309d9fdcb8c6a27688c214a811c7d54fed09c Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Sun, 15 Mar 2026 14:52:56 +1300 Subject: [PATCH 55/69] bump version to 1.0-16 --- src/rJava.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index c0ca8c7..d342050 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x01000f /* rJava v1.0-15 */ +#define RJAVA_VER 0x010010 /* rJava v1.0-16 */ /* important changes between versions: 3.0 - adds compiler From c8f3318388e71ea3c99f989d00eb2c2f47c736d4 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Sun, 15 Mar 2026 14:53:18 +1300 Subject: [PATCH 56/69] use https in URL --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1b7c4aa..df0cdf2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,6 +7,6 @@ Authors@R: person("Simon", "Urbanek", role=c("aut","cre","cph"), email="Simon.Ur Depends: R (>= 3.6.0), methods Description: Low-level interface to Java VM very much like .C/.Call and friends. Allows creation of objects, calling methods and accessing fields. License: LGPL-2.1 -URL: http://www.rforge.net/rJava/ +URL: https://www.rforge.net/rJava/ SystemRequirements: Java JDK 1.2 or higher (for JRI/REngine JDK 1.4 or higher), GNU make BugReports: https://github.com/s-u/rJava/issues From 4ed4e8d47317513a27a2a24aec12e53b5fdaa2a0 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Sun, 15 Mar 2026 15:26:32 +1300 Subject: [PATCH 57/69] use R_getAttribNames() in R 4.6.0+ --- src/jri/src/Rengine.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/jri/src/Rengine.c b/src/jri/src/Rengine.c index d298bdd..ada9015 100644 --- a/src/jri/src/Rengine.c +++ b/src/jri/src/Rengine.c @@ -410,19 +410,33 @@ JNIEXPORT jobjectArray JNICALL Java_org_rosuda_JRI_Rengine_rniGetAttrNames (JNIEnv *env, jobject this, jlong exp) { SEXP o = L2SEXP(exp); - SEXP att = ATTRIB(o), ah = att; unsigned int ac = 0; jobjectArray sa; +#if (R_VERSION >= R_Version(4,6,0)) + SEXP ans = R_getAttribNames(o); + ac = (unsigned int) XLENGTH(o); + if (!ac) return 0; +#else + SEXP att = ATTRIB(o), ah = att; if (att == R_NilValue) return 0; /* count the number of attributes */ while (ah != R_NilValue) { ac++; ah = CDR(ah); } +#endif /* allocate Java array */ sa = (*env)->NewObjectArray(env, ac, (*env)->FindClass(env, "java/lang/String"), 0); if (!sa) return 0; ac = 0; +#if (R_VERSION >= R_Version(4,6,0)) + R_xlen_t i = 0, n = XLENGTH(ans); + while (i < n) { + jobject s = (*env)->NewStringUTF(env, CHAR_UTF8(STRING_ELT(ans, i))); + (*env)->SetObjectArrayElement(env, sa, (unsigned int)i, s); + i++; + } +#else ah = att; /* iterate again and set create the strings */ while (ah != R_NilValue) { @@ -434,6 +448,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_rosuda_JRI_Rengine_rniGetAttrNames ac++; ah = CDR(ah); } +#endif return sa; } @@ -444,8 +459,7 @@ JNIEXPORT void JNICALL Java_org_rosuda_JRI_Rengine_rniSetAttr if (!an || an==R_NilValue || exp==0 || L2SEXP(exp)==R_NilValue) return; setAttrib(L2SEXP(exp), an, (attr==0)?R_NilValue:L2SEXP(attr)); - - /* BTW: we don't need to adjust the object bit for "class", setAttrib does that already */ + /* BTW: we don't need to adjust the object bit for "class", setAttrib does that already */ /* this is not official API, but whoever uses this should know what he's doing it's ok for directly constructing attr lists, and that's what it should be used for From 3ce684e34c3d9ec97b614d973c751f03ddd1cdbf Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Sun, 15 Mar 2026 16:05:20 +1300 Subject: [PATCH 58/69] work-around removal of R_lsInternal() --- src/jri/src/Rengine.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/jri/src/Rengine.c b/src/jri/src/Rengine.c index ada9015..225a919 100644 --- a/src/jri/src/Rengine.c +++ b/src/jri/src/Rengine.c @@ -232,7 +232,7 @@ JNIEXPORT void JNICALL Java_org_rosuda_JRI_Rengine_rniPrintValue JNIEXPORT jlong JNICALL Java_org_rosuda_JRI_Rengine_rniParentEnv (JNIEnv *env, jobject this, jlong exp) { - return SEXP2L(ENCLOS(exp ? L2SEXP(exp) : R_GlobalEnv)); + return SEXP2L(ENCLOS(exp ? L2SEXP(exp) : R_GlobalEnv)); } JNIEXPORT jlong JNICALL Java_org_rosuda_JRI_Rengine_rniFindVar @@ -247,7 +247,19 @@ JNIEXPORT jlong JNICALL Java_org_rosuda_JRI_Rengine_rniFindVar JNIEXPORT jlong JNICALL Java_org_rosuda_JRI_Rengine_rniListEnv (JNIEnv *env, jobject this, jlong rho, jboolean all) { +#if (R_VERSION >= R_Version(4,6,0)) + /* have to do it the hard way - eval ls(rho, all.names=all) */ + SEXP sRho = PROTECT(rho ? L2SEXP(rho) : R_GlobalEnv); + SEXP sAll = PROTECT(Rf_ScalarLogical(all ? 1 : 0)); + SEXP ana = PROTECT(CONS(sAll, R_NilValue)); + SET_TAG(ana, Rf_install("all.names")); + SEXP ex = PROTECT(lang3(Rf_install("ls"), sRho, ana)); + SEXP res = Rf_eval(ex, R_BaseEnv); + UNPROTECT(4); + return SEXP2L(res); +#else return SEXP2L(R_lsInternal(rho ? L2SEXP(rho) : R_GlobalEnv, all)); +#endif } JNIEXPORT jlong JNICALL Java_org_rosuda_JRI_Rengine_rniSpecialObject From 1350753e4538c2f51da5b69ad6008ba11aeccf30 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Sun, 15 Mar 2026 16:08:49 +1300 Subject: [PATCH 59/69] protext exps during rniEval for safety --- src/jri/Rengine.java | 11 ++++++++++- src/jri/src/Rengine.c | 9 +++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/jri/Rengine.java b/src/jri/Rengine.java index cce2d83..f84fe41 100644 --- a/src/jri/Rengine.java +++ b/src/jri/Rengine.java @@ -548,7 +548,16 @@ public synchronized REXP eval(String s, boolean convert) { if (pr != 0) { long er = rniEval(pr, 0); if (er != 0) { - REXP x = new REXP(this, er, convert); + REXP x; + if (convert) { + rniProtect(er); + try { + x = new REXP(this, er, convert); + } finally { + rniUnprotect(1); + } + } else + x = new REXP(this, er, convert); if (DEBUG>0) System.out.println("Rengine.eval("+s+"): END (OK)"+Thread.currentThread()); return x; } diff --git a/src/jri/src/Rengine.c b/src/jri/src/Rengine.c index 225a919..ebee989 100644 --- a/src/jri/src/Rengine.c +++ b/src/jri/src/Rengine.c @@ -156,6 +156,7 @@ JNIEXPORT jlong JNICALL Java_org_rosuda_JRI_Rengine_rniEval /* invalid (NULL) expression (parse error, ... ) */ if (!exp) return 0; + PROTECT(exps); if (TYPEOF(exps) == EXPRSXP) { /* if the object is a list of exps, eval them one by one */ l = LENGTH(exps); @@ -163,12 +164,16 @@ JNIEXPORT jlong JNICALL Java_org_rosuda_JRI_Rengine_rniEval es = R_tryEval(VECTOR_ELT(exps,i), eval_env, &er); /* an error occured, no need to continue */ - if (er) return 0; + if (er) { + UNPROTECT(1); + return 0; + } i++; } } else es = R_tryEval(exps, eval_env, &er); - + UNPROTECT(1); + /* er is just a flag - on error return 0 */ if (er) return 0; From 5b2ce656a648b91b5e41dca33481669af337b6ca Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Sun, 15 Mar 2026 16:12:14 +1300 Subject: [PATCH 60/69] update NEWS --- NEWS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS b/NEWS index 4e92a6c..3ab7d16 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,12 @@ NEWS/ChangeLog for rJava -------------------------- +1.0-16 2026-03-15 + o Adjust to API removal in R 4.6.0 + + o Add defensive protection during REXP conversion and rniEval + + 1.0-15 2026-03-11 o Move JRI sources to src/jri to avoid the top level warning. From 204df24b62f9b42e1fc5b87fc7461d4a2e69bce6 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 20 Mar 2026 08:22:45 +1300 Subject: [PATCH 61/69] bump to 1.0-17 --- src/rJava.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index d342050..d0d988b 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x010010 /* rJava v1.0-16 */ +#define RJAVA_VER 0x010011 /* rJava v1.0-17 */ /* important changes between versions: 3.0 - adds compiler From 29949648d625883cbbf5ddb332f39bfae5b16e84 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 20 Mar 2026 08:24:33 +1300 Subject: [PATCH 62/69] replace Rf_findVar with R_getVar in R 4.5.0+ --- src/jri/src/Rengine.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/jri/src/Rengine.c b/src/jri/src/Rengine.c index ebee989..44771f3 100644 --- a/src/jri/src/Rengine.c +++ b/src/jri/src/Rengine.c @@ -37,6 +37,13 @@ LibExtern int R_interrupts_pending; #define ENCLOS(X) R_ParentEnv(X) #endif +#if (R_VERSION >= R_Version(4,5,0)) +#ifdef Rf_findVar +#undef Rf_findVar +#endif +#define Rf_findVar(X, Y) R_getVar(X, Y, FALSE) +#endif + #include "Rcallbacks.h" #include "Rinit.h" #include "globals.h" From ccac308ab0750041682464ce4e0b9c37e07f95b2 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Fri, 20 Mar 2026 08:25:23 +1300 Subject: [PATCH 63/69] update NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 3ab7d16..62b10ce 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ NEWS/ChangeLog for rJava -------------------------- +1.0-17 2026-03-20 + o Some more API changes for R 4.6.0 + + 1.0-16 2026-03-15 o Adjust to API removal in R 4.6.0 From 80a6a802e0b19480f3f8f0bc159ca01a8e3cd305 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 8 Apr 2026 08:12:54 +1200 Subject: [PATCH 64/69] bump version to 1.0-18 --- src/rJava.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rJava.h b/src/rJava.h index d0d988b..40f846f 100644 --- a/src/rJava.h +++ b/src/rJava.h @@ -1,7 +1,7 @@ #ifndef __RJAVA_H__ #define __RJAVA_H__ -#define RJAVA_VER 0x010011 /* rJava v1.0-17 */ +#define RJAVA_VER 0x010012 /* rJava v1.0-18 */ /* important changes between versions: 3.0 - adds compiler From 6268a75c3dce26625f3f12c2db8808553d2a7421 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 8 Apr 2026 10:29:05 +1200 Subject: [PATCH 65/69] fix regression breaking JRI in R <4.5.0 --- src/jri/src/Rengine.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/jri/src/Rengine.c b/src/jri/src/Rengine.c index 44771f3..f58f8f5 100644 --- a/src/jri/src/Rengine.c +++ b/src/jri/src/Rengine.c @@ -30,14 +30,12 @@ LibExtern int R_interrupts_pending; #define EXTPTR_PTR(X) R_ExternalPtrAddr(X) #endif -#if (R_VERSION >= R_Version(2,5,0)) +#if (R_VERSION >= R_Version(4,5,0)) #ifdef ENCLOS #undef ENCLOS #endif #define ENCLOS(X) R_ParentEnv(X) -#endif -#if (R_VERSION >= R_Version(4,5,0)) #ifdef Rf_findVar #undef Rf_findVar #endif From 54bfb36263a886236747fb098a79e0883b0475be Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 8 Apr 2026 10:30:57 +1200 Subject: [PATCH 66/69] use decls from Rinterface.h and Rembedded.h when available --- src/jri/src/Rdecl.h | 19 ++++++++++++++++--- src/jri/src/Rinit.c | 5 +---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/jri/src/Rdecl.h b/src/jri/src/Rdecl.h index 48910f2..a21ddef 100644 --- a/src/jri/src/Rdecl.h +++ b/src/jri/src/Rdecl.h @@ -2,11 +2,24 @@ #define __RDECL_H__ /* declarations from R internals or other include files */ -/* last update: R 2.4.0 */ +/* last update: R 4.6.0 */ +#include + +#define R_INTERFACE_PTRS 1 +#define CSTACK_DEFNS 1 +#include /* R_ReadConsole since 4.6.0 */ + +/* 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) */ +#else void run_Rmainloop(void); /* main/main.c */ int R_ReadConsole(char*, unsigned char*, int, int); /* include/Defn.h */ +int Rf_initialize_R(int ac, char **av); /* include/Rembedded.h - exists since 2.4.0 */ +#endif /* R < 4.6.0 */ + +/* this one is still left over */ void Rf_checkArity(SEXP, SEXP); /* include/Defn.h */ -int Rf_initialize_R(int ac, char **av); /* include/Rembedded.h */ -#endif +#endif /* __RDECL_H__ */ diff --git a/src/jri/src/Rinit.c b/src/jri/src/Rinit.c index b6f75c9..05d815d 100644 --- a/src/jri/src/Rinit.c +++ b/src/jri/src/Rinit.c @@ -2,7 +2,7 @@ #include #include "Rinit.h" #include "Rcallbacks.h" -#include "Rdecl.h" +#include "Rdecl.h" /* includes Rinterface.h */ /*-------------------------------------------------------------------* * UNIX initialization (includes Darwin/Mac OS X) * @@ -10,9 +10,6 @@ #ifndef Win32 -#define R_INTERFACE_PTRS 1 -#define CSTACK_DEFNS 1 -#include /* and SaveAction is not officially exported */ extern SA_TYPE SaveAction; From 1325462636d32e75a477c5bba95c9c6a7cc050da Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 8 Apr 2026 10:33:48 +1200 Subject: [PATCH 67/69] update NEWS --- NEWS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 62b10ce..25d3751 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,13 @@ NEWS/ChangeLog for rJava -------------------------- +1.0-18 2026-04-08 + o JRI: fix regression in 1.0-16 breaking older versions of R. + + o JRI: use R embedding declarations where available (needed for + R 4.6.0) + + 1.0-17 2026-03-20 o Some more API changes for R 4.6.0 From 5b7810efecca8f96177c19a52a26e511af75e626 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Wed, 8 Apr 2026 11:22:28 +1200 Subject: [PATCH 68/69] move ancient checkArity decl from Rdecl.h to Rcallbacks.c --- src/jri/src/Rcallbacks.c | 3 ++- src/jri/src/Rdecl.h | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/jri/src/Rcallbacks.c b/src/jri/src/Rcallbacks.c index 12f2597..1337e22 100644 --- a/src/jri/src/Rcallbacks.c +++ b/src/jri/src/Rcallbacks.c @@ -26,7 +26,8 @@ #ifndef checkArity #define checkArity Rf_checkArity #endif -#else +void Rf_checkArity(SEXP, SEXP); /* include/Defn.h */ +#else /* in 2.6.0 re-mapped to Rf_checkArityCall so we just disable it to avoid API issues */ #define checkArity(X,Y) #endif diff --git a/src/jri/src/Rdecl.h b/src/jri/src/Rdecl.h index a21ddef..abe9913 100644 --- a/src/jri/src/Rdecl.h +++ b/src/jri/src/Rdecl.h @@ -19,7 +19,4 @@ int R_ReadConsole(char*, unsigned char*, int, int); /* include/Defn.h */ int Rf_initialize_R(int ac, char **av); /* include/Rembedded.h - exists since 2.4.0 */ #endif /* R < 4.6.0 */ -/* this one is still left over */ -void Rf_checkArity(SEXP, SEXP); /* include/Defn.h */ - #endif /* __RDECL_H__ */ From ac746bfa63268847c24494f8854f49d45324891d Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sun, 8 Feb 2026 13:18:03 -0800 Subject: [PATCH 69/69] Drop ancient check for utils::.DollarNames --- NAMESPACE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index 89e0163..9156174 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -32,7 +32,7 @@ S3method(within, jclassName) # within requires that with.jobjRef is visible outside export(with.jobjRef) -if( exists( ".DollarNames", asNamespace("utils") ) ) importFrom( utils, .DollarNames ) +importFrom( utils, .DollarNames ) S3method(.DollarNames, jobjRef) S3method(.DollarNames, jarrayRef) S3method(.DollarNames, jrectRef)