Statistics
| Branch: | Revision:

ffmpeg / configure @ 52b41d7f

History | View | Annotate | Download (18 KB)

1
#!/bin/sh
2
#
3
# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
4
#
5
# set temporary file name
6
if test ! -z "$TMPDIR" ; then
7
    TMPDIR1="${TMPDIR}"
8
elif test ! -z "$TEMPDIR" ; then
9
    TMPDIR1="${TEMPDIR}"
10
else
11
    TMPDIR1="/tmp"
12
fi
13

    
14
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
15
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
16
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
17
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
18

    
19
# default parameters
20
prefix="/usr/local"
21
cross_prefix=""
22
cc="gcc"
23
ar="ar"
24
ranlib="ranlib"
25
make="make"
26
strip="strip"
27
cpu=`uname -m`
28
mmx="default"
29
altivec="default"
30
mmi="default"
31
case "$cpu" in
32
  i386|i486|i586|i686|i86pc|BePC)
33
    cpu="x86"
34
  ;;
35
  armv4l)
36
    cpu="armv4l"
37
  ;;
38
  alpha)
39
    cpu="alpha"
40
  ;;
41
  "Power Macintosh"|ppc)
42
    cpu="powerpc"
43
  ;;
44
  mips)
45
    cpu="mips"
46
  ;;
47
  *)
48
    cpu="unknown"
49
  ;;
50
esac
51
gprof="no"
52
v4l="yes"
53
audio_oss="yes"
54
audio_beos="no"
55
network="yes"
56
zlib="yes"
57
mp3lame="no"
58
vorbis="no"
59
a52="yes"
60
a52bin="no"
61
win32="no"
62
mingw32="no"
63
cygwin="no"
64
lshared="no"
65
extralibs="-lm"
66
simpleidct="yes"
67
bigendian="no"
68
vhook="no"
69
dlfcn="no"
70
dlopen="no"
71
mpegaudio_hp="yes"
72
SHFLAGS=-shared
73
netserver="no"
74
need_inet_aton="no"
75
ffserver="yes"
76
LDFLAGS=-Wl,--warn-common
77
FFSLDFLAGS=-Wl,-E
78

    
79
# OS specific
80
targetos=`uname -s`
81
case $targetos in
82
BeOS)
83
prefix="/boot/home/config"
84
# helps building libavcodec
85
CFLAGS="-O3 -DPIC -fomit-frame-pointer"
86
# 3 gcc releases known for BeOS, each with ugly bugs
87
gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
88
case "$gcc_version" in
89
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
90
mmx="no"
91
;;
92
*20010315*) echo "BeBits gcc"
93
CFLAGS="$CFLAGS -fno-expensive-optimizations"
94
;;
95
esac
96
SHFLAGS=-nostart
97
# disable linux things
98
audio_oss="no"
99
v4l="no"
100
# enable beos things
101
audio_beos="yes"
102
# no need for libm, but the inet stuff
103
# Check for BONE
104
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
105
extralibs="-lbind -lsocket"
106
else
107
netserver="yes"
108
need_inet_aton="yes"
109
extralibs="-lnet"
110
fi ;;
111
SunOS)
112
v4l="no"
113
audio_oss="no"
114
make="gmake"
115
LDFLAGS=""
116
FFSLDFLAGS=""
117
need_inet_aton="yes"
118
extralibs="$extralibs -lsocket -lnsl"
119
;;
120
FreeBSD)
121
v4l="no"
122
audio_oss="yes"
123
make="gmake"
124
LDFLAGS="$LDFLAGS -export-dynamic"
125
;;
126
BSD/OS)
127
v4l="no"
128
audio_oss="yes"
129
extralibs="-lpoll -lgnugetopt -lm"
130
make="gmake"
131
;;
132
Darwin)
133
cc="cc"
134
v4l="no"
135
audio_oss="no"
136
SHFLAGS="-dynamiclib"
137
extralibs=""
138
darwin="yes"
139
strip="strip -x"
140
LDFLAGS="-d"
141
FFSLDFLAGS=-Wl,-bind_at_load
142
gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f4-)"
143
case "$gcc_version" in
144
*2.95*) 
145
CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer"
146
;;
147
*) 
148
CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic"
149
;;
150
esac
151
;;
152
MINGW32*)
153
v4l="no"
154
audio_oss="no"
155
ffserver="no"
156
network="no"
157
mingw32="yes"
158
;;
159
CYGWIN*)
160
v4l="no"
161
audio_oss="yes"
162
extralibs=""
163
cygwin="yes"
164
test -f /usr/include/inttypes.h || \
165
test -f /usr/local/include/inttypes.h || \
166
echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
167
     "/usr/include/inttypes.h !!!"
168
;;
169
Linux)
170
LDFLAGS="$LDFLAGS -rdynamic"
171
;;
172
*) ;;
173
esac
174

    
175
# find source path
176
# XXX: we assume an absolute path is given when launching configure, 
177
# except in './configure' case.
178
source_path=${0%configure}
179
source_path=${source_path%/}
180
source_path_used="yes"
181
if test -z "$source_path" -o "$source_path" = "." ; then
182
    source_path=`pwd`
183
    source_path_used="no"
184
fi
185

    
186
cat > $TMPC << EOF
187
#include <dlfcn.h>
188
int main( void ) { return (int) dlopen("foo", 0); }
189
EOF
190

    
191
ldl=-ldl
192

    
193
if $cc -o $TMPO $TMPC -ldl 2> /dev/null  ; then
194
vhook=yes
195
dlfcn=yes
196
dlopen=yes
197
fi
198

    
199
if $cc -o $TMPO $TMPC 2> /dev/null  ; then
200
vhook=yes
201
dlfcn=yes
202
dlopen=yes
203
ldl=""
204
fi
205

    
206
cat > $TMPC << EOF
207
int main( void ) { return (int) dlopen("foo", 0); }
208
EOF
209

    
210
if $cc -o $TMPO $TMPC -ldl 2> /dev/null  ; then
211
vhook=yes
212
dlopen=yes
213
fi
214

    
215
if $cc -o $TMPO $TMPC 2> /dev/null  ; then
216
vhook=yes
217
dlopen=yes
218
ldl=""
219
fi
220

    
221

    
222
cat > $TMPC << EOF
223
#include <X11/Xlib.h>
224
#include <Imlib2.h>
225
int main( void ) { return (int) imlib_load_font("foo"); }
226
EOF
227

    
228
imlib2=no
229
if $cc -o $TMPO $TMPC -lImlib2 2> /dev/null  ; then
230
imlib2=yes
231
fi
232

    
233
for opt do
234
  case "$opt" in
235
  --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
236
  ;;
237
  --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
238
  ;;
239
  --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
240
  ;;
241
  --cc=*) cc=`echo $opt | cut -d '=' -f 2`
242
  ;;
243
  --make=*) make=`echo $opt | cut -d '=' -f 2`
244
  ;;
245
  --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
246
  ;;
247
  --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
248
  ;;
249
  --extra-libs=*) extralibs=${opt#--extra-libs=}
250
  ;;
251
  --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
252
  ;;
253
  --disable-mmx) mmx="no"
254
  ;;
255
  --disable-altivec) altivec="no"
256
  ;;
257
  --enable-gprof) gprof="yes"
258
  ;;
259
  --disable-v4l) v4l="no"
260
  ;;
261
  --disable-audio-oss) audio_oss="no"
262
  ;;
263
  --disable-audio-beos) audio_beos="no"
264
  ;;
265
  --disable-network) network="no"
266
  ;;
267
  --disable-zlib) zlib="no"
268
  ;;
269
  --disable-a52) a52="no"
270
  ;;
271
  --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
272
  ;;
273
  --enable-mp3lame) mp3lame="yes"
274
  ;;
275
  --enable-vorbis) vorbis="yes"
276
  ;;
277
  --disable-vhook) vhook="no"
278
  ;;
279
  --disable-simple_idct) simpleidct="no"
280
  ;;
281
  --enable-win32) win32="yes"
282
  ;;
283
  --enable-mingw32) mingw32="yes"
284
  ;;
285
  --enable-shared) lshared="yes"
286
  ;;
287
  --disable-mpegaudio-hp) mpegaudio_hp="no"
288
  ;;
289
  --disable-ffserver) ffserver="no"
290
  ;;
291
  esac
292
done
293

    
294
# compute mmx state
295
if test $mmx = "default"; then
296
    if test $cpu = "x86"; then
297
        mmx="yes"
298
    else
299
        mmx="no"
300
    fi
301
fi
302

    
303
# Can only do AltiVec on PowerPC
304
if test $altivec = "default"; then
305
    if test $cpu = "powerpc"; then
306
        altivec="yes"
307
    else
308
        altivec="no"
309
    fi
310
fi
311

    
312
# See does our compiler support Motorola AltiVec C API
313
if test $altivec = "yes"; then
314
cat > $TMPC << EOF
315
int main(void) {
316
    vector signed int v1, v2, v3;
317
    v1 = vec_add(v2,v3);
318
    return 0;
319
}
320
EOF
321
$cc -o $TMPO $TMPC -faltivec 2> /dev/null || altivec="no"
322
fi
323

    
324
# Can only do mmi on mips
325
if test $mmi = "default"; then
326
    if test $cpu = "mips"; then
327
        mmi="yes"
328
    else
329
        mmi="no"
330
    fi
331
fi
332

    
333
# See does our compiler support mmi
334
if test $mmi = "yes"; then
335
cat > $TMPC << EOF
336
int main(void) {
337
    __asm__ ("lq \$2, 0(\$2)");
338
    return 0;
339
}
340
EOF
341
$cc -o $TMPO $TMPC 2> /dev/null || mmi="no"
342
fi
343

    
344
# Checking for CFLAGS
345
if test -z "$CFLAGS"; then
346
    CFLAGS="-O3"
347
fi
348

    
349
if test "$win32" = "yes" ; then
350
    cross_prefix="i386-mingw32msvc-"
351
    v4l="no"
352
    audio_oss="no"
353
    network="no"
354
fi
355

    
356
if test "$mingw32" = "yes" ; then
357
    cross_prefix=""
358
    v4l="no"
359
    audio_oss="no"
360
    network="no"
361
fi
362

    
363
cc="${cross_prefix}${cc}"
364
ar="${cross_prefix}${ar}"
365
ranlib="${cross_prefix}${ranlib}"
366
strip="${cross_prefix}${strip}"
367

    
368
if test -z "$cross_prefix" ; then
369

    
370
# ---
371
# big/little endian test
372
cat > $TMPC << EOF
373
#include <inttypes.h>
374
int main(int argc, char ** argv){
375
	volatile uint32_t i=0x01234567;
376
	return (*((uint8_t*)(&i))) == 0x67;
377
}
378
EOF
379

    
380
if $cc -o $TMPO $TMPC 2>/dev/null ; then
381
$TMPO && bigendian="yes"
382
else
383
echo big/little test failed
384
fi
385

    
386
else
387

    
388
# if cross compiling, cannot launch a program, so make a static guess
389
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
390
    bigendian="yes"
391
fi
392

    
393
fi
394

    
395
# ---
396
# check availability of some header files
397

    
398
cat > $TMPC << EOF
399
#include <malloc.h>
400
int main( void ) { return 0; }
401
EOF
402

    
403
_memalign=no
404
_malloc_h=no
405
if $cc -o $TMPO $TMPC 2> /dev/null ; then
406
_malloc_h=yes
407
_memalign=yes
408
# check for memalign - atmos
409
cat > $TMPC << EOF
410
#include <malloc.h>
411
int main ( void ) {
412
char *string = NULL;
413
string = memalign(64, sizeof(char));
414
return 0;
415
}
416
EOF
417
$cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
418
fi
419

    
420
cat > $TMPC << EOF
421
#define _GNU_SOURCE
422
#include <time.h>
423
int main( void ) { return *strptime("", "", 0); }
424
EOF
425

    
426
strptime=no
427
if $cc -o $TMPO $TMPC 2> /dev/null ; then
428
  strptime=yes
429
fi
430

    
431
if test "$zlib" = "yes"; then
432
# check for zlib - mmu_man
433
cat > $TMPC << EOF
434
#include <zlib.h>
435
int main ( void ) {
436
if (zlibVersion() != ZLIB_VERSION)
437
   puts("zlib version differs !!!");
438
   return 1;
439
return 0;
440
}
441
EOF
442
$cc -o $TMPO $TMPC -lz 2> /dev/null || zlib="no"
443
# $TMPO 2> /dev/null > /dev/null || zlib="no"
444
# XXX: more tests needed - runtime test
445
fi
446
if test "$zlib" = "yes"; then
447
extralibs="$extralibs -lz"
448
fi
449

    
450
# test for lrintf in math.h
451
cat > $TMPC << EOF
452
#define _ISOC9X_SOURCE  1
453
#include <math.h>
454
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
455
EOF
456

    
457
have_lrintf="no"
458
if $cc $extralibs -o $TMPO $TMPC 2> /dev/null ; then
459
  have_lrintf="yes"
460
  $TMPO 2> /dev/null > /dev/null || have_lrintf="no"
461
fi
462

    
463
_restrict=
464
for restrict_keyword in restrict __restrict__ __restrict; do
465
  echo "void foo(char * $restrict_keyword p);" > $TMPC
466
  if $cc -c -o $TMPO $TMPC 2> /dev/null; then
467
    _restrict=$restrict_keyword
468
    break;
469
  fi
470
done
471

    
472
# test gcc version to see if vector builtins can be used
473
# currently only used on i386 for MMX builtins
474
cat > $TMPC << EOF
475
int main(void) { 
476
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
477
return 0;
478
#else
479
#error no vector builtins
480
#endif
481
}
482
EOF
483

    
484
builtin_vector=no
485
if $cc -o $TMPO $TMPC 2> /dev/null ; then
486
  builtin_vector=yes
487
  if test "$mmx" = "yes" ; then
488
     CFLAGS="$CFLAGS -msse"
489
  fi
490
fi
491

    
492
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
493
cat << EOF
494

    
495
Usage: configure [options]
496
Options: [defaults in brackets after descriptions]
497

    
498
EOF
499
echo "Standard options:"
500
echo "  --help                   print this message"
501
echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
502
echo "  --enable-mp3lame         enable mp3 encoding via libmp3lame [default=no]"
503
echo "  --enable-vorbis          enable vorbis support via libvorbisenc [default=no]"
504
echo "  --enable-win32           enable win32 cross compile"
505
echo "  --enable-mingw32         enable mingw32 native windows compile"
506
echo "  --disable-a52            disable GPL'ed A52 support [default=no]"
507
echo "  --enable-a52bin          open liba52.so.0 at runtime [default=no]"
508
echo "  --enable-shared          build shared libraries [default=no]"
509
echo ""
510
echo "Advanced options (experts only):"
511
echo "  --source-path=PATH       path of source code [$source_path]"
512
echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
513
echo "  --cc=CC                  use C compiler CC [$cc]"
514
echo "  --make=MAKE              use specified make [$make]"
515
echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]"
516
echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
517
echo "  --extra-libs=ELIBS       add ELIBS [$ELIBS]"
518
echo "  --cpu=CPU                force cpu to CPU  [$cpu]"
519
echo "  --disable-mmx            disable mmx usage"
520
echo "  --disable-altivec        disable AltiVec usage"
521
echo "  --disable-audio-oss      disable OSS audio support [default=no]"
522
echo "  --disable-audio-beos     disable BeOS audio support [default=no]"
523
echo "  --disable-v4l            disable video4linux grabbing [default=no]"
524
echo "  --disable-network        disable network support [default=no]"
525
echo "  --disable-zlib           disable zlib [default=no]"
526
echo "  --disable-simple_idct    disable simple IDCT routines [default=no]"
527
echo "  --disable-vhook          disable video hooking support"
528
echo "  --enable-gprof           enable profiling with gprof [$gprof]"
529
echo "  --disable-mpegaudio-hp   faster (but less accurate)"
530
echo "                           mpegaudio decoding [default=no]"
531
echo "  --disable-ffserver       disable ffserver build"
532
echo ""
533
echo "NOTE: The object files are build at the place where configure is launched"
534
exit 1
535
fi
536

    
537
echo "Install prefix   $prefix"
538
echo "Source path      $source_path"
539
echo "C compiler       $cc"
540
echo "make             $make"
541
echo "CPU              $cpu"
542
echo "Big Endian       $bigendian"
543
if test $cpu = "x86"; then
544
echo "MMX enabled      $mmx"
545
echo "Vector Builtins  $builtin_vector"
546
fi
547
if test $cpu = "mips"; then
548
echo "MMI enabled      $mmi"
549
fi
550
if test $cpu = "powerpc"; then
551
echo "AltiVec enabled  $altivec"
552
fi
553
echo "gprof enabled    $gprof"
554
echo "zlib enabled     $zlib"
555
echo "mp3lame enabled  $mp3lame"
556
echo "vorbis enabled   $vorbis"
557
echo "a52 support      $a52"
558
echo "a52 dlopened     $a52bin"
559
echo "Video hooking    $vhook"
560

    
561
if test "$vhook" = "yes" ; then
562
echo "Imlib2 support   $imlib2"
563
fi
564

    
565
echo "Creating config.mak and config.h"
566

    
567
echo "# Automatically generated by configure - do not modify" > config.mak
568
echo "/* Automatically generated by configure - do not modify */" > $TMPH
569

    
570
echo "prefix=$prefix" >> config.mak
571
echo "MAKE=$make" >> config.mak
572
echo "CC=$cc" >> config.mak
573
echo "AR=$ar" >> config.mak
574
echo "RANLIB=$ranlib" >> config.mak
575
echo "STRIP=$strip" >> config.mak
576
echo "OPTFLAGS=$CFLAGS" >> config.mak
577
echo "LDFLAGS=$LDFLAGS" >> config.mak
578
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
579
echo "SHFLAGS=$SHFLAGS" >> config.mak
580
if test "$cpu" = "x86" ; then
581
  echo "TARGET_ARCH_X86=yes" >> config.mak
582
  echo "#define ARCH_X86 1" >> $TMPH
583
elif test "$cpu" = "armv4l" ; then
584
  echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
585
  echo "#define ARCH_ARMV4L 1" >> $TMPH
586
elif test "$cpu" = "alpha" ; then
587
  echo "TARGET_ARCH_ALPHA=yes" >> config.mak
588
  echo "#define ARCH_ALPHA 1" >> $TMPH
589
elif test "$cpu" = "sparc64" ; then
590
  echo "TARGET_ARCH_SPARC64=yes" >> config.mak
591
  echo "#define ARCH_SPARC64 1" >> $TMPH
592
elif test "$cpu" = "powerpc" ; then
593
  echo "TARGET_ARCH_POWERPC=yes" >> config.mak
594
  echo "#define ARCH_POWERPC 1" >> $TMPH
595
elif test "$cpu" = "mips" ; then
596
  echo "TARGET_ARCH_MIPS=yes" >> config.mak
597
  echo "#define ARCH_MIPS 1" >> $TMPH
598
fi
599
if test "$bigendian" = "yes" ; then
600
  echo "WORDS_BIGENDIAN=yes" >> config.mak
601
  echo "#define WORDS_BIGENDIAN 1" >> $TMPH
602
fi
603
if test "$mmx" = "yes" ; then
604
  echo "TARGET_MMX=yes" >> config.mak
605
  echo "#define HAVE_MMX 1" >> $TMPH
606
fi
607
if test "$builtin_vector" = "yes" ; then
608
  echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
609
  echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
610
fi
611
if test "$mmi" = "yes" ; then
612
  echo "TARGET_MMI=yes" >> config.mak
613
  echo "#define HAVE_MMI 1" >> $TMPH
614
fi
615
if test "$altivec" = "yes" ; then
616
  echo "TARGET_ALTIVEC=yes" >> config.mak
617
  echo "#define HAVE_ALTIVEC 1" >> $TMPH
618
fi
619
if test "$gprof" = "yes" ; then
620
  echo "TARGET_GPROF=yes" >> config.mak
621
  echo "#define HAVE_GPROF 1" >> $TMPH
622
fi
623
if test "$strptime" = "yes" ; then
624
  echo "#define HAVE_STRPTIME 1" >> $TMPH
625
else
626
  echo "BUILD_STRPTIME=yes" >> config.mak
627
fi
628
if test "$imlib2" = "yes" ; then
629
  echo "HAVE_IMLIB2=yes" >> config.mak
630
fi
631
if test "$have_lrintf" = "yes" ; then
632
  echo "#define HAVE_LRINTF 1" >> $TMPH
633
fi
634
if test "$vhook" = "yes" ; then
635
  echo "BUILD_VHOOK=yes" >> config.mak
636
  echo "#define HAVE_VHOOK 1" >> $TMPH
637
  extralibs="$extralibs $ldl"
638
fi
639
if test "$lshared" = "yes" ; then
640
  echo "BUILD_SHARED=yes" >> config.mak
641
  echo "PIC=-fPIC" >> config.mak
642
fi
643
echo "EXTRALIBS=$extralibs" >> config.mak
644
echo -n "VERSION=" >>config.mak
645
head $source_path/VERSION >>config.mak
646
echo "" >>config.mak
647
# if you do not want to use encoders, disable that.
648
echo "#define CONFIG_ENCODERS 1" >> $TMPH
649
echo "CONFIG_ENCODERS=yes" >> config.mak
650

    
651
# if you do not want to use decoders, disable that.
652
echo "#define CONFIG_DECODERS 1" >> $TMPH
653
echo "CONFIG_DECODERS=yes" >> config.mak
654

    
655
# AC3
656
if test "$a52" = "yes" ; then
657
  echo "#define CONFIG_AC3 1" >> $TMPH
658
  echo "CONFIG_AC3=yes" >> config.mak
659

    
660
  if test "$a52bin" = "yes" ; then
661
    echo "#define CONFIG_A52BIN 1" >> $TMPH
662
    echo "CONFIG_A52BIN=yes" >> config.mak
663
  fi
664
fi
665

    
666
# mpeg audio high precision mode
667
if test "$mpegaudio_hp" = "yes" ; then
668
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
669
fi
670

    
671
if test "$v4l" = "yes" ; then
672
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
673
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
674
fi
675

    
676
if test "$dlopen" = "yes" ; then
677
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
678
fi
679

    
680
if test "$dlfcn" = "yes" ; then
681
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
682
fi
683

    
684
if test "$audio_oss" = "yes" ; then
685
  echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
686
  echo "CONFIG_AUDIO_OSS=yes" >> config.mak
687
fi
688

    
689
if test "$audio_beos" = "yes" ; then
690
  echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
691
  echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
692
fi
693

    
694
if test "$network" = "yes" ; then
695
  echo "#define CONFIG_NETWORK 1" >> $TMPH
696
  echo "CONFIG_NETWORK=yes" >> config.mak
697
fi
698

    
699
if test "$zlib" = "yes" ; then
700
  echo "#define CONFIG_ZLIB 1" >> $TMPH
701
  echo "CONFIG_ZLIB=yes" >> config.mak
702
fi
703

    
704
if test "$mp3lame" = "yes" ; then
705
  echo "#define CONFIG_MP3LAME 1" >> $TMPH
706
  echo "CONFIG_MP3LAME=yes" >> config.mak
707
fi
708

    
709
if test "$vorbis" = "yes" ; then
710
  echo "#define CONFIG_VORBIS 1" >> $TMPH
711
  echo "CONFIG_VORBIS=yes" >> config.mak
712
fi
713

    
714
if test "$win32" = "yes" ; then
715
  echo "#define CONFIG_WIN32 1" >> $TMPH
716
  echo "CONFIG_WIN32=yes" >> config.mak
717
fi
718

    
719
if test "$mingw32" = "yes" ; then
720
  echo "#define CONFIG_WIN32 1" >> $TMPH
721
  echo "CONFIG_WIN32=yes" >> config.mak
722
  echo "#define __MINGW32__ 1" >> $TMPH
723
  echo "__MINGW32__=1" >> config.mak
724
fi
725

    
726
if test "$cygwin" = "yes" ; then
727
  # setup correct exesuffix
728
  echo "CONFIG_WIN32=yes" >> config.mak
729
fi
730

    
731
if test "$darwin" = "yes"; then
732
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
733
  echo "CONFIG_DARWIN=yes" >> config.mak
734
fi
735

    
736
if test "$_malloc_h" = "yes" ; then
737
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
738
else
739
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
740
fi
741

    
742
if test "$_memalign" = "yes" ; then
743
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
744
else
745
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
746
fi
747

    
748
if test "$netserver" = "yes" ; then
749
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
750
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
751
fi
752

    
753
if test "$need_inet_aton" = "yes" ; then
754
  echo "NEED_INET_ATON=yes" >> config.mak
755
fi
756

    
757
if test "$simpleidct" = "yes" ; then
758
  echo "#define SIMPLE_IDCT 1" >> $TMPH
759
fi
760

    
761
if test "$ffserver" = "yes" ; then
762
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
763
  echo "CONFIG_FFSERVER=yes" >> config.mak
764
fi
765

    
766
echo "#define restrict $_restrict" >> $TMPH
767

    
768
# build tree in object directory if source path is different from current one
769
if test "$source_path_used" = "yes" ; then
770
    DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
771
          libavcodec/ppc libavcodec/liba52 libavcodec/mlib tests vhook"
772
    FILES="Makefile libavformat/Makefile libavcodec/Makefile tests/Makefile vhook/Makefile"
773
    for dir in $DIRS ; do
774
            mkdir -p $dir
775
    done
776
    for f in $FILES ; do
777
        ln -sf $source_path/$f $f
778
    done
779
fi
780
echo "SRC_PATH=$source_path" >> config.mak
781

    
782
diff $TMPH config.h >/dev/null 2>&1
783
if test $? -ne 0 ; then
784
	mv -f $TMPH config.h
785
else
786
	echo "config.h is unchanged"
787
fi
788

    
789
rm -f $TMPO $TMPC $TMPS $TMPH