From b000e7bb749e8f688220f967360fc58dd70a8ade Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 1 Mar 2024 05:47:07 +0000 Subject: [PATCH] configure.ac: Append `POSTLINK` to `LINK_SO` for all platforms The `POSTLINK` variable had been used only for darwin platforms, but it's now used for WebAssembly/WASI as well. To make shared extension libraries properly post-processed, we need to append `POSTLINK` to `LINK_SO` but it was done only for darwin platforms. This commit generalizes the appending to all platforms. --- configure.ac | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 1c46d4c2bc..8be679667d 100644 --- a/configure.ac +++ b/configure.ac @@ -1107,10 +1107,6 @@ main() AS_IF([test -n "$dsymutil"], [ POSTLINK="$dsymutil \$@ 2>/dev/null${POSTLINK:+; $POSTLINK}" ]) - AS_IF([test -n "${POSTLINK}"], [ - LINK_SO="$LINK_SO -\$(POSTLINK)" - ]) AC_CHECK_HEADERS(crt_externs.h, [], [], [ #include ]) @@ -1275,6 +1271,13 @@ main() [ LIBS="-lm $LIBS"]) : ${ORIG_LIBS=$LIBS} +AS_IF([test -n "${POSTLINK}"], [ + # NOTE: A (part of) link commands used link shared extension libraries. If + # the first line of the value is empty, mkmf prepends default link steps. + LINK_SO="$LINK_SO +\$(POSTLINK)" +]) + AS_IF([test -n "${rb_there_is_in_fact_no_gplusplus_but_autoconf_is_cheating_us}"], [ AC_MSG_NOTICE([Test skipped due to lack of a C++ compiler.]) ],