Statistics
| Branch: | Revision:

ffmpeg / configure @ 13c2469d

History | View | Annotate | Download (42.6 KB)

1 de6d9b64 Fabrice Bellard
#!/bin/sh
2 0f3cb305 Fabrice Bellard
#
3 5cbcf02c Fabrice Bellard
# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
4 0f3cb305 Fabrice Bellard
#
5 cf9d24ad Dan Christiansen
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 cc973ecb Luca Barbato
echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
17 cf9d24ad Dan Christiansen
echo "  --mandir=DIR             man documentation in DIR [PREFIX/man]"
18
echo "  --enable-mp3lame         enable mp3 encoding via libmp3lame [default=no]"
19 9146ca37 Måns Rullgård
echo "  --enable-libogg          enable ogg support via libogg [default=no]"
20 5c5dea3f Nilesh Bansal
echo "  --enable-vorbis          enable vorbis support via libvorbis [default=no]"
21
echo "  --enable-theora          enable theora support via libtheora [default=no]"
22 cf9d24ad Dan Christiansen
echo "  --enable-faad            enable faad support via libfaad [default=no]"
23
echo "  --enable-faadbin         build faad support with runtime linking [default=no]"
24
echo "  --enable-faac            enable faac support via libfaac [default=no]"
25 bb4c2140 Michael Niedermayer
echo "  --enable-libgsm          enable gsm support via libgsm [default=no]"
26 1ddadfa9 Adam Thayer
echo "  --enable-xvid            enable xvid support via xvidcore [default=no]"
27 6662ec29 Michael Niedermayer
echo "  --enable-x264            enable H.264 encoding via x264 [default=no]"
28 cf9d24ad Dan Christiansen
echo "  --enable-mingw32         enable mingw32 native/cross windows compile"
29
echo "  --enable-a52             enable GPL'ed A52 support [default=no]"
30
echo "  --enable-a52bin          open liba52.so.0 at runtime [default=no]"
31 23c99253 Michael Niedermayer
echo "  --enable-dts             enable GPL'ed DTS support [default=no]"
32 cf9d24ad Dan Christiansen
echo "  --enable-pp              enable GPL'ed post processing support [default=no]"
33
echo "  --enable-shared-pp       use libpostproc.so [default=no]"
34
echo "  --enable-shared          build shared libraries [default=no]"
35
echo "  --enable-amr_nb          enable amr_nb float audio codec"
36
echo "  --enable-amr_nb-fixed    use fixed point for amr-nb codec"
37 64cba748 Michael Niedermayer
echo "  --enable-amr_wb          enable amr_wb float audio codec"
38 cf9d24ad Dan Christiansen
echo "  --enable-sunmlib         use Sun medialib [default=no]"
39 9c3d33d6 Michael Niedermayer
echo "  --enable-pthreads        use pthreads [default=no]"
40 f02be79d Roman Shaposhnik
echo "  --enable-dc1394          enable IIDC-1394 grabbing using libdc1394 and libraw1394 [default=no]"
41 b2e3c528 Michael Niedermayer
echo "  --enable-gpl             allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
42 cf9d24ad Dan Christiansen
echo ""
43
echo "Advanced options (experts only):"
44
echo "  --source-path=PATH       path of source code [$source_path]"
45
echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
46
echo "  --cc=CC                  use C compiler CC [$cc]"
47
echo "  --make=MAKE              use specified make [$make]"
48
echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]"
49
echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
50
echo "  --extra-libs=ELIBS       add ELIBS [$ELIBS]"
51 eb94aca9 Charles Yates
echo "  --build-suffix=SUFFIX    suffix for application specific build []"
52 cf9d24ad Dan Christiansen
echo "  --cpu=CPU                force cpu to CPU  [$cpu]"
53
echo "  --tune=PROCESSOR         tune code for a particular CPU (may fails or misperforms on other CPUs)"
54
echo "  --powerpc-perf-enable    enable performance report on PPC (requires enabling PMC)"
55
echo "  --disable-mmx            disable mmx usage"
56
echo "  --disable-altivec        disable AltiVec usage"
57
echo "  --disable-audio-oss      disable OSS audio support [default=no]"
58
echo "  --disable-audio-beos     disable BeOS audio support [default=no]"
59
echo "  --disable-v4l            disable video4linux grabbing [default=no]"
60
echo "  --disable-dv1394         disable DV1394 grabbing [default=no]"
61
echo "  --disable-network        disable network support [default=no]"
62
echo "  --disable-zlib           disable zlib [default=no]"
63
echo "  --disable-simple_idct    disable simple IDCT routines [default=no]"
64
echo "  --disable-vhook          disable video hooking support"
65
echo "  --enable-gprof           enable profiling with gprof [$gprof]"
66
echo "  --disable-debug          disable debugging symbols"
67
echo "  --disable-opts           disable compiler optimizations"
68
echo "  --disable-mpegaudio-hp   faster (but less accurate)"
69
echo "                           mpegaudio decoding [default=no]"
70
echo "  --disable-ffserver       disable ffserver build"
71
echo "  --disable-ffplay         disable ffplay build"
72
echo "  --enable-small           optimize for size instead of speed"
73 da9b170c Michael Niedermayer
echo "  --enable-memalign-hack   emulate memalign, interferes with memory debuggers"
74 65d1bea2 Michel Bardiaux
echo "  --disable-strip          disable stripping of executables and shared libraries"
75 5e3419b1 Michael Niedermayer
echo "  --enable-codec=codec     enables codec"
76
echo "  --disable-codec=codec    disables codec"
77 009cf97d Michael Niedermayer
echo "  --disable-encoders       disables all encoders"
78 cf9d24ad Dan Christiansen
echo ""
79
echo "NOTE: The object files are build at the place where configure is launched"
80
exit 1
81
fi
82
83 0f3cb305 Fabrice Bellard
# set temporary file name
84 57514323 Zdenek Kabelac
if test ! -z "$TMPDIR" ; then
85 0f3cb305 Fabrice Bellard
    TMPDIR1="${TMPDIR}"
86 57514323 Zdenek Kabelac
elif test ! -z "$TEMPDIR" ; then
87 0f3cb305 Fabrice Bellard
    TMPDIR1="${TEMPDIR}"
88 3d204385 Nick Kurshev
else
89 0f3cb305 Fabrice Bellard
    TMPDIR1="/tmp"
90 3d204385 Nick Kurshev
fi
91
92 0f3cb305 Fabrice Bellard
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
93
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
94 f3ec2d46 Slavik Gnatenko
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
95 0f3cb305 Fabrice Bellard
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
96
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
97
98 de6d9b64 Fabrice Bellard
# default parameters
99
prefix="/usr/local"
100 cc973ecb Luca Barbato
libdir=""
101 23a65308 Fabrice Bellard
mandir=""
102 951bf3e6 Fabrice Bellard
bindir=""
103 0f3cb305 Fabrice Bellard
cross_prefix=""
104 de6d9b64 Fabrice Bellard
cc="gcc"
105
ar="ar"
106 be7109c1 Michael Niedermayer
ranlib="ranlib"
107 4a908fbc Alex Beregszaszi
make="make"
108 0f3cb305 Fabrice Bellard
strip="strip"
109 de6d9b64 Fabrice Bellard
cpu=`uname -m`
110 a4adb608 Michael Niedermayer
tune="generic"
111 e45a2872 Romain Dolbeau
powerpc_perf="no"
112 0f3cb305 Fabrice Bellard
mmx="default"
113 ab6c65f6 Brian Foley
altivec="default"
114 d46aba26 Leon van Stuivenberg
mmi="default"
115 de6d9b64 Fabrice Bellard
case "$cpu" in
116 ef0bc4c9 François Revol
  i386|i486|i586|i686|i86pc|BePC)
117 de6d9b64 Fabrice Bellard
    cpu="x86"
118
  ;;
119 7bf9648e Jacob Meuser
  x86_64|amd64)
120
    cpu="x86"
121
    canon_arch="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
122
    if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
123
      if [ -z "`echo $CFLAGS | grep -- -m32`"  ]; then
124
        cpu="x86_64"
125
      fi
126 053dea12 Aurelien Jacobs
    fi
127
  ;;
128 93caefc7 Alex Beregszaszi
  # armv4l is a subset of armv5tel
129
  armv4l|armv5tel)
130 6ed7422a Fabrice Bellard
    cpu="armv4l"
131
  ;;
132 91d1f1a4 Nick Kurshev
  alpha)
133
    cpu="alpha"
134
  ;;
135 a43bd1d7 Heliodoro Tammaro
  "Power Macintosh"|ppc)
136 90cee0c3 Michael Niedermayer
    cpu="powerpc"
137
  ;;
138 d46aba26 Leon van Stuivenberg
  mips)
139
    cpu="mips"
140
  ;;
141 bb476ff3 James Morrison
  sun4u|sparc64)
142 a7beab73 Roman Shaposhnik
    cpu="sparc64"
143
  ;;
144 bb476ff3 James Morrison
  sparc)
145
    cpu="sparc"
146
  ;;
147 bdb2e37c Alex Beregszaszi
  sh4)
148
    cpu="sh4"
149
  ;;
150 de6d9b64 Fabrice Bellard
  *)
151 0f3cb305 Fabrice Bellard
    cpu="unknown"
152 de6d9b64 Fabrice Bellard
  ;;
153
esac
154
gprof="no"
155 5cbcf02c Fabrice Bellard
v4l="yes"
156
audio_oss="yes"
157 dfdfa47c François Revol
audio_beos="no"
158 8aa3ee32 Max Krasnyansky
dv1394="yes"
159 f02be79d Roman Shaposhnik
dc1394="no"
160 5cbcf02c Fabrice Bellard
network="yes"
161 0147f198 François Revol
zlib="yes"
162 bb4c2140 Michael Niedermayer
libgsm="no"
163 a6741398 Juanjo
mp3lame="no"
164 9146ca37 Måns Rullgård
libogg="no"
165 81e0d0b4 Mark Hills
vorbis="no"
166 5c5dea3f Nilesh Bansal
theora="no"
167 0fc50e58 Zdenek Kabelac
faad="no"
168
faadbin="no"
169 29d48296 Michael Niedermayer
faac="no"
170 1ddadfa9 Adam Thayer
xvid="no"
171 6662ec29 Michael Niedermayer
x264="no"
172 ba9261e5 Michael Niedermayer
a52="no"
173 57514323 Zdenek Kabelac
a52bin="no"
174 23c99253 Michael Niedermayer
dts="no"
175 ba9261e5 Michael Niedermayer
pp="no"
176 bba9b16c Michael Niedermayer
shared_pp="no"
177 732d9245 Bill Eldridge
mingw32="no"
178 3f027ca7 Felix Bünemann
cygwin="no"
179 f3ec2d46 Slavik Gnatenko
os2="no"
180 83286d2a Zdenek Kabelac
lshared="no"
181 cddf3f45 Glenn Maynard
optimize="yes"
182
debug="yes"
183 65d1bea2 Michel Bardiaux
dostrip="yes"
184 ef0bc4c9 François Revol
extralibs="-lm"
185 c02dbee1 Michael Niedermayer
simpleidct="yes"
186 0f3cb305 Fabrice Bellard
bigendian="no"
187 7f965c1c Chris Flerackers
inttypes="yes"
188 b5c950c4 Michael Niedermayer
emu_fast_int="no"
189 a8721c09 Fabrice Bellard
vhook="default"
190 adbc0510 Philip Gladstone
dlfcn="no"
191
dlopen="no"
192 1eb2212e Fabrice Bellard
mpegaudio_hp="yes"
193 e1707f52 Michael Niedermayer
SHFLAGS=-shared
194 26b35efb François Revol
netserver="no"
195 4baca069 Philip Gladstone
need_inet_aton="no"
196 8154d2e0 Fabrice Bellard
ffserver="yes"
197 a86b921c Fabrice Bellard
ffplay="yes"
198 4baca069 Philip Gladstone
LDFLAGS=-Wl,--warn-common
199
FFSLDFLAGS=-Wl,-E
200 f39e56a8 Jacob Meuser
LDCONFIG="ldconfig"
201 f3ec2d46 Slavik Gnatenko
LIBPREF="lib"
202
LIBSUF=".a"
203
SLIBPREF="lib"
204
SLIBSUF=".so"
205 951bf3e6 Fabrice Bellard
EXESUF=""
206 eb94aca9 Charles Yates
BUILDSUF=""
207 891f64b3 joca@rixmail.se
amr_nb="no"
208 d663a1fd Michael Niedermayer
amr_wb="no"
209 bc634f6f Zdenek Kabelac
amr_nb_fixed="no"
210 2a515c08 Torsten Martinsen
amr_if2="no"
211 f80f7964 Roman Shaposhnik
sunmlib="no"
212 9c3d33d6 Michael Niedermayer
pthreads="no"
213 b2e3c528 Michael Niedermayer
gpl="no"
214 da9b170c Michael Niedermayer
memalignhack="no"
215 ef0bc4c9 François Revol
216
# OS specific
217
targetos=`uname -s`
218
case $targetos in
219
BeOS)
220
prefix="/boot/home/config"
221
# helps building libavcodec
222 cddf3f45 Glenn Maynard
CFLAGS="-DPIC -fomit-frame-pointer"
223 31ba0b4d François Revol
# 3 gcc releases known for BeOS, each with ugly bugs
224 b2924696 Roman Shaposhnik
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
225 31ba0b4d François Revol
case "$gcc_version" in
226
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
227
mmx="no"
228
;;
229
*20010315*) echo "BeBits gcc"
230
CFLAGS="$CFLAGS -fno-expensive-optimizations"
231
;;
232
esac
233 e1707f52 Michael Niedermayer
SHFLAGS=-nostart
234
# disable linux things
235
audio_oss="no"
236 5cbcf02c Fabrice Bellard
v4l="no"
237 8aa3ee32 Max Krasnyansky
dv1394="no"
238 dfdfa47c François Revol
# enable beos things
239
audio_beos="yes"
240 ef0bc4c9 François Revol
# no need for libm, but the inet stuff
241
# Check for BONE
242
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
243
extralibs="-lbind -lsocket"
244
else
245 26b35efb François Revol
netserver="yes"
246 4baca069 Philip Gladstone
need_inet_aton="yes"
247 26b35efb François Revol
extralibs="-lnet"
248 ef0bc4c9 François Revol
fi ;;
249 4baca069 Philip Gladstone
SunOS)
250
v4l="no"
251
audio_oss="no"
252 8aa3ee32 Max Krasnyansky
dv1394="no"
253 4baca069 Philip Gladstone
make="gmake"
254
LDFLAGS=""
255
FFSLDFLAGS=""
256
need_inet_aton="yes"
257
extralibs="$extralibs -lsocket -lnsl"
258
;;
259 b7aa4a59 Steven M. Schultz
NetBSD)
260
v4l="no"
261
audio_oss="yes"
262
dv1394="no"
263
make="gmake"
264
LDFLAGS="$LDFLAGS -export-dynamic"
265
case `uname -r` in
266
2.*) extralibs="-lossaudio"
267
;;
268
esac
269
;;
270 8c802695 Jacob Meuser
OpenBSD)
271
v4l="no"
272
audio_oss="yes"
273
dv1394="no"
274
make="gmake"
275
CFLAGS="$CFLAGS \$(PIC)"
276
LDFLAGS="$LDFLAGS -export-dynamic -pthread"
277 f39e56a8 Jacob Meuser
LDCONFIG="ldconfig -m \$(libdir)"
278 8c802695 Jacob Meuser
extralibs="$extralibs -lossaudio"
279
;;
280 9c938e77 Philip Gladstone
FreeBSD)
281
v4l="no"
282
audio_oss="yes"
283 8aa3ee32 Max Krasnyansky
dv1394="no"
284 9c938e77 Philip Gladstone
make="gmake"
285 12043e1d Steven M. Schultz
CFLAGS="-pthread"
286
LDFLAGS="$LDFLAGS -export-dynamic -pthread"
287 9c938e77 Philip Gladstone
;;
288 4a908fbc Alex Beregszaszi
BSD/OS)
289 5cbcf02c Fabrice Bellard
v4l="no"
290 6063bce7 Fabrice Bellard
audio_oss="yes"
291 8aa3ee32 Max Krasnyansky
dv1394="no"
292 4a908fbc Alex Beregszaszi
extralibs="-lpoll -lgnugetopt -lm"
293
make="gmake"
294
;;
295 90cee0c3 Michael Niedermayer
Darwin)
296 a43bd1d7 Heliodoro Tammaro
cc="cc"
297 90cee0c3 Michael Niedermayer
v4l="no"
298
audio_oss="no"
299 8aa3ee32 Max Krasnyansky
dv1394="no"
300 d3b15036 Steven M. Schultz
ffserver="no"
301 a43bd1d7 Heliodoro Tammaro
SHFLAGS="-dynamiclib"
302 90cee0c3 Michael Niedermayer
extralibs=""
303 a43bd1d7 Heliodoro Tammaro
darwin="yes"
304 47930f09 Philip Gladstone
strip="strip -x"
305 ad5a429c Roine Gustafsson
LDFLAGS="-Wl,-d,-search_paths_first"
306 4baca069 Philip Gladstone
FFSLDFLAGS=-Wl,-bind_at_load
307 90cee0c3 Michael Niedermayer
;;
308 732d9245 Bill Eldridge
MINGW32*)
309 951bf3e6 Fabrice Bellard
# Note: the rest of the mingw32 config is done afterwards as mingw32
310
# can be forced on command line for linux cross compilation
311 732d9245 Bill Eldridge
mingw32="yes"
312
;;
313 3f027ca7 Felix Bünemann
CYGWIN*)
314
v4l="no"
315
audio_oss="yes"
316 8aa3ee32 Max Krasnyansky
dv1394="no"
317 487c2fad Michael Niedermayer
ffserver="no"
318 3f027ca7 Felix Bünemann
extralibs=""
319
cygwin="yes"
320 487c2fad Michael Niedermayer
EXESUF=".exe"
321 3f027ca7 Felix Bünemann
;;
322 b55e4ef4 Philip Gladstone
Linux)
323 4baca069 Philip Gladstone
LDFLAGS="$LDFLAGS -rdynamic"
324 b55e4ef4 Philip Gladstone
;;
325 99614dd4 Michel Bardiaux
IRIX*)
326
ranlib="echo ignoring ranlib"
327
v4l="no"
328
audio_oss="no"
329
make="gmake"
330
;;
331 f3ec2d46 Slavik Gnatenko
OS/2)
332
TMPE=$TMPE".exe"
333 3ca4b654 Michael Niedermayer
ar="emxomfar -p128"
334 69db4e10 Slavik Gnatenko
ranlib="echo ignoring ranlib"
335
strip="echo ignoring strip"
336 cddf3f45 Glenn Maynard
CFLAGS="-Zomf"
337 69db4e10 Slavik Gnatenko
LDFLAGS="-Zomf -Zstack 16384 -s"
338 3ca4b654 Michael Niedermayer
SHFLAGS="-Zdll -Zomf"
339 f3ec2d46 Slavik Gnatenko
FFSLDFLAGS=""
340
LIBPREF=""
341
LIBSUF=".lib"
342
SLIBPREF=""
343
SLIBSUF=".dll"
344 951bf3e6 Fabrice Bellard
EXESUF=".exe"
345 f3ec2d46 Slavik Gnatenko
extralibs=""
346
v4l="no"
347
audio_oss="no"
348 8aa3ee32 Max Krasnyansky
dv1394="no"
349 f3ec2d46 Slavik Gnatenko
network="no"
350
ffserver="no"
351 3ca4b654 Michael Niedermayer
vhook="no"
352 f3ec2d46 Slavik Gnatenko
os2="yes"
353 3ca4b654 Michael Niedermayer
354 f3ec2d46 Slavik Gnatenko
;;
355 ef0bc4c9 François Revol
*) ;;
356
esac
357 de6d9b64 Fabrice Bellard
358 6852ac95 Romain Dolbeau
# From mplayer configure. We need TARGET_OS available
359
# to the Makefile, so it can distinguish between flavors
360
# of AltiVec on PowerPC
361
TARGET_OS=`( uname -s ) 2>&1`
362
  case "$TARGET_OS" in
363 2450cff2 François Revol
  Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
364 6852ac95 Romain Dolbeau
    ;;
365
  IRIX*)
366
    TARGET_OS=IRIX
367
    ;;
368
  HP-UX*)
369
    TARGET_OS=HP-UX
370
    ;;
371
  [cC][yY][gG][wW][iI][nN]*)
372
    TARGET_OS=CYGWIN
373
    ;;
374
  *)
375
    TARGET_OS="$TARGET_OS-UNKNOWN"
376
    ;;
377
  esac
378
379 0f3cb305 Fabrice Bellard
# find source path
380 586bc755 Roman Shaposhnik
source_path="`echo $0 | sed -e 's#/configure##'`"
381 0f3cb305 Fabrice Bellard
source_path_used="yes"
382
if test -z "$source_path" -o "$source_path" = "." ; then
383
    source_path=`pwd`
384
    source_path_used="no"
385 e7a4dafb Måns Rullgård
else
386
    source_path="`cd \"$source_path\"; pwd`"
387 de6d9b64 Fabrice Bellard
fi
388
389 f255e0ab Michel Bardiaux
FFMPEG_CONFIGURATION=" "
390
for opt do
391
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
392
done
393
394 24a9ad7e Måns Rullgård
CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c  | sed 's/.*&\(.*\)).*/\1/'`
395 009cf97d Michael Niedermayer
396 de6d9b64 Fabrice Bellard
for opt do
397
  case "$opt" in
398
  --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
399
  ;;
400 cc973ecb Luca Barbato
  --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`
401
  ;;
402 23a65308 Fabrice Bellard
  --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
403
  ;;
404 0f3cb305 Fabrice Bellard
  --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
405
  ;;
406
  --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
407
  ;;
408 de6d9b64 Fabrice Bellard
  --cc=*) cc=`echo $opt | cut -d '=' -f 2`
409
  ;;
410 4a908fbc Alex Beregszaszi
  --make=*) make=`echo $opt | cut -d '=' -f 2`
411
  ;;
412 f4e2c4b1 Roine Gustafsson
  --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
413 0f3cb305 Fabrice Bellard
  ;;
414 f4e2c4b1 Roine Gustafsson
  --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
415 0f3cb305 Fabrice Bellard
  ;;
416
  --extra-libs=*) extralibs=${opt#--extra-libs=}
417
  ;;
418 eb94aca9 Charles Yates
  --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
419
  ;;
420 de6d9b64 Fabrice Bellard
  --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
421
  ;;
422 a4adb608 Michael Niedermayer
  --tune=*) tune=`echo $opt | cut -d '=' -f 2`
423
  ;;
424 e45a2872 Romain Dolbeau
  --powerpc-perf-enable) powerpc_perf="yes"
425
  ;;
426 de6d9b64 Fabrice Bellard
  --disable-mmx) mmx="no"
427
  ;;
428 ab6c65f6 Brian Foley
  --disable-altivec) altivec="no"
429
  ;;
430 de6d9b64 Fabrice Bellard
  --enable-gprof) gprof="yes"
431
  ;;
432 5cbcf02c Fabrice Bellard
  --disable-v4l) v4l="no"
433
  ;;
434
  --disable-audio-oss) audio_oss="no"
435
  ;;
436 dfdfa47c François Revol
  --disable-audio-beos) audio_beos="no"
437
  ;;
438 8aa3ee32 Max Krasnyansky
  --disable-dv1394) dv1394="no"
439
  ;;
440 ffc0ef96 Luca Abeni
  --disable-network) network="no"; ffserver="no"
441 5cbcf02c Fabrice Bellard
  ;;
442 0147f198 François Revol
  --disable-zlib) zlib="no"
443
  ;;
444 ba9261e5 Michael Niedermayer
  --enable-a52) a52="yes"
445 6ed7422a Fabrice Bellard
  ;;
446 9c938e77 Philip Gladstone
  --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
447 57514323 Zdenek Kabelac
  ;;
448 23c99253 Michael Niedermayer
  --enable-dts) dts="yes" ; extralibs="$extralibs -ldts"
449
  ;;
450 ba9261e5 Michael Niedermayer
  --enable-pp) pp="yes"
451 bba9b16c Michael Niedermayer
  ;;
452
  --enable-shared-pp) shared_pp="yes"
453
  ;;
454 bb4c2140 Michael Niedermayer
  --enable-libgsm) libgsm="yes"
455
  ;;
456 a6741398 Juanjo
  --enable-mp3lame) mp3lame="yes"
457
  ;;
458 9146ca37 Måns Rullgård
  --enable-libogg) libogg="yes"
459 5c5dea3f Nilesh Bansal
  ;;
460 81e0d0b4 Mark Hills
  --enable-vorbis) vorbis="yes"
461
  ;;
462 5c5dea3f Nilesh Bansal
  --enable-theora) theora="yes"
463
  ;;
464 445ad18d Zdenek Kabelac
  --enable-faad) faad="yes"
465
  ;;
466
  --enable-faadbin) faadbin="yes"
467
  ;;
468 29d48296 Michael Niedermayer
  --enable-faac) faac="yes"
469
  ;;
470 1ddadfa9 Adam Thayer
  --enable-xvid) xvid="yes"
471
  ;;
472 6662ec29 Michael Niedermayer
  --enable-x264) x264="yes"; extralibs="$extralibs -lx264"
473
  ;;
474 f02be79d Roman Shaposhnik
  --enable-dc1394) dc1394="yes"
475
  ;;
476 68892110 Philip Gladstone
  --disable-vhook) vhook="no"
477
  ;;
478 c02dbee1 Michael Niedermayer
  --disable-simple_idct) simpleidct="no"
479 045ed63f Zdenek Kabelac
  ;;
480 732d9245 Bill Eldridge
  --enable-mingw32) mingw32="yes"
481
  ;;
482 83286d2a Zdenek Kabelac
  --enable-shared) lshared="yes"
483 0319c531 Nick Kurshev
  ;;
484 cddf3f45 Glenn Maynard
  --disable-debug) debug="no"
485
  ;;
486
  --disable-opts) optimize="no"
487
  ;;
488 1eb2212e Fabrice Bellard
  --disable-mpegaudio-hp) mpegaudio_hp="no"
489
  ;;
490 8154d2e0 Fabrice Bellard
  --disable-ffserver) ffserver="no"
491
  ;;
492 a86b921c Fabrice Bellard
  --disable-ffplay) ffplay="no"
493
  ;;
494 cddf3f45 Glenn Maynard
  --enable-small) optimize="small"
495 553a6284 Michael Niedermayer
  ;;
496 891f64b3 joca@rixmail.se
  --enable-amr_nb) amr_nb="yes"
497
  ;;
498 bc634f6f Zdenek Kabelac
  --enable-amr_nb-fixed) amr_nb_fixed="yes"
499
  ;;
500 64cba748 Michael Niedermayer
  --enable-amr_wb) amr_wb="yes"
501
  ;; 
502 2a515c08 Torsten Martinsen
  --enable-amr_if2) amr_if2="yes"
503
  ;;
504 f80f7964 Roman Shaposhnik
  --enable-sunmlib) sunmlib="yes"
505
  ;;
506 9c3d33d6 Michael Niedermayer
  --enable-pthreads) pthreads="yes"
507
  ;;
508 b2e3c528 Michael Niedermayer
  --enable-gpl) gpl="yes"
509
  ;;
510 da9b170c Michael Niedermayer
  --enable-memalign-hack) memalignhack="yes"
511
  ;;
512 65d1bea2 Michel Bardiaux
  --disable-strip) dostrip="no"
513
  ;;
514 009cf97d Michael Niedermayer
  --enable-codec=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-codec=}"
515
  ;;
516
  --disable-codec=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-codec=}##\"`"
517
  ;;
518
  --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
519
  ;;
520 de6d9b64 Fabrice Bellard
  esac
521
done
522
523 5c5dea3f Nilesh Bansal
if test "$theora" = "yes" ; then
524 9146ca37 Måns Rullgård
    if test "$libogg" = "no"; then
525
        echo "libogg must be enabled to enable Theora"     
526 5c5dea3f Nilesh Bansal
        fail="yes"
527
        theora="no"
528
    fi
529
fi
530
531
if test "$vorbis" = "yes" ; then
532 9146ca37 Måns Rullgård
    if test "$libogg" = "no"; then
533
        echo "libogg must be enabled to enable Vorbis"
534 5c5dea3f Nilesh Bansal
        fail="yes"
535
        vorbis="no"
536
    fi
537
fi
538
539 b2e3c528 Michael Niedermayer
if test "$gpl" != "yes"; then
540
    if test "$pp" != "no" -o "$shared_pp" != "no"; then
541
        echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
542
        fail="yes"
543
    fi
544
545
    if test "$a52" != "no" -o "$a52bin" != "no"; then
546
        echo "liba52 is under GPL and --enable-gpl is not specified"
547
        fail="yes"
548
    fi
549 23c99253 Michael Niedermayer
550 1ddadfa9 Adam Thayer
    if test "$xvid" != "no"; then
551
        echo "libxvidcore is under GPL and --enable-gpl is not specified"
552
        fail="yes"
553
    fi
554
555 6662ec29 Michael Niedermayer
    if test "$x264" != "no"; then
556
        echo "x264 is under GPL and --enable-gpl is not specified"
557
        fail="yes"
558
    fi
559
560 23c99253 Michael Niedermayer
    if test "$dts" != "no"; then
561
        echo "libdts is under GPL and --enable-gpl is not specified"
562
        fail="yes"
563
    fi
564 b2e3c528 Michael Niedermayer
    
565
    if test "$faad" != "no" -o "$faadbin" != "no"; then
566
        cat > $TMPC << EOF
567
            #include <faad.h>
568
            int main( void ) { return 0; }
569
EOF
570
    
571
        if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
572
            cat > $TMPC << EOF
573
                #include <faad.h>
574
                #ifndef FAAD2_VERSION
575
                ok faad1
576
                #endif
577
                int main( void ) { return 0; }
578
EOF
579
            if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
580
                echo "faad2 is under GPL and --enable-gpl is not specified"
581
                fail="yes"
582
            fi
583
        else
584
            faad="no"
585
            faadbin="no"
586
            echo "faad test failed"
587
        fi
588
    fi
589
   
590
591 a18b5183 Michael Niedermayer
    if test "$fail" = "yes"; then
592 b2e3c528 Michael Niedermayer
        exit 1
593
    fi
594
fi
595
596 0f3cb305 Fabrice Bellard
# compute mmx state
597
if test $mmx = "default"; then
598 053dea12 Aurelien Jacobs
    if test $cpu = "x86" -o $cpu = "x86_64"; then
599 0f3cb305 Fabrice Bellard
        mmx="yes"
600
    else
601
        mmx="no"
602
    fi
603
fi
604
605 cf9d24ad Dan Christiansen
#Darwin CC versions
606 75388c74 Michael Niedermayer
needmdynamicnopic="no"
607 cf9d24ad Dan Christiansen
if test $targetos = Darwin; then
608 b2924696 Roman Shaposhnik
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
609 747a0554 Tinic Uro
	CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
610 cf9d24ad Dan Christiansen
    else
611 b2924696 Roman Shaposhnik
	gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
612 cf9d24ad Dan Christiansen
	case "$gcc_version" in
613
	    *2.95*) 
614 747a0554 Tinic Uro
		CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
615 cf9d24ad Dan Christiansen
		;;
616 369a02c2 Bill May
	    *[34].*)
617 747a0554 Tinic Uro
		CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
618 75388c74 Michael Niedermayer
		if test "$lshared" = no; then
619
		   needmdynamicnopic="yes"
620
		fi
621 cf9d24ad Dan Christiansen
		;;
622
	    *)
623 747a0554 Tinic Uro
		CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
624 75388c74 Michael Niedermayer
		if test "$lshared" = no; then
625
		   needmdynamicnopic="yes"
626
		fi
627 cf9d24ad Dan Christiansen
		;;
628
	esac
629
    fi
630
fi
631
632 ab6c65f6 Brian Foley
# Can only do AltiVec on PowerPC
633
if test $altivec = "default"; then
634
    if test $cpu = "powerpc"; then
635
        altivec="yes"
636
    else
637
        altivec="no"
638
    fi
639
fi
640
641 a4adb608 Michael Niedermayer
# Add processor-specific flags
642
TUNECPU="generic"
643 9007f514 Romain Dolbeau
POWERPCMODE="32bits"
644 a4adb608 Michael Niedermayer
if test $tune != "generic"; then
645
    case $tune in
646
	601|ppc601|PowerPC601)
647
	    CFLAGS="$CFLAGS -mcpu=601"
648
	    if test $altivec = "yes"; then
649
		echo "WARNING: tuning for PPC601 but altivec enabled !";
650
	    fi
651
	    TUNECPU=ppc601
652
	;;
653
	603*|ppc603*|PowerPC603*)
654
	    CFLAGS="$CFLAGS -mcpu=603"
655
	    if test $altivec = "yes"; then
656
		echo "WARNING: tuning for PPC603 but altivec enabled !";
657
	    fi
658
	    TUNECPU=ppc603
659
	;;
660
	604*|ppc604*|PowerPC604*)
661
	    CFLAGS="$CFLAGS -mcpu=604"
662
	    if test $altivec = "yes"; then
663
		echo "WARNING: tuning for PPC604 but altivec enabled !";
664
	    fi
665
	    TUNECPU=ppc604
666
	;;
667 8d6625b6 Dan Christiansen
	G3|g3|75*|ppc75*|PowerPC75*)
668 fe0f2a97 Dan Christiansen
	    CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
669 a4adb608 Michael Niedermayer
	    if test $altivec = "yes"; then
670
		echo "WARNING: tuning for PPC75x but altivec enabled !";
671
	    fi
672
	    TUNECPU=ppc750
673
	;;
674 8d6625b6 Dan Christiansen
	G4|g4|745*|ppc745*|PowerPC745*)
675 fe0f2a97 Dan Christiansen
	    CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
676 3efd4952 Romain Dolbeau
	    if test $altivec = "no"; then
677
		echo "WARNING: tuning for PPC745x but altivec disabled !";
678
	    fi
679
	    TUNECPU=ppc7450
680
	;;
681
	74*|ppc74*|PowerPC74*)
682 fe0f2a97 Dan Christiansen
	    CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
683 a4adb608 Michael Niedermayer
	    if test $altivec = "no"; then
684
		echo "WARNING: tuning for PPC74xx but altivec disabled !";
685
	    fi
686 e45a2872 Romain Dolbeau
	    TUNECPU=ppc7400
687 a4adb608 Michael Niedermayer
	;;
688 8d6625b6 Dan Christiansen
	G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
689 9007f514 Romain Dolbeau
	    CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
690 a4adb608 Michael Niedermayer
	    if test $altivec = "no"; then
691
		echo "WARNING: tuning for PPC970 but altivec disabled !";
692
	    fi
693
	    TUNECPU=ppc970
694 9007f514 Romain Dolbeau
            POWERPCMODE="64bits"
695 a4adb608 Michael Niedermayer
	;;
696 efc39ba8 Måns Rullgård
	i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona)
697
	    CFLAGS="$CFLAGS -march=$tune"
698
	;;
699 a4adb608 Michael Niedermayer
	*)
700 efc39ba8 Måns Rullgård
	echo "WARNING: unknown CPU \"$tune\", ignored"
701 a4adb608 Michael Niedermayer
	;;
702
    esac
703
fi
704
705 cf9d24ad Dan Christiansen
# AltiVec flags: The FSF version of GCC differs from the Apple version 
706 b6e52719 Magnus Damm
if test $cpu = "powerpc"; then
707
    if test $altivec = "yes"; then
708 b2924696 Roman Shaposhnik
        if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
709 b6e52719 Magnus Damm
            CFLAGS="$CFLAGS -faltivec"
710
        else
711
            CFLAGS="$CFLAGS -maltivec -mabi=altivec"
712
        fi
713
    fi
714
fi
715
716 a9a07762 Michael Niedermayer
# See if we have <altivec.h>
717
cat > $TMPC << EOF
718
#include <altivec.h>
719
int main( void ) { return 0; }
720
EOF
721
722
_altivec_h="no"
723 b6e52719 Magnus Damm
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
724 a9a07762 Michael Niedermayer
_altivec_h="yes"
725
fi
726
727 ab6c65f6 Brian Foley
# See does our compiler support Motorola AltiVec C API
728
if test $altivec = "yes"; then
729 a9a07762 Michael Niedermayer
if test $_altivec_h = "yes"; then
730 ab6c65f6 Brian Foley
cat > $TMPC << EOF
731 a9a07762 Michael Niedermayer
#include <altivec.h>
732 ab6c65f6 Brian Foley
int main(void) {
733
    vector signed int v1, v2, v3;
734
    v1 = vec_add(v2,v3);
735
    return 0;
736
}
737
EOF
738 a9a07762 Michael Niedermayer
else
739
cat > $TMPC << EOF
740
int main(void) {
741
    vector signed int v1, v2, v3;
742
    v1 = vec_add(v2,v3);
743
    return 0;
744
}
745
EOF
746
fi
747 b6e52719 Magnus Damm
$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
748 ab6c65f6 Brian Foley
fi
749
750 d46aba26 Leon van Stuivenberg
# Can only do mmi on mips
751
if test $mmi = "default"; then
752
    if test $cpu = "mips"; then
753
        mmi="yes"
754
    else
755
        mmi="no"
756
    fi
757
fi
758
759
# See does our compiler support mmi
760
if test $mmi = "yes"; then
761
cat > $TMPC << EOF
762
int main(void) {
763
    __asm__ ("lq \$2, 0(\$2)");
764
    return 0;
765
}
766
EOF
767 f3ec2d46 Slavik Gnatenko
$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
768 d46aba26 Leon van Stuivenberg
fi
769
770 732d9245 Bill Eldridge
if test "$mingw32" = "yes" ; then
771
    v4l="no"
772
    audio_oss="no"
773 8aa3ee32 Max Krasnyansky
    dv1394="no"
774 f02be79d Roman Shaposhnik
    dc1394="no"
775 951bf3e6 Fabrice Bellard
    ffserver="no"
776 732d9245 Bill Eldridge
    network="no"
777 951bf3e6 Fabrice Bellard
    LIBPREF=""
778
    LIBSUF=".lib"
779
    SLIBPREF=""
780
    SLIBSUF=".dll"
781
    EXESUF=".exe"
782
    prefix="/c/Program Files/FFmpeg"
783
    bindir="$prefix"
784 732d9245 Bill Eldridge
fi
785
786 0f3cb305 Fabrice Bellard
cc="${cross_prefix}${cc}"
787
ar="${cross_prefix}${ar}"
788 be7109c1 Michael Niedermayer
ranlib="${cross_prefix}${ranlib}"
789 0f3cb305 Fabrice Bellard
strip="${cross_prefix}${strip}"
790
791 487a54d7 Fabrice Bellard
if test -z "$cross_prefix" ; then
792
793 3d204385 Nick Kurshev
# ---
794 a3999908 Michael Niedermayer
# big/little endian test
795
cat > $TMPC << EOF
796
#include <inttypes.h>
797
int main(int argc, char ** argv){
798
	volatile uint32_t i=0x01234567;
799
	return (*((uint8_t*)(&i))) == 0x67;
800
}
801
EOF
802
803 f3ec2d46 Slavik Gnatenko
if $cc -o $TMPE $TMPC 2>/dev/null ; then
804
$TMPE && bigendian="yes"
805 a3999908 Michael Niedermayer
else
806
echo big/little test failed
807
fi
808
809 487a54d7 Fabrice Bellard
else
810
811
# if cross compiling, cannot launch a program, so make a static guess
812
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
813
    bigendian="yes"
814
fi
815
816
fi
817
818 a3999908 Michael Niedermayer
# ---
819 7f965c1c Chris Flerackers
# *inttypes.h* test
820
cat > $TMPC << EOF
821
#include <inttypes.h>
822
int main(int argc, char ** argv){
823
    return 0;
824
}
825
EOF
826
827
$cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
828
829
# ---
830 b5c950c4 Michael Niedermayer
# *int_fast* test
831
cat > $TMPC << EOF
832
#include <inttypes.h>
833
int main(int argc, char ** argv){
834
	volatile uint_fast64_t i=0x01234567;
835
	return 0;
836
}
837
EOF
838
839
$cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
840
841
# ---
842 3d204385 Nick Kurshev
# check availability of some header files
843
844
cat > $TMPC << EOF
845
#include <malloc.h>
846
int main( void ) { return 0; }
847
EOF
848
849
_memalign=no
850
_malloc_h=no
851 f3ec2d46 Slavik Gnatenko
if $cc -o $TMPE $TMPC 2> /dev/null ; then
852 3d204385 Nick Kurshev
_malloc_h=yes
853
_memalign=yes
854
# check for memalign - atmos
855
cat > $TMPC << EOF
856 487c2fad Michael Niedermayer
#include <stdio.h>
857 3d204385 Nick Kurshev
#include <malloc.h>
858
int main ( void ) {
859
char *string = NULL;
860
string = memalign(64, sizeof(char));
861
return 0;
862
}
863
EOF
864 f3ec2d46 Slavik Gnatenko
$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
865 3d204385 Nick Kurshev
fi
866
867 8bf5d58f Michael Niedermayer
if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
868
    echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
869
    exit 1
870
fi
871
872 68892110 Philip Gladstone
cat > $TMPC << EOF
873 5e4639e2 Glenn Maynard
#include <time.h>
874
int main( void ) { localtime_r(NULL, NULL); }
875
EOF
876
877
localtime_r=no
878
if $cc -o $TMPE $TMPC 2> /dev/null ; then
879
  localtime_r=yes
880
fi
881
882 0147f198 François Revol
if test "$zlib" = "yes"; then
883
# check for zlib - mmu_man
884
cat > $TMPC << EOF
885
#include <zlib.h>
886
int main ( void ) {
887
if (zlibVersion() != ZLIB_VERSION)
888
   puts("zlib version differs !!!");
889
   return 1;
890
return 0;
891
}
892
EOF
893 e27ca59b Michael Niedermayer
$cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
894 f3ec2d46 Slavik Gnatenko
# $TMPE 2> /dev/null > /dev/null || zlib="no"
895 0147f198 François Revol
# XXX: more tests needed - runtime test
896
fi
897
if test "$zlib" = "yes"; then
898
extralibs="$extralibs -lz"
899
fi
900
901 95e2ce4a Michael Niedermayer
# test for lrintf in math.h
902
cat > $TMPC << EOF
903
#define _ISOC9X_SOURCE  1
904
#include <math.h>
905
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
906
EOF
907
908
have_lrintf="no"
909 f3ec2d46 Slavik Gnatenko
if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
910 95e2ce4a Michael Niedermayer
  have_lrintf="yes"
911 c2b9685e Michael Niedermayer
  # allanc@chickenandporn.com: cannot execute cross-compiled
912
  # code on the host.  Only execute if not cross-compiling.
913
  if test -z "$cross_prefix" ; then
914
    $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
915
  fi
916 95e2ce4a Michael Niedermayer
fi
917
918 c13e1abd Falk Hüffner
_restrict=
919
for restrict_keyword in restrict __restrict__ __restrict; do
920
  echo "void foo(char * $restrict_keyword p);" > $TMPC
921
  if $cc -c -o $TMPO $TMPC 2> /dev/null; then
922
    _restrict=$restrict_keyword
923
    break;
924
  fi
925
done
926
927 52b41d7f Fabrice Bellard
# test gcc version to see if vector builtins can be used
928
# currently only used on i386 for MMX builtins
929
cat > $TMPC << EOF
930 053dea12 Aurelien Jacobs
#include <xmmintrin.h>
931 52b41d7f Fabrice Bellard
int main(void) { 
932
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
933
return 0;
934
#else
935
#error no vector builtins
936
#endif
937
}
938
EOF
939
940
builtin_vector=no
941 13c2469d Michael Niedermayer
if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
942 52b41d7f Fabrice Bellard
  builtin_vector=yes
943 a8721c09 Fabrice Bellard
fi
944
945
# dlopen/dlfcn.h probing
946
947
cat > $TMPC << EOF
948
#include <dlfcn.h>
949
int main( void ) { return (int) dlopen("foo", 0); }
950
EOF
951
952
ldl=-ldl
953
954 cf9d24ad Dan Christiansen
if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
955 a8721c09 Fabrice Bellard
dlfcn=yes
956
dlopen=yes
957
fi
958
959 cf9d24ad Dan Christiansen
if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
960 a8721c09 Fabrice Bellard
dlfcn=yes
961
dlopen=yes
962
ldl=""
963
fi
964
965
cat > $TMPC << EOF
966
int main( void ) { return (int) dlopen("foo", 0); }
967
EOF
968
969 cf9d24ad Dan Christiansen
if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1  ; then
970 a8721c09 Fabrice Bellard
dlopen=yes
971
fi
972
973 cf9d24ad Dan Christiansen
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
974 a8721c09 Fabrice Bellard
dlopen=yes
975
ldl=""
976
fi
977
978
if test "$vhook" = "default" ; then
979
  vhook="$dlopen"
980
fi
981
982 a86b921c Fabrice Bellard
##########################################
983
# imlib probe
984
985 a8721c09 Fabrice Bellard
cat > $TMPC << EOF
986
#include <X11/Xlib.h>
987
#include <Imlib2.h>
988
int main( void ) { return (int) imlib_load_font("foo"); }
989
EOF
990
991
imlib2=no
992 7802d373 Michael Niedermayer
if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1  ; then
993 a8721c09 Fabrice Bellard
imlib2=yes
994 52b41d7f Fabrice Bellard
fi
995
996 a86b921c Fabrice Bellard
##########################################
997
# freetype probe
998
999 04511d53 Philip Gladstone
cat > $TMPC << EOF
1000
#include <ft2build.h>
1001
int main( void ) { return (int) FT_Init_FreeType(0); }
1002
EOF
1003
1004
freetype2=no
1005 69db4e10 Slavik Gnatenko
if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
1006 e2a3cd59 Roman Shaposhnik
  if (freetype-config --version) >/dev/null 2>&1 ; then
1007 cf9d24ad Dan Christiansen
    if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  > /dev/null 2>&1 ; then
1008 dee076fc François Revol
      freetype2=yes
1009 04511d53 Philip Gladstone
    fi
1010 dee076fc François Revol
  fi
1011 04511d53 Philip Gladstone
fi
1012
1013 a86b921c Fabrice Bellard
##########################################
1014
# SDL probe
1015
1016
cat > $TMPC << EOF
1017
#include <SDL.h>
1018 31319a8c Fabrice Bellard
#undef main /* We don't want SDL to override our main() */
1019 a86b921c Fabrice Bellard
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1020
EOF
1021
1022
sdl_too_old=no
1023
sdl=no
1024 e2a3cd59 Roman Shaposhnik
if (sdl-config --version) >/dev/null 2>&1 ; then
1025 cf9d24ad Dan Christiansen
if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs`  > /dev/null 2>&1  ; then
1026 a86b921c Fabrice Bellard
_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
1027
if test "$_sdlversion" -lt 121 ; then
1028
sdl_too_old=yes
1029
else
1030
sdl=yes
1031
fi
1032
fi
1033 c3f6b472 Michael Niedermayer
fi
1034 a86b921c Fabrice Bellard
1035 146ea952 Nicolas Boos
##########################################
1036
# texi2html probe
1037
1038
texi2html=no
1039 e2a3cd59 Roman Shaposhnik
if (texi2html -version) >/dev/null 2>&1; then
1040 146ea952 Nicolas Boos
texi2html=yes
1041
fi
1042
1043 7a91333f Hans Zandbelt
if test "$network" = "yes" ; then
1044
##########################################
1045
# IPv6 probe
1046
1047
cat > $TMPC << EOF
1048
#include <sys/types.h>
1049
#include <sys/socket.h>
1050
#include <netinet/in.h>
1051
#include <netdb.h>
1052
int main( void ) {
1053
  struct sockaddr_storage saddr;
1054
  struct ipv6_mreq mreq6;
1055
  getaddrinfo(0,0,0,0);
1056
  getnameinfo(0,0,0,0,0,0,0);
1057
  IN6_IS_ADDR_MULTICAST(0);
1058
}
1059
EOF
1060
1061
ipv6=no
1062
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
1063
ipv6=yes
1064
fi
1065
fi
1066
1067 b2924696 Roman Shaposhnik
case "`$cc -v 2>&1 | grep version`" in
1068 cf9d24ad Dan Christiansen
    *gcc*)
1069 2f3eca08 Michael Niedermayer
	CFLAGS="-Wall -Wno-switch $CFLAGS"
1070 cf9d24ad Dan Christiansen
	;;
1071
    *)
1072
	;;
1073
esac
1074
1075 94a3401e Fabrice Bellard
if test "$sdl" = "no" ; then
1076
   ffplay=no
1077
fi
1078
1079 cddf3f45 Glenn Maynard
if test "$debug" = "yes"; then
1080 7906085f Falk Hüffner
	CFLAGS="-g $CFLAGS"
1081 cddf3f45 Glenn Maynard
fi
1082
1083
if test "$optimize" = "small"; then
1084 98ca7790 Michael Niedermayer
#  CFLAGS=${CFLAGS//-O3/-Os}
1085 553a6284 Michael Niedermayer
  CFLAGS="$CFLAGS -Os"
1086
fi
1087
1088 cddf3f45 Glenn Maynard
if test "$optimize" = "yes"; then
1089 b2924696 Roman Shaposhnik
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
1090 cf9d24ad Dan Christiansen
	CFLAGS="$CFLAGS -O5"
1091
	LDFLAGS="$LDFLAGS -O5"
1092
    else
1093 7906085f Falk Hüffner
	CFLAGS="-O3 $CFLAGS"
1094 cf9d24ad Dan Christiansen
    fi
1095 cddf3f45 Glenn Maynard
fi
1096
1097 951bf3e6 Fabrice Bellard
if test x"$bindir" = x""; then
1098
bindir="${prefix}/bin"
1099
fi
1100
1101 cc973ecb Luca Barbato
if test x"$libdir" = x""; then
1102
libdir="${prefix}/lib"
1103
fi
1104
1105 23a65308 Fabrice Bellard
if test x"$mandir" = x""; then
1106
mandir="${prefix}/man"
1107
fi
1108
1109 de6d9b64 Fabrice Bellard
echo "Install prefix   $prefix"
1110 0f3cb305 Fabrice Bellard
echo "Source path      $source_path"
1111 de6d9b64 Fabrice Bellard
echo "C compiler       $cc"
1112 4a908fbc Alex Beregszaszi
echo "make             $make"
1113 a4adb608 Michael Niedermayer
echo "CPU              $cpu ($tune)"
1114 eb94aca9 Charles Yates
if test "$BUILDSUF" != ""; then
1115
echo "Build suffix     $BUILDSUF"
1116
fi
1117 0f3cb305 Fabrice Bellard
echo "Big Endian       $bigendian"
1118 7f965c1c Chris Flerackers
echo "inttypes.h       $inttypes"
1119 b5c950c4 Michael Niedermayer
echo "broken inttypes.h $emu_fast_int"
1120 053dea12 Aurelien Jacobs
if test $cpu = "x86" -o $cpu = "x86_64"; then
1121 de6d9b64 Fabrice Bellard
echo "MMX enabled      $mmx"
1122 52b41d7f Fabrice Bellard
echo "Vector Builtins  $builtin_vector"
1123 e41e8342 Fabrice Bellard
fi
1124
if test $cpu = "mips"; then
1125 d46aba26 Leon van Stuivenberg
echo "MMI enabled      $mmi"
1126 e41e8342 Fabrice Bellard
fi
1127
if test $cpu = "powerpc"; then
1128 ab6c65f6 Brian Foley
echo "AltiVec enabled  $altivec"
1129 e41e8342 Fabrice Bellard
fi
1130 de6d9b64 Fabrice Bellard
echo "gprof enabled    $gprof"
1131 0147f198 François Revol
echo "zlib enabled     $zlib"
1132 bb4c2140 Michael Niedermayer
echo "libgsm enabled   $libgsm"
1133 a6741398 Juanjo
echo "mp3lame enabled  $mp3lame"
1134 9146ca37 Måns Rullgård
echo "libogg enabled   $libogg"
1135 81e0d0b4 Mark Hills
echo "vorbis enabled   $vorbis"
1136 5c5dea3f Nilesh Bansal
echo "theora enabled   $theora"
1137 445ad18d Zdenek Kabelac
echo "faad enabled     $faad"
1138
echo "faadbin enabled  $faadbin"
1139 29d48296 Michael Niedermayer
echo "faac enabled     $faac"
1140 1ddadfa9 Adam Thayer
echo "xvid enabled     $xvid"
1141 6662ec29 Michael Niedermayer
echo "x264 enabled     $x264"
1142 5cbcf02c Fabrice Bellard
echo "a52 support      $a52"
1143 57514323 Zdenek Kabelac
echo "a52 dlopened     $a52bin"
1144 23c99253 Michael Niedermayer
echo "dts support      $dts"
1145 bba9b16c Michael Niedermayer
echo "pp support       $pp"
1146 cddf3f45 Glenn Maynard
echo "debug symbols    $debug"
1147 65d1bea2 Michel Bardiaux
echo "strip symbols    $dostrip"
1148 cddf3f45 Glenn Maynard
echo "optimize         $optimize"
1149 bba9b16c Michael Niedermayer
echo "shared pp        $shared_pp"
1150 47930f09 Philip Gladstone
echo "Video hooking    $vhook"
1151 a86b921c Fabrice Bellard
echo "SDL support      $sdl"
1152
if test $sdl_too_old = "yes"; then
1153
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1154
fi
1155 68892110 Philip Gladstone
1156
if test "$vhook" = "yes" ; then
1157 47930f09 Philip Gladstone
echo "Imlib2 support   $imlib2"
1158 04511d53 Philip Gladstone
echo "freetype support $freetype2"
1159 68892110 Philip Gladstone
fi
1160 f80f7964 Roman Shaposhnik
echo "Sun medialib support"  $sunmlib
1161 9c3d33d6 Michael Niedermayer
echo "pthreads support"      $pthreads
1162 bc634f6f Zdenek Kabelac
echo "AMR-NB float support"  $amr_nb
1163
echo "AMR-NB fixed support"  $amr_nb_fixed
1164 d663a1fd Michael Niedermayer
echo "AMR-WB float support"  $amr_wb
1165 2a515c08 Torsten Martinsen
echo "AMR-WB IF2 support"    $amr_if2
1166 7a91333f Hans Zandbelt
echo "network support      $network"
1167
if test "$network" = "yes" ; then
1168
echo "IPv6 support         $ipv6"
1169
fi
1170 b2e3c528 Michael Niedermayer
if test "$gpl" = "no" ; then
1171
echo "License: LGPL"
1172
else
1173
echo "License: GPL"
1174
fi
1175 de6d9b64 Fabrice Bellard
1176 980fc7b8 Fabrice Bellard
echo "Creating config.mak and config.h"
1177 de6d9b64 Fabrice Bellard
1178 f255e0ab Michel Bardiaux
date >> config.log
1179
echo "   $0 $FFMPEG_CONFIGURATION" >> config.log
1180 980fc7b8 Fabrice Bellard
echo "# Automatically generated by configure - do not modify" > config.mak
1181 045ed63f Zdenek Kabelac
echo "/* Automatically generated by configure - do not modify */" > $TMPH
1182 f255e0ab Michel Bardiaux
echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1183 de6d9b64 Fabrice Bellard
1184 980fc7b8 Fabrice Bellard
echo "prefix=$prefix" >> config.mak
1185 cc973ecb Luca Barbato
echo "libdir=$libdir" >> config.mak
1186 951bf3e6 Fabrice Bellard
echo "bindir=$bindir" >> config.mak
1187 23a65308 Fabrice Bellard
echo "mandir=$mandir" >> config.mak
1188 4a908fbc Alex Beregszaszi
echo "MAKE=$make" >> config.mak
1189 980fc7b8 Fabrice Bellard
echo "CC=$cc" >> config.mak
1190
echo "AR=$ar" >> config.mak
1191 be7109c1 Michael Niedermayer
echo "RANLIB=$ranlib" >> config.mak
1192 65d1bea2 Michel Bardiaux
if test "$dostrip" = "yes" ; then
1193 0f3cb305 Fabrice Bellard
echo "STRIP=$strip" >> config.mak
1194 65d1bea2 Michel Bardiaux
echo "INSTALLSTRIP=-s" >> config.mak
1195
else
1196
echo "STRIP=echo ignoring strip" >> config.mak
1197
echo "INSTALLSTRIP=" >> config.mak
1198
fi
1199 75388c74 Michael Niedermayer
1200
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic.  Used when building 
1201
# shared modules on OS/X (vhook/Makefile).
1202
SHCFLAGS=$CFLAGS
1203
if test "$needmdynamicnopic" = yes; then
1204
   CFLAGS="$CFLAGS -mdynamic-no-pic"
1205
fi
1206
1207 a9b3f630 Nick Kurshev
echo "OPTFLAGS=$CFLAGS" >> config.mak
1208 75388c74 Michael Niedermayer
echo "SHCFLAGS=$SHCFLAGS">>config.mak
1209 0f3cb305 Fabrice Bellard
echo "LDFLAGS=$LDFLAGS" >> config.mak
1210 f39e56a8 Jacob Meuser
echo "LDCONFIG=$LDCONFIG" >> config.mak
1211 4baca069 Philip Gladstone
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1212 e1707f52 Michael Niedermayer
echo "SHFLAGS=$SHFLAGS" >> config.mak
1213 eb94aca9 Charles Yates
echo "BUILDSUF=$BUILDSUF" >> config.mak
1214 f3ec2d46 Slavik Gnatenko
echo "LIBPREF=$LIBPREF" >> config.mak
1215 eb94aca9 Charles Yates
echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1216 f3ec2d46 Slavik Gnatenko
echo "SLIBPREF=$SLIBPREF" >> config.mak
1217 eb94aca9 Charles Yates
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1218
echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1219 6852ac95 Romain Dolbeau
echo "TARGET_OS=$TARGET_OS" >> config.mak
1220 57514323 Zdenek Kabelac
if test "$cpu" = "x86" ; then
1221 980fc7b8 Fabrice Bellard
  echo "TARGET_ARCH_X86=yes" >> config.mak
1222 045ed63f Zdenek Kabelac
  echo "#define ARCH_X86 1" >> $TMPH
1223 053dea12 Aurelien Jacobs
elif test "$cpu" = "x86_64" ; then
1224
  echo "TARGET_ARCH_X86_64=yes" >> config.mak
1225
  echo "#define ARCH_X86_64 1" >> $TMPH
1226 0f3cb305 Fabrice Bellard
elif test "$cpu" = "armv4l" ; then
1227 6ed7422a Fabrice Bellard
  echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1228 045ed63f Zdenek Kabelac
  echo "#define ARCH_ARMV4L 1" >> $TMPH
1229 0f3cb305 Fabrice Bellard
elif test "$cpu" = "alpha" ; then
1230 91d1f1a4 Nick Kurshev
  echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1231 045ed63f Zdenek Kabelac
  echo "#define ARCH_ALPHA 1" >> $TMPH
1232 35fedfc3 Philip Gladstone
elif test "$cpu" = "sparc64" ; then
1233
  echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1234
  echo "#define ARCH_SPARC64 1" >> $TMPH
1235 bb476ff3 James Morrison
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1236
  echo "#define ARCH_SPARC 1" >> $TMPH
1237
elif test "$cpu" = "sparc" ; then
1238
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1239
  echo "#define ARCH_SPARC 1" >> $TMPH
1240 0f3cb305 Fabrice Bellard
elif test "$cpu" = "powerpc" ; then
1241
  echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1242
  echo "#define ARCH_POWERPC 1" >> $TMPH
1243 9007f514 Romain Dolbeau
  if test $POWERPCMODE = "32bits"; then
1244
    echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1245
  else
1246
    echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1247
  fi
1248 e45a2872 Romain Dolbeau
  if test "$powerpc_perf" = "yes"; then
1249
    echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1250
  fi
1251 d46aba26 Leon van Stuivenberg
elif test "$cpu" = "mips" ; then
1252
  echo "TARGET_ARCH_MIPS=yes" >> config.mak
1253
  echo "#define ARCH_MIPS 1" >> $TMPH
1254 bdb2e37c Alex Beregszaszi
elif test "$cpu" = "sh4" ; then
1255
  echo "TARGET_ARCH_SH4=yes" >> config.mak
1256
  echo "#define ARCH_SH4 1" >> $TMPH
1257
fi
1258 a4adb608 Michael Niedermayer
echo "#define TUNECPU $TUNECPU" >> $TMPH
1259 0f3cb305 Fabrice Bellard
if test "$bigendian" = "yes" ; then
1260
  echo "WORDS_BIGENDIAN=yes" >> config.mak
1261
  echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1262 91d1f1a4 Nick Kurshev
fi
1263 d2a9bddd Michael Niedermayer
if test "$inttypes" != "yes" ; then
1264
  echo "#define EMULATE_INTTYPES 1" >> $TMPH
1265 7f965c1c Chris Flerackers
fi
1266 b5c950c4 Michael Niedermayer
if test "$emu_fast_int" = "yes" ; then
1267 19d053c5 Roman Shaposhnik
  echo "#define EMULATE_FAST_INT 1" >> $TMPH
1268 b5c950c4 Michael Niedermayer
fi
1269 57514323 Zdenek Kabelac
if test "$mmx" = "yes" ; then
1270 980fc7b8 Fabrice Bellard
  echo "TARGET_MMX=yes" >> config.mak
1271 045ed63f Zdenek Kabelac
  echo "#define HAVE_MMX 1" >> $TMPH
1272 e82c5a8c Michael Niedermayer
  echo "#define __CPU__ 586" >> $TMPH
1273 de6d9b64 Fabrice Bellard
fi
1274 52b41d7f Fabrice Bellard
if test "$builtin_vector" = "yes" ; then
1275
  echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1276
  echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1277
fi
1278 d46aba26 Leon van Stuivenberg
if test "$mmi" = "yes" ; then
1279
  echo "TARGET_MMI=yes" >> config.mak
1280
  echo "#define HAVE_MMI 1" >> $TMPH
1281
fi
1282 ab6c65f6 Brian Foley
if test "$altivec" = "yes" ; then
1283
  echo "TARGET_ALTIVEC=yes" >> config.mak
1284
  echo "#define HAVE_ALTIVEC 1" >> $TMPH
1285 db40a39a Michael Niedermayer
  echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1286
  echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1287 a9a07762 Michael Niedermayer
  if test "$_altivec_h" = "yes" ; then
1288
    echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1289
  else
1290 e67e14d5 Alex Beregszaszi
    echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1291 a9a07762 Michael Niedermayer
  fi
1292 ab6c65f6 Brian Foley
fi
1293 57514323 Zdenek Kabelac
if test "$gprof" = "yes" ; then
1294 980fc7b8 Fabrice Bellard
  echo "TARGET_GPROF=yes" >> config.mak
1295 045ed63f Zdenek Kabelac
  echo "#define HAVE_GPROF 1" >> $TMPH
1296 de6d9b64 Fabrice Bellard
fi
1297 5e4639e2 Glenn Maynard
if test "$localtime_r" = "yes" ; then
1298
  echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1299
fi
1300 68892110 Philip Gladstone
if test "$imlib2" = "yes" ; then
1301
  echo "HAVE_IMLIB2=yes" >> config.mak
1302
fi
1303 04511d53 Philip Gladstone
if test "$freetype2" = "yes" ; then
1304
  echo "HAVE_FREETYPE2=yes" >> config.mak
1305
fi
1306 f80f7964 Roman Shaposhnik
if test "$sunmlib" = "yes" ; then
1307
  echo "HAVE_MLIB=yes" >> config.mak
1308
  echo "#define HAVE_MLIB 1" >> $TMPH
1309
  extralibs="$extralibs -lmlib"
1310
fi
1311 9c3d33d6 Michael Niedermayer
if test "$pthreads" = "yes" ; then
1312
  echo "HAVE_PTHREADS=yes" >> config.mak
1313
  echo "#define HAVE_PTHREADS 1" >> $TMPH
1314 2450cff2 François Revol
  echo "#define HAVE_THREADS 1" >> $TMPH
1315 8c802695 Jacob Meuser
  if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
1316 12043e1d Steven M. Schultz
     extralibs="$extralibs -lpthread"
1317
  fi
1318 9c3d33d6 Michael Niedermayer
fi
1319 a86b921c Fabrice Bellard
if test "$sdl" = "yes" ; then
1320
  echo "CONFIG_SDL=yes" >> config.mak
1321
  echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1322
  echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1323
fi
1324 146ea952 Nicolas Boos
if test "$texi2html" = "yes"; then
1325
  echo "BUILD_DOC=yes" >> config.mak
1326
fi
1327 95e2ce4a Michael Niedermayer
if test "$have_lrintf" = "yes" ; then
1328
  echo "#define HAVE_LRINTF 1" >> $TMPH
1329
fi
1330 68892110 Philip Gladstone
if test "$vhook" = "yes" ; then
1331
  echo "BUILD_VHOOK=yes" >> config.mak
1332
  echo "#define HAVE_VHOOK 1" >> $TMPH
1333 9c938e77 Philip Gladstone
  extralibs="$extralibs $ldl"
1334 68892110 Philip Gladstone
fi
1335 57514323 Zdenek Kabelac
if test "$lshared" = "yes" ; then
1336 0319c531 Nick Kurshev
  echo "BUILD_SHARED=yes" >> config.mak
1337 97006039 Jacob Meuser
  echo "PIC=-fPIC -DPIC" >> config.mak
1338 0319c531 Nick Kurshev
fi
1339 ef0bc4c9 François Revol
echo "EXTRALIBS=$extralibs" >> config.mak
1340 281a74da Michael Niedermayer
version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1341 258207b7 Fabrice Bellard
 cut -d '"' -f 2`
1342
echo "VERSION=$version" >>config.mak
1343 d771bcae Fabrice Bellard
# if you do not want to use encoders, disable that.
1344 045ed63f Zdenek Kabelac
echo "#define CONFIG_ENCODERS 1" >> $TMPH
1345 d771bcae Fabrice Bellard
echo "CONFIG_ENCODERS=yes" >> config.mak
1346
1347
# if you do not want to use decoders, disable that.
1348 045ed63f Zdenek Kabelac
echo "#define CONFIG_DECODERS 1" >> $TMPH
1349 d771bcae Fabrice Bellard
echo "CONFIG_DECODERS=yes" >> config.mak
1350
1351 5cbcf02c Fabrice Bellard
# AC3
1352
if test "$a52" = "yes" ; then
1353
  echo "#define CONFIG_AC3 1" >> $TMPH
1354
  echo "CONFIG_AC3=yes" >> config.mak
1355 d771bcae Fabrice Bellard
1356 5cbcf02c Fabrice Bellard
  if test "$a52bin" = "yes" ; then
1357
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1358
    echo "CONFIG_A52BIN=yes" >> config.mak
1359
  fi
1360
fi
1361
1362 23c99253 Michael Niedermayer
# DTS
1363
if test "$dts" = "yes" ; then
1364
  echo "#define CONFIG_DTS 1" >> $TMPH
1365
  echo "CONFIG_DTS=yes" >> config.mak
1366
fi
1367
1368 bba9b16c Michael Niedermayer
# PP
1369
if test "$pp" = "yes" ; then
1370
  echo "#define CONFIG_PP 1" >> $TMPH
1371
  echo "CONFIG_PP=yes" >> config.mak
1372
1373
  if test "$shared_pp" = "yes" ; then
1374
    echo "#define SHARED_PP 1" >> $TMPH
1375
    echo "SHARED_PP=yes" >> config.mak
1376
  fi
1377
fi
1378
1379 1eb2212e Fabrice Bellard
# mpeg audio high precision mode
1380
if test "$mpegaudio_hp" = "yes" ; then
1381
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1382
fi
1383
1384 5cbcf02c Fabrice Bellard
if test "$v4l" = "yes" ; then
1385
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1386
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1387
fi
1388
1389 8aa3ee32 Max Krasnyansky
if test "$dv1394" = "yes" ; then
1390
  echo "#define CONFIG_DV1394 1" >> $TMPH
1391
  echo "CONFIG_DV1394=yes" >> config.mak
1392
fi
1393
1394 f02be79d Roman Shaposhnik
if test "$dc1394" = "yes" ; then
1395
  echo "#define CONFIG_DC1394 1" >> $TMPH
1396
  echo "CONFIG_DC1394=yes" >> config.mak
1397
fi
1398
1399 adbc0510 Philip Gladstone
if test "$dlopen" = "yes" ; then
1400
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1401
fi
1402
1403
if test "$dlfcn" = "yes" ; then
1404
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1405
fi
1406
1407 5cbcf02c Fabrice Bellard
if test "$audio_oss" = "yes" ; then
1408
  echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1409
  echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1410 57514323 Zdenek Kabelac
fi
1411
1412 dfdfa47c François Revol
if test "$audio_beos" = "yes" ; then
1413
  echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1414
  echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1415
fi
1416
1417 5cbcf02c Fabrice Bellard
if test "$network" = "yes" ; then
1418
  echo "#define CONFIG_NETWORK 1" >> $TMPH
1419
  echo "CONFIG_NETWORK=yes" >> config.mak
1420 6ed7422a Fabrice Bellard
fi
1421 daf8e955 Fabrice Bellard
1422 7a91333f Hans Zandbelt
if test "$ipv6" = "yes" ; then
1423
  echo "#define CONFIG_IPV6 1" >> $TMPH
1424
fi
1425
1426 0147f198 François Revol
if test "$zlib" = "yes" ; then
1427
  echo "#define CONFIG_ZLIB 1" >> $TMPH
1428
  echo "CONFIG_ZLIB=yes" >> config.mak
1429
fi
1430
1431 bb4c2140 Michael Niedermayer
if test "$libgsm" = "yes" ; then
1432
  echo "#define CONFIG_LIBGSM 1" >> $TMPH
1433
  echo "CONFIG_LIBGSM=yes" >> config.mak
1434
fi
1435
1436 57514323 Zdenek Kabelac
if test "$mp3lame" = "yes" ; then
1437 045ed63f Zdenek Kabelac
  echo "#define CONFIG_MP3LAME 1" >> $TMPH
1438 a6741398 Juanjo
  echo "CONFIG_MP3LAME=yes" >> config.mak
1439
fi
1440
1441 9146ca37 Måns Rullgård
if test "$libogg" = "yes" ; then
1442 5c5dea3f Nilesh Bansal
  echo "#define CONFIG_LIBOGG 1" >> $TMPH
1443
  echo "CONFIG_LIBOGG=yes" >> config.mak
1444
fi
1445
1446 81e0d0b4 Mark Hills
if test "$vorbis" = "yes" ; then
1447 5c5dea3f Nilesh Bansal
  echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1448
  echo "CONFIG_LIBVORBIS=yes" >> config.mak
1449
fi
1450
1451
if test "$theora" = "yes" ; then
1452
  echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1453
  echo "CONFIG_LIBTHEORA=yes" >> config.mak
1454 81e0d0b4 Mark Hills
fi
1455
1456 0fc50e58 Zdenek Kabelac
if test "$faad" = "yes" ; then
1457
  echo "#define CONFIG_FAAD 1" >> $TMPH
1458
  echo "CONFIG_FAAD=yes" >> config.mak
1459
fi
1460
1461
if test "$faadbin" = "yes" ; then
1462
  echo "#define CONFIG_FAADBIN 1" >> $TMPH
1463 445ad18d Zdenek Kabelac
  echo "CONFIG_FAADBIN=yes" >> config.mak
1464 0fc50e58 Zdenek Kabelac
fi
1465
1466 29d48296 Michael Niedermayer
if test "$faac" = "yes" ; then
1467
  echo "#define CONFIG_FAAC 1" >> $TMPH
1468
  echo "CONFIG_FAAC=yes" >> config.mak
1469
fi
1470
1471 1ddadfa9 Adam Thayer
if test "$xvid" = "yes" ; then
1472
  echo "#define CONFIG_XVID 1" >> $TMPH
1473
  echo "CONFIG_XVID=yes" >> config.mak
1474
fi
1475
1476 6662ec29 Michael Niedermayer
if test "$x264" = "yes" ; then
1477
  echo "#define CONFIG_X264 1" >> $TMPH
1478
  echo "CONFIG_X264=yes" >> config.mak
1479
fi
1480
1481 732d9245 Bill Eldridge
if test "$mingw32" = "yes" ; then
1482
  echo "#define CONFIG_WIN32 1" >> $TMPH
1483
  echo "CONFIG_WIN32=yes" >> config.mak
1484 16806499 Michael Niedermayer
  echo "HAVE_W32THREADS=yes" >> config.mak
1485
  echo "#define HAVE_W32THREADS 1" >> $TMPH
1486 2450cff2 François Revol
  echo "#define HAVE_THREADS 1" >> $TMPH
1487 7eea5766 Fabrice Bellard
  echo "#ifndef __MINGW32__" >> $TMPH
1488 732d9245 Bill Eldridge
  echo "#define __MINGW32__ 1" >> $TMPH
1489 7eea5766 Fabrice Bellard
  echo "#endif" >> $TMPH
1490 3f027ca7 Felix Bünemann
fi
1491
1492 f3ec2d46 Slavik Gnatenko
if test "$os2" = "yes" ; then
1493
  echo "#define CONFIG_OS2 1" >> $TMPH
1494
  echo "CONFIG_OS2=yes" >> config.mak
1495
fi
1496
1497 6e023978 Roman Shaposhnik
if test "$TARGET_OS" = "SunOS" ; then
1498
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1499
fi
1500
1501 2450cff2 François Revol
if test "$TARGET_OS" = "BeOS" ; then
1502
  echo "HAVE_BEOSTHREADS=yes" >> config.mak
1503
  echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1504
  echo "#define HAVE_THREADS 1" >> $TMPH
1505
fi
1506
1507 90cee0c3 Michael Niedermayer
if test "$darwin" = "yes"; then
1508
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
1509
  echo "CONFIG_DARWIN=yes" >> config.mak
1510
fi
1511
1512 57514323 Zdenek Kabelac
if test "$_malloc_h" = "yes" ; then
1513 045ed63f Zdenek Kabelac
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1514 3d204385 Nick Kurshev
else
1515 045ed63f Zdenek Kabelac
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1516 3d204385 Nick Kurshev
fi
1517
1518 57514323 Zdenek Kabelac
if test "$_memalign" = "yes" ; then
1519 045ed63f Zdenek Kabelac
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1520
else
1521
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1522
fi
1523
1524 da9b170c Michael Niedermayer
if test "$memalignhack" = "yes" ; then
1525
  echo "#define MEMALIGN_HACK 1" >> $TMPH
1526
fi
1527
1528
1529 26b35efb François Revol
if test "$netserver" = "yes" ; then
1530
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1531
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1532
fi
1533
1534 4baca069 Philip Gladstone
if test "$need_inet_aton" = "yes" ; then
1535
  echo "NEED_INET_ATON=yes" >> config.mak
1536
fi
1537
1538 57514323 Zdenek Kabelac
if test "$simpleidct" = "yes" ; then
1539 045ed63f Zdenek Kabelac
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1540
fi
1541
1542 8154d2e0 Fabrice Bellard
if test "$ffserver" = "yes" ; then
1543
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1544
  echo "CONFIG_FFSERVER=yes" >> config.mak
1545
fi
1546
1547 a86b921c Fabrice Bellard
if test "$ffplay" = "yes" ; then
1548
  echo "CONFIG_FFPLAY=yes" >> config.mak
1549
fi
1550
1551 b2e3c528 Michael Niedermayer
if test "$gpl" = "yes" ; then
1552
  echo "#define CONFIG_GPL 1" >> $TMPH
1553
  echo "CONFIG_GPL=yes" >> config.mak
1554
fi
1555
1556 c13e1abd Falk Hüffner
echo "#define restrict $_restrict" >> $TMPH
1557
1558 bb801c97 Michael Niedermayer
if test "$optimize" = "small"; then
1559
  echo "#define always_inline"  >> $TMPH
1560
fi
1561
1562 0f3cb305 Fabrice Bellard
# build tree in object directory if source path is different from current one
1563
if test "$source_path_used" = "yes" ; then
1564 8b8e1c55 Philipp Matthias Hahn
    DIRS="doc libavformat libavcodec libavcodec/alpha libavcodec/armv4l \
1565
          libavcodec/i386 libavcodec/sparc libavcodec/mlib \
1566
          libavcodec/ppc libavcodec/liba52 libavcodec/libpostproc tests vhook"
1567
    FILES="Makefile libavformat/Makefile libavcodec/Makefile \
1568
          libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile \
1569
          doc/Makefile doc/texi2pod.pl"
1570 0f3cb305 Fabrice Bellard
    for dir in $DIRS ; do
1571
            mkdir -p $dir
1572
    done
1573
    for f in $FILES ; do
1574 281a74da Michael Niedermayer
        ln -sf "$source_path/$f" $f
1575 0f3cb305 Fabrice Bellard
    done
1576 8b8e1c55 Philipp Matthias Hahn
    echo "SRC_PATH=$source_path" >> config.mak
1577
else
1578
    echo "SRC_PATH='$source_path'" >> config.mak
1579 0f3cb305 Fabrice Bellard
fi
1580
1581 d663a1fd Michael Niedermayer
if test "$amr_wb" = "yes" ; then
1582
  echo "#define AMR_WB 1" >> $TMPH
1583
  echo "AMR_WB=yes" >> config.mak
1584
  echo
1585
  echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1586
  echo "V5.1.0 from "
1587
  echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1588
  echo "and extracted the source to libavcodec/amrwb_float"
1589
  echo
1590
fi
1591
1592 891f64b3 joca@rixmail.se
if test "$amr_nb" = "yes" ; then
1593
  echo "#define AMR_NB 1" >> $TMPH
1594
  echo "AMR_NB=yes" >> config.mak
1595
  echo
1596 bc634f6f Zdenek Kabelac
if test "$amr_nb_fixed" = "yes" ; then
1597
  echo "AMR_NB_FIXED=yes" >> config.mak
1598
  echo "#define AMR_NB_FIXED 1" >> $TMPH
1599
  echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1600
  echo "REL-5 version 5.1.0 from "
1601 184582de Michael Niedermayer
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1602 891f64b3 joca@rixmail.se
  echo "and extracted src to libavcodec/amr"
1603 bc634f6f Zdenek Kabelac
  echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1604
  echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1605
  echo
1606
else
1607
  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1608
  echo "REL-5 V5.1.0 from "
1609 184582de Michael Niedermayer
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1610 bc634f6f Zdenek Kabelac
  echo "and extracted the source to libavcodec/amr_float"
1611 821e46f4 Michael Niedermayer
  echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1612 891f64b3 joca@rixmail.se
  echo
1613
fi
1614
1615 2a515c08 Torsten Martinsen
if test "$amr_if2" = "yes" ; then
1616
  echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1617
fi
1618
1619 bc634f6f Zdenek Kabelac
fi
1620
1621 009cf97d Michael Niedermayer
for codec in $CODEC_LIST ; do
1622 ce869f59 Michael Niedermayer
    echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1623
    echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1624 009cf97d Michael Niedermayer
done
1625
1626 a7c02e25 Zdenek Kabelac
diff $TMPH config.h >/dev/null 2>&1
1627 045ed63f Zdenek Kabelac
if test $? -ne 0 ; then
1628
	mv -f $TMPH config.h
1629 3d204385 Nick Kurshev
else
1630 045ed63f Zdenek Kabelac
	echo "config.h is unchanged"
1631 3d204385 Nick Kurshev
fi
1632
1633 f3ec2d46 Slavik Gnatenko
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1634 def4272a Aurelien Jacobs
1635
1636
# build pkg-config files libavcodec.pc, libavformat.pc and libpostproc.pc 
1637
1638
lavc_build=`grep '#define LIBAVCODEC_BUILD' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9]//g'`
1639
lavf_build=`grep '#define LIBAVFORMAT_BUILD' "$source_path/libavformat/avformat.h" | sed 's/[^0-9]//g'`
1640
1641
requires=
1642
test "$libogg" = "yes" && requires="$requires ogg >= 1.1"
1643
test "$vorbis" = "yes" && requires="$requires vorbis"
1644
test "$theora" = "yes" && requires="$requires theora"
1645
1646
# libavcodec.pc
1647
cat <<EOF >libavcodec.pc
1648
prefix=$prefix
1649
exec_prefix=\${prefix}
1650
libdir=\${exec_prefix}/lib
1651
includedir=\${prefix}/include
1652
1653
Name: libavcodec
1654
Description: FFmpeg codec library
1655
Version: $version-$lavc_build
1656
Requires: $requires
1657
Conflicts:
1658
Libs: -L\${libdir} -lavcodec $extralibs
1659
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1660
EOF
1661
1662
cat <<EOF >libavcodec-uninstalled.pc
1663
prefix=
1664
exec_prefix=
1665
libdir=\${pcfiledir}/libavcodec
1666
includedir=\${pcfiledir}/libavcodec
1667
1668
Name: libavcodec
1669
Description: FFmpeg codec library
1670
Version: $version-$lavc_build
1671
Requires: $requires
1672
Conflicts:
1673
Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1674
Cflags: -I\${includedir}
1675
EOF
1676
1677
# libavformat.pc
1678
cat <<EOF >libavformat.pc
1679
prefix=$prefix
1680
exec_prefix=\${prefix}
1681
libdir=\${exec_prefix}/lib
1682
includedir=\${prefix}/include
1683
1684
Name: libavformat
1685
Description: FFmpeg container format library
1686
Version: $version-$lavf_build
1687
Requires: $requires libavcodec = $version-$lavc_build
1688
Conflicts:
1689
Libs: -L\${libdir} -lavformat $extralibs
1690
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1691
EOF
1692
1693
cat <<EOF >libavformat-uninstalled.pc
1694
prefix=
1695
exec_prefix=
1696
libdir=\${pcfiledir}/libavformat
1697
includedir=\${pcfiledir}/libavformat
1698
1699
Name: libavformat
1700
Description: FFmpeg container format library
1701
Version: $version-$lavf_build
1702
Requires: $requires libavcodec = $version-$lavc_build
1703
Conflicts:
1704
Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1705
Cflags: -I\${includedir}
1706
EOF
1707
1708
1709
# libpostproc.pc
1710
cat <<EOF >libpostproc.pc
1711
prefix=$prefix
1712
exec_prefix=\${prefix}
1713
libdir=\${exec_prefix}/lib
1714
includedir=\${prefix}/include
1715
1716
Name: libpostproc
1717
Description: FFmpeg post processing library
1718
Version: $version
1719
Requires: 
1720
Conflicts:
1721
Libs: -L\${libdir} -lpostproc
1722
Cflags: -I\${includedir} -I\${includedir}/postproc
1723
EOF
1724
1725
cat <<EOF >libpostproc-uninstalled.pc
1726
prefix=
1727
exec_prefix=
1728
libdir=\${pcfiledir}/libavcodec/libpostproc
1729
includedir=\${pcfiledir}/libavcodec/libpostproc
1730
1731
Name: libpostproc
1732
Description: FFmpeg post processing library
1733
Version: $version
1734
Requires: 
1735
Conflicts:
1736
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1737
Cflags: -I\${includedir}
1738
EOF