Files
swg-main/build_duality.sh
2020-02-02 15:41:01 -05:00

51 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
basedir=$PWD
PATH=$PATH:$basedir/build/bin
MODE=Release
DBSERVICE=//127.0.0.1/swgd
DBUSERNAME=swgd
DBPASSWORD=swgd
read -p "Do you want to recompile the src? (y/n) " srcresponse
read -p "Do you want to build dsrc? (y/n) " dsrcresponse
srcresponse=${srcresponse,,} #tolower
if [[ $srcresponse =~ ^(yes|y| ) ]]; then
unset ORACLE_HOME
unset ORACLE_SID
unset JAVA_HOME
export ORACLE_HOME=/usr/lib/oracle/12.2/client
export JAVA_HOME=/usr/java
export ORACLE_SID=swg
rm -rf $basedir/build
mkdir $basedir/build
mkdir $basedir/build/bin
cd $basedir/build
export LDFLAGS=-L/usr/lib32
export CMAKE_PREFIX_PATH="/usr/lib32:/lib32:/usr/lib/i386-linux-gnu:/usr/include/i386-linux-gnu"
cmake -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32 -DCMAKE_MODULE_LINKER_FLAGS=-m32 -DCMAKE_SHARED_LINKER_FLAGS=-m32 -DCMAKE_BUILD_TYPE=$MODE $basedir/src
make -j$(nproc)
if [[ $MODE =~ ^(Release) ]]; then
strip -s bin/*
fi
cd $basedir
fi
dsrcresponse=${dsrcresponse,,} #tolower
if [[ $dsrcresponse =~ ^(yes|y| ) ]]; then
python $basedir/include/build_dsrc.py
python $basedir/utils/build_object_template_crc_string_tables.py
python $basedir/utils/build_quest_crc_string_tables.py
$basedir/utils/build_miff.sh
cd $basedir/src/game/server/database
perl ./templates/processTemplateList.pl < $basedir/dsrc/sku.0/sys.server/built/game/misc/object_template_crc_string_table.tab > $basedir/build/templates.sql
sqlplus ${DBUSERNAME}/${DBPASSWORD}@${DBSERVICE} @$basedir/build/templates.sql > $basedir/build/templates.out
cd $basedir
if [ ! -d $basedir/data/sku.0/sys.client/compiled ]; then
mkdir $basedir/data/sku.0/sys.client/compiled
fi
if [ ! -L $basedir/data/sku.0/sys.client/compiled/clientdata ]; then
ln -s $basedir/clientdata/ $basedir/data/sku.0/sys.client/compiled/
fi
fi