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