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}"
30 i386|i486|i586|i686|i86pc)
50 if [ "$1" = "-h" -o "$1" = "--help" ] ; then
53 Usage: configure [options]
54 Options: [defaults in brackets after descriptions]
56 --help print this message
58 echo " --prefix=PREFIX install in PREFIX [$prefix]"
59 echo " --cc=CC use C compiler CC [$cc]"
60 echo " --cpu=CPU force cpu to CPU [$cpu]"
61 echo " --disable-mmx disable mmx usage"
62 echo " --enable-gprof enable profiling with gprof [$gprof]"
63 echo " --disable-grab disable audio/video grabbing code"
64 echo " --enable-win32 enable win32 cross compile"
65 echo " --enable-shared build shared libraries [default=no]"
72 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
74 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
76 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
78 --disable-mmx) mmx="no"
80 --enable-gprof) gprof="yes"
82 --disable-grab) grab="no"
84 --enable-win32) win32="yes"
86 --enable-shared=*) lshared=`echo $opt | cut -d '=' -f 2`
92 if test -z "$CFLAGS"; then
96 if [ "$win32" = "yes" ] ; then
97 cross_prefix="i386-mingw32msvc-"
98 cc="${cross_prefix}gcc"
99 ar="${cross_prefix}ar"
104 # check availability of some header files
108 int main( void ) { return 0; }
113 if $cc -o $TMPO $TMPC 2> /dev/null ; then
116 # check for memalign - atmos
121 string = memalign(64, sizeof(char));
125 $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
128 echo "Install prefix $prefix"
129 echo "C compiler $cc"
131 echo "MMX enabled $mmx"
132 echo "gprof enabled $gprof"
133 echo "grab enabled $grab"
135 echo "Creating config.mak and config.h"
137 echo "# Automatically generated by configure - do not modify" > config.mak
138 echo "/* Automatically generated by configure - do not modify */" > config.h
140 echo "prefix=$prefix" >> config.mak
141 echo "MAKE=make" >> config.mak
142 echo "CC=$cc" >> config.mak
143 echo "AR=$ar" >> config.mak
144 echo "OPTFLAGS=$CFLAGS" >> config.mak
145 if [ "$cpu" = "x86" ] ; then
146 echo "TARGET_ARCH_X86=yes" >> config.mak
147 echo "#define ARCH_X86 1" >> config.h
149 if [ "$cpu" = "armv4l" ]; then
150 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
151 echo "#define ARCH_ARMV4L 1" >> config.h
153 if [ "$cpu" = "alpha" ]; then
154 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
155 echo "#define ARCH_ALPHA 1" >> config.h
157 if [ "$mmx" = "yes" ] ; then
158 echo "TARGET_MMX=yes" >> config.mak
159 echo "#define HAVE_MMX 1" >> config.h
161 if [ "$gprof" = "yes" ] ; then
162 echo "TARGET_GPROF=yes" >> config.mak
163 echo "#define HAVE_GPROF 1" >> config.h
165 if [ "$lshared" = "yes" ] ; then
166 echo "BUILD_SHARED=yes" >> config.mak
168 echo "BUILD_SHARED=no" >> config.mak
170 echo -n "VERSION=" >>config.mak
171 head VERSION >>config.mak
173 # if you do not want to use encoders, disable that.
174 echo "#define CONFIG_ENCODERS 1" >> config.h
175 echo "CONFIG_ENCODERS=yes" >> config.mak
177 # if you do not want to use decoders, disable that.
178 echo "#define CONFIG_DECODERS 1" >> config.h
179 echo "CONFIG_DECODERS=yes" >> config.mak
181 # special AC3 stuff in case you already have it
182 # without libavcodec.
183 echo "#define CONFIG_AC3 1" >> config.h
184 echo "CONFIG_AC3=yes" >> config.mak
186 if [ "$grab" = "yes" ] ; then
187 echo "#define CONFIG_GRAB 1" >> config.h
188 echo "CONFIG_GRAB=yes" >> config.mak
191 if [ "$win32" = "yes" ] ; then
192 echo "#define CONFIG_WIN32 1" >> config.h
193 echo "CONFIG_WIN32=yes" >> config.mak
196 if [ "$_malloc_h" = "yes" ]; then
197 echo "#define HAVE_MALLOC_H 1" >> config.h
199 echo "#undef HAVE_MALLOC_H" >> config.h
202 if [ "$_memalign" = "yes" ]; then
203 echo "#define HAVE_MEMALIGN 1" >> config.h
205 echo "#undef HAVE_MEMALIGN" >> config.h
208 rm -f $TMPO $TMPC $TMPS