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|BePC)
56 prefix="/boot/home/config"
57 # helps building libavcodec
60 # no need for libm, but the inet stuff
62 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
63 extralibs="-lbind -lsocket"
65 echo "Not sure building for net_server will succeed... good luck."
71 if [ "$1" = "-h" -o "$1" = "--help" ] ; then
74 Usage: configure [options]
75 Options: [defaults in brackets after descriptions]
77 --help print this message
79 echo " --prefix=PREFIX install in PREFIX [$prefix]"
80 echo " --cc=CC use C compiler CC [$cc]"
81 echo " --cpu=CPU force cpu to CPU [$cpu]"
82 echo " --disable-mmx disable mmx usage"
83 echo " --enable-gprof enable profiling with gprof [$gprof]"
84 echo " --disable-grab disable audio/video grabbing code"
85 echo " --enable-mp3lame enable mp3 encoding via libmp3lame"
86 echo " --enable-win32 enable win32 cross compile"
87 echo " --enable-shared build shared libraries [default=no]"
94 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
96 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
98 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
100 --disable-mmx) mmx="no"
102 --enable-gprof) gprof="yes"
104 --disable-grab) grab="no"
106 --enable-mp3lame) mp3lame="yes"
108 --enable-win32) win32="yes"
110 --enable-shared=*) lshared=`echo $opt | cut -d '=' -f 2`
115 # Checking for CFLAGS
116 if test -z "$CFLAGS"; then
120 if [ "$win32" = "yes" ] ; then
121 cross_prefix="i386-mingw32msvc-"
122 cc="${cross_prefix}gcc"
123 ar="${cross_prefix}ar"
128 # check availability of some header files
132 int main( void ) { return 0; }
137 if $cc -o $TMPO $TMPC 2> /dev/null ; then
140 # check for memalign - atmos
145 string = memalign(64, sizeof(char));
149 $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
152 echo "Install prefix $prefix"
153 echo "C compiler $cc"
155 echo "MMX enabled $mmx"
156 echo "gprof enabled $gprof"
157 echo "grab enabled $grab"
158 echo "mp3lame enabled $mp3lame"
160 echo "Creating config.mak and config.h"
162 echo "# Automatically generated by configure - do not modify" > config.mak
163 echo "/* Automatically generated by configure - do not modify */" > config.h
165 echo "prefix=$prefix" >> config.mak
166 echo "MAKE=make" >> config.mak
167 echo "CC=$cc" >> config.mak
168 echo "AR=$ar" >> config.mak
169 echo "OPTFLAGS=$CFLAGS" >> config.mak
170 if [ "$cpu" = "x86" ] ; then
171 echo "TARGET_ARCH_X86=yes" >> config.mak
172 echo "#define ARCH_X86 1" >> config.h
174 if [ "$cpu" = "armv4l" ]; then
175 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
176 echo "#define ARCH_ARMV4L 1" >> config.h
178 if [ "$cpu" = "alpha" ]; then
179 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
180 echo "#define ARCH_ALPHA 1" >> config.h
182 if [ "$mmx" = "yes" ] ; then
183 echo "TARGET_MMX=yes" >> config.mak
184 echo "#define HAVE_MMX 1" >> config.h
186 if [ "$gprof" = "yes" ] ; then
187 echo "TARGET_GPROF=yes" >> config.mak
188 echo "#define HAVE_GPROF 1" >> config.h
190 if [ "$lshared" = "yes" ] ; then
191 echo "BUILD_SHARED=yes" >> config.mak
193 echo "BUILD_SHARED=no" >> config.mak
195 echo "EXTRALIBS=$extralibs" >> config.mak
196 echo -n "VERSION=" >>config.mak
197 head VERSION >>config.mak
199 # if you do not want to use encoders, disable that.
200 echo "#define CONFIG_ENCODERS 1" >> config.h
201 echo "CONFIG_ENCODERS=yes" >> config.mak
203 # if you do not want to use decoders, disable that.
204 echo "#define CONFIG_DECODERS 1" >> config.h
205 echo "CONFIG_DECODERS=yes" >> config.mak
207 # special AC3 stuff in case you already have it
208 # without libavcodec.
209 echo "#define CONFIG_AC3 1" >> config.h
210 echo "CONFIG_AC3=yes" >> config.mak
212 if [ "$grab" = "yes" ] ; then
213 echo "#define CONFIG_GRAB 1" >> config.h
214 echo "CONFIG_GRAB=yes" >> config.mak
217 if [ "$mp3lame" = "yes" ] ; then
218 echo "#define CONFIG_MP3LAME 1" >> config.h
219 echo "CONFIG_MP3LAME=yes" >> config.mak
222 if [ "$win32" = "yes" ] ; then
223 echo "#define CONFIG_WIN32 1" >> config.h
224 echo "CONFIG_WIN32=yes" >> config.mak
227 if [ "$_malloc_h" = "yes" ]; then
228 echo "#define HAVE_MALLOC_H 1" >> config.h
230 echo "#undef HAVE_MALLOC_H" >> config.h
233 if [ "$_memalign" = "yes" ]; then
234 echo "#define HAVE_MEMALIGN 1" >> config.h
236 echo "#undef HAVE_MEMALIGN" >> config.h
239 rm -f $TMPO $TMPC $TMPS