]> git.sesse.net Git - ffmpeg/blob - configure
d7769e21fe9bfcfe2a8038680451dd08d0f0a165
[ffmpeg] / 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 "MAKE=make" >> config.mak
72 echo "CC=$cc" >> config.mak
73 echo "AR=$ar" >> config.mak
74 echo "OPTFLAGS=$CFLAGS" >> config.mak
75 if [ "$cpu" = "x86" ] ; then
76   echo "TARGET_ARCH_X86=yes" >> config.mak
77   echo "#define ARCH_X86 1" >> config.h
78 fi
79 if [ "$mmx" = "yes" ] ; then
80   echo "TARGET_MMX=yes" >> config.mak
81   echo "#define HAVE_MMX 1" >> config.h
82 fi
83 if [ "$gprof" = "yes" ] ; then
84   echo "TARGET_GPROF=yes" >> config.mak
85   echo "#define HAVE_GPROF 1" >> config.h
86 fi
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