Initial revision
[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
56echo "Creating config.mk and config.h"
57
58echo "# Automatically generated by configure - do not modify" > config.mk
59echo "/* Automatically generated by configure - do not modify */" > config.h
60
61echo "PREFIX=$prefix" >> config.mk
62echo "CC=$cc" >> config.mk
63echo "AR=$ar" >> config.mk
64if [ "$cpu" = "x86" ] ; then
65 echo "CONFIG_CPU_X86=y" >> config.mk
66 echo "#define CONFIG_CPU_X86 1" >> config.h
67fi
68if [ "$mmx" = "yes" ] ; then
69 echo "CONFIG_MMX=y" >> config.mk
70 echo "#define CONFIG_MMX 1" >> config.h
71fi
72if [ "$gprof" = "yes" ] ; then
73 echo "CONFIG_GPROF=y" >> config.mk
74 echo "#define CONFIG_GPROF 1" >> config.h
75fi