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