diff options
author | David Walter Seikel | 2012-02-20 15:27:30 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-02-20 15:27:30 +1000 |
commit | 31a378998c641064b92c5d6578dece08b015df58 (patch) | |
tree | 7c93ad46807600d0575c976d69e9de69345e38b9 | |
parent | Applied patch by onefang for #975: chat console interferes with login control... (diff) | |
download | meta-impy-31a378998c641064b92c5d6578dece08b015df58.zip meta-impy-31a378998c641064b92c5d6578dece08b015df58.tar.gz meta-impy-31a378998c641064b92c5d6578dece08b015df58.tar.bz2 meta-impy-31a378998c641064b92c5d6578dece08b015df58.tar.xz |
Adding my linux build scripts. Makes it easy to build under 32 and 64 bit linux.
-rwxr-xr-x | linden/scripts/linux/0-patch-SL-source | 31 | ||||
-rwxr-xr-x | linden/scripts/linux/1-get-libraries-from-SL | 71 | ||||
-rwxr-xr-x | linden/scripts/linux/2-trim-libraries-from-SL | 248 | ||||
-rwxr-xr-x | linden/scripts/linux/3-compile-SL-source | 101 | ||||
-rwxr-xr-x | linden/scripts/linux/4-package-viewer | 5 | ||||
-rw-r--r-- | linden/scripts/linux/README.txt | 26 | ||||
-rw-r--r-- | linden/scripts/linux/config-SL-source | 63 |
7 files changed, 545 insertions, 0 deletions
diff --git a/linden/scripts/linux/0-patch-SL-source b/linden/scripts/linux/0-patch-SL-source new file mode 100755 index 0000000..4885d5d --- /dev/null +++ b/linden/scripts/linux/0-patch-SL-source | |||
@@ -0,0 +1,31 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # Check for patches to apply. The names of the patches must be in the form | ||
4 | # slviewer-*.patch* (Example: slviewer-v117-EmbbededNotecard.patch.bz2). | ||
5 | # They must be applicable from inside the source directory with the -p1 | ||
6 | # option, i.e. they have been built from outside the source directory | ||
7 | # with a diff command such as: | ||
8 | # diff -urN linden/ linden-patched/ >slviewer-whatever.patch | ||
9 | # And they may be gzipped or bzipped. | ||
10 | |||
11 | source config-SL-source | ||
12 | |||
13 | PATCHES=`/bin/ls $PATH_TO_PATCHES/$1/slviewer-*.patch* 2>/dev/null` | ||
14 | PATCHES="$PATCHES `/bin/ls $PATH_TO_PATCHES/$1/slviewer-*.diff* 2>/dev/null`" | ||
15 | if [ "$PATCHES" != "" ] ; then | ||
16 | echo "Applying patches..." | ||
17 | cd $PATH_TO_SOURCES | ||
18 | for i in $PATCHES; do | ||
19 | echo "Patch: $i" | ||
20 | if echo $i | grep ".gz" &>/dev/null ; then | ||
21 | gunzip -c $i | patch -p1 -s | ||
22 | elif echo $i | grep ".bz2" &>/dev/null ; then | ||
23 | bzcat $i | patch -p1 -s | ||
24 | elif echo $i | grep ".zip" &>/dev/null ; then | ||
25 | unzip -o $i >/dev/null | ||
26 | else | ||
27 | patch -p1 -s <$i | ||
28 | fi | ||
29 | done | ||
30 | fi | ||
31 | |||
diff --git a/linden/scripts/linux/1-get-libraries-from-SL b/linden/scripts/linux/1-get-libraries-from-SL new file mode 100755 index 0000000..9ba61f4 --- /dev/null +++ b/linden/scripts/linux/1-get-libraries-from-SL | |||
@@ -0,0 +1,71 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # cmake-SL v1.31 (c)2008-2009 Henri Beauchamp. Released under GPL license v2: | ||
4 | # http://www.gnu.org/licenses/gpl.txt | ||
5 | |||
6 | ############################################################################### | ||
7 | ######## THIS IS QUICK'N DIRTY ALPHA SOFTWARE. USE AT YOUR OWN RISKS ! ######## | ||
8 | ############################################################################### | ||
9 | |||
10 | ############################################################################### | ||
11 | # BEWARE: this script is meant to compile a -personal- SL client. It is -NOT- # | ||
12 | # suitable to build client versions meant for public release, because # | ||
13 | # non-open source code is packaged by this script. # | ||
14 | ############################################################################### | ||
15 | |||
16 | # This bash script is aimed at easying up the build process of a SL client | ||
17 | # with cmake. | ||
18 | # You may enable or disable the use of your system's library by editing | ||
19 | # the USE_SYSTEM_* variable ("yes" --> use the system library, "no" --> use | ||
20 | # LL's provided ones). | ||
21 | # The script also takes care of updating properly the viewer_manifest.py script | ||
22 | # accordingly, so that you (should) end up with a properly packaged client. | ||
23 | |||
24 | # To use this script, simply make it executable (chmod +x cmake-SL) and | ||
25 | # put it into /usr/local/bin (or any other directory in your PATH). | ||
26 | # Then, download the slviewer-src-*.tar.gz, slviewer-linux-libs-*.tar.gz, | ||
27 | # slviewer-artwork-*.zip and fmodapi*.tar.gz archives, and finally, invoke | ||
28 | # make-SL as follow: | ||
29 | # cmake-SL path_to_archives (example: make-SL ~/downloads) | ||
30 | # or simply: | ||
31 | # cmake-SL | ||
32 | # when invoking from the directory where the archives are. | ||
33 | # The sources will be installed into the PATH_TO_SOURCES directory, | ||
34 | # and the client will be built into the TEMP_DIR directory. | ||
35 | # The packaged build will be moved to your home directory. | ||
36 | # | ||
37 | # If you want to retry a compilation after fixing something manually and | ||
38 | # don't want cmake-SL to start all over again, overwriting everything, | ||
39 | # you may invoke it with the --retry option, like this: | ||
40 | # cmake-SL --retry | ||
41 | # | ||
42 | # Finally, if you just want to prepare the sources without starting the | ||
43 | # compilation, use: | ||
44 | # cmake-SL [path_to_archives] --prep | ||
45 | # | ||
46 | # This script has been tested by the author, on (very customized) | ||
47 | # Mandriva 2007.1 and 2009.0 distros. | ||
48 | # Tested with SL v1.21 and v1.22 sources. | ||
49 | |||
50 | source config-SL-source | ||
51 | |||
52 | |||
53 | cd $PATH_TO_SOURCES/indra | ||
54 | |||
55 | # Do a clean build | ||
56 | ./develop.py clean | ||
57 | |||
58 | # Force the vectorization use if we chose so. | ||
59 | if [ "$FORCE_VECTORIZE" == "yes" ] ; then | ||
60 | TUNE_FLAGS="$TUNE_FLAGS -DLL_VECTORIZE=1" | ||
61 | fi | ||
62 | if [ "$ALLOW_WARNINGS" == "yes" ] ; then | ||
63 | FATAL_WARNINGS="-DGCC_DISABLE_FATAL_WARNINGS:BOOL=TRUE" | ||
64 | else | ||
65 | FATAL_WARNINGS="" | ||
66 | fi | ||
67 | # Configure the sources and download the LL provided libraries: | ||
68 | ./develop.py --type=Release configure "$FATAL_WARNINGS" \ | ||
69 | -DCMAKE_C_FLAGS:STRING="-O2 $TUNE_FLAGS" -DCMAKE_CXX_FLAGS:STRING="-O2 $TUNE_FLAGS" \ | ||
70 | -DCMAKE_C_FLAGS_RELEASE:STRING="-O2 $TUNE_FLAGS" -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 $TUNE_FLAGS" \ | ||
71 | -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="-g -O2 $TUNE_FLAGS" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-g -O2 $TUNE_FLAGS" | ||
diff --git a/linden/scripts/linux/2-trim-libraries-from-SL b/linden/scripts/linux/2-trim-libraries-from-SL new file mode 100755 index 0000000..b6fcf06 --- /dev/null +++ b/linden/scripts/linux/2-trim-libraries-from-SL | |||
@@ -0,0 +1,248 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # You may enable or disable the use of your system's library by editing | ||
4 | # the USE_SYSTEM_* variable ("yes" --> use the system library, "no" --> use | ||
5 | # LL's provided ones). | ||
6 | # The script also takes care of updating properly the viewer_manifest.py script | ||
7 | # accordingly, so that you (should) end up with a properly packaged client. | ||
8 | |||
9 | source config-SL-source | ||
10 | |||
11 | |||
12 | ########### functions definitions ########### | ||
13 | |||
14 | function check() { | ||
15 | if [ "$1" != "no" ] ; then | ||
16 | if [ -f $2 ] ; then | ||
17 | echo "Using the system $3..." | ||
18 | return 0 | ||
19 | else | ||
20 | echo "WARNING: system $3 requested but not available..." | ||
21 | fi | ||
22 | fi | ||
23 | return 1 | ||
24 | } | ||
25 | |||
26 | function update_manifest() { | ||
27 | grep -v $1 $PATH_TO_SOURCES/indra/newview/viewer_manifest.py >$TEMP_DIR/viewer_manifest.py | ||
28 | mv -f $TEMP_DIR/viewer_manifest.py $PATH_TO_SOURCES/indra/newview/viewer_manifest.py | ||
29 | chmod +x $PATH_TO_SOURCES/indra/newview/viewer_manifest.py | ||
30 | } | ||
31 | |||
32 | ########### end of functions ########### | ||
33 | |||
34 | if [ "$TEMP_DIR" == "" ] ; then | ||
35 | export TEMP_DIR="/usr/tmp/$USER" | ||
36 | fi | ||
37 | |||
38 | # Use the parameter (if any) as the path to the archives: | ||
39 | |||
40 | PATH_TO_ARCHIVES=`pwd` | ||
41 | if [ "$1" != "" ] && [ "$1" != "--prep" ] ; then | ||
42 | if [ -d $1 ] ; then | ||
43 | PATH_TO_ARCHIVES=$1 | ||
44 | shift | ||
45 | fi | ||
46 | fi | ||
47 | |||
48 | cd $PATH_TO_SOURCES/indra | ||
49 | |||
50 | |||
51 | # Force the vectorization use if we chose so. | ||
52 | if [ "$FORCE_VECTORIZE" == "yes" ] ; then | ||
53 | TUNE_FLAGS="$TUNE_FLAGS -DLL_VECTORIZE=1" | ||
54 | fi | ||
55 | if [ "$ALLOW_WARNINGS" == "yes" ] ; then | ||
56 | FATAL_WARNINGS="-DGCC_DISABLE_FATAL_WARNINGS:BOOL=TRUE" | ||
57 | else | ||
58 | FATAL_WARNINGS="" | ||
59 | fi | ||
60 | |||
61 | # Let's use the system GTK+ if available: | ||
62 | if check $USE_SYSTEM_GTK /usr/include/atk-1.0/atk/atk.h "GTK+" ; then | ||
63 | cd $PATH_TO_SOURCES/libraries/x86_64-linux/lib_release_client | ||
64 | rm -f libgtk* libgdk* libglib* libgmodule* libgobject* libgthread* libpango* libatk* libpixman* | ||
65 | cd ../include | ||
66 | rm -rf atk-1.0/ gtk-2.0/ glib-2.0/ pango-1.0/ pixman-1/ | ||
67 | cp -a /usr/include/atk-1.0 . | ||
68 | cp -a /usr/include/gtk-2.0 . | ||
69 | cp -a /usr/lib/gtk-2.0/include/* gtk-2.0/ | ||
70 | cp -a /usr/include/glib-2.0 . | ||
71 | cp -a /usr/lib/glib-2.0/include/* glib-2.0/ | ||
72 | cp -a /usr/include/pango-1.0 . | ||
73 | if [ -d /usr/include/cairo ] ; then | ||
74 | rm -rf cairo/ | ||
75 | cp -a /usr/include/cairo . | ||
76 | cd ../lib_release_client | ||
77 | rm -f libcairo* | ||
78 | fi | ||
79 | update_manifest libatk | ||
80 | update_manifest cairo | ||
81 | update_manifest libgtk | ||
82 | update_manifest libgdk | ||
83 | update_manifest libglib | ||
84 | update_manifest libgmodule | ||
85 | update_manifest libgobject | ||
86 | update_manifest libgthread | ||
87 | update_manifest libpango | ||
88 | update_manifest libpixman | ||
89 | fi | ||
90 | |||
91 | # Let's use the system zlib if available: | ||
92 | if check $USE_SYSTEM_ZLIB /usr/include/zlib.h "zlib" ; then | ||
93 | cd $PATH_TO_SOURCES/libraries | ||
94 | rm -rf include/zlib/ | ||
95 | rm -f x86_64-linux/lib_release_client/libz.so.1 | ||
96 | mkdir -p include/zlib | ||
97 | cp -a /usr/include/zlib*.h include/zlib/ | ||
98 | fi | ||
99 | |||
100 | # Let's use the system jpeglib if available: | ||
101 | if check $USE_SYSTEM_JPEGLIB /usr/include/jpeglib.h "jpeglib" ; then | ||
102 | cd $PATH_TO_SOURCES/libraries | ||
103 | rm -rf include/jpeglib/ x86_64-linux/lib_release_client/libjpeg.a | ||
104 | mkdir -p include/jpeglib | ||
105 | cp -a /usr/include/j*.h include/jpeglib/ | ||
106 | touch include/jpeglib/jinclude.h | ||
107 | fi | ||
108 | |||
109 | # Let's use the system ogg if available: | ||
110 | if check $USE_SYSTEM_OGG /usr/include/ogg/ogg.h "ogg" ; then | ||
111 | cd $PATH_TO_SOURCES/libraries | ||
112 | rm -rf include/ogg/ x86_64-linux/lib_release_client/libogg* | ||
113 | fi | ||
114 | |||
115 | # Let's use the system vorbis if available: | ||
116 | if check $USE_SYSTEM_VORBIS /usr/include/vorbis/vorbisenc.h "vorbis" ; then | ||
117 | cd $PATH_TO_SOURCES/libraries | ||
118 | rm -rf include/vorbis/ x86_64-linux/lib_release_client/libvorbis* | ||
119 | fi | ||
120 | |||
121 | # Let's use the system SDL if available: | ||
122 | if check $USE_SYSTEM_SDL /usr/include/SDL/SDL.h "SDL" ; then | ||
123 | cd $PATH_TO_SOURCES/libraries/x86_64-linux | ||
124 | rm -rf include/SDL/ lib_release_client/libSDL* | ||
125 | update_manifest libSDL | ||
126 | fi | ||
127 | |||
128 | # Let's use the system openssl if available: | ||
129 | if check $USE_SYSTEM_SSL /usr/include/openssl/opensslconf.h "openssl" ; then | ||
130 | cd $PATH_TO_SOURCES/libraries/x86_64-linux/lib_release_client | ||
131 | rm -f libssl.* libcrypto.* | ||
132 | update_manifest libssl | ||
133 | update_manifest libcrypto | ||
134 | fi | ||
135 | |||
136 | # Let's use the system apr if available: | ||
137 | if check $USE_SYSTEM_APR /usr/include/apr*/apr_base64.h "apr" ; then | ||
138 | cd $PATH_TO_SOURCES/libraries/x86_64-linux | ||
139 | rm -rf include/apr-1/* | ||
140 | rm -f lib_release_client/libapr* | ||
141 | cp -a /usr/include/apr*/* include/apr-1/ | ||
142 | update_manifest libapr | ||
143 | fi | ||
144 | |||
145 | # Let's use the system db4 if available: | ||
146 | if check $USE_SYSTEM_DB4 /usr/include/db4/db.h "db4" ; then | ||
147 | rm -f $PATH_TO_SOURCES/libraries/x86_64-linux/lib_release_client/libdb*.so | ||
148 | update_manifest libdb | ||
149 | if [ $USE_SYSTEM_DB4 != "yes" ] ; then | ||
150 | if ! grep $USE_SYSTEM_DB4 $PATH_TO_SOURCES/indra/cmake/BerkeleyDB.cmake ; then | ||
151 | # If we gave a version number instead of "yes", patch the | ||
152 | # BerkeleyDB.cmake file to use that DB4 version instead of 4.2. | ||
153 | sed -e "s/4.2/$USE_SYSTEM_DB4/" $PATH_TO_SOURCES/indra/cmake/BerkeleyDB.cmake >$TEMP_DIR/BerkeleyDB.cmake | ||
154 | mv -f $TEMP_DIR/BerkeleyDB.cmake $PATH_TO_SOURCES/indra/cmake/BerkeleyDB.cmake | ||
155 | fi | ||
156 | fi | ||
157 | fi | ||
158 | |||
159 | # Let's use the system expat if available: | ||
160 | if check $USE_SYSTEM_EXPAT /usr/include/expat.h "expat" ; then | ||
161 | cd $PATH_TO_SOURCES/libraries | ||
162 | rm -rf include/expat/ | ||
163 | rm -f x86_64-linux/lib_release_client/libexpat* | ||
164 | mkdir -p include/expat | ||
165 | cp -a /usr/include/expat*.h include/expat/ | ||
166 | update_manifest libexpat | ||
167 | fi | ||
168 | |||
169 | # Let's use the system xmlrpc-epi if available: | ||
170 | if check $USE_SYSTEM_XMLRPC /usr/include/xmlrpc.h "xmlrpc-epi" ; then | ||
171 | cd $PATH_TO_SOURCES/libraries | ||
172 | rm -rf include/xmlrpc-epi/ x86_64-linux/lib_release_client/libxmlrpc.a | ||
173 | mkdir -p include/xmlrpc-epi | ||
174 | cp -a /usr/include/xmlrpc*.h include/xmlrpc-epi/ | ||
175 | fi | ||
176 | |||
177 | # Let's use the system c-ares if available: | ||
178 | if check $USE_SYSTEM_CARES /usr/lib/libcares.a "c-ares" ; then | ||
179 | cd $PATH_TO_SOURCES/libraries | ||
180 | rm -f include/ares/* | ||
181 | rm -f x86_64-linux/lib_release_client/libcares.* | ||
182 | cp -a /usr/include/ares* include/ares/ | ||
183 | cp -a /usr/lib/libcares.a x86_64-linux/lib_release_client/ | ||
184 | fi | ||
185 | |||
186 | # Let's use the system curl if available: | ||
187 | if check $USE_SYSTEM_CURL /usr/include/curl/curl.h "curl" ; then | ||
188 | cd $PATH_TO_SOURCES/libraries | ||
189 | rm -rf include/curl/ | ||
190 | rm -f x86_64-linux/lib_release_client/libcurl.* | ||
191 | fi | ||
192 | |||
193 | # Let's use the system uuid if available: | ||
194 | if check $USE_SYSTEM_UUID /lib/libuuid.so.1 "libuuid" ; then | ||
195 | rm -f $PATH_TO_SOURCES/libraries/x86_64-linux/lib_release_client/libuuid.* | ||
196 | update_manifest libuuid | ||
197 | fi | ||
198 | |||
199 | # Let's use the system google-perftools if available: | ||
200 | if check $USE_SYSTEM_PERFTOOLS /usr/include/google/malloc_hook.h "google-perftools" ; then | ||
201 | cd $PATH_TO_SOURCES/libraries/x86_64-linux | ||
202 | rm -f lib_release_client/libtcmalloc.* lib_release_client/libstacktrace.* | ||
203 | rm -rf include/google/ | ||
204 | cp -a /usr/lib/libstacktrace.* /usr/lib/libtcmalloc.so* lib_release_client/ | ||
205 | cp -a /usr/include/google include/ | ||
206 | update_manifest tcmalloc | ||
207 | update_manifest stacktrace | ||
208 | fi | ||
209 | |||
210 | # Let's use the system libELFIO if available: | ||
211 | if check $USE_SYSTEM_ELFIO /usr/include/ELFIO.h "libELFIO" ; then | ||
212 | cd $PATH_TO_SOURCES/libraries/x86_64-linux | ||
213 | rm -f include/ELFIO/* | ||
214 | rm -f lib_release_client/libELFIO.* | ||
215 | cp -af /usr/include/ELF* include/ELFIO/ | ||
216 | cp -af /usr/lib/libELFIO.so lib_release_client/ | ||
217 | update_manifest ELFIO | ||
218 | fi | ||
219 | |||
220 | # Let's use the system libstdc++ if available: | ||
221 | if check $USE_SYSTEM_LIBSTDC /usr/lib/libstdc++.so.6 "libstdc++" ; then | ||
222 | rm -f $PATH_TO_SOURCES/libraries/x86_64-linux/lib_release_client/libstdc++.* | ||
223 | update_manifest libstdc | ||
224 | fi | ||
225 | |||
226 | # Let's use the system boost if available: | ||
227 | if check $USE_SYSTEM_BOOST /usr/include/boost/version.hpp "boost" ; then | ||
228 | cd $PATH_TO_SOURCES/libraries | ||
229 | rm -rf include/boost/ | ||
230 | rm -f x86_64-linux/lib_release/libboost_* | ||
231 | rm -f x86_64-linux/lib_release_client/libboost_* | ||
232 | fi | ||
233 | |||
234 | |||
235 | # Force libkdu inclusion | ||
236 | # (disabled for now (v1.21.0 viewer) as the cmake scripts fail to get libkdu from Internet). | ||
237 | if false; then | ||
238 | # Remove everything dealing with libstdc++ and the crash logger: | ||
239 | update_manifest libstdc | ||
240 | update_manifest logger | ||
241 | # Now, any line with a '#' followed with several spaces _should_ be dealing | ||
242 | # with the libkdu stuff... So, we simply remove the '#"... | ||
243 | sed -e "s/# them/# them/" $PATH_TO_SOURCES/indra/newview/viewer_manifest.py >$TEMP_DIR/viewer_manifest.py | ||
244 | sed -e "s/^# / /" $TEMP_DIR/viewer_manifest.py >$PATH_TO_SOURCES/indra/newview/viewer_manifest.py | ||
245 | rm -f $TEMP_DIR/viewer_manifest.py | ||
246 | chmod +x $PATH_TO_SOURCES/indra/newview/viewer_manifest.py | ||
247 | fi | ||
248 | |||
diff --git a/linden/scripts/linux/3-compile-SL-source b/linden/scripts/linux/3-compile-SL-source new file mode 100755 index 0000000..34395bb --- /dev/null +++ b/linden/scripts/linux/3-compile-SL-source | |||
@@ -0,0 +1,101 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # cmake-SL v1.31 (c)2008-2009 Henri Beauchamp. Released under GPL license v2: | ||
4 | # http://www.gnu.org/licenses/gpl.txt | ||
5 | |||
6 | ############################################################################### | ||
7 | ######## THIS IS QUICK'N DIRTY ALPHA SOFTWARE. USE AT YOUR OWN RISKS ! ######## | ||
8 | ############################################################################### | ||
9 | |||
10 | ############################################################################### | ||
11 | # BEWARE: this script is meant to compile a -personal- SL client. It is -NOT- # | ||
12 | # suitable to build client versions meant for public release, because # | ||
13 | # non-open source code is packaged by this script. # | ||
14 | ############################################################################### | ||
15 | |||
16 | # This bash script is aimed at easying up the build process of a SL client | ||
17 | # with cmake. | ||
18 | # You may enable or disable the use of your system's library by editing | ||
19 | # the USE_SYSTEM_* variable ("yes" --> use the system library, "no" --> use | ||
20 | # LL's provided ones). | ||
21 | # The script also takes care of updating properly the viewer_manifest.py script | ||
22 | # accordingly, so that you (should) end up with a properly packaged client. | ||
23 | |||
24 | # To use this script, simply make it executable (chmod +x cmake-SL) and | ||
25 | # put it into /usr/local/bin (or any other directory in your PATH). | ||
26 | # Then, download the slviewer-src-*.tar.gz, slviewer-linux-libs-*.tar.gz, | ||
27 | # slviewer-artwork-*.zip and fmodapi*.tar.gz archives, and finally, invoke | ||
28 | # make-SL as follow: | ||
29 | # cmake-SL path_to_archives (example: make-SL ~/downloads) | ||
30 | # or simply: | ||
31 | # cmake-SL | ||
32 | # when invoking from the directory where the archives are. | ||
33 | # The sources will be installed into the PATH_TO_SOURCES directory, | ||
34 | # and the client will be built into the TEMP_DIR directory. | ||
35 | # The packaged build will be moved to your home directory. | ||
36 | # | ||
37 | # If you want to retry a compilation after fixing something manually and | ||
38 | # don't want cmake-SL to start all over again, overwriting everything, | ||
39 | # you may invoke it with the --retry option, like this: | ||
40 | # cmake-SL --retry | ||
41 | # | ||
42 | # Finally, if you just want to prepare the sources without starting the | ||
43 | # compilation, use: | ||
44 | # cmake-SL [path_to_archives] --prep | ||
45 | # | ||
46 | # This script has been tested by the author, on (very customized) | ||
47 | # Mandriva 2007.1 and 2009.0 distros. | ||
48 | # Tested with SL v1.21 and v1.22 sources. | ||
49 | |||
50 | source config-SL-source | ||
51 | |||
52 | ########### functions definitions ########### | ||
53 | |||
54 | function compile() { | ||
55 | cd $PATH_TO_SOURCES/indra | ||
56 | echo "Compiling the client into $TEMP_DIR..." | ||
57 | nice -n 19 ionice -c 3 ./develop.py --type=Release build | ||
58 | # if (($? == 0)) ; then | ||
59 | # mv -f $PATH_TO_SOURCES/indra/viewer-linux-i686*/newview/SecondLife*.tar.bz2 $HOME/ | ||
60 | # fi | ||
61 | } | ||
62 | |||
63 | ########### end of functions ########### | ||
64 | |||
65 | if [ "$TEMP_DIR" == "" ] ; then | ||
66 | export TEMP_DIR="/usr/tmp/$USER" | ||
67 | fi | ||
68 | |||
69 | # Check to see if we simply want to retry a compilation: | ||
70 | if [ "$1" == "--retry" ] ; then | ||
71 | compile | ||
72 | exit $? | ||
73 | fi | ||
74 | |||
75 | # Use the parameter (if any) as the path to the archives: | ||
76 | |||
77 | PATH_TO_ARCHIVES=`pwd` | ||
78 | if [ "$1" != "" ] && [ "$1" != "--prep" ] ; then | ||
79 | if [ -d $1 ] ; then | ||
80 | PATH_TO_ARCHIVES=$1 | ||
81 | shift | ||
82 | fi | ||
83 | fi | ||
84 | |||
85 | cd $PATH_TO_SOURCES/indra | ||
86 | |||
87 | # Do a clean build | ||
88 | #./develop.py clean | ||
89 | |||
90 | # Force the vectorization use if we chose so. | ||
91 | if [ "$FORCE_VECTORIZE" == "yes" ] ; then | ||
92 | TUNE_FLAGS="$TUNE_FLAGS -DLL_VECTORIZE=1" | ||
93 | fi | ||
94 | if [ "$ALLOW_WARNINGS" == "yes" ] ; then | ||
95 | FATAL_WARNINGS="-DGCC_DISABLE_FATAL_WARNINGS:BOOL=TRUE" | ||
96 | else | ||
97 | FATAL_WARNINGS="" | ||
98 | fi | ||
99 | |||
100 | time compile | ||
101 | |||
diff --git a/linden/scripts/linux/4-package-viewer b/linden/scripts/linux/4-package-viewer new file mode 100755 index 0000000..b2bff7f --- /dev/null +++ b/linden/scripts/linux/4-package-viewer | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | cd ../../indra/viewer-linux-* | ||
4 | make package | ||
5 | |||
diff --git a/linden/scripts/linux/README.txt b/linden/scripts/linux/README.txt new file mode 100644 index 0000000..6a4e2b5 --- /dev/null +++ b/linden/scripts/linux/README.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | How to build a linux version. | ||
2 | |||
3 | Edit config-SL-source to suit, the one that comes with the viewer | ||
4 | is the one used to build the linux release. | ||
5 | |||
6 | Run the scripts in order - | ||
7 | |||
8 | 0-patch-SL-source | ||
9 | 1-get-libraries-from-SL | ||
10 | 2-trim-libraries-from-SL | ||
11 | 3-compile-SL-source | ||
12 | |||
13 | The patch script should do nothing unless you have setup patches, so you | ||
14 | can skip it. The get-libraries script needs a working network | ||
15 | connection, it fetches pre built libraries. It also sets up the build. | ||
16 | Trim-libraries removes those pre built libraries again if you configured | ||
17 | things to not use them. The compile script does the actual work. | ||
18 | Usually when making changes, only the compile script needs to be run | ||
19 | again. | ||
20 | |||
21 | 4-package-viewer can be run at a later stage to actually build a tarball | ||
22 | of the viewer, ready for users to install. | ||
23 | |||
24 | These scripts are based on cmake-SL v1.31 (c)2008-2009 Henri Beauchamp. | ||
25 | Released under GPL license v2: http://www.gnu.org/licenses/gpl.txt | ||
26 | Modifications made by David Seikel. | ||
diff --git a/linden/scripts/linux/config-SL-source b/linden/scripts/linux/config-SL-source new file mode 100644 index 0000000..174d7d4 --- /dev/null +++ b/linden/scripts/linux/config-SL-source | |||
@@ -0,0 +1,63 @@ | |||
1 | # cmake-SL v1.31 (c)2008-2009 Henri Beauchamp. Released under GPL license v2: | ||
2 | # http://www.gnu.org/licenses/gpl.txt | ||
3 | |||
4 | |||
5 | # You may enable or disable the use of your system's library by editing | ||
6 | # the USE_SYSTEM_* variable ("yes" --> use the system library, "no" --> use | ||
7 | # LL's provided ones). | ||
8 | # The script also takes care of updating properly the viewer_manifest.py script | ||
9 | # accordingly, so that you (should) end up with a properly packaged client. | ||
10 | |||
11 | PWD=`pwd` | ||
12 | |||
13 | # Where the sources of the client will be held (defaults to "./linden"): | ||
14 | PATH_TO_SOURCES="$PWD/../.." | ||
15 | # Where the patches of the client are stored | ||
16 | PATH_TO_PATCHES="$PWD/../../patches" | ||
17 | # Where to store temporary files: | ||
18 | TEMP_DIR="/tmp/SL-$USER" | ||
19 | mkdir -p $TEMP_DIR | ||
20 | |||
21 | USE_SYSTEM_GTK="no" | ||
22 | USE_SYSTEM_SDL="no" | ||
23 | USE_SYSTEM_SSL="no" | ||
24 | # Beware: libdb4 makes use of libapr, libapr makes use of libexpat and | ||
25 | # libxmlrc-epi makes use of libexpat... so you should keep USE_SYSTEM_APR, | ||
26 | # USE_SYSTEM_DB4, USE_SYSTEM_EXPAT and USE_SYSTEM_XMLRPC in sync. | ||
27 | USE_SYSTEM_APR="no" | ||
28 | USE_SYSTEM_EXPAT="no" | ||
29 | USE_SYSTEM_XMLRPC="no" | ||
30 | # Note: you may specify a version number (example: 4.6) instead of "yes" | ||
31 | # in USE_SYSTEM_DB4 (by default the cmake scripts will attempt to link | ||
32 | # against DB4.2 only and would fail when set to "yes" if this is not the | ||
33 | # version installed on your system. | ||
34 | USE_SYSTEM_DB4="no" | ||
35 | # You should keep the USE_SYSTEM_CARES setting in sync with the USE_SYSTEM_CURL | ||
36 | # setting further below... | ||
37 | USE_SYSTEM_CARES="no" | ||
38 | # If your system libcurl does not use c-ares (non-blocking DNS calls), better | ||
39 | # using LL's provided library... | ||
40 | USE_SYSTEM_CURL="no" | ||
41 | USE_SYSTEM_OGG="no" | ||
42 | USE_SYSTEM_ZLIB="no" | ||
43 | USE_SYSTEM_UUID="no" | ||
44 | USE_SYSTEM_VORBIS="no" | ||
45 | USE_SYSTEM_JPEGLIB="no" | ||
46 | USE_SYSTEM_PERFTOOLS="no" | ||
47 | USE_SYSTEM_ELFIO="no" | ||
48 | # When compiling against anything newer than glibc v2.4, do use "yes" here: | ||
49 | USE_SYSTEM_LIBSTDC="yes" | ||
50 | # Seems that current viewers don't actually like the boost that LL uses. Probaly best to set this to "yes" | ||
51 | USE_SYSTEM_BOOST="no" | ||
52 | |||
53 | # You may add tune flags here, to optimize the code for your processor. | ||
54 | # Example, for an Athlon XP: | ||
55 | # TUNE_FLAGS="-march=athlon-xp" | ||
56 | TUNE_FLAGS="-fomit-frame-pointer -frename-registers -ftree-vectorize -fweb -fexpensive-optimizations -msse -mfpmath=sse" | ||
57 | # Set this to "yes" to force vectorization use in the viewer code (only for | ||
58 | # processors with SSE or Altivec units, and only if you did enable them via | ||
59 | # the TUNE_FLAGS. | ||
60 | FORCE_VECTORIZE="yes" | ||
61 | |||
62 | # When using gcc v4.3 or later, you might have to set this to yes... | ||
63 | ALLOW_WARNINGS="yes" | ||