this means the process run by ./dfhack will be Dwarf Fortress itself rather than the wrapper script, but it also means that no cleanup actions can occur.
First, simplifies the quoting of the environment variables. Then sets
startup-with-shell to off so that gdb does not start bash first; if it
starts bash ld will see the LD_PRELOAD and try to load libdfhack.so
into the bash process, which is not what we want.
We could instead use an exec-wrapper, but that would be a slightly
larger change and we don't need any of the convenience features that
using a shell gives us (argument expansion and redirects, basically).
That echo option is a bash-specific extension, unavailable under other shells.
Fortunately, a bare echo with no arguments prints the single newline required here.
If the file ".dfhackrc" exists in the user's home directory or in the
game directory it will be sourced, so the user can set environmental
variables like LD_LIBRARY_PATH. There's also a few shell variables it
can set to alter the behavior of the dfhack script.
1) Giving "-g" or "--gdb" as the first argument to the dfhack script
will launch DF under gdb.
2) "reset -I" is called after DF finishes, to return the terminal to a
sane state in case DF crashed or was killed.
Copy package/linux/dfhack to the games directory; it's the same as the
normal df script, but sets LD_PRELOAD properly.
Also, CMAkeLists.txt now checks to see that the output directory is set
to the game directory, and fatally fails if it isn't.