[sldev] compiling the viewer

Max Okumoto okumoto at ucsd.edu
Sun Jun 10 04:59:57 PDT 2007


Oops! There was an typo in the Makefile.  Here is a replacement.


Max Okumoto wrote:
> Cool.  I'm glad that I could be of help.  Here is a new Makefile that 
> fixes the problems that you ran into:
>
> 1. It modifies linden/indra/SConstruct to use g++34 instead of g++-3.4
> 2. Fixed hard coded path.
> 3. Added target to install secondlife-i686.supp file into correct location
> 4. Fixed target for linden/indra/newview/viewer_manifest.py to not 
> package up missing libraries.
>
> The default binary installed is striped but the one you will find in 
> linden/indra/newview/secondlife-i686-bin
> is not, so you should use that one with your debugger.  I haven't used 
> the debugger with the binary yet so I
> can't give you any advice on that yet.
>
> Don't have a windows box that I can develop on so can't help you 
> there, but it looks other people can help you there.
>
>                           Max

-------------- next part --------------
#
# @author Max Okumoto <okumoto at ucsd.edu>
#
# Makefile use to down load and build SecondLife binary from source files
# from website on Fedora Core 6.
#
# If SVN_REV is set then use SVN instead of the slviewer-src-${SL_VER}.tar.gz
#
#SVN_REV	= http://svn.secondlife.com/svn/linden/release

BUILD		= releasefordownload

DISTFILES	= distfiles

SL_YEAR		= 2007
SL_MONTH	= 06
SL_DAY		= 02
SL_TYPE		= a
SL_VER		= ${SL_YEAR}${SL_MONTH}${SL_DAY}${SL_TYPE}
SL_VER		= 1-17-0-9
SL_FOO		=

SL_URL_PREFIX	= http://secondlife.com/developers/opensource/downloads/${SL_YEAR}/${SL_MONTH}

SL_SRC_TAR	= slviewer-src-${SL_FOO}${SL_VER}.tar.gz
SL_ART_ZIP	= slviewer-artwork-${SL_FOO}${SL_VER}.zip
SL_LIB_TAR	= slviewer-linux-libs-${SL_FOO}${SL_VER}.tar.gz

FMOD_MAJ	= 3
FMOD_MIN	= 75
FMOD_VER	= fmodapi${FMOD_MAJ}${FMOD_MIN}linux
FMOD_URL_PREFIX	= http://www.fmod.org/files

FMOD_SRC_TAR	= ${FMOD_VER}.tar.gz

##############################################################################
# 
##############################################################################
all: unpack update replace build

##############################################################################
# Get stuff
##############################################################################
get: ${DISTFILES}/${SL_SRC_TAR}
get: ${DISTFILES}/${SL_ART_ZIP}
get: ${DISTFILES}/${SL_LIB_TAR}

${DISTFILES}/${SL_LIB_TAR}:
	(cd ${DISTFILES}; wget ${SL_URL_PREFIX}/${SL_LIB_TAR})

${DISTFILES}/${SL_SRC_TAR}:
	(cd ${DISTFILES}; wget ${SL_URL_PREFIX}/${SL_SRC_TAR})

${DISTFILES}/${SL_ART_ZIP}:
	(cd ${DISTFILES}; wget ${SL_URL_PREFIX}/${SL_ART_ZIP})

${DISTFILES}/${FMOD_SRC_TAR}:
	(cd ${DISTFILES}; wget ${FMOD_URL_PREFIX}/${FMOD_SRC_TAR})

##############################################################################
# Unpack stuff
##############################################################################
unpack: linden/LICENSE-source.txt
unpack: linden/LICENSE-logos.txt
unpack: linden/LICENSE-libraries-linux.txt
unpack: linden/libraries/i686-linux/lib_release_client/libfmod-${FMOD_MAJ}.${FMOD_MIN}.so
unpack: linden/indra/newview/secondlife-i686.supp

linden/LICENSE-logos.txt: ${DISTFILES}/${SL_ART_ZIP}
	@echo 'Unpack slviewer artwork'
	@unzip -q ${DISTFILES}/${SL_ART_ZIP}
	@touch linden/LICENSE-logos.txt

linden/LICENSE-libraries-linux.txt: ${DISTFILES}/${SL_LIB_TAR}
	@echo 'Unpack slviewer libraries'
	@tar xf ${DISTFILES}/${SL_LIB_TAR}
	@touch linden/LICENSE-libraries-linux.txt

linden/LICENSE-source.txt: ${DISTFILES}/${SL_SRC_TAR}
	@if [ -n "${SVN_REV}" ]; then \
		echo 'Download slviewer src using SVN'; \
		svn co -q ${SVN_REV} linden; \
	else \
		echo 'Unpack slviewer src'; \
		tar xf ${DISTFILES}/${SL_SRC_TAR}; \
	fi
	@touch linden/LICENSE-source.txt

linden/libraries/i686-linux/lib_release_client/libfmod-${FMOD_MAJ}.${FMOD_MIN}.so: ${DISTFILES}/${FMOD_SRC_TAR}
	@echo 'Unpack FMOD library'
	@tar xf ${DISTFILES}/${FMOD_SRC_TAR}
	@(cd ${FMOD_VER}/api/inc; tar cf - .) |\
		(cd linden/libraries/i686-linux/include; tar xf -)
	@(cd ${FMOD_VER}/api; tar -cf - libfmod-${FMOD_MAJ}.${FMOD_MIN}.so) |\
		(cd linden/libraries/i686-linux/lib_release_client/; tar xf -)
	@rm -rf ${FMOD_VER}
	@touch linden/libraries/i686-linux/lib_release_client/libfmod-${FMOD_MAJ}.${FMOD_MIN}.so

linden/indra/newview/secondlife-i686.supp: ${DISTFILES}/secondlife-i686.supp
	cp ${DISTFILES}/secondlife-i686.supp linden/indra/newview/secondlife-i686.supp
##############################################################################
# Update stuff
##############################################################################
update:
	@if [ -f linden/.svn/entries ]; then \
		echo "Update slviewer using SVN"; \
		(cd linden; svn update); \
	fi

##############################################################################
# Replase stuff
##############################################################################
replace: linden/indra/newview/libllkdu.so
replace: linden/indra/lib/libkdu_v42R.so
replace: linden/indra/newview/viewer_manifest.py.fixed
replace: linden/indra/SConstruct.fixed

linden/indra/newview/libllkdu.so:
	cp linden/libraries/i686-linux/lib_release_client/libllkdu.so \
		linden/indra/newview/libllkdu.so

linden/indra/lib/libkdu_v42R.so:
	cp linden/libraries/i686-linux/lib_release_client/libkdu_v42R.so \
		linden/indra/lib/libkdu_v42R.so

linden/indra/SConstruct.fixed: linden/indra/SConstruct Makefile
	#
	# compat-gcc-34 install as gcc34
	# compate-gcc-34-c++ install as g++34
	#
	sed \
		-e "s/gcc_bin = 'g++-3.4'/gcc_bin = 'g++34'/" \
		linden/indra/SConstruct > linden/indra/SConstruct.fixed
	cp linden/indra/SConstruct.fixed linden/indra/SConstruct

linden/indra/newview/viewer_manifest.py.fixed: linden/indra/newview/viewer_manifest.py Makefile
	#
	# Enable faster jpg decode libraries.
	#
	sed \
		-e '/^#.*libllkdu\.so/s/^#//' \
		-e '/^#.*libkdu_v42R\.so/s/^#//' \
		linden/indra/newview/viewer_manifest.py > linden/indra/newview/viewer_manifest.py.fixed
	cp linden/indra/newview/viewer_manifest.py.fixed linden/indra/newview/viewer_manifest.py

	#
	# Don't package up google-profiling stuff (this can be removed when
	# Linden Labs adds these libaries to the tar file.
	#
	sed \
		-e '/^  *self.path("libtcmalloc\.so/s/^/#/' \
		-e '/^  *self.path("libstacktrace\.so/s/^/#/' \
		linden/indra/newview/viewer_manifest.py > linden/indra/newview/viewer_manifest.py.fixed
	cp linden/indra/newview/viewer_manifest.py.fixed linden/indra/newview/viewer_manifest.py

##############################################################################
# Build stuff
##############################################################################
build:
	@date
	(cd linden/indra; scons DISTCC=no BTARGET=client MOZLIB=no BUILD=${BUILD})
	@date

build-no-fmod:
	@date
	(cd linden/indra; scons FMOD=no DISTCC=no BTARGET=client MOZLIB=no BUILD=${BUILD})
	@date

##############################################################################
# Install stuff
##############################################################################
install:
	#bzcat linden/indra/newview/SecondLife_i686_1_16_0_5.tar.bz2 | (cd /opt; tar xf -)
	bzcat linden/indra/newview/SecondLife_i686_1_17_0_9.tar.bz2 | (cd /opt; tar xf -)

##############################################################################
# Clean stuff
##############################################################################
clean:
	rm -rf linden
	rm -rf /tmp/linden

##############################################################################
# Utilities
##############################################################################
tags:
	find linden -type f -name '*.cpp' -exec ctags -e --append {} \;


More information about the SLDev mailing list