The AX_JNI_INCLUDE_DIR macro was violating the first rule of AC_CACHE_CHECK: "The commands-to-set-itmust have no side effects except for setting the variable cache-id." Specifically, JNI_INCLUDE_DIRS was being modified within the code block that was only supposed to be setting the value of ac_cv_jni_header_path. This was causing JNI_INCLUDE_DIRS to be incorrect/incomplete when ac_cv_jni_header_path was initialized from an Autoconf cache file.
Since the tests to find the JNI header paths are so trivial, there is nothing to be gained by caching the results. The most straightforward fix is not to cache, and that is the fix provided in this PR.
This PR is based on a patch that I submitted to GNU Savannah, but that patch does not cleanly apply here because libwally-core's local copy is not in sync with the most recent version in the GNU Autoconf Archive.
The
AX_JNI_INCLUDE_DIR
macro was violating the first rule ofAC_CACHE_CHECK
: "The commands-to-set-it must have no side effects except for setting the variable cache-id." Specifically,JNI_INCLUDE_DIRS
was being modified within the code block that was only supposed to be setting the value ofac_cv_jni_header_path
. This was causingJNI_INCLUDE_DIRS
to be incorrect/incomplete whenac_cv_jni_header_path
was initialized from an Autoconf cache file.Since the tests to find the JNI header paths are so trivial, there is nothing to be gained by caching the results. The most straightforward fix is not to cache, and that is the fix provided in this PR.
This PR is based on a patch that I submitted to GNU Savannah, but that patch does not cleanly apply here because libwally-core's local copy is not in sync with the most recent version in the GNU Autoconf Archive.