Moved some H.263+ variables to MpegEncContext to be thread-safe.
[libav.git] / configure
CommitLineData
de6d9b64
FB
1#!/bin/sh
2
3# default parameters
4prefix="/usr/local"
5cc="gcc"
6ar="ar"
7cpu=`uname -m`
8case "$cpu" in
9 i386|i486|i586|i686)
10 cpu="x86"
11 mmx="yes"
12 ;;
6ed7422a
FB
13 armv4l)
14 cpu="armv4l"
15 mmx="no"
16 ;;
de6d9b64
FB
17 *)
18 mmx="no"
19 ;;
20esac
21gprof="no"
ca9118c8 22mp3lib="yes"
6ed7422a 23grab="yes"
daf8e955 24win32="no"
de6d9b64
FB
25
26if [ "$1" = "-h" -o "$1" = "--help" ] ; then
27cat << EOF
28
29Usage: configure [options]
30Options: [defaults in brackets after descriptions]
31
32 --help print this message
33EOF
34echo " --prefix=PREFIX install in PREFIX [$prefix]"
35echo " --cc=CC use C compiler CC [$cc]"
36echo " --cpu=CPU force cpu to CPU [$cpu]"
37echo " --disable-mmx disable mmx usage"
38echo " --enable-gprof enable profiling with gprof [$gprof]"
ca9118c8 39echo " --disable-mp3lib disable mp3 lib compiling"
6ed7422a 40echo " --disable-grab disable audio/video grabbing code"
daf8e955 41echo " --enable-win32 enable win32 cross compile"
de6d9b64
FB
42exit 1
43fi
44
45for opt do
46 case "$opt" in
47 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
48 ;;
49 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
50 ;;
51 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
52 ;;
53 --disable-mmx) mmx="no"
54 ;;
55 --enable-gprof) gprof="yes"
56 ;;
ca9118c8
FB
57 --disable-mp3lib) mp3lib="no"
58 ;;
6ed7422a
FB
59 --disable-grab) grab="no"
60 ;;
daf8e955
FB
61 --enable-win32) win32="yes"
62 ;;
de6d9b64
FB
63 esac
64done
65
daf8e955
FB
66# Checking for CFLAGS
67if test -z "$CFLAGS"; then
68 CFLAGS="-O2"
69fi
70
71if [ "$win32" = "yes" ] ; then
72 cross_prefix="i386-mingw32msvc-"
73 cc="${cross_prefix}gcc"
74 ar="${cross_prefix}ar"
75 grab="no"
76fi
77
de6d9b64
FB
78echo "Install prefix $prefix"
79echo "C compiler $cc"
80echo "CPU $cpu"
81echo "MMX enabled $mmx"
82echo "gprof enabled $gprof"
6ed7422a 83echo "grab enabled $grab"
de6d9b64 84
980fc7b8 85echo "Creating config.mak and config.h"
de6d9b64 86
980fc7b8 87echo "# Automatically generated by configure - do not modify" > config.mak
de6d9b64
FB
88echo "/* Automatically generated by configure - do not modify */" > config.h
89
980fc7b8 90echo "prefix=$prefix" >> config.mak
2cc8ae96 91echo "MAKE=make" >> config.mak
980fc7b8
FB
92echo "CC=$cc" >> config.mak
93echo "AR=$ar" >> config.mak
a9b3f630 94echo "OPTFLAGS=$CFLAGS" >> config.mak
de6d9b64 95if [ "$cpu" = "x86" ] ; then
980fc7b8
FB
96 echo "TARGET_ARCH_X86=yes" >> config.mak
97 echo "#define ARCH_X86 1" >> config.h
de6d9b64 98fi
6ed7422a
FB
99if [ "$cpu" = "armv4l" ]; then
100 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
101 echo "#define ARCH_ARMV4L 1" >> config.h
102fi
de6d9b64 103if [ "$mmx" = "yes" ] ; then
980fc7b8
FB
104 echo "TARGET_MMX=yes" >> config.mak
105 echo "#define HAVE_MMX 1" >> config.h
de6d9b64
FB
106fi
107if [ "$gprof" = "yes" ] ; then
980fc7b8
FB
108 echo "TARGET_GPROF=yes" >> config.mak
109 echo "#define HAVE_GPROF 1" >> config.h
de6d9b64 110fi
d771bcae
FB
111
112# if you do not want to use encoders, disable that.
113echo "#define CONFIG_ENCODERS 1" >> config.h
114echo "CONFIG_ENCODERS=yes" >> config.mak
115
116# if you do not want to use decoders, disable that.
117echo "#define CONFIG_DECODERS 1" >> config.h
118echo "CONFIG_DECODERS=yes" >> config.mak
119
120# special AC3 and MPGLIB enabling stuff in case you already have it
121# without libavcodec.
122echo "#define CONFIG_AC3 1" >> config.h
123echo "CONFIG_AC3=yes" >> config.mak
124
ca9118c8
FB
125if [ "$mp3lib" = "yes" ] ; then
126 echo "#define CONFIG_MPGLIB 1" >> config.h
127 echo "CONFIG_MPGLIB=yes" >> config.mak
128fi
6ed7422a
FB
129
130if [ "$grab" = "yes" ] ; then
131 echo "#define CONFIG_GRAB 1" >> config.h
132 echo "CONFIG_GRAB=yes" >> config.mak
133fi
daf8e955
FB
134
135if [ "$win32" = "yes" ] ; then
136 echo "#define CONFIG_WIN32 1" >> config.h
137 echo "CONFIG_WIN32=yes" >> config.mak
138fi