gmc bitstream decoding support (the real motion compensation isnt implemnted yet)
[libav.git] / configure
CommitLineData
de6d9b64
FB
1#!/bin/sh
2
3d204385
NK
3TMPC="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
4TMPO="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
5TMPS="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
6
7if [ ! -z "$TMPDIR" ]; then
8 TMPC="${TMPDIR}/${TMPC}"
9 TMPCPP="${TMPDIR}/${TMPCPP}"
10 TMPO="${TMPDIR}/${TMPO}"
11 TMPS="${TMPDIR}/${TMPS}"
12elif [ ! -z "$TEMPDIR" ]; then
13 TMPC="${TEMPDIR}/${TMPC}"
14 TMPCPP="${TEMPDIR}/${TMPCPP}"
15 TMPO="${TEMPDIR}/${TMPO}"
16 TMPS="${TEMPDIR}/${TMPS}"
17else
18 TMPC="/tmp/${TMPC}"
19 TMPCPP="/tmp/${TMPCPP}"
20 TMPO="/tmp/${TMPO}"
21 TMPS="/tmp/${TMPS}"
22fi
23
de6d9b64
FB
24# default parameters
25prefix="/usr/local"
26cc="gcc"
27ar="ar"
28cpu=`uname -m`
29case "$cpu" in
123ba071 30 i386|i486|i586|i686|i86pc)
de6d9b64
FB
31 cpu="x86"
32 mmx="yes"
33 ;;
6ed7422a
FB
34 armv4l)
35 cpu="armv4l"
36 mmx="no"
37 ;;
91d1f1a4
NK
38 alpha)
39 cpu="alpha"
40 mmx="no"
41 ;;
de6d9b64
FB
42 *)
43 mmx="no"
44 ;;
45esac
46gprof="no"
6ed7422a 47grab="yes"
daf8e955 48win32="no"
de6d9b64
FB
49
50if [ "$1" = "-h" -o "$1" = "--help" ] ; then
51cat << EOF
52
53Usage: configure [options]
54Options: [defaults in brackets after descriptions]
55
56 --help print this message
57EOF
58echo " --prefix=PREFIX install in PREFIX [$prefix]"
59echo " --cc=CC use C compiler CC [$cc]"
60echo " --cpu=CPU force cpu to CPU [$cpu]"
61echo " --disable-mmx disable mmx usage"
62echo " --enable-gprof enable profiling with gprof [$gprof]"
6ed7422a 63echo " --disable-grab disable audio/video grabbing code"
daf8e955 64echo " --enable-win32 enable win32 cross compile"
0319c531 65echo " --enable-shared build shared libraries [default=no]"
de6d9b64
FB
66exit 1
67fi
68
0319c531 69lshared=no
de6d9b64
FB
70for opt do
71 case "$opt" in
72 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
73 ;;
74 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
75 ;;
76 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
77 ;;
78 --disable-mmx) mmx="no"
79 ;;
80 --enable-gprof) gprof="yes"
81 ;;
6ed7422a
FB
82 --disable-grab) grab="no"
83 ;;
daf8e955
FB
84 --enable-win32) win32="yes"
85 ;;
0319c531
NK
86 --enable-shared=*) lshared=`echo $opt | cut -d '=' -f 2`
87 ;;
de6d9b64
FB
88 esac
89done
90
daf8e955
FB
91# Checking for CFLAGS
92if test -z "$CFLAGS"; then
93 CFLAGS="-O2"
94fi
95
96if [ "$win32" = "yes" ] ; then
97 cross_prefix="i386-mingw32msvc-"
98 cc="${cross_prefix}gcc"
99 ar="${cross_prefix}ar"
100 grab="no"
101fi
102
3d204385
NK
103# ---
104# check availability of some header files
105
106cat > $TMPC << EOF
107#include <malloc.h>
108int main( void ) { return 0; }
109EOF
110
111_memalign=no
112_malloc_h=no
113if $cc -o $TMPO $TMPC 2> /dev/null ; then
114_malloc_h=yes
115_memalign=yes
116# check for memalign - atmos
117cat > $TMPC << EOF
118#include <malloc.h>
119int main ( void ) {
120char *string = NULL;
121string = memalign(64, sizeof(char));
122return 0;
123}
124EOF
125$cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
126fi
127
de6d9b64
FB
128echo "Install prefix $prefix"
129echo "C compiler $cc"
130echo "CPU $cpu"
131echo "MMX enabled $mmx"
132echo "gprof enabled $gprof"
6ed7422a 133echo "grab enabled $grab"
de6d9b64 134
980fc7b8 135echo "Creating config.mak and config.h"
de6d9b64 136
980fc7b8 137echo "# Automatically generated by configure - do not modify" > config.mak
de6d9b64
FB
138echo "/* Automatically generated by configure - do not modify */" > config.h
139
980fc7b8 140echo "prefix=$prefix" >> config.mak
2cc8ae96 141echo "MAKE=make" >> config.mak
980fc7b8
FB
142echo "CC=$cc" >> config.mak
143echo "AR=$ar" >> config.mak
a9b3f630 144echo "OPTFLAGS=$CFLAGS" >> config.mak
de6d9b64 145if [ "$cpu" = "x86" ] ; then
980fc7b8
FB
146 echo "TARGET_ARCH_X86=yes" >> config.mak
147 echo "#define ARCH_X86 1" >> config.h
de6d9b64 148fi
6ed7422a
FB
149if [ "$cpu" = "armv4l" ]; then
150 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
151 echo "#define ARCH_ARMV4L 1" >> config.h
152fi
91d1f1a4
NK
153if [ "$cpu" = "alpha" ]; then
154 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
155 echo "#define ARCH_ALPHA 1" >> config.h
156fi
de6d9b64 157if [ "$mmx" = "yes" ] ; then
980fc7b8
FB
158 echo "TARGET_MMX=yes" >> config.mak
159 echo "#define HAVE_MMX 1" >> config.h
de6d9b64
FB
160fi
161if [ "$gprof" = "yes" ] ; then
980fc7b8
FB
162 echo "TARGET_GPROF=yes" >> config.mak
163 echo "#define HAVE_GPROF 1" >> config.h
de6d9b64 164fi
0319c531
NK
165if [ "$lshared" = "yes" ] ; then
166 echo "BUILD_SHARED=yes" >> config.mak
167else
168 echo "BUILD_SHARED=no" >> config.mak
169fi
170echo -n "VERSION=" >>config.mak
171head VERSION >>config.mak
172echo "" >>config.mak
d771bcae
FB
173# if you do not want to use encoders, disable that.
174echo "#define CONFIG_ENCODERS 1" >> config.h
175echo "CONFIG_ENCODERS=yes" >> config.mak
176
177# if you do not want to use decoders, disable that.
178echo "#define CONFIG_DECODERS 1" >> config.h
179echo "CONFIG_DECODERS=yes" >> config.mak
180
d2b7bcd2 181# special AC3 stuff in case you already have it
d771bcae
FB
182# without libavcodec.
183echo "#define CONFIG_AC3 1" >> config.h
184echo "CONFIG_AC3=yes" >> config.mak
185
6ed7422a
FB
186if [ "$grab" = "yes" ] ; then
187 echo "#define CONFIG_GRAB 1" >> config.h
188 echo "CONFIG_GRAB=yes" >> config.mak
189fi
daf8e955
FB
190
191if [ "$win32" = "yes" ] ; then
192 echo "#define CONFIG_WIN32 1" >> config.h
193 echo "CONFIG_WIN32=yes" >> config.mak
194fi
3d204385
NK
195
196if [ "$_malloc_h" = "yes" ]; then
197 echo "#define HAVE_MALLOC_H 1" >> config.h
198else
199 echo "#undef HAVE_MALLOC_H" >> config.h
200fi
201
202if [ "$_memalign" = "yes" ]; then
203 echo "#define HAVE_MEMALIGN 1" >> config.h
204else
205 echo "#undef HAVE_MEMALIGN" >> config.h
206fi
207
208rm -f $TMPO $TMPC $TMPS