Rename libstdc++ automatically in Linux launcher script

develop
lethosor 2016-01-18 09:18:32 -05:00
parent 63e5b5bc0f
commit c15cf5f415
1 changed files with 17 additions and 0 deletions

@ -15,6 +15,7 @@
# DF_VALGRIND_OPTS: Options to pass to valgrind, if it's being run # DF_VALGRIND_OPTS: Options to pass to valgrind, if it's being run
# DF_HELGRIND_OPTS: Options to pass to helgrind, if it's being run # DF_HELGRIND_OPTS: Options to pass to helgrind, if it's being run
# DF_POST_CMD: Shell command to be run at very end of script # DF_POST_CMD: Shell command to be run at very end of script
# DFHACK_NO_RENAME_LIBSTDCXX: Non-empty to prevent automatically renaming libstdc++
DF_DIR=$(dirname "$0") DF_DIR=$(dirname "$0")
cd "${DF_DIR}" cd "${DF_DIR}"
@ -31,6 +32,22 @@ if [ -r "./$RC" ]; then
. "./$RC" . "./$RC"
fi fi
# Disable bundled libstdc++
libcxx_orig="libs/libstdc++.so.6"
libcxx_backup="libs/libstdc++.so.6.backup"
if [ -z "${DFHACK_NO_RENAME_LIBSTDCXX:-}" ] && [ -e "$libcxx_orig" ] && [ ! -e "$libcxx_backup" ]; then
mv "$libcxx_orig" "$libcxx_backup"
cat <<EOF
NOTICE: $libcxx_orig has been moved to $libcxx_backup
for better compatibility. If you are using an older distro and this breaks,
run "cp $libcxx_backup $libcxx_orig", or add this to
$HOME/$RC to affect future DFHack installations:
export DFHACK_NO_RENAME_LIBSTDCXX=1
EOF
fi
# Save current terminal settings # Save current terminal settings
old_tty_settings=$(stty -g) old_tty_settings=$(stty -g)