Commit | Line | Data |
---|---|---|
de6d9b64 | 1 | #!/bin/sh |
0f3cb305 | 2 | # |
5cbcf02c | 3 | # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard |
0f3cb305 FB |
4 | # |
5 | # set temporary file name | |
57514323 | 6 | if test ! -z "$TMPDIR" ; then |
0f3cb305 | 7 | TMPDIR1="${TMPDIR}" |
57514323 | 8 | elif test ! -z "$TEMPDIR" ; then |
0f3cb305 | 9 | TMPDIR1="${TEMPDIR}" |
3d204385 | 10 | else |
0f3cb305 | 11 | TMPDIR1="/tmp" |
3d204385 NK |
12 | fi |
13 | ||
0f3cb305 FB |
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 | ||
de6d9b64 FB |
19 | # default parameters |
20 | prefix="/usr/local" | |
0f3cb305 | 21 | cross_prefix="" |
de6d9b64 FB |
22 | cc="gcc" |
23 | ar="ar" | |
be7109c1 | 24 | ranlib="ranlib" |
4a908fbc | 25 | make="make" |
0f3cb305 | 26 | strip="strip" |
de6d9b64 | 27 | cpu=`uname -m` |
0f3cb305 | 28 | mmx="default" |
ab6c65f6 | 29 | altivec="default" |
d46aba26 | 30 | mmi="default" |
de6d9b64 | 31 | case "$cpu" in |
ef0bc4c9 | 32 | i386|i486|i586|i686|i86pc|BePC) |
de6d9b64 | 33 | cpu="x86" |
de6d9b64 | 34 | ;; |
6ed7422a FB |
35 | armv4l) |
36 | cpu="armv4l" | |
6ed7422a | 37 | ;; |
91d1f1a4 NK |
38 | alpha) |
39 | cpu="alpha" | |
91d1f1a4 | 40 | ;; |
a43bd1d7 | 41 | "Power Macintosh"|ppc) |
90cee0c3 MN |
42 | cpu="powerpc" |
43 | ;; | |
d46aba26 LS |
44 | mips) |
45 | cpu="mips" | |
46 | ;; | |
de6d9b64 | 47 | *) |
0f3cb305 | 48 | cpu="unknown" |
de6d9b64 FB |
49 | ;; |
50 | esac | |
51 | gprof="no" | |
5cbcf02c FB |
52 | v4l="yes" |
53 | audio_oss="yes" | |
54 | network="yes" | |
0147f198 | 55 | zlib="yes" |
a6741398 | 56 | mp3lame="no" |
81e0d0b4 | 57 | vorbis="no" |
5cbcf02c | 58 | a52="yes" |
57514323 | 59 | a52bin="no" |
daf8e955 | 60 | win32="no" |
3f027ca7 | 61 | cygwin="no" |
83286d2a | 62 | lshared="no" |
ef0bc4c9 | 63 | extralibs="-lm" |
c02dbee1 | 64 | simpleidct="yes" |
0f3cb305 | 65 | bigendian="no" |
68892110 | 66 | vhook="no" |
1eb2212e | 67 | mpegaudio_hp="yes" |
e1707f52 | 68 | SHFLAGS=-shared |
26b35efb | 69 | netserver="no" |
ef0bc4c9 FR |
70 | |
71 | # OS specific | |
72 | targetos=`uname -s` | |
73 | case $targetos in | |
74 | BeOS) | |
75 | prefix="/boot/home/config" | |
76 | # helps building libavcodec | |
e1707f52 MN |
77 | CFLAGS="-O3 -DPIC -fomit-frame-pointer" |
78 | SHFLAGS=-nostart | |
79 | # disable linux things | |
80 | audio_oss="no" | |
5cbcf02c | 81 | v4l="no" |
ef0bc4c9 FR |
82 | # no need for libm, but the inet stuff |
83 | # Check for BONE | |
84 | if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then | |
85 | extralibs="-lbind -lsocket" | |
86 | else | |
26b35efb FR |
87 | netserver="yes" |
88 | extralibs="-lnet" | |
ef0bc4c9 | 89 | fi ;; |
4a908fbc | 90 | BSD/OS) |
5cbcf02c | 91 | v4l="no" |
6063bce7 | 92 | audio_oss="yes" |
4a908fbc AB |
93 | extralibs="-lpoll -lgnugetopt -lm" |
94 | make="gmake" | |
95 | ;; | |
90cee0c3 | 96 | Darwin) |
a43bd1d7 | 97 | cc="cc" |
90cee0c3 MN |
98 | v4l="no" |
99 | audio_oss="no" | |
80663785 | 100 | CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic" |
a43bd1d7 | 101 | SHFLAGS="-dynamiclib" |
90cee0c3 | 102 | extralibs="" |
a43bd1d7 | 103 | darwin="yes" |
90cee0c3 | 104 | ;; |
3f027ca7 FB |
105 | CYGWIN*) |
106 | v4l="no" | |
107 | audio_oss="yes" | |
108 | extralibs="" | |
109 | cygwin="yes" | |
110 | test -f /usr/include/inttypes.h || \ | |
111 | test -f /usr/local/include/inttypes.h || \ | |
112 | echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \ | |
113 | "/usr/include/inttypes.h !!!" | |
114 | ;; | |
ef0bc4c9 FR |
115 | *) ;; |
116 | esac | |
de6d9b64 | 117 | |
0f3cb305 FB |
118 | # find source path |
119 | # XXX: we assume an absolute path is given when launching configure, | |
120 | # except in './configure' case. | |
121 | source_path=${0%configure} | |
122 | source_path=${source_path%/} | |
123 | source_path_used="yes" | |
124 | if test -z "$source_path" -o "$source_path" = "." ; then | |
125 | source_path=`pwd` | |
126 | source_path_used="no" | |
de6d9b64 FB |
127 | fi |
128 | ||
68892110 PG |
129 | cat > $TMPC << EOF |
130 | #include <dlfcn.h> | |
131 | int main( void ) { return (int) dlopen("foo", 0); } | |
132 | EOF | |
133 | ||
134 | if $cc -o $TMPO $TMPC -ldl 2> /dev/null ; then | |
135 | : vhook=yes | |
136 | fi | |
137 | ||
138 | cat > $TMPC << EOF | |
139 | #include <X11/Xlib.h> | |
140 | #include <Imlib2.h> | |
141 | int main( void ) { return (int) imlib_load_font("foo"); } | |
142 | EOF | |
143 | ||
144 | imlib2=no | |
145 | if $cc -o $TMPO $TMPC -lImlib2 2> /dev/null ; then | |
146 | imlib2=yes | |
147 | fi | |
148 | ||
de6d9b64 FB |
149 | for opt do |
150 | case "$opt" in | |
151 | --prefix=*) prefix=`echo $opt | cut -d '=' -f 2` | |
152 | ;; | |
0f3cb305 FB |
153 | --source-path=*) source_path=`echo $opt | cut -d '=' -f 2` |
154 | ;; | |
155 | --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` | |
156 | ;; | |
de6d9b64 FB |
157 | --cc=*) cc=`echo $opt | cut -d '=' -f 2` |
158 | ;; | |
4a908fbc AB |
159 | --make=*) make=`echo $opt | cut -d '=' -f 2` |
160 | ;; | |
0f3cb305 FB |
161 | --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}" |
162 | ;; | |
163 | --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=} | |
164 | ;; | |
165 | --extra-libs=*) extralibs=${opt#--extra-libs=} | |
166 | ;; | |
de6d9b64 FB |
167 | --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` |
168 | ;; | |
169 | --disable-mmx) mmx="no" | |
170 | ;; | |
ab6c65f6 BF |
171 | --disable-altivec) altivec="no" |
172 | ;; | |
de6d9b64 FB |
173 | --enable-gprof) gprof="yes" |
174 | ;; | |
5cbcf02c FB |
175 | --disable-v4l) v4l="no" |
176 | ;; | |
177 | --disable-audio-oss) audio_oss="no" | |
178 | ;; | |
179 | --disable-network) network="no" | |
180 | ;; | |
0147f198 FR |
181 | --disable-zlib) zlib="no" |
182 | ;; | |
5cbcf02c | 183 | --disable-a52) a52="no" |
6ed7422a | 184 | ;; |
57514323 ZK |
185 | --enable-a52bin) a52bin="yes" ; extralibs="-ldl $extralibs" |
186 | ;; | |
a6741398 J |
187 | --enable-mp3lame) mp3lame="yes" |
188 | ;; | |
81e0d0b4 MH |
189 | --enable-vorbis) vorbis="yes" |
190 | ;; | |
68892110 PG |
191 | --disable-vhook) vhook="no" |
192 | ;; | |
c02dbee1 | 193 | --disable-simple_idct) simpleidct="no" |
045ed63f | 194 | ;; |
daf8e955 FB |
195 | --enable-win32) win32="yes" |
196 | ;; | |
83286d2a | 197 | --enable-shared) lshared="yes" |
0319c531 | 198 | ;; |
1eb2212e FB |
199 | --disable-mpegaudio-hp) mpegaudio_hp="no" |
200 | ;; | |
de6d9b64 FB |
201 | esac |
202 | done | |
203 | ||
0f3cb305 FB |
204 | # compute mmx state |
205 | if test $mmx = "default"; then | |
206 | if test $cpu = "x86"; then | |
207 | mmx="yes" | |
208 | else | |
209 | mmx="no" | |
210 | fi | |
211 | fi | |
212 | ||
ab6c65f6 BF |
213 | # Can only do AltiVec on PowerPC |
214 | if test $altivec = "default"; then | |
215 | if test $cpu = "powerpc"; then | |
216 | altivec="yes" | |
217 | else | |
218 | altivec="no" | |
219 | fi | |
220 | fi | |
221 | ||
222 | # See does our compiler support Motorola AltiVec C API | |
223 | if test $altivec = "yes"; then | |
224 | cat > $TMPC << EOF | |
225 | int main(void) { | |
226 | vector signed int v1, v2, v3; | |
227 | v1 = vec_add(v2,v3); | |
228 | return 0; | |
229 | } | |
230 | EOF | |
231 | $cc -o $TMPO $TMPC -faltivec 2> /dev/null || altivec="no" | |
232 | fi | |
233 | ||
d46aba26 LS |
234 | # Can only do mmi on mips |
235 | if test $mmi = "default"; then | |
236 | if test $cpu = "mips"; then | |
237 | mmi="yes" | |
238 | else | |
239 | mmi="no" | |
240 | fi | |
241 | fi | |
242 | ||
243 | # See does our compiler support mmi | |
244 | if test $mmi = "yes"; then | |
245 | cat > $TMPC << EOF | |
246 | int main(void) { | |
247 | __asm__ ("lq \$2, 0(\$2)"); | |
248 | return 0; | |
249 | } | |
250 | EOF | |
251 | $cc -o $TMPO $TMPC 2> /dev/null || mmi="no" | |
252 | fi | |
253 | ||
daf8e955 FB |
254 | # Checking for CFLAGS |
255 | if test -z "$CFLAGS"; then | |
29482cb4 | 256 | CFLAGS="-O3" |
daf8e955 FB |
257 | fi |
258 | ||
57514323 | 259 | if test "$win32" = "yes" ; then |
daf8e955 | 260 | cross_prefix="i386-mingw32msvc-" |
5cbcf02c FB |
261 | v4l="no" |
262 | audio_oss="no" | |
263 | network="no" | |
daf8e955 FB |
264 | fi |
265 | ||
0f3cb305 FB |
266 | cc="${cross_prefix}${cc}" |
267 | ar="${cross_prefix}${ar}" | |
be7109c1 | 268 | ranlib="${cross_prefix}${ranlib}" |
0f3cb305 FB |
269 | strip="${cross_prefix}${strip}" |
270 | ||
487a54d7 FB |
271 | if test -z "$cross_prefix" ; then |
272 | ||
3d204385 | 273 | # --- |
a3999908 MN |
274 | # big/little endian test |
275 | cat > $TMPC << EOF | |
276 | #include <inttypes.h> | |
277 | int main(int argc, char ** argv){ | |
278 | volatile uint32_t i=0x01234567; | |
279 | return (*((uint8_t*)(&i))) == 0x67; | |
280 | } | |
281 | EOF | |
282 | ||
283 | if $cc -o $TMPO $TMPC 2>/dev/null ; then | |
284 | $TMPO && bigendian="yes" | |
285 | else | |
286 | echo big/little test failed | |
287 | fi | |
288 | ||
487a54d7 FB |
289 | else |
290 | ||
291 | # if cross compiling, cannot launch a program, so make a static guess | |
292 | if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then | |
293 | bigendian="yes" | |
294 | fi | |
295 | ||
296 | fi | |
297 | ||
a3999908 | 298 | # --- |
3d204385 NK |
299 | # check availability of some header files |
300 | ||
301 | cat > $TMPC << EOF | |
302 | #include <malloc.h> | |
303 | int main( void ) { return 0; } | |
304 | EOF | |
305 | ||
306 | _memalign=no | |
307 | _malloc_h=no | |
308 | if $cc -o $TMPO $TMPC 2> /dev/null ; then | |
309 | _malloc_h=yes | |
310 | _memalign=yes | |
311 | # check for memalign - atmos | |
312 | cat > $TMPC << EOF | |
313 | #include <malloc.h> | |
314 | int main ( void ) { | |
315 | char *string = NULL; | |
316 | string = memalign(64, sizeof(char)); | |
317 | return 0; | |
318 | } | |
319 | EOF | |
320 | $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no | |
321 | fi | |
322 | ||
68892110 PG |
323 | cat > $TMPC << EOF |
324 | #define _GNU_SOURCE | |
325 | #include <time.h> | |
326 | int main( void ) { return *strptime("", "", 0); } | |
327 | EOF | |
328 | ||
329 | strptime=no | |
330 | if $cc -o $TMPO $TMPC 2> /dev/null ; then | |
331 | strptime=yes | |
332 | fi | |
333 | ||
0147f198 FR |
334 | if test "$zlib" = "yes"; then |
335 | # check for zlib - mmu_man | |
336 | cat > $TMPC << EOF | |
337 | #include <zlib.h> | |
338 | int main ( void ) { | |
339 | if (zlibVersion() != ZLIB_VERSION) | |
340 | puts("zlib version differs !!!"); | |
341 | return 1; | |
342 | return 0; | |
343 | } | |
344 | EOF | |
345 | $cc -o $TMPO $TMPC -lz 2> /dev/null || zlib="no" | |
346 | # $TMPO 2> /dev/null > /dev/null || zlib="no" | |
347 | # XXX: more tests needed - runtime test | |
348 | fi | |
349 | if test "$zlib" = "yes"; then | |
350 | extralibs="$extralibs -lz" | |
351 | fi | |
352 | ||
c13e1abd FH |
353 | _restrict= |
354 | for restrict_keyword in restrict __restrict__ __restrict; do | |
355 | echo "void foo(char * $restrict_keyword p);" > $TMPC | |
356 | if $cc -c -o $TMPO $TMPC 2> /dev/null; then | |
357 | _restrict=$restrict_keyword | |
358 | break; | |
359 | fi | |
360 | done | |
361 | ||
6063bce7 | 362 | if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
0f3cb305 FB |
363 | cat << EOF |
364 | ||
365 | Usage: configure [options] | |
366 | Options: [defaults in brackets after descriptions] | |
367 | ||
368 | EOF | |
369 | echo "Standard options:" | |
370 | echo " --help print this message" | |
371 | echo " --prefix=PREFIX install in PREFIX [$prefix]" | |
0f3cb305 | 372 | echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]" |
81e0d0b4 | 373 | echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]" |
0f3cb305 | 374 | echo " --enable-win32 enable win32 cross compile" |
5cbcf02c | 375 | echo " --disable-a52 disable GPL'ed A52 support [default=no]" |
0f3cb305 FB |
376 | echo " --enable-a52bin open liba52.so.0 at runtime [default=no]" |
377 | echo " --enable-shared build shared libraries [default=no]" | |
378 | echo "" | |
379 | echo "Advanced options (experts only):" | |
380 | echo " --source-path=PATH path of source code [$source_path]" | |
381 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" | |
382 | echo " --cc=CC use C compiler CC [$cc]" | |
4a908fbc | 383 | echo " --make=MAKE use specified make [$make]" |
0f3cb305 FB |
384 | echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]" |
385 | echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]" | |
386 | echo " --extra-libs=ELIBS add ELIBS [$ELIBS]" | |
387 | echo " --cpu=CPU force cpu to CPU [$cpu]" | |
388 | echo " --disable-mmx disable mmx usage" | |
ab6c65f6 | 389 | echo " --disable-altivec disable AltiVec usage" |
5cbcf02c | 390 | echo " --disable-audio-oss disable OSS audio support [default=no]" |
6063bce7 | 391 | echo " --disable-v4l disable video4linux grabbing [default=no]" |
5cbcf02c | 392 | echo " --disable-network disable network support [default=no]" |
0147f198 | 393 | echo " --disable-zlib disable zlib [default=no]" |
5cbcf02c | 394 | echo " --disable-simple_idct disable simple IDCT routines [default=no]" |
68892110 | 395 | # echo " --disable-vhook disable video hooking support" |
0f3cb305 | 396 | echo " --enable-gprof enable profiling with gprof [$gprof]" |
1eb2212e FB |
397 | echo " --disable-mpegaudio-hp faster (but less accurate)" |
398 | echo " mpegaudio decoding [default=no]" | |
0f3cb305 FB |
399 | echo "" |
400 | echo "NOTE: The object files are build at the place where configure is launched" | |
401 | exit 1 | |
402 | fi | |
403 | ||
de6d9b64 | 404 | echo "Install prefix $prefix" |
0f3cb305 | 405 | echo "Source path $source_path" |
de6d9b64 | 406 | echo "C compiler $cc" |
4a908fbc | 407 | echo "make $make" |
de6d9b64 | 408 | echo "CPU $cpu" |
0f3cb305 | 409 | echo "Big Endian $bigendian" |
e41e8342 | 410 | if test $cpu = "x86"; then |
de6d9b64 | 411 | echo "MMX enabled $mmx" |
e41e8342 FB |
412 | fi |
413 | if test $cpu = "mips"; then | |
d46aba26 | 414 | echo "MMI enabled $mmi" |
e41e8342 FB |
415 | fi |
416 | if test $cpu = "powerpc"; then | |
ab6c65f6 | 417 | echo "AltiVec enabled $altivec" |
e41e8342 | 418 | fi |
de6d9b64 | 419 | echo "gprof enabled $gprof" |
0147f198 | 420 | echo "zlib enabled $zlib" |
a6741398 | 421 | echo "mp3lame enabled $mp3lame" |
81e0d0b4 | 422 | echo "vorbis enabled $vorbis" |
5cbcf02c | 423 | echo "a52 support $a52" |
57514323 | 424 | echo "a52 dlopened $a52bin" |
68892110 PG |
425 | # echo "Video hooking $vhook" |
426 | ||
427 | if test "$vhook" = "yes" ; then | |
428 | : echo "Imlib2 support $imlib2" | |
429 | fi | |
de6d9b64 | 430 | |
980fc7b8 | 431 | echo "Creating config.mak and config.h" |
de6d9b64 | 432 | |
980fc7b8 | 433 | echo "# Automatically generated by configure - do not modify" > config.mak |
045ed63f | 434 | echo "/* Automatically generated by configure - do not modify */" > $TMPH |
de6d9b64 | 435 | |
980fc7b8 | 436 | echo "prefix=$prefix" >> config.mak |
4a908fbc | 437 | echo "MAKE=$make" >> config.mak |
980fc7b8 FB |
438 | echo "CC=$cc" >> config.mak |
439 | echo "AR=$ar" >> config.mak | |
be7109c1 | 440 | echo "RANLIB=$ranlib" >> config.mak |
0f3cb305 | 441 | echo "STRIP=$strip" >> config.mak |
a9b3f630 | 442 | echo "OPTFLAGS=$CFLAGS" >> config.mak |
0f3cb305 | 443 | echo "LDFLAGS=$LDFLAGS" >> config.mak |
e1707f52 | 444 | echo "SHFLAGS=$SHFLAGS" >> config.mak |
57514323 | 445 | if test "$cpu" = "x86" ; then |
980fc7b8 | 446 | echo "TARGET_ARCH_X86=yes" >> config.mak |
045ed63f | 447 | echo "#define ARCH_X86 1" >> $TMPH |
0f3cb305 | 448 | elif test "$cpu" = "armv4l" ; then |
6ed7422a | 449 | echo "TARGET_ARCH_ARMV4L=yes" >> config.mak |
045ed63f | 450 | echo "#define ARCH_ARMV4L 1" >> $TMPH |
0f3cb305 | 451 | elif test "$cpu" = "alpha" ; then |
91d1f1a4 | 452 | echo "TARGET_ARCH_ALPHA=yes" >> config.mak |
045ed63f | 453 | echo "#define ARCH_ALPHA 1" >> $TMPH |
0f3cb305 FB |
454 | elif test "$cpu" = "powerpc" ; then |
455 | echo "TARGET_ARCH_POWERPC=yes" >> config.mak | |
456 | echo "#define ARCH_POWERPC 1" >> $TMPH | |
d46aba26 LS |
457 | elif test "$cpu" = "mips" ; then |
458 | echo "TARGET_ARCH_MIPS=yes" >> config.mak | |
459 | echo "#define ARCH_MIPS 1" >> $TMPH | |
0f3cb305 FB |
460 | fi |
461 | if test "$bigendian" = "yes" ; then | |
462 | echo "WORDS_BIGENDIAN=yes" >> config.mak | |
463 | echo "#define WORDS_BIGENDIAN 1" >> $TMPH | |
91d1f1a4 | 464 | fi |
57514323 | 465 | if test "$mmx" = "yes" ; then |
980fc7b8 | 466 | echo "TARGET_MMX=yes" >> config.mak |
045ed63f | 467 | echo "#define HAVE_MMX 1" >> $TMPH |
de6d9b64 | 468 | fi |
d46aba26 LS |
469 | if test "$mmi" = "yes" ; then |
470 | echo "TARGET_MMI=yes" >> config.mak | |
471 | echo "#define HAVE_MMI 1" >> $TMPH | |
472 | fi | |
ab6c65f6 BF |
473 | if test "$altivec" = "yes" ; then |
474 | echo "TARGET_ALTIVEC=yes" >> config.mak | |
475 | echo "#define HAVE_ALTIVEC 1" >> $TMPH | |
476 | fi | |
57514323 | 477 | if test "$gprof" = "yes" ; then |
980fc7b8 | 478 | echo "TARGET_GPROF=yes" >> config.mak |
045ed63f | 479 | echo "#define HAVE_GPROF 1" >> $TMPH |
de6d9b64 | 480 | fi |
68892110 PG |
481 | if test "$strptime" = "yes" ; then |
482 | echo "#define HAVE_STRPTIME 1" >> $TMPH | |
483 | else | |
484 | echo "BUILD_STRPTIME=yes" >> config.mak | |
485 | fi | |
486 | if test "$imlib2" = "yes" ; then | |
487 | echo "HAVE_IMLIB2=yes" >> config.mak | |
488 | fi | |
489 | if test "$vhook" = "yes" ; then | |
490 | echo "BUILD_VHOOK=yes" >> config.mak | |
491 | echo "#define HAVE_VHOOK 1" >> $TMPH | |
492 | extralibs="$extralibs -ldl" | |
493 | fi | |
57514323 | 494 | if test "$lshared" = "yes" ; then |
0319c531 | 495 | echo "BUILD_SHARED=yes" >> config.mak |
5cbcf02c | 496 | echo "PIC=-fPIC" >> config.mak |
0319c531 | 497 | fi |
ef0bc4c9 | 498 | echo "EXTRALIBS=$extralibs" >> config.mak |
0319c531 | 499 | echo -n "VERSION=" >>config.mak |
0f3cb305 | 500 | head $source_path/VERSION >>config.mak |
0319c531 | 501 | echo "" >>config.mak |
d771bcae | 502 | # if you do not want to use encoders, disable that. |
045ed63f | 503 | echo "#define CONFIG_ENCODERS 1" >> $TMPH |
d771bcae FB |
504 | echo "CONFIG_ENCODERS=yes" >> config.mak |
505 | ||
506 | # if you do not want to use decoders, disable that. | |
045ed63f | 507 | echo "#define CONFIG_DECODERS 1" >> $TMPH |
d771bcae FB |
508 | echo "CONFIG_DECODERS=yes" >> config.mak |
509 | ||
5cbcf02c FB |
510 | # AC3 |
511 | if test "$a52" = "yes" ; then | |
512 | echo "#define CONFIG_AC3 1" >> $TMPH | |
513 | echo "CONFIG_AC3=yes" >> config.mak | |
d771bcae | 514 | |
5cbcf02c FB |
515 | if test "$a52bin" = "yes" ; then |
516 | echo "#define CONFIG_A52BIN 1" >> $TMPH | |
517 | echo "CONFIG_A52BIN=yes" >> config.mak | |
518 | fi | |
519 | fi | |
520 | ||
1eb2212e FB |
521 | # mpeg audio high precision mode |
522 | if test "$mpegaudio_hp" = "yes" ; then | |
523 | echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH | |
524 | fi | |
525 | ||
5cbcf02c FB |
526 | if test "$v4l" = "yes" ; then |
527 | echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH | |
528 | echo "CONFIG_VIDEO4LINUX=yes" >> config.mak | |
529 | fi | |
530 | ||
531 | if test "$audio_oss" = "yes" ; then | |
532 | echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH | |
533 | echo "CONFIG_AUDIO_OSS=yes" >> config.mak | |
57514323 ZK |
534 | fi |
535 | ||
5cbcf02c FB |
536 | if test "$network" = "yes" ; then |
537 | echo "#define CONFIG_NETWORK 1" >> $TMPH | |
538 | echo "CONFIG_NETWORK=yes" >> config.mak | |
6ed7422a | 539 | fi |
daf8e955 | 540 | |
0147f198 FR |
541 | if test "$zlib" = "yes" ; then |
542 | echo "#define CONFIG_ZLIB 1" >> $TMPH | |
543 | echo "CONFIG_ZLIB=yes" >> config.mak | |
544 | fi | |
545 | ||
57514323 | 546 | if test "$mp3lame" = "yes" ; then |
045ed63f | 547 | echo "#define CONFIG_MP3LAME 1" >> $TMPH |
a6741398 J |
548 | echo "CONFIG_MP3LAME=yes" >> config.mak |
549 | fi | |
550 | ||
81e0d0b4 MH |
551 | if test "$vorbis" = "yes" ; then |
552 | echo "#define CONFIG_VORBIS 1" >> $TMPH | |
553 | echo "CONFIG_VORBIS=yes" >> config.mak | |
554 | fi | |
555 | ||
57514323 | 556 | if test "$win32" = "yes" ; then |
045ed63f | 557 | echo "#define CONFIG_WIN32 1" >> $TMPH |
daf8e955 FB |
558 | echo "CONFIG_WIN32=yes" >> config.mak |
559 | fi | |
3d204385 | 560 | |
3f027ca7 FB |
561 | if test "$cygwin" = "yes" ; then |
562 | # setup correct exesuffix | |
563 | echo "CONFIG_WIN32=yes" >> config.mak | |
564 | fi | |
565 | ||
90cee0c3 MN |
566 | if test "$darwin" = "yes"; then |
567 | echo "#define CONFIG_DARWIN 1" >> $TMPH | |
568 | echo "CONFIG_DARWIN=yes" >> config.mak | |
569 | fi | |
570 | ||
57514323 | 571 | if test "$_malloc_h" = "yes" ; then |
045ed63f | 572 | echo "#define HAVE_MALLOC_H 1" >> $TMPH |
3d204385 | 573 | else |
045ed63f | 574 | echo "#undef HAVE_MALLOC_H" >> $TMPH |
3d204385 NK |
575 | fi |
576 | ||
57514323 | 577 | if test "$_memalign" = "yes" ; then |
045ed63f ZK |
578 | echo "#define HAVE_MEMALIGN 1" >> $TMPH |
579 | else | |
580 | echo "#undef HAVE_MEMALIGN" >> $TMPH | |
581 | fi | |
582 | ||
26b35efb FR |
583 | if test "$netserver" = "yes" ; then |
584 | echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH | |
585 | echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak | |
586 | fi | |
587 | ||
57514323 | 588 | if test "$simpleidct" = "yes" ; then |
045ed63f ZK |
589 | echo "#define SIMPLE_IDCT 1" >> $TMPH |
590 | fi | |
591 | ||
c13e1abd FH |
592 | echo "#define restrict $_restrict" >> $TMPH |
593 | ||
0f3cb305 FB |
594 | # build tree in object directory if source path is different from current one |
595 | if test "$source_path_used" = "yes" ; then | |
596 | DIRS="libav libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \ | |
59925ef2 | 597 | libavcodec/ppc libavcodec/liba52 libavcodec/mlib tests" |
0f3cb305 FB |
598 | FILES="Makefile libav/Makefile libavcodec/Makefile tests/Makefile" |
599 | for dir in $DIRS ; do | |
600 | mkdir -p $dir | |
601 | done | |
602 | for f in $FILES ; do | |
603 | ln -sf $source_path/$f $f | |
604 | done | |
605 | fi | |
606 | echo "SRC_PATH=$source_path" >> config.mak | |
607 | ||
a7c02e25 | 608 | diff $TMPH config.h >/dev/null 2>&1 |
045ed63f ZK |
609 | if test $? -ne 0 ; then |
610 | mv -f $TMPH config.h | |
3d204385 | 611 | else |
045ed63f | 612 | echo "config.h is unchanged" |
3d204385 NK |
613 | fi |
614 | ||
045ed63f | 615 | rm -f $TMPO $TMPC $TMPS $TMPH |