3 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
5 echo "Usage: ./configure [options]"
7 echo "available options:"
9 echo " --help print this message"
10 echo " --enable-avis-input enables avisynth input (win32 only)"
11 echo " --enable-mp4-output enables mp4 output (using gpac)"
12 echo " --enable-vfw compiles the VfW frontend"
13 echo " --enable-pthread enables multithreaded encoding"
14 echo " --enable-debug adds -g, doesn't strip"
15 echo " --enable-visualize enables visualization (X11 only)"
16 echo " --extra-asflags=EASFLAGS add EASFLAGS to ASFLAGS"
17 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS"
18 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS"
25 bindir='${eprefix}/bin'
26 libdir='${eprefix}/lib'
27 includedir='${prefix}/include'
37 CFLAGS="-Wall -I. -O4 -ffast-math -D__X264__"
50 CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
54 CFLAGS="$CFLAGS -falign-loops=16"
55 LDFLAGS="$LDFLAGS -lm -lmx"
59 LDFLAGS="$LDFLAGS -lm"
63 LDFLAGS="$LDFLAGS -lm"
67 CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
68 LDFLAGS="$LDFLAGS -lm"
72 CFLAGS="$CFLAGS -mno-cygwin"
73 LDFLAGS="$LDFLAGS -mno-cygwin"
74 ASFLAGS="-f win32 -DPREFIX"
79 ASFLAGS="-f win32 -DPREFIX"
84 CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
85 LDFLAGS="$LDFLAGS -lm"
89 echo "Unknown system $UNAMES, edit the configure"
96 i386|i486|i586|i686|BePC)
98 CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
102 CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
104 ASFLAGS="-f elf -m amd64"
106 "Power Macintosh"|ppc)
110 CFLAGS="$CFLAGS -faltivec"
112 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
115 sun4m|sun4d|sparc|sparc64)
120 CFLAGS="$CFLAGS -mcpu=ultrasparc"
121 LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
123 ASFLAGS="-xarch=v8plusa"
144 echo "Unknown platform $UNAMEM, edit the configure"
149 CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
172 if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
173 CFLAGS="$CFLAGS -DAVIS_INPUT"
174 LDFLAGS="$LDFLAGS -lvfw32"
179 CFLAGS="$CFLAGS -DMP4_OUTPUT"
180 LDFLAGS="$LDFLAGS -lgpac_static"
181 if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
182 LDFLAGS="$LDFLAGS -lwinmm"
187 ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
190 CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
191 VFW_CFLAGS="${opt#--extra-cflags=}"
194 LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
195 VFW_LDFLAGS="${opt#--extra-ldflags=}"
198 CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
204 LDFLAGS="$LDFLAGS -lpthread"
216 LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
217 CFLAGS="$CFLAGS -DVISUALIZE=1"
221 echo "Unknown option $opt, ignored"
227 if [ "$debug" != "yes" ]; then
228 CFLAGS="$CFLAGS -s -fomit-frame-pointer"
229 LDFLAGS="$LDFLAGS -s"
230 VFW_LDFLAGS="$VFW_LDFLAGS -s"
234 cat > config.mak << EOF
239 includedir=$includedir
250 HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
253 if [ "$vfw" = "yes" ]; then
254 rm -f vfw/build/cygwin/config.mak
255 cat > vfw/build/cygwin/config.mak << EOF
259 echo "default: x264vfw.dll" >> config.mak
262 echo "Platform: $ARCH"
264 echo "avis input: $avis_input"
265 echo "mp4 output: $mp4_output"
266 echo "pthread: $pthread"
269 echo "visualize: $vis"
271 echo "You can run 'make' now."