Salome HOME
spns #23875 : URANIE Windows build
[tools/sat_salome.git] / products / compil_scripts / mesa.sh
1 #!/bin/bash
2
3 echo "##########################################################################"
4 echo "mesa" $VERSION
5 echo "##########################################################################"
6
7
8
9 cd $SOURCE_DIR
10 autoreconf -fi
11
12 cd $BUILD_DIR
13
14 echo
15 echo "*** configure"
16
17 function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
18
19 if version_ge $VERSION "19"; then
20     $SOURCE_DIR/configure                 \
21     --prefix=$PRODUCT_INSTALL             \
22     --enable-opengl --disable-gles1 --disable-gles2 \
23     --disable-va --disable-xvmc --disable-vdpau \
24     --enable-shared-glapi \
25     --disable-texture-float \
26     --enable-llvm --disable-llvm-shared-libs \
27     --with-llvm-prefix=$LLVM_ROOT_DIR                 \
28     --with-gallium-drivers=swrast \
29     --disable-dri --with-dri-drivers= \
30     --disable-egl --with-platforms=x11 --disable-gbm \
31     --enable-glx=gallium-xlib \
32     --disable-osmesa --enable-gallium-osmesa \
33     --enable-autotools
34 elif version_ge $VERSION "17"; then
35     $SOURCE_DIR/configure                 \
36     --prefix=$PRODUCT_INSTALL             \
37     --enable-opengl --disable-gles1 --disable-gles2 \
38     --disable-va --disable-xvmc --disable-vdpau \
39     --enable-shared-glapi \
40     --disable-texture-float \
41     --enable-gallium-llvm --enable-llvm-shared-libs \
42     --with-llvm-prefix=$LLVM_ROOT_DIR                 \
43     --with-gallium-drivers=swrast \
44     --disable-dri --with-dri-drivers= \
45     --disable-egl --with-platforms=x11 --disable-gbm \
46     --enable-glx=gallium-xlib \
47     --disable-osmesa --enable-gallium-osmesa
48
49 else
50     $SOURCE_DIR/configure CXXFLAGS="-O2 -g -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
51                           CFLAGS="-O2 -g -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
52                           --prefix=$PRODUCT_INSTALL             \
53                           --enable-opengl --disable-gles1 --disable-gles2   \
54                           --disable-va --disable-xvmc --disable-vdpau       \
55                           --enable-shared-glapi                             \
56                           --disable-texture-float                           \
57                           --enable-gallium-llvm --enable-llvm-shared-libs   \
58                           --with-llvm-prefix=$LLVM_ROOT_DIR                 \
59                           --with-gallium-drivers=swrast,swr                 \
60                           --disable-dri --with-dri-drivers=                 \
61                           --disable-egl --with-egl-platforms= --disable-gbm \
62                           --enable-glx=gallium-xlib                         \
63                           --disable-osmesa --enable-gallium-osmesa \
64                           PYTHON2=${PYTHON_ROOT_DIR}/bin/python
65 fi
66     
67 if [ $? -ne 0 ]
68 then
69     echo "ERROR on configure"
70     exit 1
71 fi
72
73 echo
74 echo "*** make" $MAKE_OPTIONS
75 make -j8 $MAKE_OPTIONS
76 if [ $? -ne 0 ]
77 then
78     echo "ERROR on make"
79     exit 2
80 fi
81
82 echo
83 echo "*** make install"
84 make install
85 if [ $? -ne 0 ]
86 then
87     echo "ERROR on make install"
88     exit 3
89 fi
90
91 echo
92 echo "########## END"
93