26 if [ "$1" = "-h" -o "$1" = "--help" ] ; then
29 Usage: configure [options]
30 Options: [defaults in brackets after descriptions]
32 --help print this message
34 echo " --prefix=PREFIX install in PREFIX [$prefix]"
35 echo " --cc=CC use C compiler CC [$cc]"
36 echo " --cpu=CPU force cpu to CPU [$cpu]"
37 echo " --disable-mmx disable mmx usage"
38 echo " --enable-gprof enable profiling with gprof [$gprof]"
39 echo " --disable-mp3lib disable mp3 lib compiling"
40 echo " --disable-grab disable audio/video grabbing code"
41 echo " --enable-win32 enable win32 cross compile"
47 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
49 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
51 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
53 --disable-mmx) mmx="no"
55 --enable-gprof) gprof="yes"
57 --disable-mp3lib) mp3lib="no"
59 --disable-grab) grab="no"
61 --enable-win32) win32="yes"
67 if test -z "$CFLAGS"; then
71 if [ "$win32" = "yes" ] ; then
72 cross_prefix="i386-mingw32msvc-"
73 cc="${cross_prefix}gcc"
74 ar="${cross_prefix}ar"
78 echo "Install prefix $prefix"
81 echo "MMX enabled $mmx"
82 echo "gprof enabled $gprof"
83 echo "grab enabled $grab"
85 echo "Creating config.mak and config.h"
87 echo "# Automatically generated by configure - do not modify" > config.mak
88 echo "/* Automatically generated by configure - do not modify */" > config.h
90 echo "prefix=$prefix" >> config.mak
91 echo "MAKE=make" >> config.mak
92 echo "CC=$cc" >> config.mak
93 echo "AR=$ar" >> config.mak
94 echo "OPTFLAGS=$CFLAGS" >> config.mak
95 if [ "$cpu" = "x86" ] ; then
96 echo "TARGET_ARCH_X86=yes" >> config.mak
97 echo "#define ARCH_X86 1" >> config.h
99 if [ "$cpu" = "armv4l" ]; then
100 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
101 echo "#define ARCH_ARMV4L 1" >> config.h
103 if [ "$mmx" = "yes" ] ; then
104 echo "TARGET_MMX=yes" >> config.mak
105 echo "#define HAVE_MMX 1" >> config.h
107 if [ "$gprof" = "yes" ] ; then
108 echo "TARGET_GPROF=yes" >> config.mak
109 echo "#define HAVE_GPROF 1" >> config.h
112 # if you do not want to use encoders, disable that.
113 echo "#define CONFIG_ENCODERS 1" >> config.h
114 echo "CONFIG_ENCODERS=yes" >> config.mak
116 # if you do not want to use decoders, disable that.
117 echo "#define CONFIG_DECODERS 1" >> config.h
118 echo "CONFIG_DECODERS=yes" >> config.mak
120 # special AC3 and MPGLIB enabling stuff in case you already have it
121 # without libavcodec.
122 echo "#define CONFIG_AC3 1" >> config.h
123 echo "CONFIG_AC3=yes" >> config.mak
125 if [ "$mp3lib" = "yes" ] ; then
126 echo "#define CONFIG_MPGLIB 1" >> config.h
127 echo "CONFIG_MPGLIB=yes" >> config.mak
130 if [ "$grab" = "yes" ] ; then
131 echo "#define CONFIG_GRAB 1" >> config.h
132 echo "CONFIG_GRAB=yes" >> config.mak
135 if [ "$win32" = "yes" ] ; then
136 echo "#define CONFIG_WIN32 1" >> config.h
137 echo "CONFIG_WIN32=yes" >> config.mak