3 TMPC="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
4 TMPO="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
5 TMPS="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
6 TMPH="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
8 if test ! -z "$TMPDIR" ; then
9 TMPC="${TMPDIR}/${TMPC}"
10 TMPCPP="${TMPDIR}/${TMPCPP}"
11 TMPO="${TMPDIR}/${TMPO}"
12 TMPS="${TMPDIR}/${TMPS}"
13 TMPH="${TMPDIR}/${TMPH}"
14 elif test ! -z "$TEMPDIR" ; then
15 TMPC="${TEMPDIR}/${TMPC}"
16 TMPCPP="${TEMPDIR}/${TMPCPP}"
17 TMPO="${TEMPDIR}/${TMPO}"
18 TMPS="${TEMPDIR}/${TMPS}"
19 TMPH="${TEMPDIR}/${TMPH}"
22 TMPCPP="/tmp/${TMPCPP}"
34 i386|i486|i586|i686|i86pc|BePC)
61 prefix="/boot/home/config"
62 # helps building libavcodec
65 # no need for libm, but the inet stuff
67 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
68 extralibs="-lbind -lsocket"
70 echo "Not sure building for net_server will succeed... good luck."
76 if test "$1" = "-h" -o "$1" = "--help" ; then
79 Usage: configure [options]
80 Options: [defaults in brackets after descriptions]
82 --help print this message
84 echo " --prefix=PREFIX install in PREFIX [$prefix]"
85 echo " --cc=CC use C compiler CC [$cc]"
86 echo " --cpu=CPU force cpu to CPU [$cpu]"
87 echo " --disable-mmx disable mmx usage"
88 echo " --enable-gprof enable profiling with gprof [$gprof]"
89 echo " --disable-grab disable audio/video grabbing code"
90 echo " --enable-simple_idct use simple IDCT routines [default=no]"
91 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
92 echo " --enable-win32 enable win32 cross compile"
93 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
94 echo " --enable-shared build shared libraries [default=no]"
101 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
103 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
105 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
107 --disable-mmx) mmx="no"
109 --enable-gprof) gprof="yes"
111 --disable-grab) grab="no"
113 --enable-a52bin) a52bin="yes" ; extralibs="-ldl $extralibs"
115 --enable-mp3lame) mp3lame="yes"
117 --enable-simple_idct) simpleidct="yes"
119 --enable-win32) win32="yes"
121 --enable-shared=*) lshared=`echo $opt | cut -d '=' -f 2`
126 # Checking for CFLAGS
127 if test -z "$CFLAGS"; then
131 if test "$win32" = "yes" ; then
132 cross_prefix="i386-mingw32msvc-"
133 cc="${cross_prefix}gcc"
134 ar="${cross_prefix}ar"
139 # check availability of some header files
143 int main( void ) { return 0; }
148 if $cc -o $TMPO $TMPC 2> /dev/null ; then
151 # check for memalign - atmos
156 string = memalign(64, sizeof(char));
160 $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
163 echo "Install prefix $prefix"
164 echo "C compiler $cc"
166 echo "MMX enabled $mmx"
167 echo "gprof enabled $gprof"
168 echo "grab enabled $grab"
169 echo "mp3lame enabled $mp3lame"
170 echo "a52 dlopened $a52bin"
172 echo "Creating config.mak and config.h"
174 echo "# Automatically generated by configure - do not modify" > config.mak
175 echo "/* Automatically generated by configure - do not modify */" > $TMPH
177 echo "prefix=$prefix" >> config.mak
178 echo "MAKE=make" >> config.mak
179 echo "CC=$cc" >> config.mak
180 echo "AR=$ar" >> config.mak
181 echo "OPTFLAGS=$CFLAGS" >> config.mak
182 if test "$cpu" = "x86" ; then
183 echo "TARGET_ARCH_X86=yes" >> config.mak
184 echo "#define ARCH_X86 1" >> $TMPH
186 if test "$cpu" = "armv4l" ; then
187 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
188 echo "#define ARCH_ARMV4L 1" >> $TMPH
190 if test "$cpu" = "alpha" ; then
191 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
192 echo "#define ARCH_ALPHA 1" >> $TMPH
194 if test "$mmx" = "yes" ; then
195 echo "TARGET_MMX=yes" >> config.mak
196 echo "#define HAVE_MMX 1" >> $TMPH
198 if test "$gprof" = "yes" ; then
199 echo "TARGET_GPROF=yes" >> config.mak
200 echo "#define HAVE_GPROF 1" >> $TMPH
202 if test "$lshared" = "yes" ; then
203 echo "BUILD_SHARED=yes" >> config.mak
205 echo "BUILD_SHARED=no" >> config.mak
207 echo "EXTRALIBS=$extralibs" >> config.mak
208 echo -n "VERSION=" >>config.mak
209 head VERSION >>config.mak
211 # if you do not want to use encoders, disable that.
212 echo "#define CONFIG_ENCODERS 1" >> $TMPH
213 echo "CONFIG_ENCODERS=yes" >> config.mak
215 # if you do not want to use decoders, disable that.
216 echo "#define CONFIG_DECODERS 1" >> $TMPH
217 echo "CONFIG_DECODERS=yes" >> config.mak
219 # special AC3 stuff in case you already have it
220 # without libavcodec.
221 echo "#define CONFIG_AC3 1" >> $TMPH
222 echo "CONFIG_AC3=yes" >> config.mak
224 if test "$a52bin" = "yes" ; then
225 echo "#define CONFIG_A52BIN 1" >> $TMPH
226 echo "CONFIG_A52BIN=yes" >> config.mak
228 echo "CONFIG_A52BIN=no" >> config.mak
231 if test "$grab" = "yes" ; then
232 echo "#define CONFIG_GRAB 1" >> $TMPH
233 echo "CONFIG_GRAB=yes" >> config.mak
236 if test "$mp3lame" = "yes" ; then
237 echo "#define CONFIG_MP3LAME 1" >> $TMPH
238 echo "CONFIG_MP3LAME=yes" >> config.mak
241 if test "$win32" = "yes" ; then
242 echo "#define CONFIG_WIN32 1" >> $TMPH
243 echo "CONFIG_WIN32=yes" >> config.mak
246 if test "$_malloc_h" = "yes" ; then
247 echo "#define HAVE_MALLOC_H 1" >> $TMPH
249 echo "#undef HAVE_MALLOC_H" >> $TMPH
252 if test "$_memalign" = "yes" ; then
253 echo "#define HAVE_MEMALIGN 1" >> $TMPH
255 echo "#undef HAVE_MEMALIGN" >> $TMPH
258 if test "$simpleidct" = "yes" ; then
259 echo "#define SIMPLE_IDCT 1" >> $TMPH
262 diff $TMPH config.h >/dev/null 2>&1
263 if test $? -ne 0 ; then
266 echo "config.h is unchanged"
269 rm -f $TMPO $TMPC $TMPS $TMPH