Merge pull request #3597 from myk002/myk_linux_deploy

deploy linux build to steam
develop
Myk 2023-07-28 22:55:55 -07:00 committed by GitHub
commit 7231287f6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 206 additions and 108 deletions

@ -3,9 +3,9 @@ name: Build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
build: build-test:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: build (Linux, GCC ${{ matrix.gcc }}, ${{ matrix.plugins }} plugins) name: Test (Linux, GCC ${{ matrix.gcc }}, ${{ matrix.plugins }} plugins)
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -29,25 +29,18 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install \ sudo apt-get install \
ccache \ ccache \
libgtk2.0-0 \ libgl-dev \
libncursesw5 \
libsdl-image1.2-dev \
libsdl-ttf2.0-dev \
libsdl1.2-dev \
libxml-libxml-perl \
libxml-libxslt-perl \ libxml-libxslt-perl \
lua5.3 \ ninja-build
ninja-build \
zlib1g-dev
pip install 'sphinx<4.4.0' pip install 'sphinx<4.4.0'
- name: Install GCC - name: Install GCC
run: | run: |
sudo apt-get install gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} sudo apt-get install gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
- name: Clone DFHack - name: Clone DFHack
uses: actions/checkout@v1 uses: actions/checkout@v3
with: with:
fetch-depth: 0 # unlimited - we need past tags
submodules: true submodules: true
fetch-depth: 0
- name: Set up environment - name: Set up environment
id: env_setup id: env_setup
run: | run: |
@ -56,19 +49,18 @@ jobs:
echo "DF_VERSION=${DF_VERSION}" >> $GITHUB_ENV echo "DF_VERSION=${DF_VERSION}" >> $GITHUB_ENV
echo "DF_FOLDER=${HOME}/DF/${DF_VERSION}/df_linux" >> $GITHUB_ENV echo "DF_FOLDER=${HOME}/DF/${DF_VERSION}/df_linux" >> $GITHUB_ENV
echo "CCACHE_DIR=${HOME}/.ccache" >> $GITHUB_ENV echo "CCACHE_DIR=${HOME}/.ccache" >> $GITHUB_ENV
# - name: Fetch DF cache
# uses: actions/cache@v3
# with:
# path: ~/DF
# key: dfcache-${{ steps.env_setup.outputs.df_version }}-${{ hashFiles('ci/download-df.sh') }}
- name: Fetch ccache - name: Fetch ccache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ~/.ccache path: ~/.ccache
key: ccache-${{ matrix.os }}-gcc-${{ matrix.gcc }}-${{ github.ref_name }}-${{ github.sha }} key: ccache-${{ matrix.os }}-gcc-${{ matrix.gcc }}-${{ github.sha }}
restore-keys: | restore-keys: |
ccache-${{ matrix.os }}-gcc-${{ matrix.gcc }}-${{ github.ref_name }}
ccache-${{ matrix.os }}-gcc-${{ matrix.gcc }} ccache-${{ matrix.os }}-gcc-${{ matrix.gcc }}
# - name: Fetch DF cache
# uses: actions/cache@v3
# with:
# path: ~/DF
# key: df-${{ steps.env_setup.outputs.df_version }}-${{ hashFiles('ci/download-df.sh') }}
# - name: Download DF # - name: Download DF
# run: | # run: |
# sh ci/download-df.sh # sh ci/download-df.sh
@ -113,21 +105,87 @@ jobs:
# cp "$DF_FOLDER"/test*.json "$DF_FOLDER"/*.log artifacts || status=$((status + 4)) # cp "$DF_FOLDER"/test*.json "$DF_FOLDER"/*.log artifacts || status=$((status + 4))
# exit $status # exit $status
# - name: Upload test artifacts # - name: Upload test artifacts
# uses: actions/upload-artifact@v1 # uses: actions/upload-artifact@v3
# if: (success() || failure()) && steps.run_tests.outcome != 'skipped' # if: (success() || failure()) && steps.run_tests.outcome != 'skipped'
# continue-on-error: true # continue-on-error: true
# with: # with:
# name: test-artifacts-${{ matrix.gcc }} # name: test-artifacts-${{ matrix.gcc }}
# path: artifacts # path: artifacts
- name: Clean up DF folder # - name: Clean up DF folder
# prevent DFHack-generated files from ending up in the cache # # prevent DFHack-generated files from ending up in the cache
# (download-df.sh also removes them, this is just to save cache space) # # (download-df.sh also removes them, this is just to save cache space)
if: success() || failure() # if: success() || failure()
# run: |
# rm -rf "$DF_FOLDER"
build-linux64:
name: Linux package
runs-on: ubuntu-22.04
steps:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: 3
- name: Install dependencies
run: | run: |
rm -rf "$DF_FOLDER" sudo apt-get update
sudo apt-get install \
ccache \
gcc-10 \
g++-10 \
libgl-dev \
libxml-libxslt-perl \
ninja-build
pip install 'sphinx<4.4.0'
- name: Clone DFHack
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Fetch ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-ubuntu-22.04-gcc-10-${{ github.sha }}
restore-keys: |
ccache-ubuntu-22.04-gcc-10
- name: Set up environment
id: env_setup
run: |
echo "CCACHE_DIR=${HOME}/.ccache" >> $GITHUB_ENV
- name: Configure DFHack
env:
CC: gcc-10
CXX: g++-10
run: |
cmake \
-S . \
-B build \
-G Ninja \
-DDFHACK_BUILD_ARCH=64 \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_DOCS:BOOL=1 \
-DBUILD_STONESENSE:BOOL=1 \
-DCMAKE_INSTALL_PREFIX=build/output
- name: Build DFHack
run: |
ninja -C build install
ccache --max-size 50M
ccache --cleanup
ccache --show-stats
- name: Format artifact name
id: artifactname
run: |
echo name=$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dfhack-linux64-build-${{ steps.artifactname.outputs.name }}
path: build/output/*
build-cross-win64: build-cross-win64:
name: Build MSVC win64 name: Win64 package
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Install dependencies - name: Install dependencies
@ -143,11 +201,10 @@ jobs:
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: build/win64-cross/ccache path: build/win64-cross/ccache
key: ccache-win64-cross-msvc-${{ github.ref_name }}-${{ github.sha }} key: ccache-win64-cross-msvc-${{ github.sha }}
restore-keys: | restore-keys: |
ccache-win64-cross-msvc-${{ github.ref_name }}
ccache-win64-cross-msvc ccache-win64-cross-msvc
- name: Cross-compile win64 artifacts - name: Cross-compile win64
env: env:
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1' CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1'
run: | run: |
@ -160,7 +217,7 @@ jobs:
id: artifactname id: artifactname
run: | run: |
echo name=$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT echo name=$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Upload win64 artifacts - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: dfhack-win64-build-${{ steps.artifactname.outputs.name }} name: dfhack-win64-build-${{ steps.artifactname.outputs.name }}
@ -177,7 +234,7 @@ jobs:
run: | run: |
pip install 'sphinx' pip install 'sphinx'
- name: Clone DFHack - name: Clone DFHack
uses: actions/checkout@v1 uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- name: Build docs - name: Build docs
@ -196,7 +253,7 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install lua5.3 sudo apt-get install lua5.3
- name: Clone DFHack - name: Clone DFHack
uses: actions/checkout@v1 uses: actions/checkout@v3
with: with:
submodules: true submodules: true
# don't need tags here # don't need tags here

@ -23,10 +23,21 @@ jobs:
name: Deploy to Steam name: Deploy to Steam
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: 3
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install ccache sudo apt-get install \
ccache \
gcc-10 \
g++-10 \
libgl-dev \
libxml-libxslt-perl \
ninja-build
pip install 'sphinx<4.4.0'
- name: Clone DFHack - name: Clone DFHack
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
@ -40,16 +51,66 @@ jobs:
ref: main ref: main
ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }} ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
path: depends/steam path: depends/steam
- name: Fetch ccache - name: Fetch linux64 ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-ubuntu-22.04-gcc-10-${{ github.sha }}
restore-keys: |
ccache-ubuntu-22.04-gcc-10
- name: Fetch win64 ccache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: build/win64-cross/ccache path: build/win64-cross/ccache
key: ccache-win64-cross-msvc-${{ github.sha }} key: ccache-win64-cross-msvc-${{ github.sha }}
restore-keys: | restore-keys: |
ccache-win64-cross-msvc ccache-win64-cross-msvc
- name: Set up environment
id: env_setup
run: |
echo "CCACHE_DIR=${HOME}/.ccache" >> $GITHUB_ENV
- name: Configure DFHack (common files)
run: |
cmake \
-S . \
-B build \
-G Ninja \
-DDFHACK_BUILD_ARCH=64 \
-DBUILD_LIBRARY:BOOL=0 \
-DBUILD_BINARIES:BOOL=0 \
-DBUILD_DOCS:BOOL=1 \
-DCMAKE_INSTALL_PREFIX=build/common-output
- name: Build DFHack (common files)
run: |
ninja -C build install
- name: Configure DFHack (linux build)
env:
CC: gcc-10
CXX: g++-10
run: |
cmake \
-S . \
-B build \
-G Ninja \
-DDFHACK_BUILD_ARCH=64 \
-DBUILD_STONESENSE:BOOL=1 \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_LIBRARY:BOOL=1 \
-DBUILD_BINARIES:BOOL=1 \
-DBUILD_DOCS:BOOL=0 \
-DINSTALL_SCRIPTS:BOOL=0 \
-DINSTALL_DATA_FILES:BOOL=0 \
-DCMAKE_INSTALL_PREFIX=build/linux-output
- name: Build DFHack (linux build)
run: |
ninja -C build install
ccache --max-size 50M
ccache --cleanup
ccache --show-stats
- name: Cross-compile win64 artifacts - name: Cross-compile win64 artifacts
env: env:
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1' CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1 -DBUILD_DOCS:BOOL=0 -DINSTALL_SCRIPTS:BOOL=0 -DINSTALL_DATA_FILES:BOOL=0'
steam_username: ${{ secrets.STEAM_SDK_USERNAME }} steam_username: ${{ secrets.STEAM_SDK_USERNAME }}
steam_password: ${{ secrets.STEAM_SDK_PASSWORD }} steam_password: ${{ secrets.STEAM_SDK_PASSWORD }}
run: | run: |
@ -71,5 +132,7 @@ jobs:
appId: 2346660 appId: 2346660
buildDescription: ${{ github.event.inputs.version }} buildDescription: ${{ github.event.inputs.version }}
rootPath: build rootPath: build
depot1Path: win64-cross/output depot1Path: common-output
depot2Path: win64-cross/output
depot3Path: linux-output
releaseBranch: ${{ github.event.inputs.release_channel }} releaseBranch: ${{ github.event.inputs.release_channel }}

@ -210,17 +210,16 @@ set(DFHACK_BINARY_DESTINATION .)
set(DFHACK_PLUGIN_DESTINATION ${DFHACK_DATA_DESTINATION}/plugins) set(DFHACK_PLUGIN_DESTINATION ${DFHACK_DATA_DESTINATION}/plugins)
# dfhack lua files go here: # dfhack lua files go here:
set(DFHACK_LUA_DESTINATION ${DFHACK_DATA_DESTINATION}/lua) set(DFHACK_LUA_DESTINATION ${DFHACK_DATA_DESTINATION}/lua)
# the windows .lib file goes here:
set(DFHACK_DEVLIB_DESTINATION ${DFHACK_DATA_DESTINATION})
# user documentation goes here: # user documentation goes here:
set(DFHACK_USERDOC_DESTINATION ${DFHACK_DATA_DESTINATION}) set(DFHACK_USERDOC_DESTINATION ${DFHACK_DATA_DESTINATION})
# developer documentation goes here:
set(DFHACK_DEVDOC_DESTINATION ${DFHACK_DATA_DESTINATION})
# some options for the user/developer to play with # some options for the user/developer to play with
option(BUILD_LIBRARY "Build the DFHack library." ON) option(BUILD_LIBRARY "Build the DFHack library." ON)
option(BUILD_PLUGINS "Build the DFHack plugins." ON) option(BUILD_PLUGINS "Build the DFHack plugins." ON)
option(BUILD_BINARIES "Build the DFHack binary tools." ON)
option(INSTALL_SCRIPTS "Install DFHack scripts." ON)
option(INSTALL_DATA_FILES "Install DFHack common data files." ON)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
if(UNIX) if(UNIX)
@ -387,11 +386,14 @@ include_directories(depends/lodepng)
include_directories(depends/tthread) include_directories(depends/tthread)
include_directories(depends/clsocket/src) include_directories(depends/clsocket/src)
include_directories(depends/xlsxio/include) include_directories(depends/xlsxio/include)
if(BUILD_LIBRARY)
add_subdirectory(depends) add_subdirectory(depends)
endif()
# Testing with CTest # Testing with CTest
macro(dfhack_test name files) macro(dfhack_test name files)
if(UNIX AND NOT APPLE) # remove this once our MSVC build env has been updated if(BUILD_LIBRARY AND UNIX AND NOT APPLE) # remove this once our MSVC build env has been updated
add_executable(${name} ${files}) add_executable(${name} ${files})
target_include_directories(${name} PUBLIC depends/googletest/googletest/include) target_include_directories(${name} PUBLIC depends/googletest/googletest/include)
target_link_libraries(${name} dfhack gtest) target_link_libraries(${name} dfhack gtest)
@ -416,12 +418,17 @@ file(WRITE "${CMAKE_BINARY_DIR}/dfhack_setarch.txt" ${DFHACK_SETARCH})
install(FILES "${CMAKE_BINARY_DIR}/dfhack_setarch.txt" DESTINATION "${DFHACK_DATA_DESTINATION}") install(FILES "${CMAKE_BINARY_DIR}/dfhack_setarch.txt" DESTINATION "${DFHACK_DATA_DESTINATION}")
# build the plugins # build the plugins
if(BUILD_PLUGINS) if(BUILD_LIBRARY AND BUILD_PLUGINS)
add_subdirectory(plugins) add_subdirectory(plugins)
endif() endif()
if(INSTALL_DATA_FILES)
add_subdirectory(data) add_subdirectory(data)
endif()
if(INSTALL_SCRIPTS)
add_subdirectory(scripts) add_subdirectory(scripts)
endif()
if(BUILD_DOCS) if(BUILD_DOCS)
find_package(Python3) find_package(Python3)
@ -582,7 +589,7 @@ endif()
set(DFHACK_BUILD_ARCH_PREV "${DFHACK_BUILD_ARCH}" CACHE STRING "Previous build architecture" FORCE) set(DFHACK_BUILD_ARCH_PREV "${DFHACK_BUILD_ARCH}" CACHE STRING "Previous build architecture" FORCE)
option(BUILD_SIZECHECK "Build the sizecheck library, for research" OFF) option(BUILD_SIZECHECK "Build the sizecheck library, for research" OFF)
if(BUILD_SIZECHECK) if(BUILD_LIBRARY AND BUILD_SIZECHECK)
add_subdirectory(depends/sizecheck) add_subdirectory(depends/sizecheck)
add_dependencies(dfhack sizecheck) add_dependencies(dfhack sizecheck)
endif() endif()

@ -1,26 +1,20 @@
#!/bin/sh #!/bin/sh
# NOTE: This is dfhack's modification of the normal invocation script,
# changed to properly set LD_PRELOAD so as to run DFHACK.
#
# You can run DF under gdb by passing -g or --gdb as the first argument. # You can run DF under gdb by passing -g or --gdb as the first argument.
# #
# If the file ".dfhackrc" exists in the DF directory or your home directory # If the file ".dfhackrc" exists in the DF directory or your home directory
# it will be sourced by this script, to let you set environmental variables. # it will be sourced by this script, to let you set environmental variables.
# If it exists in both places it will first source the one in your home # If it exists in both places it will first source the one in your home
# directory, then the on in the game directory. # directory, then the one in the game directory.
# #
# Shell variables .dfhackrc can set to affect this script: # Shell variables .dfhackrc can set to affect this script:
# DF_GDB_OPTS: Options to pass to gdb, if it's being run # DF_GDB_OPTS: Options to pass to gdb, if it's being run
# 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}"
export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing.
# User config files # User config files
RC=".dfhackrc" RC=".dfhackrc"
@ -32,22 +26,6 @@ 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
if [ ! -t 0 ]; then if [ ! -t 0 ]; then
stty() { stty() {
return return
@ -57,14 +35,7 @@ fi
# Save current terminal settings # Save current terminal settings
old_tty_settings=$(stty -g) old_tty_settings=$(stty -g)
# Use distro_fixes.sh from LNP if it exists
DISTROFIXES="distro_fixes.sh"
if [ -r "$DISTROFIXES" ]; then
. "./$DISTROFIXES"
fi
# Now run # Now run
export LD_LIBRARY_PATH="./hack/libs:./hack:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="./hack/libs:./hack:$LD_LIBRARY_PATH"
LIB="./hack/libdfhack.so" LIB="./hack/libdfhack.so"
@ -74,7 +45,7 @@ if which objdump > /dev/null; then
fi fi
PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}${LIBSAN}${LIB}" PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}${LIBSAN}${LIB}"
setarch_arch=$(cat hack/dfhack_setarch.txt || printf i386) setarch_arch=$(cat hack/dfhack_setarch.txt || printf x86_64)
if ! setarch "$setarch_arch" -R true 2>/dev/null; then if ! setarch "$setarch_arch" -R true 2>/dev/null; then
echo "warn: architecture '$setarch_arch' not supported by setarch" >&2 echo "warn: architecture '$setarch_arch' not supported by setarch" >&2
if [ "$setarch_arch" = "i386" ]; then if [ "$setarch_arch" = "i386" ]; then
@ -90,7 +61,7 @@ case "$1" in
-g | --gdb) -g | --gdb)
shift shift
echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp
gdb $DF_GDB_OPTS -x gdbcmd.tmp --args ./libs/Dwarf_Fortress "$@" gdb $DF_GDB_OPTS -x gdbcmd.tmp --args ./dwarfort "$@"
rm gdbcmd.tmp rm gdbcmd.tmp
ret=$? ret=$?
;; ;;
@ -107,11 +78,11 @@ case "$1" in
echo "set environment MALLOC_PERTURB_ 45" >> gdbcmd.tmp echo "set environment MALLOC_PERTURB_ 45" >> gdbcmd.tmp
echo "set startup-with-shell off" >> gdbcmd.tmp echo "set startup-with-shell off" >> gdbcmd.tmp
echo "target extended-remote localhost:12345" >> gdbcmd.tmp echo "target extended-remote localhost:12345" >> gdbcmd.tmp
echo "set remote exec-file ./libs/Dwarf_Fortress" >> gdbcmd.tmp echo "set remote exec-file ./dwarfort" >> gdbcmd.tmp
# For some reason gdb ignores sysroot setting if it is from same file as # For some reason gdb ignores sysroot setting if it is from same file as
# target extended-remote command # target extended-remote command
echo "set sysroot /" > gdbcmd_sysroot.tmp echo "set sysroot /" > gdbcmd_sysroot.tmp
gdb $DF_GDB_OPTS -x gdbcmd.tmp -x gdbcmd_sysroot.tmp --args ./libs/Dwarf_Fortress "$@" gdb $DF_GDB_OPTS -x gdbcmd.tmp -x gdbcmd_sysroot.tmp --args ./dwarfort "$@"
rm gdbcmd.tmp gdbcmd_sysroot.tmp rm gdbcmd.tmp gdbcmd_sysroot.tmp
ret=$? ret=$?
;; ;;
@ -124,35 +95,35 @@ case "$1" in
;; ;;
-h | --helgrind) -h | --helgrind)
shift shift
LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./libs/Dwarf_Fortress "$@" LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./dwarfort "$@"
ret=$? ret=$?
;; ;;
-v | --valgrind) -v | --valgrind)
shift shift
LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./libs/Dwarf_Fortress "$@" LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./dwarfort "$@"
ret=$? ret=$?
;; ;;
-c | --callgrind) -c | --callgrind)
shift shift
LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./libs/Dwarf_Fortress "$@" LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./dwarfort "$@"
ret=$? ret=$?
;; ;;
--strace) --strace)
shift shift
strace -f setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@" 2> strace.log strace -f setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@" 2> strace.log
ret=$? ret=$?
;; ;;
-x | --exec) -x | --exec)
exec setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@" exec setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@"
# script does not resume # script does not resume
;; ;;
--sc | --sizecheck) --sc | --sizecheck)
PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}./hack/libsizecheck.so" PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}./hack/libsizecheck.so"
MALLOC_PERTURB_=45 setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@" MALLOC_PERTURB_=45 setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@"
ret=$? ret=$?
;; ;;
*) *)
setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@" setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@"
ret=$? ret=$?
;; ;;
esac esac