Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Enno Rehling 2018-02-02 19:50:10 +01:00
commit 096861fc62
4 changed files with 40 additions and 15 deletions

View File

@ -38,8 +38,12 @@ else (MSVC)
find_package (Curses) find_package (Curses)
endif (MSVC) endif (MSVC)
find_package (SQLite3) if (ERESSEA_DB STREQUAL "db")
find_package (BerkeleyDB) find_package (BerkeleyDB REQUIRED QUIET)
else()
find_package (SQLite3 REQUIRED QUIET)
endif()
find_package (LibXml2 REQUIRED) find_package (LibXml2 REQUIRED)
find_package (ToLua REQUIRED) find_package (ToLua REQUIRED)
if (TOLUA_FOUND) if (TOLUA_FOUND)

View File

@ -3703,7 +3703,7 @@
</string> </string>
<string name="sound_out"> <string name="sound_out">
<text locale="de">Aushorchen</text> <text locale="de">Aushorchen</text>
<text locale="en">sound_out</text> <text locale="en">Sound out</text>
</string> </string>
<string name="bloodthirst"> <string name="bloodthirst">
<text locale="de">Kriegsgesang</text> <text locale="de">Kriegsgesang</text>

View File

@ -31,15 +31,18 @@ if [ ! -d $ROOT/$BUILD ]; then
fi fi
echo "build eressea" echo "build eressea"
CMAKE_ARGS=".."
cd $ROOT/$BUILD cd $ROOT/$BUILD
BRANCH=$(git status -s -b | head -1 | cut -d\ -f 2 | sed 's/\..*//') BRANCH=$(git status -s -b | head -1 | cut -d\ -f 2 | sed 's/\..*//')
if [ "$BRANCH" = "master" ] ; then if [ "$BRANCH" = "master" ] ; then
VERSION=$(git describe --match 'v*.*.*' --tags | sed 's/^v//') VERSION=$(git describe --match 'v*.*.*' --tags | sed 's/^v//')
echo "$BRANCH $VERSION" echo "$BRANCH $VERSION"
cmake -DERESSEA_VERSION="$VERSION" .. CMAKE_ARGS="-DERESSEA_VERSION=$VERSION ${CMAKE_ARGS}"
else else
REV=$(git rev-parse --short HEAD) REV=$(git rev-parse --short HEAD)
cmake -DERESSEA_BUILDNO="$REV" .. CMAKE_ARGS="-DERESSEA_BUILDNO=$REV $CMAKE_ARGS"
fi fi
cmake ${CMAKE_ARGS}
make $MAKEOPTS && make test make $MAKEOPTS && make test
cd $OLDPWD cd $OLDPWD

View File

@ -1,5 +1,20 @@
#!/bin/sh #!/bin/sh
ERESSEA_DB=sqlite
if [ -e /usr/include/db.h ] ; then
ERESSEA_DB=db
fi
# Parse command line arguments
while [ ! -z "$1" ] ; do
if [ "$1" = "--with-db" ] ; then
ERESSEA_DB=db
elif [ "$1" = "--with-sqlite" ] ; then
ERESSEA_DB=sqlite
fi
shift 1
done
ROOT=$(git rev-parse --show-toplevel) ROOT=$(git rev-parse --show-toplevel)
[ -z $BUILD ] && BUILD=Debug [ -z $BUILD ] && BUILD=Debug
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" [ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
@ -15,8 +30,6 @@ mkdir -p $BIN_DIR
rm -f $BUILD rm -f $BUILD
ln -sf $BIN_DIR $BUILD ln -sf $BIN_DIR $BUILD
rm -f CMakeCache.txt
# use anything installed in /opt or /usr # use anything installed in /opt or /usr
LIBRARY_PATH=/opt/lib:/opt/lib/$MACHINE:/usr/lib/$MACHINE LIBRARY_PATH=/opt/lib:/opt/lib/$MACHINE:/usr/lib/$MACHINE
INCLUDE_PATH=/opt/include:/usr/include INCLUDE_PATH=/opt/include:/usr/include
@ -30,11 +43,6 @@ if [ -d $HOME/usr ]; then
fi fi
DEST=$(dirname $ROOT)/server DEST=$(dirname $ROOT)/server
ARGS=" -DCMAKE_BUILD_TYPE=$BUILD \
-DCMAKE_LIBRARY_PATH=$LIBRARY_PATH \
-DCMAKE_PREFIX_PATH=$PREFIX_PATH \
-DCMAKE_INSTALL_PREFIX=$DEST"
# -DCMAKE_INCLUDE_PATH=$INCLUDE_PATH
git submodule update --init git submodule update --init
@ -46,7 +54,17 @@ elif [ -d /usr/local/include/lua5.1 ]; then
LUA_DIR=/usr/local LUA_DIR=/usr/local
LUA_VERSION="5.1" LUA_VERSION="5.1"
fi fi
export LUA_DIR
cat >| $BUILD/config.cmake <<HEREDOC
SET (ERESSEA_DB "$ERESSEA_DB" CACHE STRING "Database driver")
SET (LUA_DIR "$LUA_DIR" CACHE PATH "Lua root path")
SET (CMAKE_BUILD_TYPE "$BUILD" FORCE)
SET (CMAKE_INSTALL_PREFIX "$DEST" CACHE PATH "")
SET (CMAKE_LIBRARY_PATH "$LIBRARY_PATH" CACHE PATH "")
SET (CMAKE_PREFIX_PATH "$PREFIX_PATH" CACHE PATH "")
HEREDOC
#echo 'SET (LUA_DIR "$LUA_DIR" PATH)' >> $BUILD/config.cmake
path="$(which tolua)" path="$(which tolua)"
if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then
@ -59,7 +77,7 @@ if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then
echo "building tolua..." echo "building tolua..."
cd tolua cd tolua
make make
ARGS="$ARGS -DPC_TOLUA_DIR=$ROOT/tolua" echo 'SET(PC_TOLUA_DIR "$ROOT/tolua" CACHE PATH "tolua root")' >> $BUILD/config.cmake
else else
echo "tolua is $path" echo "tolua is $path"
fi fi
@ -68,6 +86,6 @@ unset path
set -e set -e
cd $BIN_DIR cd $BIN_DIR
cmake .. $ARGS $* cmake -C config.cmake .. $*
cd $OLDPWD cd $OLDPWD