3 # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
5 # set temporary file name
6 if test ! -z "$TMPDIR" ; then
8 elif test ! -z "$TEMPDIR" ; then
14 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
15 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
16 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
17 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
29 i386|i486|i586|i686|i86pc|BePC)
60 prefix="/boot/home/config"
61 # helps building libavcodec
64 # no need for libm, but the inet stuff
66 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
67 extralibs="-lbind -lsocket"
69 echo "Not sure building for net_server will succeed... good luck."
75 extralibs="-lpoll -lgnugetopt -lm"
82 # XXX: we assume an absolute path is given when launching configure,
83 # except in './configure' case.
84 source_path=${0%configure}
85 source_path=${source_path%/}
86 source_path_used="yes"
87 if test -z "$source_path" -o "$source_path" = "." ; then
94 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
96 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
98 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
100 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
102 --make=*) make=`echo $opt | cut -d '=' -f 2`
104 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
106 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
108 --extra-libs=*) extralibs=${opt#--extra-libs=}
110 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
112 --disable-mmx) mmx="no"
114 --enable-gprof) gprof="yes"
116 --disable-v4l) v4l="no"
118 --disable-audio-oss) audio_oss="no"
120 --disable-network) network="no"
122 --disable-a52) a52="no"
124 --enable-a52bin) a52bin="yes" ; extralibs="-ldl $extralibs"
126 --enable-mp3lame) mp3lame="yes"
128 --disable-simple_idct) simpleidct="no"
130 --enable-win32) win32="yes"
132 --enable-shared) lshared="yes"
134 --disable-mpegaudio-hp) mpegaudio_hp="no"
140 if test $mmx = "default"; then
141 if test $cpu = "x86"; then
148 # Checking for CFLAGS
149 if test -z "$CFLAGS"; then
153 if test "$win32" = "yes" ; then
154 cross_prefix="i386-mingw32msvc-"
160 # endianness : guess with cpu type. Should also use prefix
161 if test "$cpu" = "powerpc"; then
165 cc="${cross_prefix}${cc}"
166 ar="${cross_prefix}${ar}"
167 strip="${cross_prefix}${strip}"
170 # check availability of some header files
174 int main( void ) { return 0; }
179 if $cc -o $TMPO $TMPC 2> /dev/null ; then
182 # check for memalign - atmos
187 string = memalign(64, sizeof(char));
191 $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
194 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
197 Usage: configure [options]
198 Options: [defaults in brackets after descriptions]
201 echo "Standard options:"
202 echo " --help print this message"
203 echo " --prefix=PREFIX install in PREFIX [$prefix]"
204 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
205 echo " --enable-win32 enable win32 cross compile"
206 echo " --disable-a52 disable GPL'ed A52 support [default=no]"
207 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
208 echo " --enable-shared build shared libraries [default=no]"
210 echo "Advanced options (experts only):"
211 echo " --source-path=PATH path of source code [$source_path]"
212 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
213 echo " --cc=CC use C compiler CC [$cc]"
214 echo " --make=MAKE use specified make [$make]"
215 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
216 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
217 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
218 echo " --cpu=CPU force cpu to CPU [$cpu]"
219 echo " --disable-mmx disable mmx usage"
220 echo " --disable-audio-oss disable OSS audio support [default=no]"
221 echo " --disable-v4l disable video4linux grabbing [default=no]"
222 echo " --disable-network disable network support [default=no]"
223 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
224 echo " --enable-gprof enable profiling with gprof [$gprof]"
225 echo " --disable-mpegaudio-hp faster (but less accurate)"
226 echo " mpegaudio decoding [default=no]"
228 echo "NOTE: The object files are build at the place where configure is launched"
232 echo "Install prefix $prefix"
233 echo "Source path $source_path"
234 echo "C compiler $cc"
237 echo "Big Endian $bigendian"
238 echo "MMX enabled $mmx"
239 echo "gprof enabled $gprof"
240 echo "mp3lame enabled $mp3lame"
241 echo "a52 support $a52"
242 echo "a52 dlopened $a52bin"
244 echo "Creating config.mak and config.h"
246 echo "# Automatically generated by configure - do not modify" > config.mak
247 echo "/* Automatically generated by configure - do not modify */" > $TMPH
249 echo "prefix=$prefix" >> config.mak
250 echo "MAKE=$make" >> config.mak
251 echo "CC=$cc" >> config.mak
252 echo "AR=$ar" >> config.mak
253 echo "STRIP=$strip" >> config.mak
254 echo "OPTFLAGS=$CFLAGS" >> config.mak
255 echo "LDFLAGS=$LDFLAGS" >> config.mak
256 if test "$cpu" = "x86" ; then
257 echo "TARGET_ARCH_X86=yes" >> config.mak
258 echo "#define ARCH_X86 1" >> $TMPH
259 elif test "$cpu" = "armv4l" ; then
260 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
261 echo "#define ARCH_ARMV4L 1" >> $TMPH
262 elif test "$cpu" = "alpha" ; then
263 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
264 echo "#define ARCH_ALPHA 1" >> $TMPH
265 elif test "$cpu" = "powerpc" ; then
266 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
267 echo "#define ARCH_POWERPC 1" >> $TMPH
269 if test "$bigendian" = "yes" ; then
270 echo "WORDS_BIGENDIAN=yes" >> config.mak
271 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
273 if test "$mmx" = "yes" ; then
274 echo "TARGET_MMX=yes" >> config.mak
275 echo "#define HAVE_MMX 1" >> $TMPH
277 if test "$gprof" = "yes" ; then
278 echo "TARGET_GPROF=yes" >> config.mak
279 echo "#define HAVE_GPROF 1" >> $TMPH
281 if test "$lshared" = "yes" ; then
282 echo "BUILD_SHARED=yes" >> config.mak
283 echo "PIC=-fPIC" >> config.mak
285 echo "EXTRALIBS=$extralibs" >> config.mak
286 echo -n "VERSION=" >>config.mak
287 head $source_path/VERSION >>config.mak
289 # if you do not want to use encoders, disable that.
290 echo "#define CONFIG_ENCODERS 1" >> $TMPH
291 echo "CONFIG_ENCODERS=yes" >> config.mak
293 # if you do not want to use decoders, disable that.
294 echo "#define CONFIG_DECODERS 1" >> $TMPH
295 echo "CONFIG_DECODERS=yes" >> config.mak
298 if test "$a52" = "yes" ; then
299 echo "#define CONFIG_AC3 1" >> $TMPH
300 echo "CONFIG_AC3=yes" >> config.mak
302 if test "$a52bin" = "yes" ; then
303 echo "#define CONFIG_A52BIN 1" >> $TMPH
304 echo "CONFIG_A52BIN=yes" >> config.mak
308 # mpeg audio high precision mode
309 if test "$mpegaudio_hp" = "yes" ; then
310 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
313 if test "$v4l" = "yes" ; then
314 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
315 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
318 if test "$audio_oss" = "yes" ; then
319 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
320 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
323 if test "$network" = "yes" ; then
324 echo "#define CONFIG_NETWORK 1" >> $TMPH
325 echo "CONFIG_NETWORK=yes" >> config.mak
328 if test "$mp3lame" = "yes" ; then
329 echo "#define CONFIG_MP3LAME 1" >> $TMPH
330 echo "CONFIG_MP3LAME=yes" >> config.mak
333 if test "$win32" = "yes" ; then
334 echo "#define CONFIG_WIN32 1" >> $TMPH
335 echo "CONFIG_WIN32=yes" >> config.mak
338 if test "$_malloc_h" = "yes" ; then
339 echo "#define HAVE_MALLOC_H 1" >> $TMPH
341 echo "#undef HAVE_MALLOC_H" >> $TMPH
344 if test "$_memalign" = "yes" ; then
345 echo "#define HAVE_MEMALIGN 1" >> $TMPH
347 echo "#undef HAVE_MEMALIGN" >> $TMPH
350 if test "$simpleidct" = "yes" ; then
351 echo "#define SIMPLE_IDCT 1" >> $TMPH
354 # build tree in object directory if source path is different from current one
355 if test "$source_path_used" = "yes" ; then
356 DIRS="libav libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
357 libavcodec/liba52 libavcodec/mlib tests"
358 FILES="Makefile libav/Makefile libavcodec/Makefile tests/Makefile"
359 for dir in $DIRS ; do
363 ln -sf $source_path/$f $f
366 echo "SRC_PATH=$source_path" >> config.mak
368 diff $TMPH config.h >/dev/null 2>&1
369 if test $? -ne 0 ; then
372 echo "config.h is unchanged"
375 rm -f $TMPO $TMPC $TMPS $TMPH