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