Statistics
| Branch: | Revision:

ffmpeg / configure @ e3880318

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