Statistics
| Branch: | Revision:

ffmpeg / configure @ d771bcae

History | View | Annotate | Download (2.23 KB)

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