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