Statistics
| Branch: | Revision:

ffmpeg / configure @ 7802d373

History | View | Annotate | Download (32.9 KB)

1
#!/bin/sh
2
#
3
# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
4
#
5

    
6
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
7
cat << EOF
8

    
9
Usage: configure [options]
10
Options: [defaults in brackets after descriptions]
11

    
12
EOF
13
echo "Standard options:"
14
echo "  --help                   print this message"
15
echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
16
echo "  --mandir=DIR             man documentation in DIR [PREFIX/man]"
17
echo "  --enable-mp3lame         enable mp3 encoding via libmp3lame [default=no]"
18
echo "  --enable-vorbis          enable vorbis support via libvorbisenc [default=no]"
19
echo "  --enable-faad            enable faad support via libfaad [default=no]"
20
echo "  --enable-faadbin         build faad support with runtime linking [default=no]"
21
echo "  --enable-faac            enable faac support via libfaac [default=no]"
22
echo "  --enable-mingw32         enable mingw32 native/cross windows compile"
23
echo "  --enable-a52             enable GPL'ed A52 support [default=no]"
24
echo "  --enable-a52bin          open liba52.so.0 at runtime [default=no]"
25
echo "  --enable-pp              enable GPL'ed post processing support [default=no]"
26
echo "  --enable-shared-pp       use libpostproc.so [default=no]"
27
echo "  --enable-shared          build shared libraries [default=no]"
28
echo "  --enable-amr_nb          enable amr_nb float audio codec"
29
echo "  --enable-amr_nb-fixed    use fixed point for amr-nb codec"
30
echo "  --enable-amr_wb          enable amr_wb float audio codec"
31
echo "  --enable-sunmlib         use Sun medialib [default=no]"
32
echo "  --enable-pthreads        use pthreads [default=no]"
33
echo "  --enable-gpl             allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
34
echo ""
35
echo "Advanced options (experts only):"
36
echo "  --source-path=PATH       path of source code [$source_path]"
37
echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
38
echo "  --cc=CC                  use C compiler CC [$cc]"
39
echo "  --make=MAKE              use specified make [$make]"
40
echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]"
41
echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
42
echo "  --extra-libs=ELIBS       add ELIBS [$ELIBS]"
43
echo "  --cpu=CPU                force cpu to CPU  [$cpu]"
44
echo "  --tune=PROCESSOR         tune code for a particular CPU (may fails or misperforms on other CPUs)"
45
echo "  --powerpc-perf-enable    enable performance report on PPC (requires enabling PMC)"
46
echo "  --disable-mmx            disable mmx usage"
47
echo "  --disable-altivec        disable AltiVec usage"
48
echo "  --disable-audio-oss      disable OSS audio support [default=no]"
49
echo "  --disable-audio-beos     disable BeOS audio support [default=no]"
50
echo "  --disable-v4l            disable video4linux grabbing [default=no]"
51
echo "  --disable-dv1394         disable DV1394 grabbing [default=no]"
52
echo "  --disable-network        disable network support [default=no]"
53
echo "  --disable-zlib           disable zlib [default=no]"
54
echo "  --disable-simple_idct    disable simple IDCT routines [default=no]"
55
echo "  --disable-vhook          disable video hooking support"
56
echo "  --enable-gprof           enable profiling with gprof [$gprof]"
57
echo "  --disable-debug          disable debugging symbols"
58
echo "  --disable-opts           disable compiler optimizations"
59
echo "  --disable-mpegaudio-hp   faster (but less accurate)"
60
echo "                           mpegaudio decoding [default=no]"
61
echo "  --disable-ffserver       disable ffserver build"
62
echo "  --disable-ffplay         disable ffplay build"
63
echo "  --disable-risky          disables patent encumbered codecs"
64
echo "  --enable-small           optimize for size instead of speed"
65
echo ""
66
echo "NOTE: The object files are build at the place where configure is launched"
67
exit 1
68
fi
69

    
70
# set temporary file name
71
if test ! -z "$TMPDIR" ; then
72
    TMPDIR1="${TMPDIR}"
73
elif test ! -z "$TEMPDIR" ; then
74
    TMPDIR1="${TEMPDIR}"
75
else
76
    TMPDIR1="/tmp"
77
fi
78

    
79
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
80
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
81
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
82
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
83
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
84

    
85
# default parameters
86
prefix="/usr/local"
87
mandir=""
88
bindir=""
89
cross_prefix=""
90
cc="gcc"
91
ar="ar"
92
ranlib="ranlib"
93
make="make"
94
strip="strip"
95
cpu=`uname -m`
96
tune="generic"
97
powerpc_perf="no"
98
mmx="default"
99
altivec="default"
100
mmi="default"
101
case "$cpu" in
102
  i386|i486|i586|i686|i86pc|BePC)
103
    cpu="x86"
104
  ;;
105
  # armv4l is a subset of armv5tel
106
  armv4l|armv5tel)
107
    cpu="armv4l"
108
  ;;
109
  alpha)
110
    cpu="alpha"
111
  ;;
112
  "Power Macintosh"|ppc)
113
    cpu="powerpc"
114
  ;;
115
  mips)
116
    cpu="mips"
117
  ;;
118
  sun4u|sparc64)
119
    cpu="sparc64"
120
  ;;
121
  sparc)
122
    cpu="sparc"
123
  ;;
124
  sh4)
125
    cpu="sh4"
126
  ;;
127
  *)
128
    cpu="unknown"
129
  ;;
130
esac
131
gprof="no"
132
v4l="yes"
133
audio_oss="yes"
134
audio_beos="no"
135
dv1394="yes"
136
network="yes"
137
zlib="yes"
138
mp3lame="no"
139
vorbis="no"
140
faad="no"
141
faadbin="no"
142
faac="no"
143
a52="no"
144
a52bin="no"
145
pp="no"
146
shared_pp="no"
147
mingw32="no"
148
cygwin="no"
149
os2="no"
150
lshared="no"
151
optimize="yes"
152
debug="yes"
153
extralibs="-lm"
154
simpleidct="yes"
155
bigendian="no"
156
inttypes="yes"
157
emu_fast_int="no"
158
vhook="default"
159
dlfcn="no"
160
dlopen="no"
161
mpegaudio_hp="yes"
162
SHFLAGS=-shared
163
netserver="no"
164
need_inet_aton="no"
165
ffserver="yes"
166
ffplay="yes"
167
LDFLAGS=-Wl,--warn-common
168
FFSLDFLAGS=-Wl,-E
169
LIBPREF="lib"
170
LIBSUF=".a"
171
SLIBPREF="lib"
172
SLIBSUF=".so"
173
EXESUF=""
174
risky="yes"
175
amr_nb="no"
176
amr_wb="no"
177
amr_nb_fixed="no"
178
sunmlib="no"
179
pthreads="no"
180
gpl="no"
181

    
182
# OS specific
183
targetos=`uname -s`
184
case $targetos in
185
BeOS)
186
prefix="/boot/home/config"
187
# helps building libavcodec
188
CFLAGS="-DPIC -fomit-frame-pointer"
189
# 3 gcc releases known for BeOS, each with ugly bugs
190
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
191
case "$gcc_version" in
192
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
193
mmx="no"
194
;;
195
*20010315*) echo "BeBits gcc"
196
CFLAGS="$CFLAGS -fno-expensive-optimizations"
197
;;
198
esac
199
SHFLAGS=-nostart
200
# disable linux things
201
audio_oss="no"
202
v4l="no"
203
dv1394="no"
204
# enable beos things
205
audio_beos="yes"
206
# no need for libm, but the inet stuff
207
# Check for BONE
208
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
209
extralibs="-lbind -lsocket"
210
else
211
netserver="yes"
212
need_inet_aton="yes"
213
extralibs="-lnet"
214
fi ;;
215
SunOS)
216
v4l="no"
217
audio_oss="no"
218
dv1394="no"
219
make="gmake"
220
LDFLAGS=""
221
FFSLDFLAGS=""
222
need_inet_aton="yes"
223
extralibs="$extralibs -lsocket -lnsl"
224
;;
225
FreeBSD)
226
v4l="no"
227
audio_oss="yes"
228
dv1394="no"
229
make="gmake"
230
CFLAGS="-pthread"
231
LDFLAGS="$LDFLAGS -export-dynamic -pthread"
232
;;
233
BSD/OS)
234
v4l="no"
235
audio_oss="yes"
236
dv1394="no"
237
extralibs="-lpoll -lgnugetopt -lm"
238
make="gmake"
239
;;
240
Darwin)
241
cc="cc"
242
v4l="no"
243
audio_oss="no"
244
dv1394="no"
245
ffserver="no"
246
SHFLAGS="-dynamiclib"
247
extralibs=""
248
darwin="yes"
249
strip="strip -x"
250
LDFLAGS="-Wl,-d"
251
FFSLDFLAGS=-Wl,-bind_at_load
252
;;
253
MINGW32*)
254
# Note: the rest of the mingw32 config is done afterwards as mingw32
255
# can be forced on command line for linux cross compilation
256
mingw32="yes"
257
;;
258
CYGWIN*)
259
v4l="no"
260
audio_oss="yes"
261
dv1394="no"
262
extralibs=""
263
cygwin="yes"
264
test -f /usr/include/inttypes.h || \
265
test -f /usr/local/include/inttypes.h || \
266
echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
267
     "/usr/include/inttypes.h !!!"
268
;;
269
Linux)
270
LDFLAGS="$LDFLAGS -rdynamic"
271
;;
272
IRIX*)
273
ranlib="echo ignoring ranlib"
274
v4l="no"
275
audio_oss="no"
276
make="gmake"
277
;;
278
OS/2)
279
TMPE=$TMPE".exe"
280
ar="emxomfar -p64"
281
ranlib="echo ignoring ranlib"
282
strip="echo ignoring strip"
283
CFLAGS="-Zomf"
284
LDFLAGS="-Zomf -Zstack 16384 -s"
285
SHFLAGS=""
286
FFSLDFLAGS=""
287
LIBPREF=""
288
LIBSUF=".lib"
289
SLIBPREF=""
290
SLIBSUF=".dll"
291
EXESUF=".exe"
292
extralibs=""
293
v4l="no"
294
audio_oss="no"
295
dv1394="no"
296
network="no"
297
ffserver="no"
298
os2="yes"
299
;;
300
*) ;;
301
esac
302

    
303
# From mplayer configure. We need TARGET_OS available
304
# to the Makefile, so it can distinguish between flavors
305
# of AltiVec on PowerPC
306
TARGET_OS=`( uname -s ) 2>&1`
307
  case "$TARGET_OS" in
308
  Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
309
    ;;
310
  IRIX*)
311
    TARGET_OS=IRIX
312
    ;;
313
  HP-UX*)
314
    TARGET_OS=HP-UX
315
    ;;
316
  [cC][yY][gG][wW][iI][nN]*)
317
    TARGET_OS=CYGWIN
318
    ;;
319
  *)
320
    TARGET_OS="$TARGET_OS-UNKNOWN"
321
    ;;
322
  esac
323

    
324
# find source path
325
# XXX: we assume an absolute path is given when launching configure, 
326
# except in './configure' case.
327
source_path="`echo $0 | sed -e 's#/configure##'`"
328
source_path_used="yes"
329
if test -z "$source_path" -o "$source_path" = "." ; then
330
    source_path=`pwd`
331
    source_path_used="no"
332
fi
333

    
334
for opt do
335
  case "$opt" in
336
  --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
337
  ;;
338
  --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
339
  ;;
340
  --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
341
  ;;
342
  --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
343
  ;;
344
  --cc=*) cc=`echo $opt | cut -d '=' -f 2`
345
  ;;
346
  --make=*) make=`echo $opt | cut -d '=' -f 2`
347
  ;;
348
  --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
349
  ;;
350
  --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
351
  ;;
352
  --extra-libs=*) extralibs=${opt#--extra-libs=}
353
  ;;
354
  --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
355
  ;;
356
  --tune=*) tune=`echo $opt | cut -d '=' -f 2`
357
  ;;
358
  --powerpc-perf-enable) powerpc_perf="yes"
359
  ;;
360
  --disable-mmx) mmx="no"
361
  ;;
362
  --disable-altivec) altivec="no"
363
  ;;
364
  --enable-gprof) gprof="yes"
365
  ;;
366
  --disable-v4l) v4l="no"
367
  ;;
368
  --disable-audio-oss) audio_oss="no"
369
  ;;
370
  --disable-audio-beos) audio_beos="no"
371
  ;;
372
  --disable-dv1394) dv1394="no"
373
  ;;
374
  --disable-network) network="no"
375
  ;;
376
  --disable-zlib) zlib="no"
377
  ;;
378
  --enable-a52) a52="yes"
379
  ;;
380
  --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
381
  ;;
382
  --enable-pp) pp="yes"
383
  ;;
384
  --enable-shared-pp) shared_pp="yes"
385
  ;;
386
  --enable-mp3lame) mp3lame="yes"
387
  ;;
388
  --enable-vorbis) vorbis="yes"
389
  ;;
390
  --enable-faad) faad="yes"
391
  ;;
392
  --enable-faadbin) faadbin="yes"
393
  ;;
394
  --enable-faac) faac="yes"
395
  ;;
396
  --disable-vhook) vhook="no"
397
  ;;
398
  --disable-simple_idct) simpleidct="no"
399
  ;;
400
  --enable-mingw32) mingw32="yes"
401
  ;;
402
  --enable-shared) lshared="yes"
403
  ;;
404
  --disable-debug) debug="no"
405
  ;;
406
  --disable-opts) optimize="no"
407
  ;;
408
  --disable-mpegaudio-hp) mpegaudio_hp="no"
409
  ;;
410
  --disable-ffserver) ffserver="no"
411
  ;;
412
  --disable-ffplay) ffplay="no"
413
  ;;
414
  --disable-risky) risky="no"
415
  ;;
416
  --enable-small) optimize="small"
417
  ;;
418
  --enable-amr_nb) amr_nb="yes"
419
  ;;
420
  --enable-amr_nb-fixed) amr_nb_fixed="yes"
421
  ;;
422
  --enable-amr_wb) amr_wb="yes"
423
  ;; 
424
  --enable-sunmlib) sunmlib="yes"
425
  ;;
426
  --enable-pthreads) pthreads="yes"
427
  ;;
428
  --enable-gpl) gpl="yes"
429
  ;;
430
  esac
431
done
432

    
433
if test "$gpl" != "yes"; then
434
    if test "$pp" != "no" -o "$shared_pp" != "no"; then
435
        echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
436
        fail="yes"
437
    fi
438

    
439
    if test "$a52" != "no" -o "$a52bin" != "no"; then
440
        echo "liba52 is under GPL and --enable-gpl is not specified"
441
        fail="yes"
442
    fi
443
    
444
    if test "$faad" != "no" -o "$faadbin" != "no"; then
445
        cat > $TMPC << EOF
446
            #include <faad.h>
447
            int main( void ) { return 0; }
448
EOF
449
    
450
        if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
451
            cat > $TMPC << EOF
452
                #include <faad.h>
453
                #ifndef FAAD2_VERSION
454
                ok faad1
455
                #endif
456
                int main( void ) { return 0; }
457
EOF
458
            if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
459
                echo "faad2 is under GPL and --enable-gpl is not specified"
460
                fail="yes"
461
            fi
462
        else
463
            faad="no"
464
            faadbin="no"
465
            echo "faad test failed"
466
        fi
467
    fi
468
   
469

    
470
    if test "$fail" = "yes"; then
471
        exit 1
472
    fi
473
fi
474

    
475
# compute mmx state
476
if test $mmx = "default"; then
477
    if test $cpu = "x86"; then
478
        mmx="yes"
479
    else
480
        mmx="no"
481
    fi
482
fi
483

    
484
#Darwin CC versions
485
needmdynamicnopic="no"
486
if test $targetos = Darwin; then
487
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
488
	CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
489
    else
490
	gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
491
	case "$gcc_version" in
492
	    *2.95*) 
493
		CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
494
		;;
495
	    *3.*)
496
		CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
497
		if test "$lshared" = no; then
498
		   needmdynamicnopic="yes"
499
		fi
500
		;;
501
	    *)
502
		CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
503
		if test "$lshared" = no; then
504
		   needmdynamicnopic="yes"
505
		fi
506
		;;
507
	esac
508
    fi
509
fi
510

    
511
# Can only do AltiVec on PowerPC
512
if test $altivec = "default"; then
513
    if test $cpu = "powerpc"; then
514
        altivec="yes"
515
    else
516
        altivec="no"
517
    fi
518
fi
519

    
520
# Add processor-specific flags
521
TUNECPU="generic"
522
POWERPCMODE="32bits"
523
if test $tune != "generic"; then
524
    case $tune in
525
	601|ppc601|PowerPC601)
526
	    CFLAGS="$CFLAGS -mcpu=601"
527
	    if test $altivec = "yes"; then
528
		echo "WARNING: tuning for PPC601 but altivec enabled !";
529
	    fi
530
	    TUNECPU=ppc601
531
	;;
532
	603*|ppc603*|PowerPC603*)
533
	    CFLAGS="$CFLAGS -mcpu=603"
534
	    if test $altivec = "yes"; then
535
		echo "WARNING: tuning for PPC603 but altivec enabled !";
536
	    fi
537
	    TUNECPU=ppc603
538
	;;
539
	604*|ppc604*|PowerPC604*)
540
	    CFLAGS="$CFLAGS -mcpu=604"
541
	    if test $altivec = "yes"; then
542
		echo "WARNING: tuning for PPC604 but altivec enabled !";
543
	    fi
544
	    TUNECPU=ppc604
545
	;;
546
	G3|g3|75*|ppc75*|PowerPC75*)
547
	    CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
548
	    if test $altivec = "yes"; then
549
		echo "WARNING: tuning for PPC75x but altivec enabled !";
550
	    fi
551
	    TUNECPU=ppc750
552
	;;
553
	G4|g4|745*|ppc745*|PowerPC745*)
554
	    CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
555
	    if test $altivec = "no"; then
556
		echo "WARNING: tuning for PPC745x but altivec disabled !";
557
	    fi
558
	    TUNECPU=ppc7450
559
	;;
560
	74*|ppc74*|PowerPC74*)
561
	    CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
562
	    if test $altivec = "no"; then
563
		echo "WARNING: tuning for PPC74xx but altivec disabled !";
564
	    fi
565
	    TUNECPU=ppc7400
566
	;;
567
	G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
568
	    CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
569
	    if test $altivec = "no"; then
570
		echo "WARNING: tuning for PPC970 but altivec disabled !";
571
	    fi
572
	    TUNECPU=ppc970
573
            POWERPCMODE="64bits"
574
	;;
575
	*)
576
	echo "WARNING: unknown CPU "$tune", ignored"
577
	;;
578
    esac
579
fi
580

    
581
# AltiVec flags: The FSF version of GCC differs from the Apple version 
582
if test $cpu = "powerpc"; then
583
    if test $altivec = "yes"; then
584
        if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
585
            CFLAGS="$CFLAGS -faltivec"
586
        else
587
            CFLAGS="$CFLAGS -maltivec -mabi=altivec"
588
        fi
589
    fi
590
fi
591

    
592
# See if we have <altivec.h>
593
cat > $TMPC << EOF
594
#include <altivec.h>
595
int main( void ) { return 0; }
596
EOF
597

    
598
_altivec_h="no"
599
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
600
_altivec_h="yes"
601
fi
602

    
603
# See does our compiler support Motorola AltiVec C API
604
if test $altivec = "yes"; then
605
if test $_altivec_h = "yes"; then
606
cat > $TMPC << EOF
607
#include <altivec.h>
608
int main(void) {
609
    vector signed int v1, v2, v3;
610
    v1 = vec_add(v2,v3);
611
    return 0;
612
}
613
EOF
614
else
615
cat > $TMPC << EOF
616
int main(void) {
617
    vector signed int v1, v2, v3;
618
    v1 = vec_add(v2,v3);
619
    return 0;
620
}
621
EOF
622
fi
623
$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
624
fi
625

    
626
# Can only do mmi on mips
627
if test $mmi = "default"; then
628
    if test $cpu = "mips"; then
629
        mmi="yes"
630
    else
631
        mmi="no"
632
    fi
633
fi
634

    
635
# See does our compiler support mmi
636
if test $mmi = "yes"; then
637
cat > $TMPC << EOF
638
int main(void) {
639
    __asm__ ("lq \$2, 0(\$2)");
640
    return 0;
641
}
642
EOF
643
$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
644
fi
645

    
646
if test "$mingw32" = "yes" ; then
647
    v4l="no"
648
    audio_oss="no"
649
    dv1394="no"
650
    ffserver="no"
651
    network="no"
652
    LIBPREF=""
653
    LIBSUF=".lib"
654
    SLIBPREF=""
655
    SLIBSUF=".dll"
656
    EXESUF=".exe"
657
    prefix="/c/Program Files/FFmpeg"
658
    bindir="$prefix"
659
fi
660

    
661
cc="${cross_prefix}${cc}"
662
ar="${cross_prefix}${ar}"
663
ranlib="${cross_prefix}${ranlib}"
664
strip="${cross_prefix}${strip}"
665

    
666
if test -z "$cross_prefix" ; then
667

    
668
# ---
669
# big/little endian test
670
cat > $TMPC << EOF
671
#include <inttypes.h>
672
int main(int argc, char ** argv){
673
	volatile uint32_t i=0x01234567;
674
	return (*((uint8_t*)(&i))) == 0x67;
675
}
676
EOF
677

    
678
if $cc -o $TMPE $TMPC 2>/dev/null ; then
679
$TMPE && bigendian="yes"
680
else
681
echo big/little test failed
682
fi
683

    
684
else
685

    
686
# if cross compiling, cannot launch a program, so make a static guess
687
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
688
    bigendian="yes"
689
fi
690

    
691
fi
692

    
693
# ---
694
# *inttypes.h* test
695
cat > $TMPC << EOF
696
#include <inttypes.h>
697
int main(int argc, char ** argv){
698
    return 0;
699
}
700
EOF
701

    
702
$cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
703

    
704
# ---
705
# *int_fast* test
706
cat > $TMPC << EOF
707
#include <inttypes.h>
708
int main(int argc, char ** argv){
709
	volatile uint_fast64_t i=0x01234567;
710
	return 0;
711
}
712
EOF
713

    
714
$cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
715

    
716
# ---
717
# check availability of some header files
718

    
719
cat > $TMPC << EOF
720
#include <malloc.h>
721
int main( void ) { return 0; }
722
EOF
723

    
724
_memalign=no
725
_malloc_h=no
726
if $cc -o $TMPE $TMPC 2> /dev/null ; then
727
_malloc_h=yes
728
_memalign=yes
729
# check for memalign - atmos
730
cat > $TMPC << EOF
731
#include <malloc.h>
732
int main ( void ) {
733
char *string = NULL;
734
string = memalign(64, sizeof(char));
735
return 0;
736
}
737
EOF
738
$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
739
fi
740

    
741
cat > $TMPC << EOF
742
#include <time.h>
743
int main( void ) { localtime_r(NULL, NULL); }
744
EOF
745

    
746
localtime_r=no
747
if $cc -o $TMPE $TMPC 2> /dev/null ; then
748
  localtime_r=yes
749
fi
750

    
751
if test "$zlib" = "yes"; then
752
# check for zlib - mmu_man
753
cat > $TMPC << EOF
754
#include <zlib.h>
755
int main ( void ) {
756
if (zlibVersion() != ZLIB_VERSION)
757
   puts("zlib version differs !!!");
758
   return 1;
759
return 0;
760
}
761
EOF
762
$cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
763
# $TMPE 2> /dev/null > /dev/null || zlib="no"
764
# XXX: more tests needed - runtime test
765
fi
766
if test "$zlib" = "yes"; then
767
extralibs="$extralibs -lz"
768
fi
769

    
770
# test for lrintf in math.h
771
cat > $TMPC << EOF
772
#define _ISOC9X_SOURCE  1
773
#include <math.h>
774
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
775
EOF
776

    
777
have_lrintf="no"
778
if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
779
  have_lrintf="yes"
780
  $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
781
fi
782

    
783
_restrict=
784
for restrict_keyword in restrict __restrict__ __restrict; do
785
  echo "void foo(char * $restrict_keyword p);" > $TMPC
786
  if $cc -c -o $TMPO $TMPC 2> /dev/null; then
787
    _restrict=$restrict_keyword
788
    break;
789
  fi
790
done
791

    
792
# test gcc version to see if vector builtins can be used
793
# currently only used on i386 for MMX builtins
794
cat > $TMPC << EOF
795
int main(void) { 
796
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
797
return 0;
798
#else
799
#error no vector builtins
800
#endif
801
}
802
EOF
803

    
804
builtin_vector=no
805
if $cc -o $TMPO $TMPC 2> /dev/null ; then
806
  builtin_vector=yes
807
fi
808

    
809
# dlopen/dlfcn.h probing
810

    
811
cat > $TMPC << EOF
812
#include <dlfcn.h>
813
int main( void ) { return (int) dlopen("foo", 0); }
814
EOF
815

    
816
ldl=-ldl
817

    
818
if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
819
dlfcn=yes
820
dlopen=yes
821
fi
822

    
823
if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
824
dlfcn=yes
825
dlopen=yes
826
ldl=""
827
fi
828

    
829
cat > $TMPC << EOF
830
int main( void ) { return (int) dlopen("foo", 0); }
831
EOF
832

    
833
if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1  ; then
834
dlopen=yes
835
fi
836

    
837
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
838
dlopen=yes
839
ldl=""
840
fi
841

    
842
if test "$vhook" = "default" ; then
843
  vhook="$dlopen"
844
fi
845

    
846
##########################################
847
# imlib probe
848

    
849
cat > $TMPC << EOF
850
#include <X11/Xlib.h>
851
#include <Imlib2.h>
852
int main( void ) { return (int) imlib_load_font("foo"); }
853
EOF
854

    
855
imlib2=no
856
if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1  ; then
857
imlib2=yes
858
fi
859

    
860
##########################################
861
# freetype probe
862

    
863
cat > $TMPC << EOF
864
#include <ft2build.h>
865
int main( void ) { return (int) FT_Init_FreeType(0); }
866
EOF
867

    
868
freetype2=no
869
if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
870
  if test "`which freetype-config`" != ""; then
871
    if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  > /dev/null 2>&1 ; then
872
      freetype2=yes
873
    fi
874
  fi
875
fi
876

    
877
##########################################
878
# SDL probe
879

    
880
cat > $TMPC << EOF
881
#include <SDL.h>
882
#undef main /* We don't want SDL to override our main() */
883
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
884
EOF
885

    
886
sdl_too_old=no
887
sdl=no
888
if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs`  > /dev/null 2>&1  ; then
889
_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
890
if test "$_sdlversion" -lt 121 ; then
891
sdl_too_old=yes
892
else
893
sdl=yes
894
fi
895
fi
896

    
897
case "`$cc -v 2>&1 | grep version`" in
898
    *gcc*)
899
	CFLAGS="-Wall $CFLAGS"
900
	;;
901
    *)
902
	;;
903
esac
904

    
905
if test "$sdl" = "no" ; then
906
   ffplay=no
907
fi
908

    
909
if test "$debug" = "yes"; then
910
	CFLAGS="-g $CFLAGS"
911
fi
912

    
913
if test "$optimize" = "small"; then
914
#  CFLAGS=${CFLAGS//-O3/-Os}
915
  CFLAGS="$CFLAGS -Os"
916
fi
917

    
918
if test "$optimize" = "yes"; then
919
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
920
	CFLAGS="$CFLAGS -O5"
921
	LDFLAGS="$LDFLAGS -O5"
922
    else
923
	CFLAGS="-O3 $CFLAGS"
924
    fi
925
fi
926

    
927
if test x"$bindir" = x""; then
928
bindir="${prefix}/bin"
929
fi
930

    
931
if test x"$mandir" = x""; then
932
mandir="${prefix}/man"
933
fi
934

    
935
echo "Install prefix   $prefix"
936
echo "Source path      $source_path"
937
echo "C compiler       $cc"
938
echo "make             $make"
939
echo "CPU              $cpu ($tune)"
940
echo "Big Endian       $bigendian"
941
echo "inttypes.h       $inttypes"
942
echo "broken inttypes.h $emu_fast_int"
943
if test $cpu = "x86"; then
944
echo "MMX enabled      $mmx"
945
echo "Vector Builtins  $builtin_vector"
946
fi
947
if test $cpu = "mips"; then
948
echo "MMI enabled      $mmi"
949
fi
950
if test $cpu = "powerpc"; then
951
echo "AltiVec enabled  $altivec"
952
fi
953
echo "gprof enabled    $gprof"
954
echo "zlib enabled     $zlib"
955
echo "mp3lame enabled  $mp3lame"
956
echo "vorbis enabled   $vorbis"
957
echo "faad enabled     $faad"
958
echo "faadbin enabled  $faadbin"
959
echo "faac enabled     $faac"
960
echo "a52 support      $a52"
961
echo "a52 dlopened     $a52bin"
962
echo "pp support       $pp"
963
echo "debug symbols    $debug"
964
echo "optimize         $optimize"
965
echo "shared pp        $shared_pp"
966
echo "Video hooking    $vhook"
967
echo "SDL support      $sdl"
968
if test $sdl_too_old = "yes"; then
969
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
970
fi
971
echo "risky / patent encumbered codecs $risky"
972

    
973
if test "$vhook" = "yes" ; then
974
echo "Imlib2 support   $imlib2"
975
echo "freetype support $freetype2"
976
fi
977
echo "Sun medialib support"  $sunmlib
978
echo "pthreads support"      $pthreads
979
echo "AMR-NB float support"  $amr_nb
980
echo "AMR-NB fixed support"  $amr_nb_fixed
981
echo "AMR-WB float support"  $amr_wb
982
if test "$gpl" = "no" ; then
983
echo "License: LGPL"
984
else
985
echo "License: GPL"
986
fi
987

    
988
echo "Creating config.mak and config.h"
989

    
990
echo "# Automatically generated by configure - do not modify" > config.mak
991
echo "/* Automatically generated by configure - do not modify */" > $TMPH
992

    
993
echo "prefix=$prefix" >> config.mak
994
echo "bindir=$bindir" >> config.mak
995
echo "mandir=$mandir" >> config.mak
996
echo "MAKE=$make" >> config.mak
997
echo "CC=$cc" >> config.mak
998
echo "AR=$ar" >> config.mak
999
echo "RANLIB=$ranlib" >> config.mak
1000
echo "STRIP=$strip" >> config.mak
1001

    
1002
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic.  Used when building 
1003
# shared modules on OS/X (vhook/Makefile).
1004
SHCFLAGS=$CFLAGS
1005
if test "$needmdynamicnopic" = yes; then
1006
   CFLAGS="$CFLAGS -mdynamic-no-pic"
1007
fi
1008

    
1009
echo "OPTFLAGS=$CFLAGS" >> config.mak
1010
echo "SHCFLAGS=$SHCFLAGS">>config.mak
1011
echo "LDFLAGS=$LDFLAGS" >> config.mak
1012
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1013
echo "SHFLAGS=$SHFLAGS" >> config.mak
1014
echo "LIBPREF=$LIBPREF" >> config.mak
1015
echo "LIBSUF=$LIBSUF" >> config.mak
1016
echo "SLIBPREF=$SLIBPREF" >> config.mak
1017
echo "SLIBSUF=$SLIBSUF" >> config.mak
1018
echo "EXESUF=$EXESUF" >> config.mak
1019
echo "TARGET_OS=$TARGET_OS" >> config.mak
1020
if test "$cpu" = "x86" ; then
1021
  echo "TARGET_ARCH_X86=yes" >> config.mak
1022
  echo "#define ARCH_X86 1" >> $TMPH
1023
elif test "$cpu" = "armv4l" ; then
1024
  echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1025
  echo "#define ARCH_ARMV4L 1" >> $TMPH
1026
elif test "$cpu" = "alpha" ; then
1027
  echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1028
  echo "#define ARCH_ALPHA 1" >> $TMPH
1029
elif test "$cpu" = "sparc64" ; then
1030
  echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1031
  echo "#define ARCH_SPARC64 1" >> $TMPH
1032
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1033
  echo "#define ARCH_SPARC 1" >> $TMPH
1034
elif test "$cpu" = "sparc" ; then
1035
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1036
  echo "#define ARCH_SPARC 1" >> $TMPH
1037
elif test "$cpu" = "powerpc" ; then
1038
  echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1039
  echo "#define ARCH_POWERPC 1" >> $TMPH
1040
  if test $POWERPCMODE = "32bits"; then
1041
    echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1042
  else
1043
    echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1044
  fi
1045
  if test "$powerpc_perf" = "yes"; then
1046
    echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1047
  fi
1048
elif test "$cpu" = "mips" ; then
1049
  echo "TARGET_ARCH_MIPS=yes" >> config.mak
1050
  echo "#define ARCH_MIPS 1" >> $TMPH
1051
elif test "$cpu" = "sh4" ; then
1052
  echo "TARGET_ARCH_SH4=yes" >> config.mak
1053
  echo "#define ARCH_SH4 1" >> $TMPH
1054
fi
1055
echo "#define TUNECPU $TUNECPU" >> $TMPH
1056
if test "$bigendian" = "yes" ; then
1057
  echo "WORDS_BIGENDIAN=yes" >> config.mak
1058
  echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1059
fi
1060
if test "$inttypes" != "yes" ; then
1061
  echo "#define EMULATE_INTTYPES 1" >> $TMPH
1062
fi
1063
if test "$emu_fast_int" = "yes" ; then
1064
  echo "#define EMULATE_FAST_INT 1" >> $TMPH
1065
fi
1066
if test "$mmx" = "yes" ; then
1067
  echo "TARGET_MMX=yes" >> config.mak
1068
  echo "#define HAVE_MMX 1" >> $TMPH
1069
  echo "#define __CPU__ 586" >> $TMPH
1070
fi
1071
if test "$builtin_vector" = "yes" ; then
1072
  echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1073
  echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1074
fi
1075
if test "$mmi" = "yes" ; then
1076
  echo "TARGET_MMI=yes" >> config.mak
1077
  echo "#define HAVE_MMI 1" >> $TMPH
1078
fi
1079
if test "$altivec" = "yes" ; then
1080
  echo "TARGET_ALTIVEC=yes" >> config.mak
1081
  echo "#define HAVE_ALTIVEC 1" >> $TMPH
1082
  echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1083
  echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1084
  if test "$_altivec_h" = "yes" ; then
1085
    echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1086
  else
1087
    echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1088
  fi
1089
fi
1090
if test "$gprof" = "yes" ; then
1091
  echo "TARGET_GPROF=yes" >> config.mak
1092
  echo "#define HAVE_GPROF 1" >> $TMPH
1093
fi
1094
if test "$localtime_r" = "yes" ; then
1095
  echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1096
fi
1097
if test "$imlib2" = "yes" ; then
1098
  echo "HAVE_IMLIB2=yes" >> config.mak
1099
fi
1100
if test "$freetype2" = "yes" ; then
1101
  echo "HAVE_FREETYPE2=yes" >> config.mak
1102
fi
1103
if test "$sunmlib" = "yes" ; then
1104
  echo "HAVE_MLIB=yes" >> config.mak
1105
  echo "#define HAVE_MLIB 1" >> $TMPH
1106
  extralibs="$extralibs -lmlib"
1107
fi
1108
if test "$pthreads" = "yes" ; then
1109
  echo "HAVE_PTHREADS=yes" >> config.mak
1110
  echo "#define HAVE_PTHREADS 1" >> $TMPH
1111
  if test $targetos != FreeBSD; then
1112
     extralibs="$extralibs -lpthread"
1113
  fi
1114
fi
1115
if test "$sdl" = "yes" ; then
1116
  echo "CONFIG_SDL=yes" >> config.mak
1117
  echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1118
  echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1119
fi
1120
if test "$have_lrintf" = "yes" ; then
1121
  echo "#define HAVE_LRINTF 1" >> $TMPH
1122
fi
1123
if test "$vhook" = "yes" ; then
1124
  echo "BUILD_VHOOK=yes" >> config.mak
1125
  echo "#define HAVE_VHOOK 1" >> $TMPH
1126
  extralibs="$extralibs $ldl"
1127
fi
1128
if test "$lshared" = "yes" ; then
1129
  echo "BUILD_SHARED=yes" >> config.mak
1130
  echo "PIC=-fPIC" >> config.mak
1131
fi
1132
echo "EXTRALIBS=$extralibs" >> config.mak
1133
version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1134
 cut -d '"' -f 2`
1135
echo "VERSION=$version" >>config.mak
1136
# if you do not want to use encoders, disable that.
1137
echo "#define CONFIG_ENCODERS 1" >> $TMPH
1138
echo "CONFIG_ENCODERS=yes" >> config.mak
1139

    
1140
# if you do not want to use decoders, disable that.
1141
echo "#define CONFIG_DECODERS 1" >> $TMPH
1142
echo "CONFIG_DECODERS=yes" >> config.mak
1143

    
1144
# AC3
1145
if test "$a52" = "yes" ; then
1146
  echo "#define CONFIG_AC3 1" >> $TMPH
1147
  echo "CONFIG_AC3=yes" >> config.mak
1148

    
1149
  if test "$a52bin" = "yes" ; then
1150
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1151
    echo "CONFIG_A52BIN=yes" >> config.mak
1152
  fi
1153
fi
1154

    
1155
# PP
1156
if test "$pp" = "yes" ; then
1157
  echo "#define CONFIG_PP 1" >> $TMPH
1158
  echo "CONFIG_PP=yes" >> config.mak
1159

    
1160
  if test "$shared_pp" = "yes" ; then
1161
    echo "#define SHARED_PP 1" >> $TMPH
1162
    echo "SHARED_PP=yes" >> config.mak
1163
  fi
1164
fi
1165

    
1166
# mpeg audio high precision mode
1167
if test "$mpegaudio_hp" = "yes" ; then
1168
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1169
fi
1170

    
1171
if test "$v4l" = "yes" ; then
1172
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1173
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1174
fi
1175

    
1176
if test "$dv1394" = "yes" ; then
1177
  echo "#define CONFIG_DV1394 1" >> $TMPH
1178
  echo "CONFIG_DV1394=yes" >> config.mak
1179
fi
1180

    
1181
if test "$dlopen" = "yes" ; then
1182
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1183
fi
1184

    
1185
if test "$dlfcn" = "yes" ; then
1186
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1187
fi
1188

    
1189
if test "$audio_oss" = "yes" ; then
1190
  echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1191
  echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1192
fi
1193

    
1194
if test "$audio_beos" = "yes" ; then
1195
  echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1196
  echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1197
fi
1198

    
1199
if test "$network" = "yes" ; then
1200
  echo "#define CONFIG_NETWORK 1" >> $TMPH
1201
  echo "CONFIG_NETWORK=yes" >> config.mak
1202
fi
1203

    
1204
if test "$zlib" = "yes" ; then
1205
  echo "#define CONFIG_ZLIB 1" >> $TMPH
1206
  echo "CONFIG_ZLIB=yes" >> config.mak
1207
fi
1208

    
1209
if test "$mp3lame" = "yes" ; then
1210
  echo "#define CONFIG_MP3LAME 1" >> $TMPH
1211
  echo "CONFIG_MP3LAME=yes" >> config.mak
1212
fi
1213

    
1214
if test "$vorbis" = "yes" ; then
1215
  echo "#define CONFIG_VORBIS 1" >> $TMPH
1216
  echo "CONFIG_VORBIS=yes" >> config.mak
1217
fi
1218

    
1219
if test "$faad" = "yes" ; then
1220
  echo "#define CONFIG_FAAD 1" >> $TMPH
1221
  echo "CONFIG_FAAD=yes" >> config.mak
1222
fi
1223

    
1224
if test "$faadbin" = "yes" ; then
1225
  echo "#define CONFIG_FAADBIN 1" >> $TMPH
1226
  echo "CONFIG_FAADBIN=yes" >> config.mak
1227
fi
1228

    
1229
if test "$faac" = "yes" ; then
1230
  echo "#define CONFIG_FAAC 1" >> $TMPH
1231
  echo "CONFIG_FAAC=yes" >> config.mak
1232
fi
1233

    
1234
if test "$mingw32" = "yes" ; then
1235
  echo "#define CONFIG_WIN32 1" >> $TMPH
1236
  echo "CONFIG_WIN32=yes" >> config.mak
1237
  echo "HAVE_W32THREADS=yes" >> config.mak
1238
  echo "#define HAVE_W32THREADS 1" >> $TMPH
1239
  echo "#ifndef __MINGW32__" >> $TMPH
1240
  echo "#define __MINGW32__ 1" >> $TMPH
1241
  echo "#endif" >> $TMPH
1242
fi
1243

    
1244
if test "$os2" = "yes" ; then
1245
  echo "#define CONFIG_OS2 1" >> $TMPH
1246
  echo "CONFIG_OS2=yes" >> config.mak
1247
fi
1248

    
1249
if test "$TARGET_OS" = "SunOS" ; then
1250
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1251
fi
1252

    
1253
if test "$darwin" = "yes"; then
1254
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
1255
  echo "CONFIG_DARWIN=yes" >> config.mak
1256
fi
1257

    
1258
if test "$_malloc_h" = "yes" ; then
1259
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1260
else
1261
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1262
fi
1263

    
1264
if test "$_memalign" = "yes" ; then
1265
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1266
else
1267
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1268
fi
1269

    
1270
if test "$netserver" = "yes" ; then
1271
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1272
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1273
fi
1274

    
1275
if test "$need_inet_aton" = "yes" ; then
1276
  echo "NEED_INET_ATON=yes" >> config.mak
1277
fi
1278

    
1279
if test "$simpleidct" = "yes" ; then
1280
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1281
fi
1282

    
1283
if test "$ffserver" = "yes" ; then
1284
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1285
  echo "CONFIG_FFSERVER=yes" >> config.mak
1286
fi
1287

    
1288
if test "$ffplay" = "yes" ; then
1289
  echo "CONFIG_FFPLAY=yes" >> config.mak
1290
fi
1291

    
1292
if test "$risky" = "yes" ; then
1293
  echo "#define CONFIG_RISKY 1" >> $TMPH
1294
  echo "CONFIG_RISKY=yes" >> config.mak
1295
fi
1296

    
1297
if test "$gpl" = "yes" ; then
1298
  echo "#define CONFIG_GPL 1" >> $TMPH
1299
  echo "CONFIG_GPL=yes" >> config.mak
1300
fi
1301

    
1302
echo "#define restrict $_restrict" >> $TMPH
1303

    
1304
if test "$optimize" = "small"; then
1305
  echo "#define always_inline"  >> $TMPH
1306
fi
1307

    
1308
# build tree in object directory if source path is different from current one
1309
if test "$source_path_used" = "yes" ; then
1310
    DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1311
          libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1312
    FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1313
    for dir in $DIRS ; do
1314
            mkdir -p $dir
1315
    done
1316
    for f in $FILES ; do
1317
        ln -sf $source_path/$f $f
1318
    done
1319
fi
1320
echo "SRC_PATH=$source_path" >> config.mak
1321

    
1322
if test "$amr_wb" = "yes" ; then
1323
  echo "#define AMR_WB 1" >> $TMPH
1324
  echo "AMR_WB=yes" >> config.mak
1325
  echo
1326
  echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1327
  echo "V5.1.0 from "
1328
  echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1329
  echo "and extracted the source to libavcodec/amrwb_float"
1330
  echo
1331
fi
1332

    
1333
if test "$amr_nb" = "yes" ; then
1334
  echo "#define AMR_NB 1" >> $TMPH
1335
  echo "AMR_NB=yes" >> config.mak
1336
  echo
1337
if test "$amr_nb_fixed" = "yes" ; then
1338
  echo "AMR_NB_FIXED=yes" >> config.mak
1339
  echo "#define AMR_NB_FIXED 1" >> $TMPH
1340
  echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1341
  echo "REL-5 version 5.1.0 from "
1342
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1343
  echo "and extracted src to libavcodec/amr"
1344
  echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1345
  echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1346
  echo
1347
else
1348
  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1349
  echo "REL-5 V5.1.0 from "
1350
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1351
  echo "and extracted the source to libavcodec/amr_float"
1352
  echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1353
  echo
1354
fi
1355

    
1356
fi
1357

    
1358
diff $TMPH config.h >/dev/null 2>&1
1359
if test $? -ne 0 ; then
1360
	mv -f $TMPH config.h
1361
else
1362
	echo "config.h is unchanged"
1363
fi
1364

    
1365
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH