2001-07-22 17:18:56 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# default parameters
|
|
|
|
prefix="/usr/local"
|
|
|
|
cc="gcc"
|
|
|
|
ar="ar"
|
|
|
|
cpu=`uname -m`
|
|
|
|
case "$cpu" in
|
|
|
|
i386|i486|i586|i686)
|
|
|
|
cpu="x86"
|
|
|
|
mmx="yes"
|
|
|
|
;;
|
2001-08-14 00:42:31 +03:00
|
|
|
armv4l)
|
|
|
|
cpu="armv4l"
|
|
|
|
mmx="no"
|
|
|
|
;;
|
2001-07-22 17:18:56 +03:00
|
|
|
*)
|
|
|
|
mmx="no"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
gprof="no"
|
2001-07-31 02:18:14 +03:00
|
|
|
mp3lib="yes"
|
2001-08-14 00:42:31 +03:00
|
|
|
grab="yes"
|
2001-07-22 17:18:56 +03:00
|
|
|
|
|
|
|
if [ "$1" = "-h" -o "$1" = "--help" ] ; then
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
Usage: configure [options]
|
|
|
|
Options: [defaults in brackets after descriptions]
|
|
|
|
|
|
|
|
--help print this message
|
|
|
|
EOF
|
|
|
|
echo " --prefix=PREFIX install in PREFIX [$prefix]"
|
|
|
|
echo " --cc=CC use C compiler CC [$cc]"
|
|
|
|
echo " --cpu=CPU force cpu to CPU [$cpu]"
|
|
|
|
echo " --disable-mmx disable mmx usage"
|
|
|
|
echo " --enable-gprof enable profiling with gprof [$gprof]"
|
2001-07-31 02:18:14 +03:00
|
|
|
echo " --disable-mp3lib disable mp3 lib compiling"
|
2001-08-14 00:42:31 +03:00
|
|
|
echo " --disable-grab disable audio/video grabbing code"
|
2001-07-22 17:18:56 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for opt do
|
|
|
|
case "$opt" in
|
|
|
|
--prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
|
|
|
|
;;
|
|
|
|
--cc=*) cc=`echo $opt | cut -d '=' -f 2`
|
|
|
|
;;
|
|
|
|
--cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
|
|
|
|
;;
|
|
|
|
--disable-mmx) mmx="no"
|
|
|
|
;;
|
|
|
|
--enable-gprof) gprof="yes"
|
|
|
|
;;
|
2001-07-31 02:18:14 +03:00
|
|
|
--disable-mp3lib) mp3lib="no"
|
|
|
|
;;
|
2001-08-14 00:42:31 +03:00
|
|
|
--disable-grab) grab="no"
|
|
|
|
;;
|
2001-07-22 17:18:56 +03:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Install prefix $prefix"
|
|
|
|
echo "C compiler $cc"
|
|
|
|
echo "CPU $cpu"
|
|
|
|
echo "MMX enabled $mmx"
|
|
|
|
echo "gprof enabled $gprof"
|
2001-08-14 00:42:31 +03:00
|
|
|
echo "grab enabled $grab"
|
2001-07-22 17:18:56 +03:00
|
|
|
|
2001-07-23 23:06:54 +03:00
|
|
|
echo "Creating config.mak and config.h"
|
2001-07-22 17:18:56 +03:00
|
|
|
|
2001-07-23 23:06:54 +03:00
|
|
|
echo "# Automatically generated by configure - do not modify" > config.mak
|
2001-07-22 17:18:56 +03:00
|
|
|
echo "/* Automatically generated by configure - do not modify */" > config.h
|
|
|
|
|
2001-07-30 12:04:34 +03:00
|
|
|
# Checking for CFLAGS
|
|
|
|
if test -z "$CFLAGS"; then
|
|
|
|
CFLAGS="-O2"
|
|
|
|
fi
|
|
|
|
|
2001-07-23 23:06:54 +03:00
|
|
|
echo "prefix=$prefix" >> config.mak
|
2001-08-11 21:57:27 +03:00
|
|
|
echo "MAKE=make" >> config.mak
|
2001-07-23 23:06:54 +03:00
|
|
|
echo "CC=$cc" >> config.mak
|
|
|
|
echo "AR=$ar" >> config.mak
|
2001-07-30 12:04:34 +03:00
|
|
|
echo "OPTFLAGS=$CFLAGS" >> config.mak
|
2001-07-22 17:18:56 +03:00
|
|
|
if [ "$cpu" = "x86" ] ; then
|
2001-07-23 23:06:54 +03:00
|
|
|
echo "TARGET_ARCH_X86=yes" >> config.mak
|
|
|
|
echo "#define ARCH_X86 1" >> config.h
|
2001-07-22 17:18:56 +03:00
|
|
|
fi
|
2001-08-14 00:42:31 +03:00
|
|
|
if [ "$cpu" = "armv4l" ]; then
|
|
|
|
echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
|
|
|
|
echo "#define ARCH_ARMV4L 1" >> config.h
|
|
|
|
fi
|
2001-07-22 17:18:56 +03:00
|
|
|
if [ "$mmx" = "yes" ] ; then
|
2001-07-23 23:06:54 +03:00
|
|
|
echo "TARGET_MMX=yes" >> config.mak
|
|
|
|
echo "#define HAVE_MMX 1" >> config.h
|
2001-07-22 17:18:56 +03:00
|
|
|
fi
|
|
|
|
if [ "$gprof" = "yes" ] ; then
|
2001-07-23 23:06:54 +03:00
|
|
|
echo "TARGET_GPROF=yes" >> config.mak
|
|
|
|
echo "#define HAVE_GPROF 1" >> config.h
|
2001-07-22 17:18:56 +03:00
|
|
|
fi
|
2001-07-23 23:58:31 +03:00
|
|
|
|
|
|
|
# if you do not want to use encoders, disable that.
|
|
|
|
echo "#define CONFIG_ENCODERS 1" >> config.h
|
|
|
|
echo "CONFIG_ENCODERS=yes" >> config.mak
|
|
|
|
|
|
|
|
# if you do not want to use decoders, disable that.
|
|
|
|
echo "#define CONFIG_DECODERS 1" >> config.h
|
|
|
|
echo "CONFIG_DECODERS=yes" >> config.mak
|
|
|
|
|
|
|
|
# special AC3 and MPGLIB enabling stuff in case you already have it
|
|
|
|
# without libavcodec.
|
|
|
|
echo "#define CONFIG_AC3 1" >> config.h
|
|
|
|
echo "CONFIG_AC3=yes" >> config.mak
|
|
|
|
|
2001-07-31 02:18:14 +03:00
|
|
|
if [ "$mp3lib" = "yes" ] ; then
|
|
|
|
echo "#define CONFIG_MPGLIB 1" >> config.h
|
|
|
|
echo "CONFIG_MPGLIB=yes" >> config.mak
|
|
|
|
fi
|
2001-08-14 00:42:31 +03:00
|
|
|
|
|
|
|
if [ "$grab" = "yes" ] ; then
|
|
|
|
echo "#define CONFIG_GRAB 1" >> config.h
|
|
|
|
echo "CONFIG_GRAB=yes" >> config.mak
|
|
|
|
fi
|