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)
63 prefix="/boot/home/config"
64 # helps building libavcodec
67 # no need for libm, but the inet stuff
69 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
70 extralibs="-lbind -lsocket"
72 echo "Not sure building for net_server will succeed... good luck."
78 if test "$1" = "-h" -o "$1" = "--help" ; then
81 Usage: configure [options]
82 Options: [defaults in brackets after descriptions]
84 --help print this message
86 echo " --prefix=PREFIX install in PREFIX [$prefix]"
87 echo " --cc=CC use C compiler CC [$cc]"
88 echo " --cpu=CPU force cpu to CPU [$cpu]"
89 echo " --disable-mmx disable mmx usage"
90 echo " --enable-gprof enable profiling with gprof [$gprof]"
91 echo " --disable-grab disable audio/video grabbing code"
92 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
93 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
94 echo " --enable-win32 enable win32 cross compile"
95 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
96 echo " --enable-shared build shared libraries [default=no]"
102 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
104 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
106 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
108 --disable-mmx) mmx="no"
110 --enable-gprof) gprof="yes"
112 --disable-grab) grab="no"
114 --enable-a52bin) a52bin="yes" ; extralibs="-ldl $extralibs"
116 --enable-mp3lame) mp3lame="yes"
118 --disable-simple_idct) simpleidct="no"
120 --enable-win32) win32="yes"
122 --enable-shared) lshared="yes"
127 # Checking for CFLAGS
128 if test -z "$CFLAGS"; then
132 if test "$win32" = "yes" ; then
133 cross_prefix="i386-mingw32msvc-"
134 cc="${cross_prefix}gcc"
135 ar="${cross_prefix}ar"
140 # check availability of some header files
144 int main( void ) { return 0; }
149 if $cc -o $TMPO $TMPC 2> /dev/null ; then
152 # check for memalign - atmos
157 string = memalign(64, sizeof(char));
161 $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
164 echo "Install prefix $prefix"
165 echo "C compiler $cc"
167 echo "MMX enabled $mmx"
168 echo "gprof enabled $gprof"
169 echo "grab enabled $grab"
170 echo "mp3lame enabled $mp3lame"
171 echo "a52 dlopened $a52bin"
173 echo "Creating config.mak and config.h"
175 echo "# Automatically generated by configure - do not modify" > config.mak
176 echo "/* Automatically generated by configure - do not modify */" > $TMPH
178 echo "prefix=$prefix" >> config.mak
179 echo "MAKE=make" >> config.mak
180 echo "CC=$cc" >> config.mak
181 echo "AR=$ar" >> config.mak
182 echo "OPTFLAGS=$CFLAGS" >> config.mak
183 if test "$cpu" = "x86" ; then
184 echo "TARGET_ARCH_X86=yes" >> config.mak
185 echo "#define ARCH_X86 1" >> $TMPH
187 if test "$cpu" = "armv4l" ; then
188 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
189 echo "#define ARCH_ARMV4L 1" >> $TMPH
191 if test "$cpu" = "alpha" ; then
192 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
193 echo "#define ARCH_ALPHA 1" >> $TMPH
195 if test "$mmx" = "yes" ; then
196 echo "TARGET_MMX=yes" >> config.mak
197 echo "#define HAVE_MMX 1" >> $TMPH
199 if test "$gprof" = "yes" ; then
200 echo "TARGET_GPROF=yes" >> config.mak
201 echo "#define HAVE_GPROF 1" >> $TMPH
203 if test "$lshared" = "yes" ; then
204 echo "BUILD_SHARED=yes" >> config.mak
206 echo "BUILD_SHARED=no" >> config.mak
208 echo "EXTRALIBS=$extralibs" >> config.mak
209 echo -n "VERSION=" >>config.mak
210 head VERSION >>config.mak
212 # if you do not want to use encoders, disable that.
213 echo "#define CONFIG_ENCODERS 1" >> $TMPH
214 echo "CONFIG_ENCODERS=yes" >> config.mak
216 # if you do not want to use decoders, disable that.
217 echo "#define CONFIG_DECODERS 1" >> $TMPH
218 echo "CONFIG_DECODERS=yes" >> config.mak
220 # special AC3 stuff in case you already have it
221 # without libavcodec.
222 echo "#define CONFIG_AC3 1" >> $TMPH
223 echo "CONFIG_AC3=yes" >> config.mak
225 if test "$a52bin" = "yes" ; then
226 echo "#define CONFIG_A52BIN 1" >> $TMPH
227 echo "CONFIG_A52BIN=yes" >> config.mak
229 echo "CONFIG_A52BIN=no" >> config.mak
232 if test "$grab" = "yes" ; then
233 echo "#define CONFIG_GRAB 1" >> $TMPH
234 echo "CONFIG_GRAB=yes" >> config.mak
237 if test "$mp3lame" = "yes" ; then
238 echo "#define CONFIG_MP3LAME 1" >> $TMPH
239 echo "CONFIG_MP3LAME=yes" >> config.mak
242 if test "$win32" = "yes" ; then
243 echo "#define CONFIG_WIN32 1" >> $TMPH
244 echo "CONFIG_WIN32=yes" >> config.mak
247 if test "$_malloc_h" = "yes" ; then
248 echo "#define HAVE_MALLOC_H 1" >> $TMPH
250 echo "#undef HAVE_MALLOC_H" >> $TMPH
253 if test "$_memalign" = "yes" ; then
254 echo "#define HAVE_MEMALIGN 1" >> $TMPH
256 echo "#undef HAVE_MEMALIGN" >> $TMPH
259 if test "$simpleidct" = "yes" ; then
260 echo "#define SIMPLE_IDCT 1" >> $TMPH
263 diff $TMPH config.h >/dev/null 2>&1
264 if test $? -ne 0 ; then
267 echo "config.h is unchanged"
270 rm -f $TMPO $TMPC $TMPS $TMPH