blob: 96f98aaa0b42eeb27f8db4428fd3a31ecdb6ae2f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
#!/bin/sh
TMPC="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
TMPS="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
if test ! -z "$TMPDIR" ; then
TMPC="${TMPDIR}/${TMPC}"
TMPCPP="${TMPDIR}/${TMPCPP}"
TMPO="${TMPDIR}/${TMPO}"
TMPS="${TMPDIR}/${TMPS}"
TMPH="${TMPDIR}/${TMPH}"
elif test ! -z "$TEMPDIR" ; then
TMPC="${TEMPDIR}/${TMPC}"
TMPCPP="${TEMPDIR}/${TMPCPP}"
TMPO="${TEMPDIR}/${TMPO}"
TMPS="${TEMPDIR}/${TMPS}"
TMPH="${TEMPDIR}/${TMPH}"
else
TMPC="/tmp/${TMPC}"
TMPCPP="/tmp/${TMPCPP}"
TMPO="/tmp/${TMPO}"
TMPS="/tmp/${TMPS}"
TMPH="/tmp/${TMPH}"
fi
# default parameters
prefix="/usr/local"
cc="gcc"
ar="ar"
cpu=`uname -m`
case "$cpu" in
i386|i486|i586|i686|i86pc|BePC)
cpu="x86"
mmx="yes"
;;
armv4l)
cpu="armv4l"
mmx="no"
;;
alpha)
cpu="alpha"
mmx="no"
;;
*)
mmx="no"
;;
esac
gprof="no"
grab="yes"
mp3lame="no"
a52bin="no"
win32="no"
lshared="no"
extralibs="-lm"
simpleidct="yes"
# OS specific
targetos=`uname -s`
case $targetos in
BeOS)
prefix="/boot/home/config"
# helps building libavcodec
grab="no"
CFLAGS="-O2 -DPIC"
# no need for libm, but the inet stuff
# Check for BONE
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
extralibs="-lbind -lsocket"
else
echo "Not sure building for net_server will succeed... good luck."
extralibs="-lsocket"
fi ;;
*) ;;
esac
if test "$1" = "-h" -o "$1" = "--help" ; then
cat << EOF
Usage: configure [options]
Options: [defaults in brackets after descriptions]
--help print this message
EOF
echo " --prefix=PREFIX install in PREFIX [$prefix]"
echo " --cc=CC use C compiler CC [$cc]"
echo " --cpu=CPU force cpu to CPU [$cpu]"
echo " --disable-mmx disable mmx usage"
echo " --enable-gprof enable profiling with gprof [$gprof]"
echo " --disable-grab disable audio/video grabbing code"
echo " --disable-simple_idct disable simple IDCT routines [default=no]"
echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
echo " --enable-win32 enable win32 cross compile"
echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
echo " --enable-shared build shared libraries [default=no]"
exit 1
fi
for opt do
case "$opt" in
--prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
;;
--cc=*) cc=`echo $opt | cut -d '=' -f 2`
;;
--cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
;;
--disable-mmx) mmx="no"
;;
--enable-gprof) gprof="yes"
;;
--disable-grab) grab="no"
;;
--enable-a52bin) a52bin="yes" ; extralibs="-ldl $extralibs"
;;
--enable-mp3lame) mp3lame="yes"
;;
--disable-simple_idct) simpleidct="no"
;;
--enable-win32) win32="yes"
;;
--enable-shared) lshared="yes"
;;
esac
done
# Checking for CFLAGS
if test -z "$CFLAGS"; then
CFLAGS="-O2"
fi
if test "$win32" = "yes" ; then
cross_prefix="i386-mingw32msvc-"
cc="${cross_prefix}gcc"
ar="${cross_prefix}ar"
grab="no"
fi
# ---
# check availability of some header files
cat > $TMPC << EOF
#include <malloc.h>
int main( void ) { return 0; }
EOF
_memalign=no
_malloc_h=no
if $cc -o $TMPO $TMPC 2> /dev/null ; then
_malloc_h=yes
_memalign=yes
# check for memalign - atmos
cat > $TMPC << EOF
#include <malloc.h>
int main ( void ) {
char *string = NULL;
string = memalign(64, sizeof(char));
return 0;
}
EOF
$cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
fi
echo "Install prefix $prefix"
echo "C compiler $cc"
echo "CPU $cpu"
echo "MMX enabled $mmx"
echo "gprof enabled $gprof"
echo "grab enabled $grab"
echo "mp3lame enabled $mp3lame"
echo "a52 dlopened $a52bin"
echo "Creating config.mak and config.h"
echo "# Automatically generated by configure - do not modify" > config.mak
echo "/* Automatically generated by configure - do not modify */" > $TMPH
echo "prefix=$prefix" >> config.mak
echo "MAKE=make" >> config.mak
echo "CC=$cc" >> config.mak
echo "AR=$ar" >> config.mak
echo "OPTFLAGS=$CFLAGS" >> config.mak
if test "$cpu" = "x86" ; then
echo "TARGET_ARCH_X86=yes" >> config.mak
echo "#define ARCH_X86 1" >> $TMPH
fi
if test "$cpu" = "armv4l" ; then
echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
echo "#define ARCH_ARMV4L 1" >> $TMPH
fi
if test "$cpu" = "alpha" ; then
echo "TARGET_ARCH_ALPHA=yes" >> config.mak
echo "#define ARCH_ALPHA 1" >> $TMPH
fi
if test "$mmx" = "yes" ; then
echo "TARGET_MMX=yes" >> config.mak
echo "#define HAVE_MMX 1" >> $TMPH
fi
if test "$gprof" = "yes" ; then
echo "TARGET_GPROF=yes" >> config.mak
echo "#define HAVE_GPROF 1" >> $TMPH
fi
if test "$lshared" = "yes" ; then
echo "BUILD_SHARED=yes" >> config.mak
else
echo "BUILD_SHARED=no" >> config.mak
fi
echo "EXTRALIBS=$extralibs" >> config.mak
echo -n "VERSION=" >>config.mak
head VERSION >>config.mak
echo "" >>config.mak
# if you do not want to use encoders, disable that.
echo "#define CONFIG_ENCODERS 1" >> $TMPH
echo "CONFIG_ENCODERS=yes" >> config.mak
# if you do not want to use decoders, disable that.
echo "#define CONFIG_DECODERS 1" >> $TMPH
echo "CONFIG_DECODERS=yes" >> config.mak
# special AC3 stuff in case you already have it
# without libavcodec.
echo "#define CONFIG_AC3 1" >> $TMPH
echo "CONFIG_AC3=yes" >> config.mak
if test "$a52bin" = "yes" ; then
echo "#define CONFIG_A52BIN 1" >> $TMPH
echo "CONFIG_A52BIN=yes" >> config.mak
else
echo "CONFIG_A52BIN=no" >> config.mak
fi
if test "$grab" = "yes" ; then
echo "#define CONFIG_GRAB 1" >> $TMPH
echo "CONFIG_GRAB=yes" >> config.mak
fi
if test "$mp3lame" = "yes" ; then
echo "#define CONFIG_MP3LAME 1" >> $TMPH
echo "CONFIG_MP3LAME=yes" >> config.mak
fi
if test "$win32" = "yes" ; then
echo "#define CONFIG_WIN32 1" >> $TMPH
echo "CONFIG_WIN32=yes" >> config.mak
fi
if test "$_malloc_h" = "yes" ; then
echo "#define HAVE_MALLOC_H 1" >> $TMPH
else
echo "#undef HAVE_MALLOC_H" >> $TMPH
fi
if test "$_memalign" = "yes" ; then
echo "#define HAVE_MEMALIGN 1" >> $TMPH
else
echo "#undef HAVE_MEMALIGN" >> $TMPH
fi
if test "$simpleidct" = "yes" ; then
echo "#define SIMPLE_IDCT 1" >> $TMPH
fi
diff $TMPH config.h >/dev/null 2>&1
if test $? -ne 0 ; then
mv -f $TMPH config.h
else
echo "config.h is unchanged"
fi
rm -f $TMPO $TMPC $TMPS $TMPH
|