Tizen 2.1 base
[sdk/emulator/qemu.git] / gl / mesa / build.sh
1 #!/bin/sh
2
3 if [ -n "$1" ]; then
4     TARGET_ARCH=$1
5 else
6     TARGET_ARCH=`uname -m`
7 fi;
8
9 if test "$TARGET_ARCH" != "i386" -a "$TARGET_ARCH" != "i486" -a "$TARGET_ARCH" != "i686" -a "$TARGET_ARCH" != "x86_64" -a "$TARGET_ARCH" != "x86" ; then
10     echo "Error! Uknown arch $TARGET_ARCH, supported: [i386|i486|i686|x86|x86_64]"
11     exit 1
12 fi;
13
14 TARGET_OS=`uname -s`
15 if test "$TARGET_ARCH" = "x86_64" ; then
16  TARGET_DIR="x86_64"
17  TARGETLIB_SIZE="--enable-64-bit"
18 else
19  TARGET_DIR="x86"
20  TARGETLIB_SIZE="--enable-32-bit"
21 fi
22
23 case $TARGET_OS in
24 Linux*)
25 make distclean && \
26 ./configure CPPFLAGS="-D_GNU_SOURCE=1" CFLAGS="-U_FORTIFY_SOURCE -fno-stack-protector" CXXFLAGS="-U_FORTIFY_SOURCE -fno-stack-protector" $TARGETLIB_SIZE --enable-shared --disable-glu --enable-opengl --enable-osmesa --disable-gles1 --disable-gles2 --disable-gallium-egl --disable-gallium-gbm --disable-gallium-g3dvl --disable-gallium-llvm --disable-egl --disable-openvg --without-gallium-drivers  --disable-dri --disable-glx --disable-gbm --disable-xvmc --disable-vdpau --disable-va --prefix="`pwd`/../lib/$TARGET_OS/$TARGET_DIR" --includedir="`pwd`/../include" --libdir="\${prefix}" && \
27 make && \
28 make install && \
29 make distclean
30 ;;
31 *)
32 echo "OpenGL acceleration is not currently supported for $TARGET_OS"
33 ;;
34 esac
35