Statistics
| Branch: | Revision:

ffmpeg / configure @ b2e3c528

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
LDFLAGS="$LDFLAGS -export-dynamic"
228
;;
229
BSD/OS)
230
v4l="no"
231
audio_oss="yes"
232
dv1394="no"
233
extralibs="-lpoll -lgnugetopt -lm"
234
make="gmake"
235
;;
236
Darwin)
237
cc="cc"
238
v4l="no"
239
audio_oss="no"
240
dv1394="no"
241
ffserver="no"
242
SHFLAGS="-dynamiclib"
243
extralibs=""
244
darwin="yes"
245
strip="strip -x"
246
LDFLAGS="-Wl,-d"
247
FFSLDFLAGS=-Wl,-bind_at_load
248
;;
249
MINGW32*)
250
# Note: the rest of the mingw32 config is done afterwards as mingw32
251
# can be forced on command line for linux cross compilation
252
mingw32="yes"
253
;;
254
CYGWIN*)
255
v4l="no"
256
audio_oss="yes"
257
dv1394="no"
258
extralibs=""
259
cygwin="yes"
260
test -f /usr/include/inttypes.h || \
261
test -f /usr/local/include/inttypes.h || \
262
echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
263
     "/usr/include/inttypes.h !!!"
264
;;
265
Linux)
266
LDFLAGS="$LDFLAGS -rdynamic"
267
;;
268
IRIX*)
269
ranlib="echo ignoring ranlib"
270
v4l="no"
271
audio_oss="no"
272
make="gmake"
273
;;
274
OS/2)
275
TMPE=$TMPE".exe"
276
ar="emxomfar -p64"
277
ranlib="echo ignoring ranlib"
278
strip="echo ignoring strip"
279
CFLAGS="-Zomf"
280
LDFLAGS="-Zomf -Zstack 16384 -s"
281
SHFLAGS=""
282
FFSLDFLAGS=""
283
LIBPREF=""
284
LIBSUF=".lib"
285
SLIBPREF=""
286
SLIBSUF=".dll"
287
EXESUF=".exe"
288
extralibs=""
289
v4l="no"
290
audio_oss="no"
291
dv1394="no"
292
network="no"
293
ffserver="no"
294
os2="yes"
295
;;
296
*) ;;
297
esac
298

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
678
else
679

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

    
685
fi
686

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
803
# dlopen/dlfcn.h probing
804

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

    
810
ldl=-ldl
811

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

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

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

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

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

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

    
840
##########################################
841
# imlib probe
842

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

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

    
854
##########################################
855
# freetype probe
856

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

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

    
871
##########################################
872
# SDL probe
873

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1126
# AC3
1127
if test "$a52" = "yes" ; then
1128
  echo "#define CONFIG_AC3 1" >> $TMPH
1129
  echo "CONFIG_AC3=yes" >> config.mak
1130

    
1131
  if test "$a52bin" = "yes" ; then
1132
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1133
    echo "CONFIG_A52BIN=yes" >> config.mak
1134
  fi
1135
fi
1136

    
1137
# PP
1138
if test "$pp" = "yes" ; then
1139
  echo "#define CONFIG_PP 1" >> $TMPH
1140
  echo "CONFIG_PP=yes" >> config.mak
1141

    
1142
  if test "$shared_pp" = "yes" ; then
1143
    echo "#define SHARED_PP 1" >> $TMPH
1144
    echo "SHARED_PP=yes" >> config.mak
1145
  fi
1146
fi
1147

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

    
1153
if test "$v4l" = "yes" ; then
1154
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1155
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1156
fi
1157

    
1158
if test "$dv1394" = "yes" ; then
1159
  echo "#define CONFIG_DV1394 1" >> $TMPH
1160
  echo "CONFIG_DV1394=yes" >> config.mak
1161
fi
1162

    
1163
if test "$dlopen" = "yes" ; then
1164
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1165
fi
1166

    
1167
if test "$dlfcn" = "yes" ; then
1168
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1169
fi
1170

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

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

    
1181
if test "$network" = "yes" ; then
1182
  echo "#define CONFIG_NETWORK 1" >> $TMPH
1183
  echo "CONFIG_NETWORK=yes" >> config.mak
1184
fi
1185

    
1186
if test "$zlib" = "yes" ; then
1187
  echo "#define CONFIG_ZLIB 1" >> $TMPH
1188
  echo "CONFIG_ZLIB=yes" >> config.mak
1189
fi
1190

    
1191
if test "$mp3lame" = "yes" ; then
1192
  echo "#define CONFIG_MP3LAME 1" >> $TMPH
1193
  echo "CONFIG_MP3LAME=yes" >> config.mak
1194
fi
1195

    
1196
if test "$vorbis" = "yes" ; then
1197
  echo "#define CONFIG_VORBIS 1" >> $TMPH
1198
  echo "CONFIG_VORBIS=yes" >> config.mak
1199
fi
1200

    
1201
if test "$faad" = "yes" ; then
1202
  echo "#define CONFIG_FAAD 1" >> $TMPH
1203
  echo "CONFIG_FAAD=yes" >> config.mak
1204
fi
1205

    
1206
if test "$faadbin" = "yes" ; then
1207
  echo "#define CONFIG_FAADBIN 1" >> $TMPH
1208
  echo "CONFIG_FAADBIN=yes" >> config.mak
1209
fi
1210

    
1211
if test "$faac" = "yes" ; then
1212
  echo "#define CONFIG_FAAC 1" >> $TMPH
1213
  echo "CONFIG_FAAC=yes" >> config.mak
1214
fi
1215

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

    
1226
if test "$os2" = "yes" ; then
1227
  echo "#define CONFIG_OS2 1" >> $TMPH
1228
  echo "CONFIG_OS2=yes" >> config.mak
1229
fi
1230

    
1231
if test "$TARGET_OS" = "SunOS" ; then
1232
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1233
fi
1234

    
1235
if test "$darwin" = "yes"; then
1236
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
1237
  echo "CONFIG_DARWIN=yes" >> config.mak
1238
fi
1239

    
1240
if test "$_malloc_h" = "yes" ; then
1241
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1242
else
1243
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1244
fi
1245

    
1246
if test "$_memalign" = "yes" ; then
1247
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1248
else
1249
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1250
fi
1251

    
1252
if test "$netserver" = "yes" ; then
1253
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1254
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1255
fi
1256

    
1257
if test "$need_inet_aton" = "yes" ; then
1258
  echo "NEED_INET_ATON=yes" >> config.mak
1259
fi
1260

    
1261
if test "$simpleidct" = "yes" ; then
1262
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1263
fi
1264

    
1265
if test "$ffserver" = "yes" ; then
1266
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1267
  echo "CONFIG_FFSERVER=yes" >> config.mak
1268
fi
1269

    
1270
if test "$ffplay" = "yes" ; then
1271
  echo "CONFIG_FFPLAY=yes" >> config.mak
1272
fi
1273

    
1274
if test "$risky" = "yes" ; then
1275
  echo "#define CONFIG_RISKY 1" >> $TMPH
1276
  echo "CONFIG_RISKY=yes" >> config.mak
1277
fi
1278

    
1279
if test "$gpl" = "yes" ; then
1280
  echo "#define CONFIG_GPL 1" >> $TMPH
1281
  echo "CONFIG_GPL=yes" >> config.mak
1282
fi
1283

    
1284
echo "#define restrict $_restrict" >> $TMPH
1285

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

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

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

    
1334
fi
1335

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

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