Skip to content

Commit ed22b8d

Browse files
committed
Mechanism to override AC_CHECK_FUNCS in Autoconf
For R packages using Autoconf, we'll sometimes need to be able to force the result of AC_CHECK_FUNCS. For example, for the `uuid` package Autoconf sets `HAVE_GETRANDOM`. Despite compiling OK, using `getrandom()` at the time of writing in fact fails for R packages compiled using Emscripten, due to a missing symbol. Autoconf missed this because we compile R packages with the `SIDE_MODULE=1` flag, and with this flag Emscripten does not complain about the missing symbols. So, using this mechanism we can force Autoconf to return "no" when checking for `getrandom()`, fixing the issue with `uuid`.
1 parent 32a757e commit ed22b8d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

inst/configure

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@
99
# Additional specific R package fixes
1010
export STRINGI_CPPFLAGS=-DU_HAVE_MMAP=0
1111

12+
# Override specific Autoconf results for Emscripten environment
13+
AC_FUNC_OVERRIDES='ac_cv_func_getrandom=no'
14+
1215
# sh is needed for scripts without shebang
13-
emconfigure sh -c "./configure.orig --build=$BUILD_PLATFORM --host=wasm32-unknown-emscripten"
16+
emconfigure sh -c "./configure.orig --build=$BUILD_PLATFORM --host=wasm32-unknown-emscripten $AC_FUNC_OVERRIDES"

0 commit comments

Comments
 (0)