# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
#
+# make sure we are running under a compatible shell
+(: ${foo%%bar}) 2>/dev/null
+if test "$?" != 0; then
+ if test "x$FFMPEG_CONFIGURE_EXEC" = x; then
+ FFMPEG_CONFIGURE_EXEC=1
+ export FFMPEG_CONFIGURE_EXEC
+ exec bash "$0" "$@"
+ exec ksh "$0" "$@"
+ exec /usr/xpg4/bin/sh "$0" "$@"
+ fi
+ echo "No compatible shell script interpreter found."
+ exit 1
+fi
+
show_help(){
echo "Usage: configure [options]"
echo "Options: [defaults in brackets after descriptions]"
echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
echo " --disable-network disable network support [default=no]"
echo " --disable-zlib disable zlib [default=no]"
- echo " --disable-lzo disable lzo [default=no]"
echo " --disable-simple_idct disable simple IDCT routines [default=no]"
echo " --disable-vhook disable video hooking support"
echo " --enable-gprof enable profiling with gprof [$gprof]"
echo "$@" >>$logfile
}
-logfile(){
+log_file(){
log BEGIN $1
cat -n $1 >>$logfile
log END $1
version from SVN. If the latest version fails, report the problem to the
ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
EOF
- if enabled log; then
+ if enabled logging; then
cat <<EOF
Include the log file "$logfile" produced by configure as this will help
solving the problem.
check_cc(){
log check_cc "$@"
cat >$TMPC
- logfile $TMPC
+ log_file $TMPC
log $cc $CFLAGS "$@" -c -o $TMPO $TMPC
$cc $CFLAGS "$@" -c -o $TMPO $TMPC >>$logfile 2>&1
}
check_cpp(){
log check_cpp "$@"
cat >$TMPC
- logfile $TMPC
+ log_file $TMPC
log $cc $CFLAGS "$@" -E -o $TMPO $TMPC
$cc $CFLAGS "$@" -E -o $TMPO $TMPC >>$logfile 2>&1
}
check_ld(){
log check_ld "$@"
cat >$TMPC
- logfile $TMPC
+ log_file $TMPC
log $cc $CFLAGS $LDFLAGS "$@" -o $TMPE $TMPC $extralibs
$cc $CFLAGS $LDFLAGS "$@" -o $TMPE $TMPC $extralibs >>$logfile 2>&1
}
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
# default parameters
-log="yes"
+logging="yes"
logfile="config.err"
prefix="/usr/local"
libdir=""
dc1394="no"
network="yes"
zlib="yes"
-lzo="yes"
libgsm="no"
mp3lame="no"
libogg="no"
make="gmake"
FFLDFLAGS=""
FFSLDFLAGS=""
+SHFLAGS="-shared -Wl,-h,\$@"
need_inet_aton="yes"
extralibs="$extralibs -lsocket -lnsl"
;;
case "$opt" in
--log)
;;
- --log=*) log="${opt#*=}"
+ --log=*) logging="${opt#*=}"
;;
--prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
;;
;;
--disable-zlib) zlib="no"
;;
- --disable-lzo) lzo="no"
- ;;
--enable-a52) a52="yes"
;;
--enable-a52bin) a52bin="yes"
esac
done
-if test "$log" != no; then
- test "$log" = yes || logfile="$log"
+if test "$logging" != no; then
+ test "$logging" = yes || logfile="$logging"
echo "# $0 $@" >$logfile
set >>$logfile
else
esac
fi
+# compiler sanity check
+check_exec <<EOF
+int main(){
+ return 0;
+}
+EOF
+if test "$?" != 0; then
+ echo "$cc is unable to create an executable file."
+ if test -z "$cross_prefix" -a "$cross_compile" = no; then
+ echo "If $cc is a cross-compiler, use the --cross-compile option."
+ fi
+ die "C compiler test failed."
+fi
+
# check for SIMD availability
# AltiVec flags: The FSF version of GCC differs from the Apple version
check_func localtime_r && localtime_r=yes || localtime_r=no
enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
-enabled lzo && enabled gpl && check_lib lzo1x.h lzo_version -llzo || lzo="no"
# check for some common methods of building with pthread support
# do this before the optional library checks as some of them require pthreads
if test "$lshared" = "yes" ; then
# LIBOBJFLAGS may have already been set in the OS configuration
if test -z "$LIBOBJFLAGS" ; then
- if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
- LIBOBJFLAGS="\$(PIC)"
- fi
+ case "$cpu" in
+ x86_64|ia64|alpha|sparc*) LIBOBJFLAGS="\$(PIC)" ;;
+ esac
fi
fi
fi
echo "gprof enabled $gprof"
echo "zlib enabled $zlib"
-echo "lzo enabled $lzo"
echo "libgsm enabled $libgsm"
echo "mp3lame enabled $mp3lame"
echo "libogg enabled $libogg"
echo "EXTRALIBS=$extralibs" >> config.mak
# If you do not want to use encoders, disable them.
-echo "#define CONFIG_ENCODERS 1" >> $TMPH
-echo "CONFIG_ENCODERS=yes" >> config.mak
+if echo "$CODEC_LIST" | grep -q encoder; then
+ echo "#define CONFIG_ENCODERS 1" >> $TMPH
+ echo "CONFIG_ENCODERS=yes" >> config.mak
+fi
# If you do not want to use decoders, disable them.
-echo "#define CONFIG_DECODERS 1" >> $TMPH
-echo "CONFIG_DECODERS=yes" >> config.mak
+if echo "$CODEC_LIST" | grep -q decoder; then
+ echo "#define CONFIG_DECODERS 1" >> $TMPH
+ echo "CONFIG_DECODERS=yes" >> config.mak
+fi
# muxers
if test "$muxers" = "yes" ; then
echo "CONFIG_ZLIB=yes" >> config.mak
fi
-if test "$lzo" = "yes" ; then
- echo "#define CONFIG_LZO 1" >> $TMPH
- echo "CONFIG_LZO=yes" >> config.mak
-fi
-
if test "$libgsm" = "yes" ; then
echo "#define CONFIG_LIBGSM 1" >> $TMPH
echo "CONFIG_LIBGSM=yes" >> config.mak
if test "$optimize" = "small"; then
echo "#define always_inline" >> $TMPH
+ echo "#define CONFIG_SMALL 1" >> $TMPH
fi
# build tree in object directory if source path is different from current one