From 263405c22469796caa9223c0e34c324bd60f0f25 Mon Sep 17 00:00:00 2001 From: vl Date: Tue, 11 May 2010 16:02:53 +0200 Subject: [PATCH] Fixed: all path are now relative. Only have to define $RYZOM_PATH --- code/ryzom/Makefile | 4 +-- code/ryzom/Variables.mk | 8 ++--- code/ryzom/client/src/Makefile | 4 +-- code/ryzom/client/src/client_sheets/Makefile | 2 +- code/ryzom/client/src/seven_zip/Makefile | 2 +- code/ryzom/common/Makefile | 4 +-- code/ryzom/common/src/game_share/Makefile | 6 ++-- code/ryzom/server/Makefile | 4 +-- code/ryzom/server/src/ai_share/Makefile | 3 +- .../server/src/frontend_service/Makefile | 3 +- code/ryzom/server/src/server_share/Makefile | 6 ++-- code/ryzom/server/src/update_cxxpath_flags.sh | 0 code/ryzom/server/src/update_packed_sheets.sh | 5 +-- code/ryzom/tools/scripts/linux/build | 20 ++++++----- code/ryzom/tools/scripts/linux/buildmode | 10 +++--- code/ryzom/tools/scripts/linux/make_all | 9 ++++- code/ryzom/tools/scripts/linux/utilities | 35 ++++++++++--------- 17 files changed, 67 insertions(+), 58 deletions(-) mode change 100644 => 100755 code/ryzom/server/src/update_cxxpath_flags.sh mode change 100644 => 100755 code/ryzom/server/src/update_packed_sheets.sh diff --git a/code/ryzom/Makefile b/code/ryzom/Makefile index 8b70c141b..2a1850c35 100644 --- a/code/ryzom/Makefile +++ b/code/ryzom/Makefile @@ -1,8 +1,8 @@ -MAKE_NIGHT_ARGS=-j10 +MAKE_NIGHT_ARGS=-j2 MAKE_ALL_ARGS=-j2 CXX=g++ CC=g++ -BIN_DIR=$(HOME)/code/ryzom/tools/scripts/linux +BIN_DIR=$(RYZOM_PATH)/tools/scripts/linux night: +make $(MAKE_NIGHT_ARGS) -k -C common night CXX=$(CXX) diff --git a/code/ryzom/Variables.mk b/code/ryzom/Variables.mk index c8639fb65..a952922f0 100644 --- a/code/ryzom/Variables.mk +++ b/code/ryzom/Variables.mk @@ -20,12 +20,12 @@ FLAGS_DBG_off = -O3 -funroll-loops -DNL_RELEASE DIR_DBG_on = debug DIR_DBG_off = release -PACK_SHEETS_FLAGS = -A/home/nevrax/code/ryzom/server -L/home/nevrax/code/ryzom/server -C/home/nevrax/code/ryzom/server/sheet_pack_cfg -Q --nons +PACK_SHEETS_FLAGS = -A$RYZOM_PATH/server -L$RYZOM_PATH/server -C$RYZOM_PATH//server/sheet_pack_cfg -Q --nons -NEL_PATH = $(HOME)/code/install/$(DIR_DBG_$(DBG)) -RYZOM_PATH = $(HOME)/code/ryzom -NEL_INCLUDE = $(HOME)/code/nel/include +NEL_PATH = $(RYZOM_PATH)/../../code/install/$(DIR_DBG_$(DBG)) + +NEL_INCLUDE = $(RYZOM_PATH)/../../code/nel/include RYZOM_COMMON_SRC = $(RYZOM_PATH)/common/src ifeq (Objects.mk,$(wildcard Objects.mk)) diff --git a/code/ryzom/client/src/Makefile b/code/ryzom/client/src/Makefile index 36816b817..c05a48c63 100644 --- a/code/ryzom/client/src/Makefile +++ b/code/ryzom/client/src/Makefile @@ -16,8 +16,8 @@ LUALDFLAGS = $(shell lua-config --libs) CXXFLAGS = $(WWWFLAGS) $(LUAFLAGS) \ $(FLAGS_CMN) $(FLAGS_DBG_$(DBG)) \ -I/usr/include/libxml2 \ - -I$(HOME)/code/luabind \ - -I$(HOME)/code/nel/include \ + -I$(RYZOM_PATH)/../../code/luabind \ + -I$(NEL_PATH)/include \ -I$(RYZOM_PATH)/common/src \ -I$(RYZOM_PATH)/client/src/seven_zip \ -I.. \ diff --git a/code/ryzom/client/src/client_sheets/Makefile b/code/ryzom/client/src/client_sheets/Makefile index 4400cb471..1976cb190 100644 --- a/code/ryzom/client/src/client_sheets/Makefile +++ b/code/ryzom/client/src/client_sheets/Makefile @@ -9,7 +9,7 @@ include ../../../Variables.mk # The flags for the C++ compiler CXXFLAGS = $(FLAGS_CMN) $(FLAGS_DBG_$(DBG)) \ - -I$(HOME)/code/nel/include \ + -I$(NEL_PATH)/include \ -I$(RYZOM_PATH)/common/src \ -I.. \ -I. diff --git a/code/ryzom/client/src/seven_zip/Makefile b/code/ryzom/client/src/seven_zip/Makefile index c3b94a194..ed87286ae 100644 --- a/code/ryzom/client/src/seven_zip/Makefile +++ b/code/ryzom/client/src/seven_zip/Makefile @@ -10,7 +10,7 @@ include ../../../Variables.mk # The flags for the C++ compiler CXXFLAGS = $(FLAGS_CMN) $(FLAGS_DBG_$(DBG)) \ -D_SZ_ONE_DIRECTORY \ - -I$(HOME)/code/nel/include \ + -I$(NEL_PATH)/include \ -I$(RYZOM_PATH)/common/src \ -I.. \ -I. diff --git a/code/ryzom/common/Makefile b/code/ryzom/common/Makefile index a4907270b..f76559463 100644 --- a/code/ryzom/common/Makefile +++ b/code/ryzom/common/Makefile @@ -1,8 +1,8 @@ -MAKE_NIGHT_ARGS=-j10 +MAKE_NIGHT_ARGS=-j2 MAKE_ALL_ARGS=-j2 CXX=g++ CC=g++ -BIN_DIR=$(HOME)/code/ryzom/tools/scripts/linux +BIN_DIR=$(RYZOM_PATH)/tools/scripts/linux night: +make $(MAKE_NIGHT_ARGS) -k -C src night CXX=$(CXX) diff --git a/code/ryzom/common/src/game_share/Makefile b/code/ryzom/common/src/game_share/Makefile index e36e10d3a..ac78fd835 100644 --- a/code/ryzom/common/src/game_share/Makefile +++ b/code/ryzom/common/src/game_share/Makefile @@ -11,8 +11,8 @@ include ../../../Variables.mk CXXFLAGS = $(FLAGS_CMN) $(FLAGS_DBG_$(DBG)) \ -I/usr/include/libxml2 \ -I/usr/include/mysql \ - -I$(HOME)/code/nel/include \ - -I$(HOME)/code/ryzom/common/src \ + -I$(NEL_INCLUDE) \ + -I$(RYZOM_PATH)/common/src \ -I./ \ -I./character_structure \ -I./egs_sheets \ @@ -20,7 +20,7 @@ CXXFLAGS = $(FLAGS_CMN) $(FLAGS_DBG_$(DBG)) \ -I./game_item_manager # The flags for the linker -LDFLAGS = $(LD_FLAGS_CMN) -L$(HOME)/install/$(DIR_DBG_$(DBG))/lib \ +LDFLAGS = $(LD_FLAGS_CMN) -L$(RYZOM_PATH)/install/$(DIR_DBG_$(DBG))/lib \ -llibmysqlclient \ -lnelnet \ -lnelgeorges \ diff --git a/code/ryzom/server/Makefile b/code/ryzom/server/Makefile index a4907270b..f76559463 100644 --- a/code/ryzom/server/Makefile +++ b/code/ryzom/server/Makefile @@ -1,8 +1,8 @@ -MAKE_NIGHT_ARGS=-j10 +MAKE_NIGHT_ARGS=-j2 MAKE_ALL_ARGS=-j2 CXX=g++ CC=g++ -BIN_DIR=$(HOME)/code/ryzom/tools/scripts/linux +BIN_DIR=$(RYZOM_PATH)/tools/scripts/linux night: +make $(MAKE_NIGHT_ARGS) -k -C src night CXX=$(CXX) diff --git a/code/ryzom/server/src/ai_share/Makefile b/code/ryzom/server/src/ai_share/Makefile index 2513043ca..87271914d 100644 --- a/code/ryzom/server/src/ai_share/Makefile +++ b/code/ryzom/server/src/ai_share/Makefile @@ -20,13 +20,12 @@ LDFLAGS = $(LD_FLAGS_CMN) \ -lxml2 # The flags for the linker -LDFLAGS2 = -L$(HOME)/install/$(DIR_DBG_$(DBG))/lib \ +LDFLAGS2 = -L$(RYZOM_PATH)/install/$(DIR_DBG_$(DBG))/lib \ -lnelnet \ -lnelgeorges \ -lnelpacs \ -L/usr/lib \ -L/usr/X11R6/lib \ - -L$(HOME)/cvs/code/ryzom/src_v2/game_share \ -lnelmisc \ -lxml2 \ -lstlport \ diff --git a/code/ryzom/server/src/frontend_service/Makefile b/code/ryzom/server/src/frontend_service/Makefile index c7c0bf227..0264234f3 100644 --- a/code/ryzom/server/src/frontend_service/Makefile +++ b/code/ryzom/server/src/frontend_service/Makefile @@ -26,12 +26,11 @@ LDFLAGS = $(LD_FLAGS_CMN) \ -ldl # The flags for the linker -LDFLAGS2 = -L$(HOME)/install/$(DIR_DBG_$(DBG))/lib \ +LDFLAGS2 = -L$(RYZOM_PATH)/install/$(DIR_DBG_$(DBG))/lib \ -lnelnet \ -lxml2 \ -L/usr/lib \ -L/usr/X11R6/lib \ - -L$(HOME)/cvs/code/ryzom/src_v2/game_share \ -lc \ -lgame_share \ -lnelgeorges \ diff --git a/code/ryzom/server/src/server_share/Makefile b/code/ryzom/server/src/server_share/Makefile index d8eb1bc0a..cf00f3aae 100644 --- a/code/ryzom/server/src/server_share/Makefile +++ b/code/ryzom/server/src/server_share/Makefile @@ -11,8 +11,8 @@ include ../../../Variables.mk CXXFLAGS = $(FLAGS_CMN) $(FLAGS_DBG_$(DBG)) \ -I/usr/include/libxml2 \ -I/usr/include/mysql \ - -I$(HOME)/code/nel/include \ - -I$(HOME)/code/ryzom/common/src \ + -I$(NEL_INCLUDE) \ + -I$(RYZOM_PATH)/common/src \ -I./ \ -I./character_structure \ -I./egs_sheets \ @@ -20,7 +20,7 @@ CXXFLAGS = $(FLAGS_CMN) $(FLAGS_DBG_$(DBG)) \ -I./game_item_manager # The flags for the linker -LDFLAGS = $(LD_FLAGS_CMN) -L$(HOME)/install/$(DIR_DBG_$(DBG))/lib \ +LDFLAGS = $(LD_FLAGS_CMN) -L$(RYZOM_PATH)/install/$(DIR_DBG_$(DBG))/lib \ -llibmysqlclient \ -lnelnet \ -lnelgeorges \ diff --git a/code/ryzom/server/src/update_cxxpath_flags.sh b/code/ryzom/server/src/update_cxxpath_flags.sh old mode 100644 new mode 100755 diff --git a/code/ryzom/server/src/update_packed_sheets.sh b/code/ryzom/server/src/update_packed_sheets.sh old mode 100644 new mode 100755 index 210750792..0c98eef45 --- a/code/ryzom/server/src/update_packed_sheets.sh +++ b/code/ryzom/server/src/update_packed_sheets.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # make sure the args are valid if [ $# -lt 2 ] @@ -25,7 +25,8 @@ done # if one of the files was missing then call the executable to rebuild the packed sheets if [ $REQUIRE_REBUILD == 1 ] then - PACK_SHEETS_FLAGS=$(grep PACK_SHEETS_FLAGS ../../../Variables.mk|cut -f2 -d=) + PACK_SHEETS_FLAGS=`grep PACK_SHEETS_FLAGS ../../../Variables.mk|cut -f2 -d=` + PACK_SHEETS_FLAGS=`eval echo $PACK_SHEETS_FLAGS` echo "$EXE_NAME $PACK_SHEETS_FLAGS" $EXE_NAME $PACK_SHEETS_FLAGS fi diff --git a/code/ryzom/tools/scripts/linux/build b/code/ryzom/tools/scripts/linux/build index eb148971b..90e811ed1 100755 --- a/code/ryzom/tools/scripts/linux/build +++ b/code/ryzom/tools/scripts/linux/build @@ -45,11 +45,15 @@ # VARIABLES #MAKE_ARGS="-j20 CC=distcc CXX=distcc" -MAKE_ARGS="-j4" +MAKE_ARGS="-j2" # Set the source directory. Use the environment SRC_DIR variable, if it's # not set, use $HOME/cvs as a default value -SRC_DIR="$HOME/code" +if test X"$RYZOM_PATH" = "X" +then + RYZOM_PATH="$HOME/code" +fi +SRC_DIR="$RYZOM_PATH/../../code" # Build diretories BUILD_DEBUG="$SRC_DIR/build/debug" @@ -60,7 +64,6 @@ INSTALL_DEBUG="$SRC_DIR/install/debug" INSTALL_RELEASE="$SRC_DIR/install/release" # PKG config -#STLPORT_DIR='/home/installs/STLport-4.5.1' STLPORT_DIR='/usr' PYTHON_VERSION=2 @@ -74,10 +77,10 @@ CONFIGURE_OPT="--disable-xmltest --enable-maintainer-mode" ########################################################################### # Flag files associated to each mode -DEBUG_FILE="$HOME/.mode_debug" -STATIC_FILE="$HOME/.mode_static" -DYNAMIC_FILE="$HOME/.mode_dynamic" -SILENT_FILE="$HOME/.mode_silent" +DEBUG_FILE="$RYZOM_PATH/.mode_debug" +STATIC_FILE="$RYZOM_PATH/.mode_static" +DYNAMIC_FILE="$RYZOM_PATH/.mode_dynamic" +SILENT_FILE="$RYZOM_PATH/.mode_silent" # Specify the source code directory of each projects NEL_SRC="$SRC_DIR/nel" @@ -346,7 +349,7 @@ case $1 in init) BUILD_ARG=$2 - buildmode + $RYZOM_PATH/tools/scripts/linux/buildmode case "$BUILD_ARG" in @@ -374,7 +377,6 @@ case $1 in # Run the configure script cd $BUILD_DIR/$BUILD_ARG -echo CFLAGS="$BUILD_CFLAGS" CXXFLAGS="$BUILD_CXXFLAGS" CFLAGS="$BUILD_CFLAGS" CXXFLAGS="$BUILD_CXXFLAGS" \ $SRC_DIR/$BUILD_ARG/configure $CONFIGURE_OPT $* || exit 1 ;; diff --git a/code/ryzom/tools/scripts/linux/buildmode b/code/ryzom/tools/scripts/linux/buildmode index cfa1caee1..7ab021b1e 100755 --- a/code/ryzom/tools/scripts/linux/buildmode +++ b/code/ryzom/tools/scripts/linux/buildmode @@ -4,11 +4,11 @@ ########################################################################### # Files associated to each mode -DEBUG_FILE=$HOME/.mode_debug -#RELEASE_FILE=$HOME/.mode_release -STATIC_FILE=$HOME/.mode_static -DYNAMIC_FILE=$HOME/.mode_dynamic -SILENT_FILE=$HOME/.mode_silent +DEBUG_FILE=$RYZOM_PATH/.mode_debug +#RELEASE_FILE=$RYZOM_PATH/.mode_release +STATIC_FILE=$RYZOM_PATH/.mode_static +DYNAMIC_FILE=$RYZOM_PATH/.mode_dynamic +SILENT_FILE=$RYZOM_PATH/.mode_silent ########################################################################### diff --git a/code/ryzom/tools/scripts/linux/make_all b/code/ryzom/tools/scripts/linux/make_all index aba1e95c9..0185176f3 100755 --- a/code/ryzom/tools/scripts/linux/make_all +++ b/code/ryzom/tools/scripts/linux/make_all @@ -1,6 +1,13 @@ #!/bin/sh - -RYZOM_PATH="$HOME/code/ryzom" +#export RYZOM_PATH="$HOME/code/ryzom" + +if [ X"$RYZOM_PATH" = "X" ] +then + echo Error: You need to setup \$RYZOM_PATH environement variable with the path where the ryzom code is + echo For example: export RYZOM_PATH=\"/home/user/code/ryzom\" + exit +fi . $RYZOM_PATH/tools/scripts/linux/utilities diff --git a/code/ryzom/tools/scripts/linux/utilities b/code/ryzom/tools/scripts/linux/utilities index 8ae3d39c8..f79792362 100755 --- a/code/ryzom/tools/scripts/linux/utilities +++ b/code/ryzom/tools/scripts/linux/utilities @@ -1,14 +1,14 @@ -#!/bin/sh +#!/bin/sh - SSH_AGENT_FILE="$HOME/ssh_agent_file" BASENAME=`basename $0` -LOG_INFO="$HOME/log/${BASENAME}_info.log" -LOG_ERROR="$HOME/log/${BASENAME}_error.log" +LOG_INFO="$RYZOM_PATH/log/${BASENAME}_info.log" +LOG_ERROR="$RYZOM_PATH/log/${BASENAME}_error.log" # first param is the subject line # others params are email -function send_mail() +send_mail() { SUBJECT=$1 shift @@ -16,13 +16,13 @@ function send_mail() cat $LOG_ERROR | mail -s "$SUBJECT on `hostname`" $* } -function print_success() +print_success() { echo "*********************** $* SUCCESS !" echo } -function print_failure() +print_failure() { echo "***************************************************" echo "***************************************************" @@ -34,7 +34,7 @@ function print_failure() # failed fill the log and send email if necessary # argument are the error message -function failed() +failed() { print_failure $* if [ "X$LOG_INFO" != "X" ] @@ -59,7 +59,7 @@ function failed() # useful function to avoid continuing if something goes wrong # first param is $? and second is the string that will display -function verify() +verify() { if [ $1 -eq 0 ] then @@ -80,7 +80,7 @@ function verify() } # step_failed() fills the log and increments $STEPS_FAILURES -function step_failed() +step_failed() { print_failure $* if [ "X$LOG_INFO" != "X" ] @@ -102,7 +102,7 @@ function step_failed() # call init_steps() before you use step() # it takes a label for following steps as parameter -function init_steps() +init_steps() { STEPS_LABEL="$*" STEPS_FAILURES=0 @@ -110,7 +110,7 @@ function init_steps() # like verify() but will continue even if step failed until verify_steps() is called # first param is $? and second is the string that will display -function step() +step() { if [ $1 -eq 0 ] then @@ -131,7 +131,7 @@ function step() } # call verify_steps() when you want to stop if error(s) occured in previous steps -function verify_steps() +verify_steps() { if [ $STEPS_FAILURES -eq 0 ] then @@ -154,7 +154,7 @@ function verify_steps() fi } -function ask_confirmation() +ask_confirmation() { echo "Using this script will destroy the current version, type 'yes' if you really want to do that" read CONF @@ -163,7 +163,7 @@ function ask_confirmation() fi } -function check_host() +check_host() { HOST=`hostname -s` if [ "X$HOST" != "X$1" ]; then @@ -172,10 +172,11 @@ function check_host() } # useful function to initialize the default log for all scripts -function init() +init() { if [ "X$LOG_INFO" != "X" ] then + test -d `dirname $LOG_INFO` || mkdir -p `dirname $LOG_INFO` test ! -f $LOG_INFO || rm $LOG_INFO touch $LOG_INFO # display all ulimit in the log @@ -184,12 +185,13 @@ function init() if [ "X$LOG_ERROR" != "X" ] then + test -d `dirname $LOG_ERROR` || mkdir -p `dirname $LOG_ERROR` test ! -f $LOG_ERROR || rm $LOG_ERROR touch $LOG_ERROR fi } -function init_ssh() +init_ssh() { if [ ! -f $SSH_AGENT_FILE ] then @@ -197,5 +199,4 @@ function init_ssh() fi eval `cat $SSH_AGENT_FILE` - }