2 # configure reset - resets probed config
3 # configure static - build all builtin static libraries
4 # configure shared - build only static libraries needed
6 #edit global_config and set HAVE_var to override probe
8 PROBED="STATIC_LIBRARIES HAVE_VIDEO4LINUX2 HAVE_DVB HAVE_GL"
9 PROBED="$PROBED HAVE_DL HAVE_NUMA HAVE_PACTL"
12 if [ "$1" = "reset" ]; then
14 sed -e "s/^$v := .*/#$v := y/" -i global_config
16 echo "configuration reset"
19 if [ "$1" = "static" ]; then
21 elif [ "$1" = "shared" ]; then
24 echo usage: "./configure <shared | static>"
29 if [ -z "$STATIC_LIBRARIES" ]; then
34 vv=`grep "^$v := .*" global_config`
36 echo "config probe override: $vv"
44 if [ $OBJDIR = i686 ]; then
45 if [ ! -x /usr/bin/nasm -a ! -x /usr/local/bin/nasm ]; then
46 echo " *** Nasm is required.";
52 if [ ! -x /usr/bin/yasm -a ! -x /usr/local/bin/yasm ]; then
53 echo " *** Yasm is required.";
58 # test for videodev2.h
61 cat > conftest.c << EOF
62 #include <asm/types.h>
64 #include <linux/videodev2.h>
71 gcc conftest.c > /dev/null 2>&1
73 if [ -x a.out ]; then HAVE_VIDEO4LINUX2=y; else HAVE_VIDEO4LINUX2=n; fi
79 cat > conftest.c << EOF
81 #include <linux/dvb/dmx.h>
82 #include <linux/dvb/frontend.h>
89 gcc conftest.c > /dev/null 2>&1
91 if [ -x a.out ]; then HAVE_DVB=y; else HAVE_DVB=n; fi
93 rm -f a.out conftest.c
96 # test for -msse support
99 cat > conftest.c << EOF
106 gcc -msse conftest.c > /dev/null 2>&1
108 if [ -x a.out ]; then HAVE_GCC=y; else HAVE_GCC=n; fi
110 rm -f a.out conftest.c
112 if [ $HAVE_GCC = n ]; then
113 echo " *** GCC 3.2.2 or greater is required. Download it from gcc.gnu.org";
118 # test for OpenGL 2.0
121 cat > conftest.c << EOF
123 #include <GL/glext.h>
132 gcc conftest.c -lGL -lGLU > /dev/null 2>&1
134 if [ -x a.out ]; then HAVE_GL=y; else HAVE_GL=n; fi
136 rm -f a.out conftest.c
142 cat > conftest.c << EOF
149 gcc conftest.c -ldl > /dev/null 2>&1
151 if [ -x a.out ]; then HAVE_DL=y; else HAVE_DL=n; fi
153 rm -f a.out conftest.c
159 cat > conftest.c << EOF
166 gcc conftest.c -lnuma > /dev/null 2>&1
168 if [ -x a.out ]; then HAVE_NUMA=y; else HAVE_NUMA=n; fi
170 rm -f a.out conftest.c
172 if pactl --version >& /dev/null; then HAVE_PACTL=y; else HAVE_PACTL=n; fi
174 # update global_config with probe data
177 sed -e "s/^#$v := .*/$v := ${!v}/" -i global_config
180 # configure thirdparty build
183 case "$STATIC_LIBRARIES" in
184 "y") ./configure static ;;
185 "n") ./configure shared ;;
186 *) echo "configuration failed"; exit 1;;
188 if [ $? -ne 0 ]; then
189 echo "Error in thirdparty configuration."
194 # configure libzmpeg3 build
196 echo CONFIGURING LIBZMPEG3
197 cd libzmpeg3* && ./configure && cd ..
198 if [ $? -ne 0 ]; then
199 echo "Error in libzmpeg3 configuration."
205 echo "Configured successfully."
206 echo "Type 'make' to build me."
207 echo "If all ok, 'make install'";