bf738dfe1fc0b46e0eefb3ea328a1595bade7d8f
[blender.git] / build_files / build_environment / install_deps.sh
1 #!/bin/bash
2
3 DISTRO=""
4 SRC="$HOME/src/blender-deps"
5 CWD=$PWD
6
7 THREADS=`cat /proc/cpuinfo | grep cores | uniq | sed -e "s/.*: *\(.*\)/\\1/"`
8
9 PYTHON_VERSION="3.3.0"
10 BOOST_VERSION="1_51_0"
11 OIIO_VERSION="1.1.0"
12 OCIO_VERSION="1.0.7"
13 FFMPEG_VERSION="1.0"
14 _ffmpeg_list_sep=";"
15
16 # XXX Looks like ubuntu has libxvidcore4-dev, while debian has libxvidcore-dev...
17 HASXVID=false
18 XVIDDEV=""
19 HASVPX=false
20 HASMP3LAME=false
21 HASX264=false
22 HASOPENJPEG=false
23 HASSCHRO=false
24
25 # Switch to english language, else some things (like check_package_DEB()) won't work!
26 LANG_BACK=$LANG
27 LANG=""
28 export LANG
29
30 ERROR() {
31   echo "${@}"
32 }
33
34 INFO() {
35   echo "${@}"
36 }
37
38 # Return 1 if $1 >= $2, else 0.
39 # $1 and $2 should be version numbers made of numbers only.
40 version_ge() {
41   if [ $(echo -e "$1\n$2" | sort --version-sort | head --lines=1) = "$1" ]; then
42     return 0
43   else
44     return 1
45   fi
46 }
47
48 # Return 1 if $1 is into $2 (e.g. 3.3.2 is into 3.3, but not 3.3.0 or 3.3.5)
49 # $1 and $2 should be version numbers made of numbers only.
50 # $1 should be at least as long as $2!
51 version_match() {
52   backIFS=$IFS
53   IFS='.'
54
55   # Split both version numbers into their numeric elements.
56   arr1=( $1 )
57   arr2=( $2 )
58
59   ret=0
60
61   count1=${#arr1[@]}
62   count2=${#arr2[@]}
63   if [ $count1 -ge $count2 ]; then
64     ret=1
65     for (( i=0; $i < $count2; i++ ))
66     do
67       if [ $(( 10#${arr1[$i]} )) -ne $(( 10#${arr2[$i]} )) ]; then
68         ret=0
69         break
70       fi
71     done
72   fi
73
74   IFS=$backIFS
75   return $ret
76 }
77
78 detect_distro() {
79   if [ -f /etc/debian_version ]; then
80     DISTRO="DEB"
81   elif [ -f /etc/redhat-release ]; then
82     DISTRO="RPM"
83   elif [ -f /etc/SuSE-release ]; then
84     DISTRO="SUSE"
85   fi
86 }
87
88 prepare_opt() {
89   INFO "Ensuring /opt/lib exists and writable by us"
90   sudo mkdir -p /opt/lib
91   sudo chown $USER /opt/lib
92   sudo chmod 775 /opt/lib
93 }
94
95 compile_Python() {
96   if [ ! -d /opt/lib/python-$PYTHON_VERSION ]; then
97     INFO "Building Python-$PYTHON_VERSION"
98
99     prepare_opt
100
101     if [ ! -d $SRC/Python-$PYTHON_VERSION ]; then
102       mkdir -p $SRC
103       wget -c http://python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.bz2 -P $SRC
104
105       INFO "Unpacking Python-$PYTHON_VERSION"
106       tar -C $SRC -xf $SRC/Python-$PYTHON_VERSION.tar.bz2
107     fi
108
109     cd $SRC/Python-$PYTHON_VERSION
110
111     ./configure --prefix=/opt/lib/python-$PYTHON_VERSION --enable-ipv6 \
112         --enable-loadable-sqlite-extensions --with-dbmliborder=bdb \
113         --with-computed-gotos --with-pymalloc
114
115     make -j$THREADS
116     make install
117     make clean
118
119     rm -f /opt/lib/python-3.3
120     ln -s python-$PYTHON_VERSION /opt/lib/python-3.3
121
122     cd $CWD
123   fi
124 }
125
126 compile_Boost() {
127   INFO "Building boost"
128
129   version_dots=`echo "$BOOST_VERSION" | sed -r 's/_/./g'`
130
131   if [ ! -d /opt/lib/boost-$version_dots ]; then
132     INFO "Building Boost-$version_dots"
133
134     prepare_opt
135
136     if [ ! -d $SRC/boost_$BOOST_VERSION ]; then
137       INFO "Downloading Boost-$version_dots"
138       mkdir -p $SRC
139       wget -c http://sourceforge.net/projects/boost/files/boost/$version_dots/boost_$BOOST_VERSION.tar.bz2/download \
140         -O $SRC/boost_$BOOST_VERSION.tar.bz2
141       tar -C $SRC -xf $SRC/boost_$BOOST_VERSION.tar.bz2
142     fi
143
144     cd $SRC/boost_$BOOST_VERSION
145     ./bootstrap.sh --with-libraries=system,filesystem,thread,regex,locale,date-time --prefix=/opt/lib/boost-$version_dots
146     ./b2 install
147     ./b2 --clean
148
149     rm -f /opt/lib/boost
150     ln -s boost-$version_dots /opt/lib/boost
151
152     cd $CWD
153   fi
154 }
155
156 compile_OCIO() {
157   if [ ! -d /opt/lib/ocio-$OCIO_VERSION ]; then
158     INFO "Building OpenColorIO-$OCIO_VERSION"
159
160     prepare_opt
161
162     if [ ! -d $SRC/OpenColorIO-$OCIO_VERSION ]; then
163         INFO "Downloading OpenColorIO-$OCIO_VERSION"
164         mkdir -p $SRC
165         wget -c http://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION \
166           -O $SRC/OpenColorIO-$OCIO_VERSION.tar.gz
167
168         INFO "Unpacking OpenColorIO-$OCIO_VERSION"
169         tar -C "$SRC" -xf $SRC/OpenColorIO-$OCIO_VERSION.tar.gz
170         mv $SRC/imageworks-OpenColorIO* $SRC/OpenColorIO-$OCIO_VERSION
171     fi
172
173     cd $SRC/OpenColorIO-$OCIO_VERSION
174     mkdir build
175     cd build
176
177     if file /bin/cp | grep -q '32-bit'; then
178       cflags="-fPIC -m32 -march=i686"
179     else
180       cflags="-fPIC"
181     fi
182
183     cmake -D CMAKE_BUILD_TYPE=Release \
184         -D CMAKE_PREFIX_PATH=/opt/lib/ocio-$OCIO_VERSION \
185         -D CMAKE_INSTALL_PREFIX=/opt/lib/ocio-$OCIO_VERSION \
186         -D CMAKE_CXX_FLAGS="$cflags" \
187         -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" \
188         ..
189
190     make -j$THREADS
191     make install
192
193     # Force linking against sttaic libs
194     rm -f /opt/lib/ocio-$OCIO_VERSION/lib/*.so*
195
196     # Additional depencencies
197     cp ext/dist/lib/libtinyxml.a /opt/lib/ocio-$OCIO_VERSION/lib
198     cp ext/dist/lib/libyaml-cpp.a /opt/lib/ocio-$OCIO_VERSION/lib
199
200     make clean
201
202     rm -f /opt/lib/ocio
203     ln -s ocio-$OCIO_VERSION /opt/lib/ocio
204
205     cd $CWD
206   fi
207 }
208
209 compile_OIIO() {
210   if [ ! -d /opt/lib/oiio-$OIIO_VERSION ]; then
211     INFO "Building OpenImageIO-$OIIO_VERSION"
212
213     prepare_opt
214
215     if [ ! -d $SRC/OpenImageIO-$OIIO_VERSION ]; then
216       wget -c https://github.com/OpenImageIO/oiio/tarball/Release-$OIIO_VERSION \
217           -O "$SRC/OpenImageIO-$OIIO_VERSION.tar.gz"
218
219       INFO "Unpacking OpenImageIO-$OIIO_VERSION"
220       tar -C $SRC -xf $SRC/OpenImageIO-$OIIO_VERSION.tar.gz
221       mv $SRC/OpenImageIO-oiio* $SRC/OpenImageIO-$OIIO_VERSION
222     fi
223
224     cd $SRC/OpenImageIO-$OIIO_VERSION
225     mkdir build
226     cd build
227
228     if [ -d /opt/lib/boost ]; then
229       boost_root="/opt/lib/boost"
230     else
231       boost_root="/usr"
232     fi
233
234     if file /bin/cp | grep -q '32-bit'; then
235       cflags="-fPIC -m32 -march=i686"
236     else
237       cflags="-fPIC"
238     fi
239
240     cmake -D CMAKE_BUILD_TYPE=Release \
241         -D CMAKE_PREFIX_PATH=/opt/lib/oiio-$OIIO_VERSION \
242         -D CMAKE_INSTALL_PREFIX=/opt/lib/oiio-$OIIO_VERSION \
243         -D BUILDSTATIC=ON \
244         -D CMAKE_CXX_FLAGS="$cflags" \
245         -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" \
246         -D BOOST_ROOT="$boost_root" \
247         ../src
248
249     make -j$THREADS
250     make install
251     make clean
252
253     rm -f /opt/lib/oiio
254     ln -s oiio-$OIIO_VERSION /opt/lib/oiio
255
256     cd $CWD
257   fi
258 }
259
260 compile_FFmpeg() {
261   if [ ! -d /opt/lib/ffmpeg-$FFMPEG_VERSION ]; then
262     INFO "Building FFmpeg-$FFMPEG_VERSION"
263
264     prepare_opt
265
266     if [ ! -d $SRC/ffmpeg-$FFMPEG_VERSION ]; then
267       INFO "Downloading FFmpeg-$FFMPEG_VERSION"
268       wget -c http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2 -P $SRC
269
270       INFO "Unpacking FFmpeg-$FFMPEG_VERSION"
271       tar -C $SRC -xf $SRC/ffmpeg-$FFMPEG_VERSION.tar.bz2
272     fi
273
274     cd $SRC/ffmpeg-$FFMPEG_VERSION
275
276     extra=""
277
278     if $HASXVID; then
279       extra="$extra --enable-libxvid"
280     fi
281
282     if $HASVPX; then
283       extra="$extra --enable-libvpx"
284     fi
285
286     if $HASMP3LAME; then
287       extra="$extra --enable-libmp3lame"
288     fi
289
290     if $HASX264; then
291       extra="$extra --enable-libx264"
292     fi
293
294     if $HASOPENJPEG; then
295       extra="$extra --enable-libopenjpeg"
296     fi
297
298     if $HASSCHRO; then
299       extra="$extra --enable-libschroedinger"
300     fi
301
302     ./configure --cc="gcc -Wl,--as-needed" --extra-ldflags="-pthread -static-libgcc" \
303         --prefix=/opt/lib/ffmpeg-$FFMPEG_VERSION --enable-static --enable-avfilter --disable-vdpau \
304         --disable-bzlib --disable-libgsm --disable-libspeex --enable-libtheora \
305         --enable-libvorbis --enable-pthreads --enable-zlib --enable-stripping --enable-runtime-cpudetect \
306         --disable-vaapi  --disable-libfaac --disable-nonfree --enable-gpl \
307         --disable-postproc --disable-x11grab  --disable-librtmp  --disable-libopencore-amrnb \
308         --disable-libopencore-amrwb --disable-libdc1394 --disable-version3  --disable-outdev=sdl \
309         --disable-outdev=alsa --disable-indev=sdl --disable-indev=alsa --disable-indev=jack \
310         --disable-indev=lavfi $extra
311
312     make -j$THREADS
313     make install
314     make clean
315
316     rm -f /opt/lib/ffmpeg
317     ln -s ffmpeg-$FFMPEG_VERSION /opt/lib/ffmpeg
318
319     cd $CWD
320   fi
321 }
322
323 deb_version() {
324     dpkg-query -W -f '${Version}' $1 | sed -r 's/^([0-9]\.[0-9]+).*/\1/'
325 }
326
327 check_package_DEB() {
328   r=`apt-cache policy $1 | grep -c 'Candidate:'`
329
330   if [ $r -ge 1 ]; then
331     return 0
332   else
333     return 1
334   fi
335 }
336
337 install_DEB() {
338   INFO "Installing dependencies for DEB-based distributive"
339
340   sudo apt-get update
341 # XXX Why in hell? Let's let this stuff to the user's responsability!!!
342 #  sudo apt-get -y upgrade
343
344   sudo apt-get install -y cmake scons gcc g++ libjpeg-dev libpng-dev libtiff-dev \
345     libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev libncurses5-dev \
346     libssl-dev liblzma-dev libreadline-dev libopenjpeg-dev libopenexr-dev libopenal-dev \
347     libglew-dev yasm libschroedinger-dev libtheora-dev libvorbis-dev libsdl1.2-dev \
348     libfftw3-dev libjack-dev python-dev patch
349
350   HASOPENJPEG=true
351   HASSCHRO=true
352
353   check_package_DEB libxvidcore-dev
354   if [ $? -eq 0 ]; then
355     sudo apt-get install -y libxvidcore-dev
356     HASXVID=true
357     XVIDDEV="libxvidcore-dev"
358   fi
359
360   check_package_DEB libxvidcore4-dev
361   if [ $? -eq 0 ]; then
362     sudo apt-get install -y libxvidcore4-dev
363     HASXVID=true
364     XVIDDEV="libxvidcore4-dev"
365   fi
366
367   check_package_DEB libmp3lame-dev
368   if [ $? -eq 0 ]; then
369     sudo apt-get install -y libmp3lame-dev
370     HASMP3LAME=true
371   fi
372
373   check_package_DEB libx264-dev
374   if [ $? -eq 0 ]; then
375     sudo apt-get install -y libx264-dev
376     HASX264=true
377   fi
378
379   check_package_DEB libvpx-dev
380   if [ $? -eq 0 ]; then
381     sudo apt-get install -y libvpx-dev
382     vpx_version=`deb_version libvpx-dev`
383     if  dpkg --compare-versions $vpx_version gt 0.9.7; then
384       if version_ge $vpx_version 0.9.7; then
385         HASVPX=true
386       fi
387     fi
388   fi
389
390   check_package_DEB libspnav-dev
391   if [ $? -eq 0 ]; then
392     sudo apt-get install -y libspnav-dev
393   fi
394
395   check_package_DEB python3.3-dev
396   if [ $? -eq 0 ]; then
397     sudo apt-get install -y python3.3-dev
398   else
399     compile_Python
400   fi
401
402   check_package_DEB libboost-dev
403   if [ $? -eq 0 ]; then
404     sudo apt-get install -y libboost-dev
405
406     boost_version=`deb_version libboost-dev`
407
408     check_package_DEB libboost-locale$boost_version-dev
409     if [ $? -eq 0 ]; then
410       sudo apt-get install -y libboost-locale$boost_version-dev libboost-filesystem$boost_version-dev \
411         libboost-regex$boost_version-dev libboost-system$boost_version-dev libboost-thread$boost_version-dev
412     else
413       compile_Boost
414     fi
415   else
416     compile_Boost
417   fi
418
419   check_package_DEB libopencolorio-dev
420   if [ $? -eq 0 ]; then
421     sudo apt-get install -y libopencolorio-dev
422   else
423     compile_OCIO
424   fi
425
426   check_package_DEB libopenimageio-dev
427   if [ $? -eq 0 ]; then
428     sudo apt-get install -y libopenimageio-dev
429   else
430     compile_OIIO
431   fi
432
433 #  XXX Debian features libav packages as ffmpeg, those are not really compatible with blender code currently :/
434 #      So for now, always build our own ffmpeg.
435 #  check_package_DEB ffmpeg
436 #  if [ $? -eq 0 ]; then
437 #    sudo apt-get install -y ffmpeg
438 #    ffmpeg_version=`deb_version ffmpeg`
439 #    INFO "ffmpeg version: $ffmpeg_version"
440 #    if [ ! -z "$ffmpeg_version" ]; then
441 #      if  dpkg --compare-versions $ffmpeg_version gt 0.7.2; then
442 #        sudo apt-get install -y libavfilter-dev libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev libswscale-dev
443 #      else
444 #        compile_FFmpeg
445 #      fi
446 #    fi
447 #  fi
448   compile_FFmpeg
449 }
450
451 check_package_RPM() {
452   r=`yum info $1 | grep -c 'Summary'`
453
454   if [ $r -ge 1 ]; then
455     return 0
456   else
457     return 1
458   fi
459 }
460
461 check_package_version_match_RPM() {
462   v=`yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'`
463
464   version_match $v $2
465   return $?
466 }
467
468 check_package_version_ge_RPM() {
469   v=`yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'`
470
471   version_ge $v $2
472   return $?
473 }
474
475 install_RPM() {
476   INFO "Installing dependencies for RPM-based distributive"
477
478   sudo yum -y update
479
480   sudo yum -y install gcc gcc-c++ cmake scons libpng-devel libtiff-devel \
481     freetype-devel libX11-devel libXi-devel wget libsqlite3x-devel ncurses-devel \
482     readline-devel openjpeg-devel openexr-devel openal-soft-devel \
483     glew-devel yasm schroedinger-devel libtheora-devel libvorbis-devel SDL-devel \
484     fftw-devel lame-libs jack-audio-connection-kit-devel libspnav-devel \
485     libjpeg-devel patch python-devel
486
487   HASOPENJPEG=true
488   HASSCHRO=true
489
490   check_package_RPM x264-devel
491   if [ $? -eq 0 ]; then
492     sudo yum install -y x264-devel
493     HASX264=true
494   fi
495
496   check_package_RPM xvidcore-devel
497   if [ $? -eq 0 ]; then
498     sudo yum install -y xvidcore-devel
499     HASXVID=true
500     XVIDDEV="xvidcore-devel"
501   fi
502
503   check_package_version_ge_RPM libvpx-devel 0.9.7
504   if [ $? -eq 1 ]; then
505     sudo yum install -y libvpx-devel
506     HASVPX=true
507   fi
508
509   check_package_RPM lame-devel
510   if [ $? -eq 0 ]; then
511     sudo yum install -y lame-devel
512     HASMP3LAME=true
513   fi
514
515   check_package_version_match_RPM python3-devel 3.3
516   if [ $? -eq 1 ]; then
517     sudo yum install -y python-devel
518   else
519     compile_Python
520   fi
521
522   check_package_RPM boost-devel
523   if [ $? -eq 0 ]; then
524     sudo yum install -y boost-devel
525   else
526     compile_Boost
527   fi
528
529   check_package_RPM OpenColorIO-devel
530   if [ $? -eq 0 ]; then
531     sudo yum install -y OpenColorIO-devel
532   else
533     compile_OCIO
534   fi
535
536   check_package_RPM OpenImageIO-devel
537   if [ $? -eq 0 ]; then
538     sudo yum install -y OpenImageIO-devel
539   else
540     compile_OIIO
541   fi
542
543   # Always for now, not sure which packages should be installed
544   compile_FFmpeg
545 }
546
547 check_package_SUSE() {
548   r=`zypper info $1 | grep -c 'Summary'`
549
550   if [ $r -ge 1 ]; then
551     return 0
552   else
553     return 1
554   fi
555 }
556
557 check_package_version_SUSE() {
558   v=`zypper info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'`
559
560   # for now major and minor versions only (as if x.y, not x.y.z)
561   r=`echo $v | grep -c $2`
562
563   if [ $r -ge 1 ]; then
564     return 0
565   else
566     return 1
567   fi
568 }
569
570 install_SUSE() {
571   INFO "Installing dependencies for SuSE-based distributive"
572
573   sudo zypper --non-interactive update --auto-agree-with-licenses
574
575   sudo zypper --non-interactive install --auto-agree-with-licenses \
576     gcc gcc-c++ libSDL-devel openal-soft-devel libpng12-devel libjpeg62-devel \
577     libtiff-devel OpenEXR-devel yasm libtheora-devel libvorbis-devel cmake \
578     scons patch
579
580   check_package_version_SUSE python3-devel 3.3.
581   if [ $? -eq 0 ]; then
582     sudo zypper --non-interactive install --auto-agree-with-licenses python3-devel
583   else
584     compile_Python
585   fi
586
587   # can not see boost_locale in repo, so let's build own boost
588   compile_Boost
589
590   # this libraries are also missing in the repo
591   compile_OCIO
592   compile_OIIO
593   compile_FFmpeg
594 }
595
596 print_info_ffmpeglink_DEB() {
597   _packages="libtheora-dev"
598
599   if $HASXVID; then
600     _packages="$_packages $XVIDDEV"
601   fi
602
603   if $HASVPX; then
604     _packages="$_packages libvpx-dev"
605   fi
606
607   if $HASMP3LAME; then
608     _packages="$_packages libmp3lame-dev"
609   fi
610
611   if $HASX264; then
612     _packages="$_packages libx264-dev"
613   fi
614
615   if $HASOPENJPEG; then
616     _packages="$_packages libopenjpeg-dev"
617   fi
618
619   if $HASSCHRO; then
620     _packages="$_packages libschroedinger-dev"
621   fi
622
623   dpkg -L $_packages | grep -e ".*\/lib[^\/]\+\.so" | awk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
624 }
625
626 print_info_ffmpeglink_RPM() {
627   _packages="libtheora-devel libvorbis-devel"
628
629   if $HASXVID; then
630     _packages="$_packages $XVIDDEV"
631   fi
632
633   if $HASVPX; then
634     _packages="$_packages libvpx-devel"
635   fi
636
637   if $HASMP3LAME; then
638     _packages="$_packages lame-devel"
639   fi
640
641   if $HASX264; then
642     _packages="$_packages x264-devel"
643   fi
644
645   if $HASOPENJPEG; then
646     _packages="$_packages openjpeg-devel"
647   fi
648
649   if $HASSCHRO; then
650     _packages="$_packages schroedinger-devel"
651   fi
652
653   rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.so" | awk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
654 }
655
656 print_info_ffmpeglink() {
657   # This func must only print a ';'-separated list of libs...
658   if [ -z "$DISTRO" ]; then
659     ERROR "Failed to detect distribution type"
660     exit 1
661   elif [ "$DISTRO" = "DEB" ]; then
662     print_info_ffmpeglink_DEB
663   elif [ "$DISTRO" = "RPM" ]; then
664     print_info_ffmpeglink_RPM
665   # XXX TODO!
666   else INFO "<Could not determine additional link libraries needed for ffmpeg, replace this by valid list of libs...>"
667 #  elif [ "$DISTRO" = "SUSE" ]; then
668 #    print_info_ffmpeglink_SUSE
669   fi
670 }
671
672 print_info() {
673   INFO ""
674   INFO "If you're using CMake add this to your configuration flags:"
675
676   if [ -d /opt/lib/boost ]; then
677     INFO "  -D BOOST_ROOT=/opt/lib/boost"
678     INFO "  -D Boost_NO_SYSTEM_PATHS=ON"
679   fi
680
681   if [ -d /opt/lib/ffmpeg ]; then
682     INFO "  -D WITH_CODEC_FFMPEG=ON"
683     INFO "  -D FFMPEG=/opt/lib/ffmpeg"
684     INFO "  -D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;rt;`print_info_ffmpeglink`'"
685   fi
686
687   INFO ""
688   INFO "If you're using SCons add this to your user-config:"
689
690   if [ -d /opt/lib/python-3.3 ]; then
691     INFO "BF_PYTHON='/opt/lib/python-3.3'"
692     INFO "BF_PYTHON_ABI_FLAGS='m'"
693   fi
694
695   if [ -d /opt/lib/ocio ]; then
696     INFO "BF_OCIO='/opt/lib/ocio'"
697   fi
698
699   if [ -d /opt/lib/oiio ]; then
700     INFO "BF_OIIO='/opt/lib/oiio'"
701   fi
702
703   if [ -d /opt/lib/boost ]; then
704     INFO "BF_BOOST='/opt/lib/boost'"
705   fi
706
707   if [ -d /opt/lib/ffmpeg ]; then
708     INFO "BF_FFMPEG='/opt/lib/ffmpeg'"
709     _ffmpeg_list_sep=" "
710     INFO "BF_FFMPEG_LIB='avformat avcodec swscale avutil avdevice `print_info_ffmpeglink`'"
711   fi
712 }
713
714 # Detect distributive type used on this machine
715 detect_distro
716
717 if [ -z "$DISTRO" ]; then
718   ERROR "Failed to detect distribution type"
719   exit 1
720 elif [ "$DISTRO" = "DEB" ]; then
721   install_DEB
722 elif [ "$DISTRO" = "RPM" ]; then
723   install_RPM
724 elif [ "$DISTRO" = "SUSE" ]; then
725   install_SUSE
726 fi
727
728 print_info
729
730 # Switch back to user language.
731 LANG=LANG_BACK
732 export LANG