Statistics
| Branch: | Revision:

ffmpeg / configure @ 12043e1d

History | View | Annotate | Download (32.4 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)
119
    cpu="sparc64"
120
  ;;
121
  sh4)
122
    cpu="sh4"
123
  ;;
124
  *)
125
    cpu="unknown"
126
  ;;
127
esac
128
gprof="no"
129
v4l="yes"
130
audio_oss="yes"
131
audio_beos="no"
132
dv1394="yes"
133
network="yes"
134
zlib="yes"
135
mp3lame="no"
136
vorbis="no"
137
faad="no"
138
faadbin="no"
139
faac="no"
140
a52="no"
141
a52bin="no"
142
pp="no"
143
shared_pp="no"
144
mingw32="no"
145
cygwin="no"
146
os2="no"
147
lshared="no"
148
optimize="yes"
149
debug="yes"
150
extralibs="-lm"
151
simpleidct="yes"
152
bigendian="no"
153
inttypes="yes"
154
emu_fast_int="no"
155
vhook="default"
156
dlfcn="no"
157
dlopen="no"
158
mpegaudio_hp="yes"
159
SHFLAGS=-shared
160
netserver="no"
161
need_inet_aton="no"
162
ffserver="yes"
163
ffplay="yes"
164
LDFLAGS=-Wl,--warn-common
165
FFSLDFLAGS=-Wl,-E
166
LIBPREF="lib"
167
LIBSUF=".a"
168
SLIBPREF="lib"
169
SLIBSUF=".so"
170
EXESUF=""
171
risky="yes"
172
amr_nb="no"
173
amr_wb="no"
174
amr_nb_fixed="no"
175
sunmlib="no"
176
pthreads="no"
177
gpl="no"
178

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

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

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

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

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

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

    
467
    if test "$fail" = "yes"; then
468
        exit 1
469
    fi
470
fi
471

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

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

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

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

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

    
587
# See if we have <altivec.h>
588
cat > $TMPC << EOF
589
#include <altivec.h>
590
int main( void ) { return 0; }
591
EOF
592

    
593
_altivec_h="no"
594
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
595
_altivec_h="yes"
596
fi
597

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

    
621
# Can only do mmi on mips
622
if test $mmi = "default"; then
623
    if test $cpu = "mips"; then
624
        mmi="yes"
625
    else
626
        mmi="no"
627
    fi
628
fi
629

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

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

    
656
cc="${cross_prefix}${cc}"
657
ar="${cross_prefix}${ar}"
658
ranlib="${cross_prefix}${ranlib}"
659
strip="${cross_prefix}${strip}"
660

    
661
if test -z "$cross_prefix" ; then
662

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

    
673
if $cc -o $TMPE $TMPC 2>/dev/null ; then
674
$TMPE && bigendian="yes"
675
else
676
echo big/little test failed
677
fi
678

    
679
else
680

    
681
# if cross compiling, cannot launch a program, so make a static guess
682
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
683
    bigendian="yes"
684
fi
685

    
686
fi
687

    
688
# ---
689
# *inttypes.h* test
690
cat > $TMPC << EOF
691
#include <inttypes.h>
692
int main(int argc, char ** argv){
693
    return 0;
694
}
695
EOF
696

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

    
699
# ---
700
# *int_fast* test
701
cat > $TMPC << EOF
702
#include <inttypes.h>
703
int main(int argc, char ** argv){
704
	volatile uint_fast64_t i=0x01234567;
705
	return 0;
706
}
707
EOF
708

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

    
711
# ---
712
# check availability of some header files
713

    
714
cat > $TMPC << EOF
715
#include <malloc.h>
716
int main( void ) { return 0; }
717
EOF
718

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

    
736
cat > $TMPC << EOF
737
#include <time.h>
738
int main( void ) { localtime_r(NULL, NULL); }
739
EOF
740

    
741
localtime_r=no
742
if $cc -o $TMPE $TMPC 2> /dev/null ; then
743
  localtime_r=yes
744
fi
745

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

    
765
# test for lrintf in math.h
766
cat > $TMPC << EOF
767
#define _ISOC9X_SOURCE  1
768
#include <math.h>
769
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
770
EOF
771

    
772
have_lrintf="no"
773
if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
774
  have_lrintf="yes"
775
  $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
776
fi
777

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

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

    
799
builtin_vector=no
800
if $cc -o $TMPO $TMPC 2> /dev/null ; then
801
  builtin_vector=yes
802
fi
803

    
804
# dlopen/dlfcn.h probing
805

    
806
cat > $TMPC << EOF
807
#include <dlfcn.h>
808
int main( void ) { return (int) dlopen("foo", 0); }
809
EOF
810

    
811
ldl=-ldl
812

    
813
if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
814
dlfcn=yes
815
dlopen=yes
816
fi
817

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

    
824
cat > $TMPC << EOF
825
int main( void ) { return (int) dlopen("foo", 0); }
826
EOF
827

    
828
if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1  ; then
829
dlopen=yes
830
fi
831

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

    
837
if test "$vhook" = "default" ; then
838
  vhook="$dlopen"
839
fi
840

    
841
##########################################
842
# imlib probe
843

    
844
cat > $TMPC << EOF
845
#include <X11/Xlib.h>
846
#include <Imlib2.h>
847
int main( void ) { return (int) imlib_load_font("foo"); }
848
EOF
849

    
850
imlib2=no
851
if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1  ; then
852
imlib2=yes
853
fi
854

    
855
##########################################
856
# freetype probe
857

    
858
cat > $TMPC << EOF
859
#include <ft2build.h>
860
int main( void ) { return (int) FT_Init_FreeType(0); }
861
EOF
862

    
863
freetype2=no
864
if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
865
  if test "`which freetype-config`" != ""; then
866
    if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  > /dev/null 2>&1 ; then
867
      freetype2=yes
868
    fi
869
  fi
870
fi
871

    
872
##########################################
873
# SDL probe
874

    
875
cat > $TMPC << EOF
876
#include <SDL.h>
877
#undef main /* We don't want SDL to override our main() */
878
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
879
EOF
880

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

    
892
case "`$cc -v 2>&1 | grep version`" in
893
    *gcc*)
894
	CFLAGS="-Wall $CFLAGS"
895
	;;
896
    *)
897
	;;
898
esac
899

    
900
if test "$sdl" = "no" ; then
901
   ffplay=no
902
fi
903

    
904
if test "$debug" = "yes"; then
905
	CFLAGS="-g $CFLAGS"
906
fi
907

    
908
if test "$optimize" = "small"; then
909
#  CFLAGS=${CFLAGS//-O3/-Os}
910
  CFLAGS="$CFLAGS -Os"
911
fi
912

    
913
if test "$optimize" = "yes"; then
914
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
915
	CFLAGS="$CFLAGS -O5"
916
	LDFLAGS="$LDFLAGS -O5"
917
    else
918
	CFLAGS="-O3 $CFLAGS"
919
    fi
920
fi
921

    
922
if test x"$bindir" = x""; then
923
bindir="${prefix}/bin"
924
fi
925

    
926
if test x"$mandir" = x""; then
927
mandir="${prefix}/man"
928
fi
929

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

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

    
983
echo "Creating config.mak and config.h"
984

    
985
echo "# Automatically generated by configure - do not modify" > config.mak
986
echo "/* Automatically generated by configure - do not modify */" > $TMPH
987

    
988
echo "prefix=$prefix" >> config.mak
989
echo "bindir=$bindir" >> config.mak
990
echo "mandir=$mandir" >> config.mak
991
echo "MAKE=$make" >> config.mak
992
echo "CC=$cc" >> config.mak
993
echo "AR=$ar" >> config.mak
994
echo "RANLIB=$ranlib" >> config.mak
995
echo "STRIP=$strip" >> config.mak
996

    
997
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic.  Used when building 
998
# shared modules on OS/X (vhook/Makefile).
999
SHCFLAGS=$CFLAGS
1000
if test "$needmdynamicnopic" = yes; then
1001
   CFLAGS="$CFLAGS -mdynamic-no-pic"
1002
fi
1003

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

    
1125
# if you do not want to use decoders, disable that.
1126
echo "#define CONFIG_DECODERS 1" >> $TMPH
1127
echo "CONFIG_DECODERS=yes" >> config.mak
1128

    
1129
# AC3
1130
if test "$a52" = "yes" ; then
1131
  echo "#define CONFIG_AC3 1" >> $TMPH
1132
  echo "CONFIG_AC3=yes" >> config.mak
1133

    
1134
  if test "$a52bin" = "yes" ; then
1135
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1136
    echo "CONFIG_A52BIN=yes" >> config.mak
1137
  fi
1138
fi
1139

    
1140
# PP
1141
if test "$pp" = "yes" ; then
1142
  echo "#define CONFIG_PP 1" >> $TMPH
1143
  echo "CONFIG_PP=yes" >> config.mak
1144

    
1145
  if test "$shared_pp" = "yes" ; then
1146
    echo "#define SHARED_PP 1" >> $TMPH
1147
    echo "SHARED_PP=yes" >> config.mak
1148
  fi
1149
fi
1150

    
1151
# mpeg audio high precision mode
1152
if test "$mpegaudio_hp" = "yes" ; then
1153
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1154
fi
1155

    
1156
if test "$v4l" = "yes" ; then
1157
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1158
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1159
fi
1160

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

    
1166
if test "$dlopen" = "yes" ; then
1167
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1168
fi
1169

    
1170
if test "$dlfcn" = "yes" ; then
1171
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1172
fi
1173

    
1174
if test "$audio_oss" = "yes" ; then
1175
  echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1176
  echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1177
fi
1178

    
1179
if test "$audio_beos" = "yes" ; then
1180
  echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1181
  echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1182
fi
1183

    
1184
if test "$network" = "yes" ; then
1185
  echo "#define CONFIG_NETWORK 1" >> $TMPH
1186
  echo "CONFIG_NETWORK=yes" >> config.mak
1187
fi
1188

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

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

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

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

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

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

    
1219
if test "$mingw32" = "yes" ; then
1220
  echo "#define CONFIG_WIN32 1" >> $TMPH
1221
  echo "CONFIG_WIN32=yes" >> config.mak
1222
  echo "HAVE_W32THREADS=yes" >> config.mak
1223
  echo "#define HAVE_W32THREADS 1" >> $TMPH
1224
  echo "#ifndef __MINGW32__" >> $TMPH
1225
  echo "#define __MINGW32__ 1" >> $TMPH
1226
  echo "#endif" >> $TMPH
1227
fi
1228

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

    
1234
if test "$TARGET_OS" = "SunOS" ; then
1235
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1236
fi
1237

    
1238
if test "$darwin" = "yes"; then
1239
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
1240
  echo "CONFIG_DARWIN=yes" >> config.mak
1241
fi
1242

    
1243
if test "$_malloc_h" = "yes" ; then
1244
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1245
else
1246
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1247
fi
1248

    
1249
if test "$_memalign" = "yes" ; then
1250
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1251
else
1252
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1253
fi
1254

    
1255
if test "$netserver" = "yes" ; then
1256
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1257
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1258
fi
1259

    
1260
if test "$need_inet_aton" = "yes" ; then
1261
  echo "NEED_INET_ATON=yes" >> config.mak
1262
fi
1263

    
1264
if test "$simpleidct" = "yes" ; then
1265
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1266
fi
1267

    
1268
if test "$ffserver" = "yes" ; then
1269
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1270
  echo "CONFIG_FFSERVER=yes" >> config.mak
1271
fi
1272

    
1273
if test "$ffplay" = "yes" ; then
1274
  echo "CONFIG_FFPLAY=yes" >> config.mak
1275
fi
1276

    
1277
if test "$risky" = "yes" ; then
1278
  echo "#define CONFIG_RISKY 1" >> $TMPH
1279
  echo "CONFIG_RISKY=yes" >> config.mak
1280
fi
1281

    
1282
if test "$gpl" = "yes" ; then
1283
  echo "#define CONFIG_GPL 1" >> $TMPH
1284
  echo "CONFIG_GPL=yes" >> config.mak
1285
fi
1286

    
1287
echo "#define restrict $_restrict" >> $TMPH
1288

    
1289
# build tree in object directory if source path is different from current one
1290
if test "$source_path_used" = "yes" ; then
1291
    DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1292
          libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1293
    FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1294
    for dir in $DIRS ; do
1295
            mkdir -p $dir
1296
    done
1297
    for f in $FILES ; do
1298
        ln -sf $source_path/$f $f
1299
    done
1300
fi
1301
echo "SRC_PATH=$source_path" >> config.mak
1302

    
1303
if test "$amr_wb" = "yes" ; then
1304
  echo "#define AMR_WB 1" >> $TMPH
1305
  echo "AMR_WB=yes" >> config.mak
1306
  echo
1307
  echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1308
  echo "V5.1.0 from "
1309
  echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1310
  echo "and extracted the source to libavcodec/amrwb_float"
1311
  echo
1312
fi
1313

    
1314
if test "$amr_nb" = "yes" ; then
1315
  echo "#define AMR_NB 1" >> $TMPH
1316
  echo "AMR_NB=yes" >> config.mak
1317
  echo
1318
if test "$amr_nb_fixed" = "yes" ; then
1319
  echo "AMR_NB_FIXED=yes" >> config.mak
1320
  echo "#define AMR_NB_FIXED 1" >> $TMPH
1321
  echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1322
  echo "REL-5 version 5.1.0 from "
1323
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1324
  echo "and extracted src to libavcodec/amr"
1325
  echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1326
  echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1327
  echo
1328
else
1329
  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1330
  echo "REL-5 V5.1.0 from "
1331
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1332
  echo "and extracted the source to libavcodec/amr_float"
1333
  echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1334
  echo
1335
fi
1336

    
1337
fi
1338

    
1339
diff $TMPH config.h >/dev/null 2>&1
1340
if test $? -ne 0 ; then
1341
	mv -f $TMPH config.h
1342
else
1343
	echo "config.h is unchanged"
1344
fi
1345

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