TMPC="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
TMPS="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
+TMPH="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
if [ ! -z "$TMPDIR" ]; then
TMPC="${TMPDIR}/${TMPC}"
TMPCPP="${TMPDIR}/${TMPCPP}"
TMPO="${TMPDIR}/${TMPO}"
TMPS="${TMPDIR}/${TMPS}"
+ TMPH="${TMPDIR}/${TMPH}"
elif [ ! -z "$TEMPDIR" ]; then
TMPC="${TEMPDIR}/${TMPC}"
TMPCPP="${TEMPDIR}/${TMPCPP}"
TMPO="${TEMPDIR}/${TMPO}"
TMPS="${TEMPDIR}/${TMPS}"
+ TMPH="${TEMPDIR}/${TMPH}"
else
TMPC="/tmp/${TMPC}"
TMPCPP="/tmp/${TMPCPP}"
TMPO="/tmp/${TMPO}"
TMPS="/tmp/${TMPS}"
+ TMPH="/tmp/${TMPH}"
fi
# default parameters
echo " --disable-mmx disable mmx usage"
echo " --enable-gprof enable profiling with gprof [$gprof]"
echo " --disable-grab disable audio/video grabbing code"
+echo " --enable-simple_idct use simple IDCT routines"
echo " --enable-mp3lame enable mp3 encoding via libmp3lame"
echo " --enable-win32 enable win32 cross compile"
echo " --enable-shared build shared libraries [default=no]"
;;
--enable-mp3lame) mp3lame="yes"
;;
+ --enable-simple_idct) simpleidct="yes"
+ ;;
--enable-win32) win32="yes"
;;
--enable-shared=*) lshared=`echo $opt | cut -d '=' -f 2`
echo "Creating config.mak and config.h"
echo "# Automatically generated by configure - do not modify" > config.mak
-echo "/* Automatically generated by configure - do not modify */" > config.h
+echo "/* Automatically generated by configure - do not modify */" > $TMPH
echo "prefix=$prefix" >> config.mak
echo "MAKE=make" >> config.mak
echo "OPTFLAGS=$CFLAGS" >> config.mak
if [ "$cpu" = "x86" ] ; then
echo "TARGET_ARCH_X86=yes" >> config.mak
- echo "#define ARCH_X86 1" >> config.h
+ echo "#define ARCH_X86 1" >> $TMPH
fi
if [ "$cpu" = "armv4l" ]; then
echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
- echo "#define ARCH_ARMV4L 1" >> config.h
+ echo "#define ARCH_ARMV4L 1" >> $TMPH
fi
if [ "$cpu" = "alpha" ]; then
echo "TARGET_ARCH_ALPHA=yes" >> config.mak
- echo "#define ARCH_ALPHA 1" >> config.h
+ echo "#define ARCH_ALPHA 1" >> $TMPH
fi
if [ "$mmx" = "yes" ] ; then
echo "TARGET_MMX=yes" >> config.mak
- echo "#define HAVE_MMX 1" >> config.h
+ echo "#define HAVE_MMX 1" >> $TMPH
fi
if [ "$gprof" = "yes" ] ; then
echo "TARGET_GPROF=yes" >> config.mak
- echo "#define HAVE_GPROF 1" >> config.h
+ echo "#define HAVE_GPROF 1" >> $TMPH
fi
if [ "$lshared" = "yes" ] ; then
echo "BUILD_SHARED=yes" >> config.mak
head VERSION >>config.mak
echo "" >>config.mak
# if you do not want to use encoders, disable that.
-echo "#define CONFIG_ENCODERS 1" >> config.h
+echo "#define CONFIG_ENCODERS 1" >> $TMPH
echo "CONFIG_ENCODERS=yes" >> config.mak
# if you do not want to use decoders, disable that.
-echo "#define CONFIG_DECODERS 1" >> config.h
+echo "#define CONFIG_DECODERS 1" >> $TMPH
echo "CONFIG_DECODERS=yes" >> config.mak
# special AC3 stuff in case you already have it
# without libavcodec.
-echo "#define CONFIG_AC3 1" >> config.h
+echo "#define CONFIG_AC3 1" >> $TMPH
echo "CONFIG_AC3=yes" >> config.mak
if [ "$grab" = "yes" ] ; then
- echo "#define CONFIG_GRAB 1" >> config.h
+ echo "#define CONFIG_GRAB 1" >> $TMPH
echo "CONFIG_GRAB=yes" >> config.mak
fi
if [ "$mp3lame" = "yes" ] ; then
- echo "#define CONFIG_MP3LAME 1" >> config.h
+ echo "#define CONFIG_MP3LAME 1" >> $TMPH
echo "CONFIG_MP3LAME=yes" >> config.mak
fi
if [ "$win32" = "yes" ] ; then
- echo "#define CONFIG_WIN32 1" >> config.h
+ echo "#define CONFIG_WIN32 1" >> $TMPH
echo "CONFIG_WIN32=yes" >> config.mak
fi
if [ "$_malloc_h" = "yes" ]; then
- echo "#define HAVE_MALLOC_H 1" >> config.h
+ echo "#define HAVE_MALLOC_H 1" >> $TMPH
else
- echo "#undef HAVE_MALLOC_H" >> config.h
+ echo "#undef HAVE_MALLOC_H" >> $TMPH
fi
if [ "$_memalign" = "yes" ]; then
- echo "#define HAVE_MEMALIGN 1" >> config.h
+ echo "#define HAVE_MEMALIGN 1" >> $TMPH
+else
+ echo "#undef HAVE_MEMALIGN" >> $TMPH
+fi
+
+if [ "$simpleidct" = "yes" ]; then
+ echo "#define SIMPLE_IDCT 1" >> $TMPH
+fi
+
+diff -q $TMPH config.h >/dev/null
+if test $? -ne 0 ; then
+ mv -f $TMPH config.h
else
- echo "#undef HAVE_MEMALIGN" >> config.h
+ echo "config.h is unchanged"
fi
-rm -f $TMPO $TMPC $TMPS
+rm -f $TMPO $TMPC $TMPS $TMPH