fixed config for direct mplayer build compatibility
[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
980fc7b8
FB
61echo "prefix=$prefix" >> config.mak
62echo "CC=$cc" >> config.mak
63echo "AR=$ar" >> config.mak
64echo "OPTFLAGS=-O2" >> config.mak
de6d9b64 65if [ "$cpu" = "x86" ] ; then
980fc7b8
FB
66 echo "TARGET_ARCH_X86=yes" >> config.mak
67 echo "#define ARCH_X86 1" >> config.h
de6d9b64
FB
68fi
69if [ "$mmx" = "yes" ] ; then
980fc7b8
FB
70 echo "TARGET_MMX=yes" >> config.mak
71 echo "#define HAVE_MMX 1" >> config.h
de6d9b64
FB
72fi
73if [ "$gprof" = "yes" ] ; then
980fc7b8
FB
74 echo "TARGET_GPROF=yes" >> config.mak
75 echo "#define HAVE_GPROF 1" >> config.h
de6d9b64 76fi