From a4a1414b6d81985e4e880c4960ca56016038bee6 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 22 Apr 2023 00:02:21 +0800 Subject: fix configure #3660 --- configure | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/configure b/configure index eb20469d1..fb4325748 100755 --- a/configure +++ b/configure @@ -1566,11 +1566,11 @@ _get_target_toolchain_flags_for_gcc() { local toolkind="${2}" local flags="" if is_arch "i386"; then - flags="-m32" + flags="${flags} -m32" fi _get_target_item "${name}" "kind"; local targetkind="${_ret}" if test_eq "${targetkind}" "shared" && test_eq "${toolkind}" "sh"; then - flags="-shared -fPIC" + flags="${flags} -shared -fPIC" fi _ret="${flags}" } @@ -1581,11 +1581,17 @@ _get_target_toolchain_flags_for_clang() { local toolkind="${2}" local flags="-Qunused-arguments" if is_arch "i386"; then - flags="-m32" + flags="${flags} -m32" fi _get_target_item "${name}" "kind"; local targetkind="${_ret}" if test_eq "${targetkind}" "shared" && test_eq "${toolkind}" "sh"; then - flags="-shared -fPIC" + flags="${flags} -shared -fPIC" + fi + if is_plat "macosx"; then + _os_iorunv "xcrun" "-sdk" "macosx" "--show-sdk-path"; local sdkdir="${_ret}" + if test_nz "${sdkdir}"; then + flags="${flags} -isysroot \"${sdkdir}\"" + fi fi _ret="${flags}" } -- cgit v1.3.1