Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.git] / cinelerra-5.1 / configure
1 #!/bin/sh
2
3 if [ $# -gt 0 ]; then
4   if [ "$1" = "static" ]; then
5     STATIC_LIBRARIES=1
6   elif [ "$1" = "shared" ]; then
7     STATIC_LIBRARIES=0
8   else
9     echo usage: "./configure <shared | static>"
10     exit 1
11   fi
12 fi
13
14 ERROR=0
15 if [ -z "$STATIC_LIBRARIES" ]; then
16 STATIC_LIBRARIES=0
17 fi
18
19 # test for nasm
20 OBJDIR=`uname -m`
21 TOPDIR=`pwd`
22
23 if [ $OBJDIR = i686 ]; then
24   if [ ! -x /usr/bin/nasm -a ! -x /usr/local/bin/nasm ]; then
25     echo " *** Nasm is required."; 
26     exit 1
27   fi
28
29 fi
30
31 if [ ! -x /usr/bin/yasm -a ! -x /usr/local/bin/yasm ]; then
32   echo " *** Yasm is required."; 
33   exit 1
34 fi
35
36
37 # test for videodev2.h
38
39 rm -f a.out
40 cat > conftest.c << EOF
41 #include <asm/types.h>
42 #include <sys/time.h>
43 #include <linux/videodev2.h>
44 int main()
45 {
46   return 0;
47 }
48 EOF
49
50 gcc conftest.c > /dev/null 2>&1
51
52 if [ -x a.out ]; then HAVE_VIDEO4LINUX2=y; else HAVE_VIDEO4LINUX2=n; fi
53
54
55 # test for dvb
56
57 rm -f a.out
58 cat > conftest.c << EOF
59 #include <time.h>
60 #include <linux/dvb/dmx.h>
61 #include <linux/dvb/frontend.h>
62 int main()
63 {
64   return 0;
65 }
66 EOF
67
68 gcc conftest.c > /dev/null 2>&1
69
70 if [ -x a.out ]; then HAVE_DVB=y; else HAVE_DVB=n; fi
71
72 rm -f a.out conftest.c
73
74
75 # test for -msse support
76
77 rm -f a.out
78 cat > conftest.c << EOF
79 int main()
80 {
81   return 0;
82 }
83 EOF
84
85 gcc -msse conftest.c > /dev/null 2>&1
86
87 if [ -x a.out ]; then HAVE_GCC=y; else HAVE_GCC=n; fi
88
89 rm -f a.out conftest.c
90
91 if [ $HAVE_GCC = n ]; then
92   echo " *** GCC 3.2.2 or greater is required.  Download it from gcc.gnu.org"; 
93   exit 1
94 fi
95
96
97 # test for OpenGL 2.0
98
99 rm -f a.out
100 cat > conftest.c << EOF
101 #include <GL/gl.h>
102 #include <GL/glext.h>
103 #include <GL/glu.h>
104 int main()
105 {
106   glUseProgram(0);
107   return 0;
108 }
109 EOF
110
111 gcc conftest.c -lGL -lGLU > /dev/null 2>&1
112
113 if [ -x a.out ]; then HAVE_GL=y; else HAVE_GL=n; fi
114
115 rm -f a.out conftest.c
116
117
118 # probe for libraries
119 if [ $STATIC_LIBRARIES = 0 ]; then
120   sed -e "s/^STATIC_LIBRARIES := .*/STATIC_LIBRARIES := n/" -i global_config
121   cd thirdparty && ./configure shared && cd ..
122 else
123   sed -e "s/^STATIC_LIBRARIES := .*/STATIC_LIBRARIES := y/" -i global_config
124   cd thirdparty && ./configure static && cd ..
125 fi
126 if [ $? -ne 0 ]; then
127   echo "Error in thirdparty configuration."
128   exit 1
129 fi
130
131 echo CONFIGURING LIBZMPEG3
132 cd libzmpeg3* && ./configure && cd ..
133 if [ $? -ne 0 ]; then
134   echo "Error in libzmpeg3 configuration."
135   exit 1
136 fi
137
138
139 # success
140 echo "Configured successfully."
141 echo "Type 'make' to build me."
142 echo "If all ok, 'make install'";
143