aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/scripts/linux/3-compile-SL-source
blob: 34395bbc5a8ce30f49a3fc3ae8118e69fdd40a20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash

# cmake-SL v1.31 (c)2008-2009 Henri Beauchamp. Released under GPL license v2:
# http://www.gnu.org/licenses/gpl.txt

###############################################################################
######## THIS IS QUICK'N DIRTY ALPHA SOFTWARE. USE AT YOUR OWN RISKS ! ########
###############################################################################

###############################################################################
# BEWARE: this script is meant to compile a -personal- SL client. It is -NOT- #
#         suitable to build client versions meant for public release, because #
#         non-open source code is packaged by this script.                    #
###############################################################################

# This bash script is aimed at easying up the build process of a SL client
# with cmake.
# You may enable or disable the use of your system's library by editing
# the USE_SYSTEM_* variable ("yes" --> use the system library, "no" --> use
# LL's provided ones).
# The script also takes care of updating properly the viewer_manifest.py script
# accordingly, so that you (should) end up with a properly packaged client.

# To use this script, simply make it executable (chmod +x cmake-SL) and
# put it into /usr/local/bin (or any other directory in your PATH).
# Then, download the slviewer-src-*.tar.gz, slviewer-linux-libs-*.tar.gz,
# slviewer-artwork-*.zip and fmodapi*.tar.gz archives, and finally, invoke
# make-SL as follow:
#   cmake-SL path_to_archives  (example: make-SL ~/downloads)
# or simply:
#   cmake-SL
# when invoking from the directory where the archives are.
# The sources will be installed into the PATH_TO_SOURCES directory,
# and the client will be built into the TEMP_DIR directory.
# The packaged build will be moved to your home directory.
#
# If you want to retry a compilation after fixing something manually and
# don't want cmake-SL to start all over again, overwriting everything,
# you may invoke it with the --retry option, like this:
#   cmake-SL --retry
#
# Finally, if you just want to prepare the sources without starting the
# compilation, use:
#   cmake-SL [path_to_archives] --prep
#
# This script has been tested by the author, on (very customized)
# Mandriva 2007.1 and 2009.0 distros.
# Tested with SL v1.21 and v1.22 sources.

source config-SL-source

########### functions definitions ###########

function compile() {
    cd $PATH_TO_SOURCES/indra
    echo "Compiling the client into $TEMP_DIR..."
    nice -n 19 ionice -c 3 ./develop.py --type=Release build
#    if (($? == 0)) ; then
#        mv -f $PATH_TO_SOURCES/indra/viewer-linux-i686*/newview/SecondLife*.tar.bz2 $HOME/
#    fi
}

########### end of functions ###########

if [ "$TEMP_DIR" == "" ] ; then
    export TEMP_DIR="/usr/tmp/$USER"
fi

# Check to see if we simply want to retry a compilation:
if [ "$1" == "--retry" ] ; then
    compile
    exit $?
fi

# Use the parameter (if any) as the path to the archives:

PATH_TO_ARCHIVES=`pwd`
if [ "$1" != "" ] && [ "$1" != "--prep" ] ; then
    if [ -d $1 ] ; then
        PATH_TO_ARCHIVES=$1
        shift
    fi
fi

cd $PATH_TO_SOURCES/indra

# Do a clean build
#./develop.py clean

# Force the vectorization use if we chose so.
if [ "$FORCE_VECTORIZE" == "yes" ] ; then
    TUNE_FLAGS="$TUNE_FLAGS -DLL_VECTORIZE=1"
fi
if [ "$ALLOW_WARNINGS" == "yes" ] ; then
    FATAL_WARNINGS="-DGCC_DISABLE_FATAL_WARNINGS:BOOL=TRUE"
else
    FATAL_WARNINGS=""
fi

time compile