Commit 045ed63f authored by Zdenek Kabelac's avatar Zdenek Kabelac

* support for simple_idct config

* preserving timestamp if config.h is not modifed

Originally committed as revision 395 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 29da453b
...@@ -3,22 +3,26 @@ ...@@ -3,22 +3,26 @@
TMPC="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c" TMPC="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o" TMPO="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
TMPS="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S" TMPS="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
if [ ! -z "$TMPDIR" ]; then if [ ! -z "$TMPDIR" ]; then
TMPC="${TMPDIR}/${TMPC}" TMPC="${TMPDIR}/${TMPC}"
TMPCPP="${TMPDIR}/${TMPCPP}" TMPCPP="${TMPDIR}/${TMPCPP}"
TMPO="${TMPDIR}/${TMPO}" TMPO="${TMPDIR}/${TMPO}"
TMPS="${TMPDIR}/${TMPS}" TMPS="${TMPDIR}/${TMPS}"
TMPH="${TMPDIR}/${TMPH}"
elif [ ! -z "$TEMPDIR" ]; then elif [ ! -z "$TEMPDIR" ]; then
TMPC="${TEMPDIR}/${TMPC}" TMPC="${TEMPDIR}/${TMPC}"
TMPCPP="${TEMPDIR}/${TMPCPP}" TMPCPP="${TEMPDIR}/${TMPCPP}"
TMPO="${TEMPDIR}/${TMPO}" TMPO="${TEMPDIR}/${TMPO}"
TMPS="${TEMPDIR}/${TMPS}" TMPS="${TEMPDIR}/${TMPS}"
TMPH="${TEMPDIR}/${TMPH}"
else else
TMPC="/tmp/${TMPC}" TMPC="/tmp/${TMPC}"
TMPCPP="/tmp/${TMPCPP}" TMPCPP="/tmp/${TMPCPP}"
TMPO="/tmp/${TMPO}" TMPO="/tmp/${TMPO}"
TMPS="/tmp/${TMPS}" TMPS="/tmp/${TMPS}"
TMPH="/tmp/${TMPH}"
fi fi
# default parameters # default parameters
...@@ -82,6 +86,7 @@ echo " --cpu=CPU force cpu to CPU [$cpu]" ...@@ -82,6 +86,7 @@ echo " --cpu=CPU force cpu to CPU [$cpu]"
echo " --disable-mmx disable mmx usage" echo " --disable-mmx disable mmx usage"
echo " --enable-gprof enable profiling with gprof [$gprof]" echo " --enable-gprof enable profiling with gprof [$gprof]"
echo " --disable-grab disable audio/video grabbing code" 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-mp3lame enable mp3 encoding via libmp3lame"
echo " --enable-win32 enable win32 cross compile" echo " --enable-win32 enable win32 cross compile"
echo " --enable-shared build shared libraries [default=no]" echo " --enable-shared build shared libraries [default=no]"
...@@ -105,6 +110,8 @@ for opt do ...@@ -105,6 +110,8 @@ for opt do
;; ;;
--enable-mp3lame) mp3lame="yes" --enable-mp3lame) mp3lame="yes"
;; ;;
--enable-simple_idct) simpleidct="yes"
;;
--enable-win32) win32="yes" --enable-win32) win32="yes"
;; ;;
--enable-shared=*) lshared=`echo $opt | cut -d '=' -f 2` --enable-shared=*) lshared=`echo $opt | cut -d '=' -f 2`
...@@ -160,7 +167,7 @@ echo "mp3lame enabled $mp3lame" ...@@ -160,7 +167,7 @@ echo "mp3lame enabled $mp3lame"
echo "Creating config.mak and config.h" 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.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 "prefix=$prefix" >> config.mak
echo "MAKE=make" >> config.mak echo "MAKE=make" >> config.mak
...@@ -169,23 +176,23 @@ echo "AR=$ar" >> config.mak ...@@ -169,23 +176,23 @@ echo "AR=$ar" >> config.mak
echo "OPTFLAGS=$CFLAGS" >> config.mak echo "OPTFLAGS=$CFLAGS" >> config.mak
if [ "$cpu" = "x86" ] ; then if [ "$cpu" = "x86" ] ; then
echo "TARGET_ARCH_X86=yes" >> config.mak echo "TARGET_ARCH_X86=yes" >> config.mak
echo "#define ARCH_X86 1" >> config.h echo "#define ARCH_X86 1" >> $TMPH
fi fi
if [ "$cpu" = "armv4l" ]; then if [ "$cpu" = "armv4l" ]; then
echo "TARGET_ARCH_ARMV4L=yes" >> config.mak echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
echo "#define ARCH_ARMV4L 1" >> config.h echo "#define ARCH_ARMV4L 1" >> $TMPH
fi fi
if [ "$cpu" = "alpha" ]; then if [ "$cpu" = "alpha" ]; then
echo "TARGET_ARCH_ALPHA=yes" >> config.mak echo "TARGET_ARCH_ALPHA=yes" >> config.mak
echo "#define ARCH_ALPHA 1" >> config.h echo "#define ARCH_ALPHA 1" >> $TMPH
fi fi
if [ "$mmx" = "yes" ] ; then if [ "$mmx" = "yes" ] ; then
echo "TARGET_MMX=yes" >> config.mak echo "TARGET_MMX=yes" >> config.mak
echo "#define HAVE_MMX 1" >> config.h echo "#define HAVE_MMX 1" >> $TMPH
fi fi
if [ "$gprof" = "yes" ] ; then if [ "$gprof" = "yes" ] ; then
echo "TARGET_GPROF=yes" >> config.mak echo "TARGET_GPROF=yes" >> config.mak
echo "#define HAVE_GPROF 1" >> config.h echo "#define HAVE_GPROF 1" >> $TMPH
fi fi
if [ "$lshared" = "yes" ] ; then if [ "$lshared" = "yes" ] ; then
echo "BUILD_SHARED=yes" >> config.mak echo "BUILD_SHARED=yes" >> config.mak
...@@ -197,43 +204,54 @@ echo -n "VERSION=" >>config.mak ...@@ -197,43 +204,54 @@ echo -n "VERSION=" >>config.mak
head VERSION >>config.mak head VERSION >>config.mak
echo "" >>config.mak echo "" >>config.mak
# if you do not want to use encoders, disable that. # 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 echo "CONFIG_ENCODERS=yes" >> config.mak
# if you do not want to use decoders, disable that. # 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 echo "CONFIG_DECODERS=yes" >> config.mak
# special AC3 stuff in case you already have it # special AC3 stuff in case you already have it
# without libavcodec. # without libavcodec.
echo "#define CONFIG_AC3 1" >> config.h echo "#define CONFIG_AC3 1" >> $TMPH
echo "CONFIG_AC3=yes" >> config.mak echo "CONFIG_AC3=yes" >> config.mak
if [ "$grab" = "yes" ] ; then if [ "$grab" = "yes" ] ; then
echo "#define CONFIG_GRAB 1" >> config.h echo "#define CONFIG_GRAB 1" >> $TMPH
echo "CONFIG_GRAB=yes" >> config.mak echo "CONFIG_GRAB=yes" >> config.mak
fi fi
if [ "$mp3lame" = "yes" ] ; then if [ "$mp3lame" = "yes" ] ; then
echo "#define CONFIG_MP3LAME 1" >> config.h echo "#define CONFIG_MP3LAME 1" >> $TMPH
echo "CONFIG_MP3LAME=yes" >> config.mak echo "CONFIG_MP3LAME=yes" >> config.mak
fi fi
if [ "$win32" = "yes" ] ; then if [ "$win32" = "yes" ] ; then
echo "#define CONFIG_WIN32 1" >> config.h echo "#define CONFIG_WIN32 1" >> $TMPH
echo "CONFIG_WIN32=yes" >> config.mak echo "CONFIG_WIN32=yes" >> config.mak
fi fi
if [ "$_malloc_h" = "yes" ]; then if [ "$_malloc_h" = "yes" ]; then
echo "#define HAVE_MALLOC_H 1" >> config.h echo "#define HAVE_MALLOC_H 1" >> $TMPH
else else
echo "#undef HAVE_MALLOC_H" >> config.h echo "#undef HAVE_MALLOC_H" >> $TMPH
fi fi
if [ "$_memalign" = "yes" ]; then 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 else
echo "#undef HAVE_MEMALIGN" >> config.h echo "config.h is unchanged"
fi fi
rm -f $TMPO $TMPC $TMPS rm -f $TMPO $TMPC $TMPS $TMPH
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment