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