diff options
author | David Seikel | 2011-01-13 12:52:29 +1000 |
---|---|---|
committer | David Seikel | 2011-01-13 12:56:32 +1000 |
commit | aaa77a5553f36fad2a21cee8b4368ce33a1b8b36 (patch) | |
tree | fbc6f61a22624701a5c29c0b72f0bd502805cfb3 /linden/scripts/linux/2-trim-libraries-from-SL | |
parent | Simplified install of libllcommon in Mac manifest. (diff) | |
download | meta-impy-aaa77a5553f36fad2a21cee8b4368ce33a1b8b36.zip meta-impy-aaa77a5553f36fad2a21cee8b4368ce33a1b8b36.tar.gz meta-impy-aaa77a5553f36fad2a21cee8b4368ce33a1b8b36.tar.bz2 meta-impy-aaa77a5553f36fad2a21cee8b4368ce33a1b8b36.tar.xz |
Linux build scripts.
These are the scripts I use to build most of the viewers that I have tried building.
These scripts are based on cmake-SL v1.31 (c)2008-2009 Henri Beauchamp.
Released under GPL license v2: http://www.gnu.org/licenses/gpl.txt
I split them up and made them more generic.
Diffstat (limited to 'linden/scripts/linux/2-trim-libraries-from-SL')
-rwxr-xr-x | linden/scripts/linux/2-trim-libraries-from-SL | 247 |
1 files changed, 247 insertions, 0 deletions
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..f86f0d8 --- /dev/null +++ b/linden/scripts/linux/2-trim-libraries-from-SL | |||
@@ -0,0 +1,247 @@ | |||
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* | ||
65 | cd ../include | ||
66 | rm -rf atk-1.0/ gtk-2.0/ glib-2.0/ pango-1.0/ | ||
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 | fi | ||
89 | |||
90 | # Let's use the system zlib if available: | ||
91 | if check $USE_SYSTEM_ZLIB /usr/include/zlib.h "zlib" ; then | ||
92 | cd $PATH_TO_SOURCES/libraries | ||
93 | rm -rf include/zlib/ | ||
94 | rm -f x86_64-linux/lib_release_client/libz.so.1 | ||
95 | mkdir -p include/zlib | ||
96 | cp -a /usr/include/zlib*.h include/zlib/ | ||
97 | fi | ||
98 | |||
99 | # Let's use the system jpeglib if available: | ||
100 | if check $USE_SYSTEM_JPEGLIB /usr/include/jpeglib.h "jpeglib" ; then | ||
101 | cd $PATH_TO_SOURCES/libraries | ||
102 | rm -rf include/jpeglib/ x86_64-linux/lib_release_client/libjpeg.a | ||
103 | mkdir -p include/jpeglib | ||
104 | cp -a /usr/include/j*.h include/jpeglib/ | ||
105 | touch include/jpeglib/jinclude.h | ||
106 | fi | ||
107 | |||
108 | # Let's use the system ogg if available: | ||
109 | if check $USE_SYSTEM_OGG /usr/include/ogg/ogg.h "ogg" ; then | ||
110 | cd $PATH_TO_SOURCES/libraries | ||
111 | rm -rf include/ogg/ x86_64-linux/lib_release_client/libogg* | ||
112 | fi | ||
113 | |||
114 | # Let's use the system vorbis if available: | ||
115 | if check $USE_SYSTEM_VORBIS /usr/include/vorbis/vorbisenc.h "vorbis" ; then | ||
116 | cd $PATH_TO_SOURCES/libraries | ||
117 | rm -rf include/vorbis/ x86_64-linux/lib_release_client/libvorbis* | ||
118 | fi | ||
119 | |||
120 | # Let's use the system SDL if available: | ||
121 | if check $USE_SYSTEM_SDL /usr/include/SDL/SDL.h "SDL" ; then | ||
122 | cd $PATH_TO_SOURCES/libraries/x86_64-linux | ||
123 | rm -rf include/SDL/ lib_release_client/libSDL* | ||
124 | update_manifest libSDL | ||
125 | fi | ||
126 | |||
127 | # Let's use the system openssl if available: | ||
128 | if check $USE_SYSTEM_SSL /usr/include/openssl/opensslconf.h "openssl" ; then | ||
129 | cd $PATH_TO_SOURCES/libraries/x86_64-linux/lib_release_client | ||
130 | rm -f libssl.* libcrypto.* | ||
131 | update_manifest libssl | ||
132 | update_manifest libcrypto | ||
133 | fi | ||
134 | |||
135 | # Let's use the system apr if available: | ||
136 | if check $USE_SYSTEM_APR /usr/include/apr*/apr_base64.h "apr" ; then | ||
137 | cd $PATH_TO_SOURCES/libraries/x86_64-linux | ||
138 | rm -rf include/apr-1/* | ||
139 | rm -f lib_release_client/libapr* | ||
140 | cp -a /usr/include/apr*/* include/apr-1/ | ||
141 | update_manifest libapr | ||
142 | fi | ||
143 | |||
144 | # Let's use the system db4 if available: | ||
145 | if check $USE_SYSTEM_DB4 /usr/include/db4/db.h "db4" ; then | ||
146 | rm -f $PATH_TO_SOURCES/libraries/x86_64-linux/lib_release_client/libdb*.so | ||
147 | update_manifest libdb | ||
148 | if [ $USE_SYSTEM_DB4 != "yes" ] ; then | ||
149 | if ! grep $USE_SYSTEM_DB4 $PATH_TO_SOURCES/indra/cmake/BerkeleyDB.cmake ; then | ||
150 | # If we gave a version number instead of "yes", patch the | ||
151 | # BerkeleyDB.cmake file to use that DB4 version instead of 4.2. | ||
152 | sed -e "s/4.2/$USE_SYSTEM_DB4/" $PATH_TO_SOURCES/indra/cmake/BerkeleyDB.cmake >$TEMP_DIR/BerkeleyDB.cmake | ||
153 | mv -f $TEMP_DIR/BerkeleyDB.cmake $PATH_TO_SOURCES/indra/cmake/BerkeleyDB.cmake | ||
154 | fi | ||
155 | fi | ||
156 | fi | ||
157 | |||
158 | # Let's use the system expat if available: | ||
159 | if check $USE_SYSTEM_EXPAT /usr/include/expat.h "expat" ; then | ||
160 | cd $PATH_TO_SOURCES/libraries | ||
161 | rm -rf include/expat/ | ||
162 | rm -f x86_64-linux/lib_release_client/libexpat* | ||
163 | mkdir -p include/expat | ||
164 | cp -a /usr/include/expat*.h include/expat/ | ||
165 | update_manifest libexpat | ||
166 | fi | ||
167 | |||
168 | # Let's use the system xmlrpc-epi if available: | ||
169 | if check $USE_SYSTEM_XMLRPC /usr/include/xmlrpc.h "xmlrpc-epi" ; then | ||
170 | cd $PATH_TO_SOURCES/libraries | ||
171 | rm -rf include/xmlrpc-epi/ x86_64-linux/lib_release_client/libxmlrpc.a | ||
172 | mkdir -p include/xmlrpc-epi | ||
173 | cp -a /usr/include/xmlrpc*.h include/xmlrpc-epi/ | ||
174 | fi | ||
175 | |||
176 | # Let's use the system c-ares if available: | ||
177 | if check $USE_SYSTEM_CARES /usr/lib/libcares.a "c-ares" ; then | ||
178 | cd $PATH_TO_SOURCES/libraries | ||
179 | rm -f include/ares/* | ||
180 | rm -f x86_64-linux/lib_release_client/libcares.* | ||
181 | cp -a /usr/include/ares* include/ares/ | ||
182 | cp -a /usr/lib/libcares.a x86_64-linux/lib_release_client/ | ||
183 | fi | ||
184 | |||
185 | # Let's use the system curl if available: | ||
186 | if check $USE_SYSTEM_CURL /usr/include/curl/curl.h "curl" ; then | ||
187 | cd $PATH_TO_SOURCES/libraries | ||
188 | rm -rf include/curl/ | ||
189 | rm -f x86_64-linux/lib_release_client/libcurl.* | ||
190 | fi | ||
191 | |||
192 | # Let's use the system uuid if available: | ||
193 | if check $USE_SYSTEM_UUID /lib/libuuid.so.1 "libuuid" ; then | ||
194 | rm -f $PATH_TO_SOURCES/libraries/x86_64-linux/lib_release_client/libuuid.* | ||
195 | update_manifest libuuid | ||
196 | fi | ||
197 | |||
198 | # Let's use the system google-perftools if available: | ||
199 | if check $USE_SYSTEM_PERFTOOLS /usr/include/google/malloc_hook.h "google-perftools" ; then | ||
200 | cd $PATH_TO_SOURCES/libraries/x86_64-linux | ||
201 | rm -f lib_release_client/libtcmalloc.* lib_release_client/libstacktrace.* | ||
202 | rm -rf include/google/ | ||
203 | cp -a /usr/lib/libstacktrace.* /usr/lib/libtcmalloc.so* lib_release_client/ | ||
204 | cp -a /usr/include/google include/ | ||
205 | update_manifest tcmalloc | ||
206 | update_manifest stacktrace | ||
207 | fi | ||
208 | |||
209 | # Let's use the system libELFIO if available: | ||
210 | if check $USE_SYSTEM_ELFIO /usr/include/ELFIO.h "libELFIO" ; then | ||
211 | cd $PATH_TO_SOURCES/libraries/x86_64-linux | ||
212 | rm -f include/ELFIO/* | ||
213 | rm -f lib_release_client/libELFIO.* | ||
214 | cp -af /usr/include/ELF* include/ELFIO/ | ||
215 | cp -af /usr/lib/libELFIO.so lib_release_client/ | ||
216 | update_manifest ELFIO | ||
217 | fi | ||
218 | |||
219 | # Let's use the system libstdc++ if available: | ||
220 | if check $USE_SYSTEM_LIBSTDC /usr/lib/libstdc++.so.6 "libstdc++" ; then | ||
221 | rm -f $PATH_TO_SOURCES/libraries/x86_64-linux/lib_release_client/libstdc++.* | ||
222 | update_manifest libstdc | ||
223 | fi | ||
224 | |||
225 | # Let's use the system boost if available: | ||
226 | if check $USE_SYSTEM_BOOST /usr/include/boost/version.hpp "boost" ; then | ||
227 | cd $PATH_TO_SOURCES/libraries | ||
228 | rm -rf include/boost/ | ||
229 | rm -f x86_64-linux/lib_release/libboost_* | ||
230 | rm -f x86_64-linux/lib_release_client/libboost_* | ||
231 | fi | ||
232 | |||
233 | |||
234 | # Force libkdu inclusion | ||
235 | # (disabled for now (v1.21.0 viewer) as the cmake scripts fail to get libkdu from Internet). | ||
236 | if false; then | ||
237 | # Remove everything dealing with libstdc++ and the crash logger: | ||
238 | update_manifest libstdc | ||
239 | update_manifest logger | ||
240 | # Now, any line with a '#' followed with several spaces _should_ be dealing | ||
241 | # with the libkdu stuff... So, we simply remove the '#"... | ||
242 | sed -e "s/# them/# them/" $PATH_TO_SOURCES/indra/newview/viewer_manifest.py >$TEMP_DIR/viewer_manifest.py | ||
243 | sed -e "s/^# / /" $TEMP_DIR/viewer_manifest.py >$PATH_TO_SOURCES/indra/newview/viewer_manifest.py | ||
244 | rm -f $TEMP_DIR/viewer_manifest.py | ||
245 | chmod +x $PATH_TO_SOURCES/indra/newview/viewer_manifest.py | ||
246 | fi | ||
247 | |||