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-cflags=ECFLAGS add ECFLAGS to CFLAGS"
17 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS"
24 bindir='${eprefix}/bin'
25 libdir='${eprefix}/lib'
26 includedir='${prefix}/include'
36 CFLAGS="-Wall -I. -O4 -ffast-math -D__X264__"
49 CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
53 CFLAGS="$CFLAGS -falign-loops=16"
54 LDFLAGS="$LDFLAGS -lm -lmx"
58 LDFLAGS="$LDFLAGS -lm"
62 LDFLAGS="$LDFLAGS -lm"
66 CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
67 LDFLAGS="$LDFLAGS -lm"
71 CFLAGS="$CFLAGS -mno-cygwin"
72 LDFLAGS="$LDFLAGS -mno-cygwin"
73 ASFLAGS="-f win32 -DPREFIX"
78 ASFLAGS="-f win32 -DPREFIX"
83 CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
84 LDFLAGS="$LDFLAGS -lm"
88 echo "Unknown system $UNAMES, edit the configure"
95 i386|i486|i586|i686|BePC)
97 CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
101 CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
103 ASFLAGS="-f elf -m amd64"
105 "Power Macintosh"|ppc)
109 CFLAGS="$CFLAGS -faltivec"
111 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
119 CFLAGS="$CFLAGS -mcpu=ultrasparc"
120 LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
122 ASFLAGS="-xarch=v8plusa"
125 echo "Unknown platform $UNAMEM, edit the configure"
130 CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
153 if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
154 CFLAGS="$CFLAGS -DAVIS_INPUT"
155 LDFLAGS="$LDFLAGS -lvfw32"
160 CFLAGS="$CFLAGS -DMP4_OUTPUT"
161 LDFLAGS="$LDFLAGS -lm4systems_static"
162 if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
163 LDFLAGS="$LDFLAGS -lwinmm"
168 CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
169 VFW_CFLAGS="${opt#--extra-cflags=}"
172 LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
173 VFW_LDFLAGS="${opt#--extra-ldflags=}"
176 CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
182 LDFLAGS="$LDFLAGS -lpthread"
194 LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
195 CFLAGS="$CFLAGS -DVISUALIZE=1"
199 echo "Unknown option $opt, ignored"
205 if [ "$debug" != "yes" ]; then
206 CFLAGS="$CFLAGS -s -fomit-frame-pointer"
207 LDFLAGS="$LDFLAGS -s"
208 VFW_LDFLAGS="$VFW_LDFLAGS -s"
212 cat > config.mak << EOF
217 includedir=$includedir
228 HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
231 if [ "$vfw" = "yes" ]; then
232 rm -f vfw/build/cygwin/config.mak
233 cat > vfw/build/cygwin/config.mak << EOF
237 echo "default: x264vfw.dll" >> config.mak
240 echo "Platform: $ARCH"
242 echo "avis input: $avis_input"
243 echo "mp4 output: $mp4_output"
244 echo "pthread: $pthread"
247 echo "visualize: $vis"
249 echo "You can run 'make' now."