Commit | Line | Data |
---|---|---|
de6d9b64 | 1 | #!/bin/sh |
0f3cb305 | 2 | # |
5cbcf02c | 3 | # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard |
0f3cb305 FB |
4 | # |
5 | # set temporary file name | |
57514323 | 6 | if test ! -z "$TMPDIR" ; then |
0f3cb305 | 7 | TMPDIR1="${TMPDIR}" |
57514323 | 8 | elif test ! -z "$TEMPDIR" ; then |
0f3cb305 | 9 | TMPDIR1="${TEMPDIR}" |
3d204385 | 10 | else |
0f3cb305 | 11 | TMPDIR1="/tmp" |
3d204385 NK |
12 | fi |
13 | ||
0f3cb305 FB |
14 | TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c" |
15 | TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o" | |
16 | TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S" | |
17 | TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h" | |
18 | ||
de6d9b64 FB |
19 | # default parameters |
20 | prefix="/usr/local" | |
0f3cb305 | 21 | cross_prefix="" |
de6d9b64 FB |
22 | cc="gcc" |
23 | ar="ar" | |
be7109c1 | 24 | ranlib="ranlib" |
4a908fbc | 25 | make="make" |
0f3cb305 | 26 | strip="strip" |
de6d9b64 | 27 | cpu=`uname -m` |
0f3cb305 | 28 | mmx="default" |
ab6c65f6 | 29 | altivec="default" |
d46aba26 | 30 | mmi="default" |
de6d9b64 | 31 | case "$cpu" in |
ef0bc4c9 | 32 | i386|i486|i586|i686|i86pc|BePC) |
de6d9b64 | 33 | cpu="x86" |
de6d9b64 | 34 | ;; |
6ed7422a FB |
35 | armv4l) |
36 | cpu="armv4l" | |
6ed7422a | 37 | ;; |
91d1f1a4 NK |
38 | alpha) |
39 | cpu="alpha" | |
91d1f1a4 | 40 | ;; |
a43bd1d7 | 41 | "Power Macintosh"|ppc) |
90cee0c3 MN |
42 | cpu="powerpc" |
43 | ;; | |
d46aba26 LS |
44 | mips) |
45 | cpu="mips" | |
46 | ;; | |
de6d9b64 | 47 | *) |
0f3cb305 | 48 | cpu="unknown" |
de6d9b64 FB |
49 | ;; |
50 | esac | |
51 | gprof="no" | |
5cbcf02c FB |
52 | v4l="yes" |
53 | audio_oss="yes" | |
dfdfa47c | 54 | audio_beos="no" |
5cbcf02c | 55 | network="yes" |
0147f198 | 56 | zlib="yes" |
a6741398 | 57 | mp3lame="no" |
81e0d0b4 | 58 | vorbis="no" |
5cbcf02c | 59 | a52="yes" |
57514323 | 60 | a52bin="no" |
daf8e955 | 61 | win32="no" |
732d9245 | 62 | mingw32="no" |
3f027ca7 | 63 | cygwin="no" |
83286d2a | 64 | lshared="no" |
ef0bc4c9 | 65 | extralibs="-lm" |
c02dbee1 | 66 | simpleidct="yes" |
0f3cb305 | 67 | bigendian="no" |
68892110 | 68 | vhook="no" |
adbc0510 PG |
69 | dlfcn="no" |
70 | dlopen="no" | |
1eb2212e | 71 | mpegaudio_hp="yes" |
e1707f52 | 72 | SHFLAGS=-shared |
26b35efb | 73 | netserver="no" |
4baca069 | 74 | need_inet_aton="no" |
8154d2e0 | 75 | ffserver="yes" |
4baca069 PG |
76 | LDFLAGS=-Wl,--warn-common |
77 | FFSLDFLAGS=-Wl,-E | |
ef0bc4c9 FR |
78 | |
79 | # OS specific | |
80 | targetos=`uname -s` | |
81 | case $targetos in | |
82 | BeOS) | |
83 | prefix="/boot/home/config" | |
84 | # helps building libavcodec | |
e1707f52 | 85 | CFLAGS="-O3 -DPIC -fomit-frame-pointer" |
31ba0b4d FR |
86 | # 3 gcc releases known for BeOS, each with ugly bugs |
87 | gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)" | |
88 | case "$gcc_version" in | |
89 | 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc" | |
90 | mmx="no" | |
91 | ;; | |
92 | *20010315*) echo "BeBits gcc" | |
93 | CFLAGS="$CFLAGS -fno-expensive-optimizations" | |
94 | ;; | |
95 | esac | |
e1707f52 MN |
96 | SHFLAGS=-nostart |
97 | # disable linux things | |
98 | audio_oss="no" | |
5cbcf02c | 99 | v4l="no" |
dfdfa47c FR |
100 | # enable beos things |
101 | audio_beos="yes" | |
ef0bc4c9 FR |
102 | # no need for libm, but the inet stuff |
103 | # Check for BONE | |
104 | if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then | |
105 | extralibs="-lbind -lsocket" | |
106 | else | |
26b35efb | 107 | netserver="yes" |
4baca069 | 108 | need_inet_aton="yes" |
26b35efb | 109 | extralibs="-lnet" |
ef0bc4c9 | 110 | fi ;; |
4baca069 PG |
111 | SunOS) |
112 | v4l="no" | |
113 | audio_oss="no" | |
114 | make="gmake" | |
115 | LDFLAGS="" | |
116 | FFSLDFLAGS="" | |
117 | need_inet_aton="yes" | |
118 | extralibs="$extralibs -lsocket -lnsl" | |
119 | ;; | |
9c938e77 PG |
120 | FreeBSD) |
121 | v4l="no" | |
122 | audio_oss="yes" | |
123 | make="gmake" | |
4baca069 | 124 | LDFLAGS="$LDFLAGS -export-dynamic" |
9c938e77 | 125 | ;; |
4a908fbc | 126 | BSD/OS) |
5cbcf02c | 127 | v4l="no" |
6063bce7 | 128 | audio_oss="yes" |
4a908fbc AB |
129 | extralibs="-lpoll -lgnugetopt -lm" |
130 | make="gmake" | |
131 | ;; | |
90cee0c3 | 132 | Darwin) |
a43bd1d7 | 133 | cc="cc" |
90cee0c3 MN |
134 | v4l="no" |
135 | audio_oss="no" | |
a43bd1d7 | 136 | SHFLAGS="-dynamiclib" |
90cee0c3 | 137 | extralibs="" |
a43bd1d7 | 138 | darwin="yes" |
47930f09 | 139 | strip="strip -x" |
6207ba95 | 140 | LDFLAGS="-d" |
4baca069 PG |
141 | FFSLDFLAGS=-Wl,-bind_at_load |
142 | gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f4-)" | |
143 | case "$gcc_version" in | |
144 | *2.95*) | |
145 | CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer" | |
146 | ;; | |
147 | *) | |
148 | CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic" | |
149 | ;; | |
150 | esac | |
90cee0c3 | 151 | ;; |
732d9245 BE |
152 | MINGW32*) |
153 | v4l="no" | |
154 | audio_oss="no" | |
155 | ffserver="no" | |
156 | network="no" | |
157 | mingw32="yes" | |
158 | ;; | |
3f027ca7 FB |
159 | CYGWIN*) |
160 | v4l="no" | |
161 | audio_oss="yes" | |
162 | extralibs="" | |
163 | cygwin="yes" | |
164 | test -f /usr/include/inttypes.h || \ | |
165 | test -f /usr/local/include/inttypes.h || \ | |
166 | echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \ | |
167 | "/usr/include/inttypes.h !!!" | |
168 | ;; | |
b55e4ef4 | 169 | Linux) |
4baca069 | 170 | LDFLAGS="$LDFLAGS -rdynamic" |
b55e4ef4 | 171 | ;; |
ef0bc4c9 FR |
172 | *) ;; |
173 | esac | |
de6d9b64 | 174 | |
0f3cb305 FB |
175 | # find source path |
176 | # XXX: we assume an absolute path is given when launching configure, | |
177 | # except in './configure' case. | |
178 | source_path=${0%configure} | |
179 | source_path=${source_path%/} | |
180 | source_path_used="yes" | |
181 | if test -z "$source_path" -o "$source_path" = "." ; then | |
182 | source_path=`pwd` | |
183 | source_path_used="no" | |
de6d9b64 FB |
184 | fi |
185 | ||
68892110 PG |
186 | cat > $TMPC << EOF |
187 | #include <dlfcn.h> | |
188 | int main( void ) { return (int) dlopen("foo", 0); } | |
189 | EOF | |
190 | ||
9c938e77 PG |
191 | ldl=-ldl |
192 | ||
68892110 | 193 | if $cc -o $TMPO $TMPC -ldl 2> /dev/null ; then |
47930f09 | 194 | vhook=yes |
adbc0510 PG |
195 | dlfcn=yes |
196 | dlopen=yes | |
68892110 PG |
197 | fi |
198 | ||
9c938e77 PG |
199 | if $cc -o $TMPO $TMPC 2> /dev/null ; then |
200 | vhook=yes | |
adbc0510 PG |
201 | dlfcn=yes |
202 | dlopen=yes | |
9c938e77 PG |
203 | ldl="" |
204 | fi | |
205 | ||
68892110 | 206 | cat > $TMPC << EOF |
adbc0510 PG |
207 | int main( void ) { return (int) dlopen("foo", 0); } |
208 | EOF | |
209 | ||
210 | if $cc -o $TMPO $TMPC -ldl 2> /dev/null ; then | |
211 | vhook=yes | |
212 | dlopen=yes | |
213 | fi | |
214 | ||
215 | if $cc -o $TMPO $TMPC 2> /dev/null ; then | |
216 | vhook=yes | |
217 | dlopen=yes | |
218 | ldl="" | |
219 | fi | |
220 | ||
221 | ||
222 | cat > $TMPC << EOF | |
68892110 PG |
223 | #include <X11/Xlib.h> |
224 | #include <Imlib2.h> | |
225 | int main( void ) { return (int) imlib_load_font("foo"); } | |
226 | EOF | |
227 | ||
228 | imlib2=no | |
229 | if $cc -o $TMPO $TMPC -lImlib2 2> /dev/null ; then | |
230 | imlib2=yes | |
231 | fi | |
232 | ||
de6d9b64 FB |
233 | for opt do |
234 | case "$opt" in | |
235 | --prefix=*) prefix=`echo $opt | cut -d '=' -f 2` | |
236 | ;; | |
0f3cb305 FB |
237 | --source-path=*) source_path=`echo $opt | cut -d '=' -f 2` |
238 | ;; | |
239 | --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` | |
240 | ;; | |
de6d9b64 FB |
241 | --cc=*) cc=`echo $opt | cut -d '=' -f 2` |
242 | ;; | |
4a908fbc AB |
243 | --make=*) make=`echo $opt | cut -d '=' -f 2` |
244 | ;; | |
0f3cb305 FB |
245 | --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}" |
246 | ;; | |
247 | --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=} | |
248 | ;; | |
249 | --extra-libs=*) extralibs=${opt#--extra-libs=} | |
250 | ;; | |
de6d9b64 FB |
251 | --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` |
252 | ;; | |
253 | --disable-mmx) mmx="no" | |
254 | ;; | |
ab6c65f6 BF |
255 | --disable-altivec) altivec="no" |
256 | ;; | |
de6d9b64 FB |
257 | --enable-gprof) gprof="yes" |
258 | ;; | |
5cbcf02c FB |
259 | --disable-v4l) v4l="no" |
260 | ;; | |
261 | --disable-audio-oss) audio_oss="no" | |
262 | ;; | |
dfdfa47c FR |
263 | --disable-audio-beos) audio_beos="no" |
264 | ;; | |
5cbcf02c FB |
265 | --disable-network) network="no" |
266 | ;; | |
0147f198 FR |
267 | --disable-zlib) zlib="no" |
268 | ;; | |
5cbcf02c | 269 | --disable-a52) a52="no" |
6ed7422a | 270 | ;; |
9c938e77 | 271 | --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs" |
57514323 | 272 | ;; |
a6741398 J |
273 | --enable-mp3lame) mp3lame="yes" |
274 | ;; | |
81e0d0b4 MH |
275 | --enable-vorbis) vorbis="yes" |
276 | ;; | |
68892110 PG |
277 | --disable-vhook) vhook="no" |
278 | ;; | |
c02dbee1 | 279 | --disable-simple_idct) simpleidct="no" |
045ed63f | 280 | ;; |
daf8e955 FB |
281 | --enable-win32) win32="yes" |
282 | ;; | |
732d9245 BE |
283 | --enable-mingw32) mingw32="yes" |
284 | ;; | |
83286d2a | 285 | --enable-shared) lshared="yes" |
0319c531 | 286 | ;; |
1eb2212e FB |
287 | --disable-mpegaudio-hp) mpegaudio_hp="no" |
288 | ;; | |
8154d2e0 FB |
289 | --disable-ffserver) ffserver="no" |
290 | ;; | |
de6d9b64 FB |
291 | esac |
292 | done | |
293 | ||
0f3cb305 FB |
294 | # compute mmx state |
295 | if test $mmx = "default"; then | |
296 | if test $cpu = "x86"; then | |
297 | mmx="yes" | |
298 | else | |
299 | mmx="no" | |
300 | fi | |
301 | fi | |
302 | ||
ab6c65f6 BF |
303 | # Can only do AltiVec on PowerPC |
304 | if test $altivec = "default"; then | |
305 | if test $cpu = "powerpc"; then | |
306 | altivec="yes" | |
307 | else | |
308 | altivec="no" | |
309 | fi | |
310 | fi | |
311 | ||
312 | # See does our compiler support Motorola AltiVec C API | |
313 | if test $altivec = "yes"; then | |
314 | cat > $TMPC << EOF | |
315 | int main(void) { | |
316 | vector signed int v1, v2, v3; | |
317 | v1 = vec_add(v2,v3); | |
318 | return 0; | |
319 | } | |
320 | EOF | |
321 | $cc -o $TMPO $TMPC -faltivec 2> /dev/null || altivec="no" | |
322 | fi | |
323 | ||
d46aba26 LS |
324 | # Can only do mmi on mips |
325 | if test $mmi = "default"; then | |
326 | if test $cpu = "mips"; then | |
327 | mmi="yes" | |
328 | else | |
329 | mmi="no" | |
330 | fi | |
331 | fi | |
332 | ||
333 | # See does our compiler support mmi | |
334 | if test $mmi = "yes"; then | |
335 | cat > $TMPC << EOF | |
336 | int main(void) { | |
337 | __asm__ ("lq \$2, 0(\$2)"); | |
338 | return 0; | |
339 | } | |
340 | EOF | |
341 | $cc -o $TMPO $TMPC 2> /dev/null || mmi="no" | |
342 | fi | |
343 | ||
daf8e955 FB |
344 | # Checking for CFLAGS |
345 | if test -z "$CFLAGS"; then | |
29482cb4 | 346 | CFLAGS="-O3" |
daf8e955 FB |
347 | fi |
348 | ||
57514323 | 349 | if test "$win32" = "yes" ; then |
daf8e955 | 350 | cross_prefix="i386-mingw32msvc-" |
5cbcf02c FB |
351 | v4l="no" |
352 | audio_oss="no" | |
353 | network="no" | |
daf8e955 FB |
354 | fi |
355 | ||
732d9245 BE |
356 | if test "$mingw32" = "yes" ; then |
357 | cross_prefix="" | |
358 | v4l="no" | |
359 | audio_oss="no" | |
360 | network="no" | |
361 | fi | |
362 | ||
0f3cb305 FB |
363 | cc="${cross_prefix}${cc}" |
364 | ar="${cross_prefix}${ar}" | |
be7109c1 | 365 | ranlib="${cross_prefix}${ranlib}" |
0f3cb305 FB |
366 | strip="${cross_prefix}${strip}" |
367 | ||
487a54d7 FB |
368 | if test -z "$cross_prefix" ; then |
369 | ||
3d204385 | 370 | # --- |
a3999908 MN |
371 | # big/little endian test |
372 | cat > $TMPC << EOF | |
373 | #include <inttypes.h> | |
374 | int main(int argc, char ** argv){ | |
375 | volatile uint32_t i=0x01234567; | |
376 | return (*((uint8_t*)(&i))) == 0x67; | |
377 | } | |
378 | EOF | |
379 | ||
380 | if $cc -o $TMPO $TMPC 2>/dev/null ; then | |
381 | $TMPO && bigendian="yes" | |
382 | else | |
383 | echo big/little test failed | |
384 | fi | |
385 | ||
487a54d7 FB |
386 | else |
387 | ||
388 | # if cross compiling, cannot launch a program, so make a static guess | |
389 | if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then | |
390 | bigendian="yes" | |
391 | fi | |
392 | ||
393 | fi | |
394 | ||
a3999908 | 395 | # --- |
3d204385 NK |
396 | # check availability of some header files |
397 | ||
398 | cat > $TMPC << EOF | |
399 | #include <malloc.h> | |
400 | int main( void ) { return 0; } | |
401 | EOF | |
402 | ||
403 | _memalign=no | |
404 | _malloc_h=no | |
405 | if $cc -o $TMPO $TMPC 2> /dev/null ; then | |
406 | _malloc_h=yes | |
407 | _memalign=yes | |
408 | # check for memalign - atmos | |
409 | cat > $TMPC << EOF | |
410 | #include <malloc.h> | |
411 | int main ( void ) { | |
412 | char *string = NULL; | |
413 | string = memalign(64, sizeof(char)); | |
414 | return 0; | |
415 | } | |
416 | EOF | |
417 | $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no | |
418 | fi | |
419 | ||
68892110 PG |
420 | cat > $TMPC << EOF |
421 | #define _GNU_SOURCE | |
422 | #include <time.h> | |
423 | int main( void ) { return *strptime("", "", 0); } | |
424 | EOF | |
425 | ||
426 | strptime=no | |
427 | if $cc -o $TMPO $TMPC 2> /dev/null ; then | |
428 | strptime=yes | |
429 | fi | |
430 | ||
0147f198 FR |
431 | if test "$zlib" = "yes"; then |
432 | # check for zlib - mmu_man | |
433 | cat > $TMPC << EOF | |
434 | #include <zlib.h> | |
435 | int main ( void ) { | |
436 | if (zlibVersion() != ZLIB_VERSION) | |
437 | puts("zlib version differs !!!"); | |
438 | return 1; | |
439 | return 0; | |
440 | } | |
441 | EOF | |
442 | $cc -o $TMPO $TMPC -lz 2> /dev/null || zlib="no" | |
443 | # $TMPO 2> /dev/null > /dev/null || zlib="no" | |
444 | # XXX: more tests needed - runtime test | |
445 | fi | |
446 | if test "$zlib" = "yes"; then | |
447 | extralibs="$extralibs -lz" | |
448 | fi | |
449 | ||
95e2ce4a MN |
450 | # test for lrintf in math.h |
451 | cat > $TMPC << EOF | |
452 | #define _ISOC9X_SOURCE 1 | |
453 | #include <math.h> | |
454 | int main( void ) { return (lrintf(3.999f) > 0)?0:1; } | |
455 | EOF | |
456 | ||
457 | have_lrintf="no" | |
458 | if $cc $extralibs -o $TMPO $TMPC 2> /dev/null ; then | |
459 | have_lrintf="yes" | |
460 | $TMPO 2> /dev/null > /dev/null || have_lrintf="no" | |
461 | fi | |
462 | ||
c13e1abd FH |
463 | _restrict= |
464 | for restrict_keyword in restrict __restrict__ __restrict; do | |
465 | echo "void foo(char * $restrict_keyword p);" > $TMPC | |
466 | if $cc -c -o $TMPO $TMPC 2> /dev/null; then | |
467 | _restrict=$restrict_keyword | |
468 | break; | |
469 | fi | |
470 | done | |
471 | ||
52b41d7f FB |
472 | # test gcc version to see if vector builtins can be used |
473 | # currently only used on i386 for MMX builtins | |
474 | cat > $TMPC << EOF | |
475 | int main(void) { | |
476 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) | |
477 | return 0; | |
478 | #else | |
479 | #error no vector builtins | |
480 | #endif | |
481 | } | |
482 | EOF | |
483 | ||
484 | builtin_vector=no | |
485 | if $cc -o $TMPO $TMPC 2> /dev/null ; then | |
486 | builtin_vector=yes | |
487 | if test "$mmx" = "yes" ; then | |
488 | CFLAGS="$CFLAGS -msse" | |
489 | fi | |
490 | fi | |
491 | ||
6063bce7 | 492 | if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
0f3cb305 FB |
493 | cat << EOF |
494 | ||
495 | Usage: configure [options] | |
496 | Options: [defaults in brackets after descriptions] | |
497 | ||
498 | EOF | |
499 | echo "Standard options:" | |
500 | echo " --help print this message" | |
501 | echo " --prefix=PREFIX install in PREFIX [$prefix]" | |
0f3cb305 | 502 | echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]" |
81e0d0b4 | 503 | echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]" |
0f3cb305 | 504 | echo " --enable-win32 enable win32 cross compile" |
732d9245 | 505 | echo " --enable-mingw32 enable mingw32 native windows compile" |
5cbcf02c | 506 | echo " --disable-a52 disable GPL'ed A52 support [default=no]" |
0f3cb305 FB |
507 | echo " --enable-a52bin open liba52.so.0 at runtime [default=no]" |
508 | echo " --enable-shared build shared libraries [default=no]" | |
509 | echo "" | |
510 | echo "Advanced options (experts only):" | |
511 | echo " --source-path=PATH path of source code [$source_path]" | |
512 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" | |
513 | echo " --cc=CC use C compiler CC [$cc]" | |
4a908fbc | 514 | echo " --make=MAKE use specified make [$make]" |
0f3cb305 FB |
515 | echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]" |
516 | echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]" | |
517 | echo " --extra-libs=ELIBS add ELIBS [$ELIBS]" | |
518 | echo " --cpu=CPU force cpu to CPU [$cpu]" | |
519 | echo " --disable-mmx disable mmx usage" | |
ab6c65f6 | 520 | echo " --disable-altivec disable AltiVec usage" |
5cbcf02c | 521 | echo " --disable-audio-oss disable OSS audio support [default=no]" |
dfdfa47c | 522 | echo " --disable-audio-beos disable BeOS audio support [default=no]" |
6063bce7 | 523 | echo " --disable-v4l disable video4linux grabbing [default=no]" |
5cbcf02c | 524 | echo " --disable-network disable network support [default=no]" |
0147f198 | 525 | echo " --disable-zlib disable zlib [default=no]" |
5cbcf02c | 526 | echo " --disable-simple_idct disable simple IDCT routines [default=no]" |
47930f09 | 527 | echo " --disable-vhook disable video hooking support" |
0f3cb305 | 528 | echo " --enable-gprof enable profiling with gprof [$gprof]" |
1eb2212e FB |
529 | echo " --disable-mpegaudio-hp faster (but less accurate)" |
530 | echo " mpegaudio decoding [default=no]" | |
8154d2e0 | 531 | echo " --disable-ffserver disable ffserver build" |
0f3cb305 FB |
532 | echo "" |
533 | echo "NOTE: The object files are build at the place where configure is launched" | |
534 | exit 1 | |
535 | fi | |
536 | ||
de6d9b64 | 537 | echo "Install prefix $prefix" |
0f3cb305 | 538 | echo "Source path $source_path" |
de6d9b64 | 539 | echo "C compiler $cc" |
4a908fbc | 540 | echo "make $make" |
de6d9b64 | 541 | echo "CPU $cpu" |
0f3cb305 | 542 | echo "Big Endian $bigendian" |
e41e8342 | 543 | if test $cpu = "x86"; then |
de6d9b64 | 544 | echo "MMX enabled $mmx" |
52b41d7f | 545 | echo "Vector Builtins $builtin_vector" |
e41e8342 FB |
546 | fi |
547 | if test $cpu = "mips"; then | |
d46aba26 | 548 | echo "MMI enabled $mmi" |
e41e8342 FB |
549 | fi |
550 | if test $cpu = "powerpc"; then | |
ab6c65f6 | 551 | echo "AltiVec enabled $altivec" |
e41e8342 | 552 | fi |
de6d9b64 | 553 | echo "gprof enabled $gprof" |
0147f198 | 554 | echo "zlib enabled $zlib" |
a6741398 | 555 | echo "mp3lame enabled $mp3lame" |
81e0d0b4 | 556 | echo "vorbis enabled $vorbis" |
5cbcf02c | 557 | echo "a52 support $a52" |
57514323 | 558 | echo "a52 dlopened $a52bin" |
47930f09 | 559 | echo "Video hooking $vhook" |
68892110 PG |
560 | |
561 | if test "$vhook" = "yes" ; then | |
47930f09 | 562 | echo "Imlib2 support $imlib2" |
68892110 | 563 | fi |
de6d9b64 | 564 | |
980fc7b8 | 565 | echo "Creating config.mak and config.h" |
de6d9b64 | 566 | |
980fc7b8 | 567 | echo "# Automatically generated by configure - do not modify" > config.mak |
045ed63f | 568 | echo "/* Automatically generated by configure - do not modify */" > $TMPH |
de6d9b64 | 569 | |
980fc7b8 | 570 | echo "prefix=$prefix" >> config.mak |
4a908fbc | 571 | echo "MAKE=$make" >> config.mak |
980fc7b8 FB |
572 | echo "CC=$cc" >> config.mak |
573 | echo "AR=$ar" >> config.mak | |
be7109c1 | 574 | echo "RANLIB=$ranlib" >> config.mak |
0f3cb305 | 575 | echo "STRIP=$strip" >> config.mak |
a9b3f630 | 576 | echo "OPTFLAGS=$CFLAGS" >> config.mak |
0f3cb305 | 577 | echo "LDFLAGS=$LDFLAGS" >> config.mak |
4baca069 | 578 | echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak |
e1707f52 | 579 | echo "SHFLAGS=$SHFLAGS" >> config.mak |
57514323 | 580 | if test "$cpu" = "x86" ; then |
980fc7b8 | 581 | echo "TARGET_ARCH_X86=yes" >> config.mak |
045ed63f | 582 | echo "#define ARCH_X86 1" >> $TMPH |
0f3cb305 | 583 | elif test "$cpu" = "armv4l" ; then |
6ed7422a | 584 | echo "TARGET_ARCH_ARMV4L=yes" >> config.mak |
045ed63f | 585 | echo "#define ARCH_ARMV4L 1" >> $TMPH |
0f3cb305 | 586 | elif test "$cpu" = "alpha" ; then |
91d1f1a4 | 587 | echo "TARGET_ARCH_ALPHA=yes" >> config.mak |
045ed63f | 588 | echo "#define ARCH_ALPHA 1" >> $TMPH |
35fedfc3 PG |
589 | elif test "$cpu" = "sparc64" ; then |
590 | echo "TARGET_ARCH_SPARC64=yes" >> config.mak | |
591 | echo "#define ARCH_SPARC64 1" >> $TMPH | |
0f3cb305 FB |
592 | elif test "$cpu" = "powerpc" ; then |
593 | echo "TARGET_ARCH_POWERPC=yes" >> config.mak | |
594 | echo "#define ARCH_POWERPC 1" >> $TMPH | |
d46aba26 LS |
595 | elif test "$cpu" = "mips" ; then |
596 | echo "TARGET_ARCH_MIPS=yes" >> config.mak | |
597 | echo "#define ARCH_MIPS 1" >> $TMPH | |
0f3cb305 FB |
598 | fi |
599 | if test "$bigendian" = "yes" ; then | |
600 | echo "WORDS_BIGENDIAN=yes" >> config.mak | |
601 | echo "#define WORDS_BIGENDIAN 1" >> $TMPH | |
91d1f1a4 | 602 | fi |
57514323 | 603 | if test "$mmx" = "yes" ; then |
980fc7b8 | 604 | echo "TARGET_MMX=yes" >> config.mak |
045ed63f | 605 | echo "#define HAVE_MMX 1" >> $TMPH |
de6d9b64 | 606 | fi |
52b41d7f FB |
607 | if test "$builtin_vector" = "yes" ; then |
608 | echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak | |
609 | echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH | |
610 | fi | |
d46aba26 LS |
611 | if test "$mmi" = "yes" ; then |
612 | echo "TARGET_MMI=yes" >> config.mak | |
613 | echo "#define HAVE_MMI 1" >> $TMPH | |
614 | fi | |
ab6c65f6 BF |
615 | if test "$altivec" = "yes" ; then |
616 | echo "TARGET_ALTIVEC=yes" >> config.mak | |
617 | echo "#define HAVE_ALTIVEC 1" >> $TMPH | |
618 | fi | |
57514323 | 619 | if test "$gprof" = "yes" ; then |
980fc7b8 | 620 | echo "TARGET_GPROF=yes" >> config.mak |
045ed63f | 621 | echo "#define HAVE_GPROF 1" >> $TMPH |
de6d9b64 | 622 | fi |
68892110 PG |
623 | if test "$strptime" = "yes" ; then |
624 | echo "#define HAVE_STRPTIME 1" >> $TMPH | |
625 | else | |
626 | echo "BUILD_STRPTIME=yes" >> config.mak | |
627 | fi | |
628 | if test "$imlib2" = "yes" ; then | |
629 | echo "HAVE_IMLIB2=yes" >> config.mak | |
630 | fi | |
95e2ce4a MN |
631 | if test "$have_lrintf" = "yes" ; then |
632 | echo "#define HAVE_LRINTF 1" >> $TMPH | |
633 | fi | |
68892110 PG |
634 | if test "$vhook" = "yes" ; then |
635 | echo "BUILD_VHOOK=yes" >> config.mak | |
636 | echo "#define HAVE_VHOOK 1" >> $TMPH | |
9c938e77 | 637 | extralibs="$extralibs $ldl" |
68892110 | 638 | fi |
57514323 | 639 | if test "$lshared" = "yes" ; then |
0319c531 | 640 | echo "BUILD_SHARED=yes" >> config.mak |
5cbcf02c | 641 | echo "PIC=-fPIC" >> config.mak |
0319c531 | 642 | fi |
ef0bc4c9 | 643 | echo "EXTRALIBS=$extralibs" >> config.mak |
0319c531 | 644 | echo -n "VERSION=" >>config.mak |
0f3cb305 | 645 | head $source_path/VERSION >>config.mak |
0319c531 | 646 | echo "" >>config.mak |
d771bcae | 647 | # if you do not want to use encoders, disable that. |
045ed63f | 648 | echo "#define CONFIG_ENCODERS 1" >> $TMPH |
d771bcae FB |
649 | echo "CONFIG_ENCODERS=yes" >> config.mak |
650 | ||
651 | # if you do not want to use decoders, disable that. | |
045ed63f | 652 | echo "#define CONFIG_DECODERS 1" >> $TMPH |
d771bcae FB |
653 | echo "CONFIG_DECODERS=yes" >> config.mak |
654 | ||
5cbcf02c FB |
655 | # AC3 |
656 | if test "$a52" = "yes" ; then | |
657 | echo "#define CONFIG_AC3 1" >> $TMPH | |
658 | echo "CONFIG_AC3=yes" >> config.mak | |
d771bcae | 659 | |
5cbcf02c FB |
660 | if test "$a52bin" = "yes" ; then |
661 | echo "#define CONFIG_A52BIN 1" >> $TMPH | |
662 | echo "CONFIG_A52BIN=yes" >> config.mak | |
663 | fi | |
664 | fi | |
665 | ||
1eb2212e FB |
666 | # mpeg audio high precision mode |
667 | if test "$mpegaudio_hp" = "yes" ; then | |
668 | echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH | |
669 | fi | |
670 | ||
5cbcf02c FB |
671 | if test "$v4l" = "yes" ; then |
672 | echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH | |
673 | echo "CONFIG_VIDEO4LINUX=yes" >> config.mak | |
674 | fi | |
675 | ||
adbc0510 PG |
676 | if test "$dlopen" = "yes" ; then |
677 | echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH | |
678 | fi | |
679 | ||
680 | if test "$dlfcn" = "yes" ; then | |
681 | echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH | |
682 | fi | |
683 | ||
5cbcf02c FB |
684 | if test "$audio_oss" = "yes" ; then |
685 | echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH | |
686 | echo "CONFIG_AUDIO_OSS=yes" >> config.mak | |
57514323 ZK |
687 | fi |
688 | ||
dfdfa47c FR |
689 | if test "$audio_beos" = "yes" ; then |
690 | echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH | |
691 | echo "CONFIG_AUDIO_BEOS=yes" >> config.mak | |
692 | fi | |
693 | ||
5cbcf02c FB |
694 | if test "$network" = "yes" ; then |
695 | echo "#define CONFIG_NETWORK 1" >> $TMPH | |
696 | echo "CONFIG_NETWORK=yes" >> config.mak | |
6ed7422a | 697 | fi |
daf8e955 | 698 | |
0147f198 FR |
699 | if test "$zlib" = "yes" ; then |
700 | echo "#define CONFIG_ZLIB 1" >> $TMPH | |
701 | echo "CONFIG_ZLIB=yes" >> config.mak | |
702 | fi | |
703 | ||
57514323 | 704 | if test "$mp3lame" = "yes" ; then |
045ed63f | 705 | echo "#define CONFIG_MP3LAME 1" >> $TMPH |
a6741398 J |
706 | echo "CONFIG_MP3LAME=yes" >> config.mak |
707 | fi | |
708 | ||
81e0d0b4 MH |
709 | if test "$vorbis" = "yes" ; then |
710 | echo "#define CONFIG_VORBIS 1" >> $TMPH | |
711 | echo "CONFIG_VORBIS=yes" >> config.mak | |
712 | fi | |
713 | ||
57514323 | 714 | if test "$win32" = "yes" ; then |
045ed63f | 715 | echo "#define CONFIG_WIN32 1" >> $TMPH |
daf8e955 FB |
716 | echo "CONFIG_WIN32=yes" >> config.mak |
717 | fi | |
3d204385 | 718 | |
732d9245 BE |
719 | if test "$mingw32" = "yes" ; then |
720 | echo "#define CONFIG_WIN32 1" >> $TMPH | |
721 | echo "CONFIG_WIN32=yes" >> config.mak | |
722 | echo "#define __MINGW32__ 1" >> $TMPH | |
723 | echo "__MINGW32__=1" >> config.mak | |
724 | fi | |
725 | ||
3f027ca7 FB |
726 | if test "$cygwin" = "yes" ; then |
727 | # setup correct exesuffix | |
728 | echo "CONFIG_WIN32=yes" >> config.mak | |
729 | fi | |
730 | ||
90cee0c3 MN |
731 | if test "$darwin" = "yes"; then |
732 | echo "#define CONFIG_DARWIN 1" >> $TMPH | |
733 | echo "CONFIG_DARWIN=yes" >> config.mak | |
734 | fi | |
735 | ||
57514323 | 736 | if test "$_malloc_h" = "yes" ; then |
045ed63f | 737 | echo "#define HAVE_MALLOC_H 1" >> $TMPH |
3d204385 | 738 | else |
045ed63f | 739 | echo "#undef HAVE_MALLOC_H" >> $TMPH |
3d204385 NK |
740 | fi |
741 | ||
57514323 | 742 | if test "$_memalign" = "yes" ; then |
045ed63f ZK |
743 | echo "#define HAVE_MEMALIGN 1" >> $TMPH |
744 | else | |
745 | echo "#undef HAVE_MEMALIGN" >> $TMPH | |
746 | fi | |
747 | ||
26b35efb FR |
748 | if test "$netserver" = "yes" ; then |
749 | echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH | |
750 | echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak | |
751 | fi | |
752 | ||
4baca069 PG |
753 | if test "$need_inet_aton" = "yes" ; then |
754 | echo "NEED_INET_ATON=yes" >> config.mak | |
755 | fi | |
756 | ||
57514323 | 757 | if test "$simpleidct" = "yes" ; then |
045ed63f ZK |
758 | echo "#define SIMPLE_IDCT 1" >> $TMPH |
759 | fi | |
760 | ||
8154d2e0 FB |
761 | if test "$ffserver" = "yes" ; then |
762 | echo "#define CONFIG_FFSERVER 1" >> $TMPH | |
763 | echo "CONFIG_FFSERVER=yes" >> config.mak | |
764 | fi | |
765 | ||
c13e1abd FH |
766 | echo "#define restrict $_restrict" >> $TMPH |
767 | ||
0f3cb305 FB |
768 | # build tree in object directory if source path is different from current one |
769 | if test "$source_path_used" = "yes" ; then | |
a382b927 FB |
770 | DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \ |
771 | libavcodec/ppc libavcodec/liba52 libavcodec/mlib tests vhook" | |
772 | FILES="Makefile libavformat/Makefile libavcodec/Makefile tests/Makefile vhook/Makefile" | |
0f3cb305 FB |
773 | for dir in $DIRS ; do |
774 | mkdir -p $dir | |
775 | done | |
776 | for f in $FILES ; do | |
777 | ln -sf $source_path/$f $f | |
778 | done | |
779 | fi | |
780 | echo "SRC_PATH=$source_path" >> config.mak | |
781 | ||
a7c02e25 | 782 | diff $TMPH config.h >/dev/null 2>&1 |
045ed63f ZK |
783 | if test $? -ne 0 ; then |
784 | mv -f $TMPH config.h | |
3d204385 | 785 | else |
045ed63f | 786 | echo "config.h is unchanged" |
3d204385 NK |
787 | fi |
788 | ||
045ed63f | 789 | rm -f $TMPO $TMPC $TMPS $TMPH |