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