Skip to content

Commit

Permalink
add soname for linux #214
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jun 27, 2023
1 parent 3d5dbfa commit 8982d88
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,18 @@ _get_target_toolchain_flags_for_gcc() {
flags="${flags} -fPIC"
fi
fi
# add soname, https://github.com/tboox/tbox/issues/214#issuecomment-1608882997
if test_eq "${targetkind}" "shared" && test_eq "${toolkind}" "sh" && is_plat "linux"; then
_get_target_item "${name}" "version"; local version="${_ret}"
if test_nz "${version}"; then
string_split "${version}" "."
local version_major="${_ret}"
local version_minor="${_ret2}"
local version_alter="${_ret3}"
_get_target_filename "${name}"; local filename="${_ret}"
flags="${flags} -Wl,-soname,${filename}.${version_major}.${version_minor}.${version_alter}"
fi
fi
_ret="${flags}"
}

Expand All @@ -1613,6 +1625,18 @@ _get_target_toolchain_flags_for_clang() {
flags="${flags} -fPIC"
fi
fi
# add soname, https://github.com/tboox/tbox/issues/214#issuecomment-1608882997
if test_eq "${targetkind}" "shared" && test_eq "${toolkind}" "sh" && is_plat "linux"; then
_get_target_item "${name}" "version"; local version="${_ret}"
if test_nz "${version}"; then
string_split "${version}" "."
local version_major="${_ret}"
local version_minor="${_ret2}"
local version_alter="${_ret3}"
_get_target_filename "${name}"; local filename="${_ret}"
flags="${flags} -Wl,-soname,${filename}.${version_major}.${version_minor}.${version_alter}"
fi
fi
if is_plat "macosx"; then
_os_iorunv "xcrun" "-sdk" "macosx" "--show-sdk-path"; local sdkdir="${_ret}"
if test_nz "${sdkdir}"; then
Expand Down

0 comments on commit 8982d88

Please sign in to comment.