Matthew_Cline

df libstdc++.so fix

Jul 12th, 2016 (edited)
2,685
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.03 KB | None | 0 0
  1. #!/bin/sh
  2. DF_DIR=$(dirname "$0")
  3. cd "${DF_DIR}"
  4. export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
  5. #export SDL_VIDEO_CENTERED=1 # Centre the screen.  Messes up resizing.
  6.  
  7. # Find 64 bit library
  8. LIBFILE="libstdc++.so.6"
  9. for d in /lib64 /lib ; do
  10.     if [ -e $d/$LIBFILE ]; then
  11.         # Get the file that the symbolic link points to
  12.         CXX_LIB=`readlink -f $d/$LIBFILE`
  13.         CXX_LIB=`basename $CXX_LIB`
  14.         VER=`echo $CXX_LIB | sed -e 's/^.*\.so.//'`
  15.         break
  16.     fi
  17. done
  18.  
  19. case $VER in
  20.     6.0.2[2-9]|6.0.3[0-9]|6.1.*)
  21.         # Nothing to do, the system C++ lib is one we can link against.
  22.         echo Using system libstdc++ library, version $VER
  23.         ;;
  24.  
  25.     *)
  26.         # Either we can't find the system C++ lib or it's of a version we can't link against,
  27.         # so use the library that shipped with us
  28.         echo Using bundled libstdc++ library
  29.         export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./c_lib
  30.         ;;
  31. esac
  32.  
  33. ./libs/Dwarf_Fortress "$@" # Go, go, go! :)
Add Comment
Please, Sign In to add comment