updated
[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"
de6d9b64
FB
24
25if [ "$1" = "-h" -o "$1" = "--help" ] ; then
26cat << EOF
27
28Usage: configure [options]
29Options: [defaults in brackets after descriptions]
30
31 --help print this message
32EOF
33echo " --prefix=PREFIX install in PREFIX [$prefix]"
34echo " --cc=CC use C compiler CC [$cc]"
35echo " --cpu=CPU force cpu to CPU [$cpu]"
36echo " --disable-mmx disable mmx usage"
37echo " --enable-gprof enable profiling with gprof [$gprof]"
ca9118c8 38echo " --disable-mp3lib disable mp3 lib compiling"
6ed7422a 39echo " --disable-grab disable audio/video grabbing code"
de6d9b64
FB
40exit 1
41fi
42
43for opt do
44 case "$opt" in
45 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
46 ;;
47 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
48 ;;
49 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
50 ;;
51 --disable-mmx) mmx="no"
52 ;;
53 --enable-gprof) gprof="yes"
54 ;;
ca9118c8
FB
55 --disable-mp3lib) mp3lib="no"
56 ;;
6ed7422a
FB
57 --disable-grab) grab="no"
58 ;;
de6d9b64
FB
59 esac
60done
61
62echo "Install prefix $prefix"
63echo "C compiler $cc"
64echo "CPU $cpu"
65echo "MMX enabled $mmx"
66echo "gprof enabled $gprof"
6ed7422a 67echo "grab enabled $grab"
de6d9b64 68
980fc7b8 69echo "Creating config.mak and config.h"
de6d9b64 70
980fc7b8 71echo "# Automatically generated by configure - do not modify" > config.mak
de6d9b64
FB
72echo "/* Automatically generated by configure - do not modify */" > config.h
73
a9b3f630
NK
74# Checking for CFLAGS
75if test -z "$CFLAGS"; then
76 CFLAGS="-O2"
77fi
78
980fc7b8 79echo "prefix=$prefix" >> config.mak
2cc8ae96 80echo "MAKE=make" >> config.mak
980fc7b8
FB
81echo "CC=$cc" >> config.mak
82echo "AR=$ar" >> config.mak
a9b3f630 83echo "OPTFLAGS=$CFLAGS" >> config.mak
de6d9b64 84if [ "$cpu" = "x86" ] ; then
980fc7b8
FB
85 echo "TARGET_ARCH_X86=yes" >> config.mak
86 echo "#define ARCH_X86 1" >> config.h
de6d9b64 87fi
6ed7422a
FB
88if [ "$cpu" = "armv4l" ]; then
89 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
90 echo "#define ARCH_ARMV4L 1" >> config.h
91fi
de6d9b64 92if [ "$mmx" = "yes" ] ; then
980fc7b8
FB
93 echo "TARGET_MMX=yes" >> config.mak
94 echo "#define HAVE_MMX 1" >> config.h
de6d9b64
FB
95fi
96if [ "$gprof" = "yes" ] ; then
980fc7b8
FB
97 echo "TARGET_GPROF=yes" >> config.mak
98 echo "#define HAVE_GPROF 1" >> config.h
de6d9b64 99fi
d771bcae
FB
100
101# if you do not want to use encoders, disable that.
102echo "#define CONFIG_ENCODERS 1" >> config.h
103echo "CONFIG_ENCODERS=yes" >> config.mak
104
105# if you do not want to use decoders, disable that.
106echo "#define CONFIG_DECODERS 1" >> config.h
107echo "CONFIG_DECODERS=yes" >> config.mak
108
109# special AC3 and MPGLIB enabling stuff in case you already have it
110# without libavcodec.
111echo "#define CONFIG_AC3 1" >> config.h
112echo "CONFIG_AC3=yes" >> config.mak
113
ca9118c8
FB
114if [ "$mp3lib" = "yes" ] ; then
115 echo "#define CONFIG_MPGLIB 1" >> config.h
116 echo "CONFIG_MPGLIB=yes" >> config.mak
117fi
6ed7422a
FB
118
119if [ "$grab" = "yes" ] ; then
120 echo "#define CONFIG_GRAB 1" >> config.h
121 echo "CONFIG_GRAB=yes" >> config.mak
122fi