Skip to content

Commit

Permalink
Mechanism to override AC_CHECK_FUNCS in Autoconf
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
georgestagg committed Apr 18, 2024
1 parent 32a757e commit ed22b8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inst/configure
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
# Additional specific R package fixes
export STRINGI_CPPFLAGS=-DU_HAVE_MMAP=0

# Override specific Autoconf results for Emscripten environment
AC_FUNC_OVERRIDES='ac_cv_func_getrandom=no'

# sh is needed for scripts without shebang
emconfigure sh -c "./configure.orig --build=$BUILD_PLATFORM --host=wasm32-unknown-emscripten"
emconfigure sh -c "./configure.orig --build=$BUILD_PLATFORM --host=wasm32-unknown-emscripten $AC_FUNC_OVERRIDES"

0 comments on commit ed22b8d

Please sign in to comment.