3 TMPC="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
4 TMPO="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
5 TMPS="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
7 if [ ! -z "$TMPDIR" ]; then
8 TMPC="${TMPDIR}/${TMPC}"
9 TMPCPP="${TMPDIR}/${TMPCPP}"
10 TMPO="${TMPDIR}/${TMPO}"
11 TMPS="${TMPDIR}/${TMPS}"
12 elif [ ! -z "$TEMPDIR" ]; then
13 TMPC="${TEMPDIR}/${TMPC}"
14 TMPCPP="${TEMPDIR}/${TMPCPP}"
15 TMPO="${TEMPDIR}/${TMPO}"
16 TMPS="${TEMPDIR}/${TMPS}"
19 TMPCPP="/tmp/${TMPCPP}"
47 if [ "$1" = "-h" -o "$1" = "--help" ] ; then
50 Usage: configure [options]
51 Options: [defaults in brackets after descriptions]
53 --help print this message
55 echo " --prefix=PREFIX install in PREFIX [$prefix]"
56 echo " --cc=CC use C compiler CC [$cc]"
57 echo " --cpu=CPU force cpu to CPU [$cpu]"
58 echo " --disable-mmx disable mmx usage"
59 echo " --enable-gprof enable profiling with gprof [$gprof]"
60 echo " --disable-mp3lib disable mp3 lib compiling"
61 echo " --disable-grab disable audio/video grabbing code"
62 echo " --enable-win32 enable win32 cross compile"
68 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
70 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
72 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
74 --disable-mmx) mmx="no"
76 --enable-gprof) gprof="yes"
78 --disable-mp3lib) mp3lib="no"
80 --disable-grab) grab="no"
82 --enable-win32) win32="yes"
88 if test -z "$CFLAGS"; then
92 if [ "$win32" = "yes" ] ; then
93 cross_prefix="i386-mingw32msvc-"
94 cc="${cross_prefix}gcc"
95 ar="${cross_prefix}ar"
100 # check availability of some header files
104 int main( void ) { return 0; }
109 if $cc -o $TMPO $TMPC 2> /dev/null ; then
112 # check for memalign - atmos
117 string = memalign(64, sizeof(char));
121 $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
124 echo "Install prefix $prefix"
125 echo "C compiler $cc"
127 echo "MMX enabled $mmx"
128 echo "gprof enabled $gprof"
129 echo "grab enabled $grab"
131 echo "Creating config.mak and config.h"
133 echo "# Automatically generated by configure - do not modify" > config.mak
134 echo "/* Automatically generated by configure - do not modify */" > config.h
136 echo "prefix=$prefix" >> config.mak
137 echo "MAKE=make" >> config.mak
138 echo "CC=$cc" >> config.mak
139 echo "AR=$ar" >> config.mak
140 echo "OPTFLAGS=$CFLAGS" >> config.mak
141 if [ "$cpu" = "x86" ] ; then
142 echo "TARGET_ARCH_X86=yes" >> config.mak
143 echo "#define ARCH_X86 1" >> config.h
145 if [ "$cpu" = "armv4l" ]; then
146 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
147 echo "#define ARCH_ARMV4L 1" >> config.h
149 if [ "$mmx" = "yes" ] ; then
150 echo "TARGET_MMX=yes" >> config.mak
151 echo "#define HAVE_MMX 1" >> config.h
153 if [ "$gprof" = "yes" ] ; then
154 echo "TARGET_GPROF=yes" >> config.mak
155 echo "#define HAVE_GPROF 1" >> config.h
158 # if you do not want to use encoders, disable that.
159 echo "#define CONFIG_ENCODERS 1" >> config.h
160 echo "CONFIG_ENCODERS=yes" >> config.mak
162 # if you do not want to use decoders, disable that.
163 echo "#define CONFIG_DECODERS 1" >> config.h
164 echo "CONFIG_DECODERS=yes" >> config.mak
166 # special AC3 and MPGLIB enabling stuff in case you already have it
167 # without libavcodec.
168 echo "#define CONFIG_AC3 1" >> config.h
169 echo "CONFIG_AC3=yes" >> config.mak
171 if [ "$mp3lib" = "yes" ] ; then
172 echo "#define CONFIG_MPGLIB 1" >> config.h
173 echo "CONFIG_MPGLIB=yes" >> config.mak
176 if [ "$grab" = "yes" ] ; then
177 echo "#define CONFIG_GRAB 1" >> config.h
178 echo "CONFIG_GRAB=yes" >> config.mak
181 if [ "$win32" = "yes" ] ; then
182 echo "#define CONFIG_WIN32 1" >> config.h
183 echo "CONFIG_WIN32=yes" >> config.mak
186 if [ "$_malloc_h" = "yes" ]; then
187 echo "#define HAVE_MALLOC_H 1" >> config.h
189 echo "#undef HAVE_MALLOC_H" >> config.h
192 if [ "$_memalign" = "yes" ]; then
193 echo "#define HAVE_MEMALIGN 1" >> config.h
195 echo "#undef HAVE_MEMALIGN" >> config.h
198 rm -f $TMPO $TMPC $TMPS