added --disable-mp3lib
[libav.git] / configure
1 #!/bin/sh
2
3 # default parameters
4 prefix="/usr/local"
5 cc="gcc"
6 ar="ar"
7 cpu=`uname -m`
8 case "$cpu" in
9 i386|i486|i586|i686)
10 cpu="x86"
11 mmx="yes"
12 ;;
13 *)
14 mmx="no"
15 ;;
16 esac
17 gprof="no"
18 mp3lib="yes"
19
20 if [ "$1" = "-h" -o "$1" = "--help" ] ; then
21 cat << EOF
22
23 Usage: configure [options]
24 Options: [defaults in brackets after descriptions]
25
26 --help print this message
27 EOF
28 echo " --prefix=PREFIX install in PREFIX [$prefix]"
29 echo " --cc=CC use C compiler CC [$cc]"
30 echo " --cpu=CPU force cpu to CPU [$cpu]"
31 echo " --disable-mmx disable mmx usage"
32 echo " --enable-gprof enable profiling with gprof [$gprof]"
33 echo " --disable-mp3lib disable mp3 lib compiling"
34 exit 1
35 fi
36
37 for opt do
38 case "$opt" in
39 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
40 ;;
41 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
42 ;;
43 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
44 ;;
45 --disable-mmx) mmx="no"
46 ;;
47 --enable-gprof) gprof="yes"
48 ;;
49 --disable-mp3lib) mp3lib="no"
50 ;;
51 esac
52 done
53
54 echo "Install prefix $prefix"
55 echo "C compiler $cc"
56 echo "CPU $cpu"
57 echo "MMX enabled $mmx"
58 echo "gprof enabled $gprof"
59
60 echo "Creating config.mak and config.h"
61
62 echo "# Automatically generated by configure - do not modify" > config.mak
63 echo "/* Automatically generated by configure - do not modify */" > config.h
64
65 # Checking for CFLAGS
66 if test -z "$CFLAGS"; then
67 CFLAGS="-O2"
68 fi
69
70 echo "prefix=$prefix" >> config.mak
71 echo "CC=$cc" >> config.mak
72 echo "AR=$ar" >> config.mak
73 echo "OPTFLAGS=$CFLAGS" >> config.mak
74 if [ "$cpu" = "x86" ] ; then
75 echo "TARGET_ARCH_X86=yes" >> config.mak
76 echo "#define ARCH_X86 1" >> config.h
77 fi
78 if [ "$mmx" = "yes" ] ; then
79 echo "TARGET_MMX=yes" >> config.mak
80 echo "#define HAVE_MMX 1" >> config.h
81 fi
82 if [ "$gprof" = "yes" ] ; then
83 echo "TARGET_GPROF=yes" >> config.mak
84 echo "#define HAVE_GPROF 1" >> config.h
85 fi
86 echo "#define BIN_PORTABILITY 1 /*undefine it if you want to get maximal performance*/" >> config.h
87
88 # if you do not want to use encoders, disable that.
89 echo "#define CONFIG_ENCODERS 1" >> config.h
90 echo "CONFIG_ENCODERS=yes" >> config.mak
91
92 # if you do not want to use decoders, disable that.
93 echo "#define CONFIG_DECODERS 1" >> config.h
94 echo "CONFIG_DECODERS=yes" >> config.mak
95
96 # special AC3 and MPGLIB enabling stuff in case you already have it
97 # without libavcodec.
98 echo "#define CONFIG_AC3 1" >> config.h
99 echo "CONFIG_AC3=yes" >> config.mak
100
101 if [ "$mp3lib" = "yes" ] ; then
102 echo "#define CONFIG_MPGLIB 1" >> config.h
103 echo "CONFIG_MPGLIB=yes" >> config.mak
104 fi