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-gprof adds -pg, doesn't strip"
16 echo " --enable-visualize enables visualization (X11 only)"
17 echo " --extra-asflags=EASFLAGS add EASFLAGS to ASFLAGS"
18 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS"
19 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS"
26 bindir='${eprefix}/bin'
27 libdir='${eprefix}/lib'
28 includedir='${prefix}/include'
39 CFLAGS="-Wall -I. -O4 -ffast-math -D__X264__"
52 CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
56 CFLAGS="$CFLAGS -falign-loops=16"
57 LDFLAGS="$LDFLAGS -lm -lmx"
61 LDFLAGS="$LDFLAGS -lm"
65 LDFLAGS="$LDFLAGS -lm"
69 CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
70 LDFLAGS="$LDFLAGS -lm"
74 CFLAGS="$CFLAGS -mno-cygwin"
75 LDFLAGS="$LDFLAGS -mno-cygwin"
76 ASFLAGS="-f win32 -DPREFIX"
81 ASFLAGS="-f win32 -DPREFIX"
86 CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
87 LDFLAGS="$LDFLAGS -lm"
91 echo "Unknown system $UNAMES, edit the configure"
98 i386|i486|i586|i686|BePC)
100 CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
104 CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
106 ASFLAGS="-f elf -m amd64"
108 "Power Macintosh"|ppc)
112 CFLAGS="$CFLAGS -faltivec"
114 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
117 sun4m|sun4d|sparc|sparc64)
122 CFLAGS="$CFLAGS -mcpu=ultrasparc"
123 LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
125 ASFLAGS="-xarch=v8plusa"
146 echo "Unknown platform $UNAMEM, edit the configure"
151 CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
174 if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
175 CFLAGS="$CFLAGS -DAVIS_INPUT"
176 LDFLAGS="$LDFLAGS -lvfw32"
181 CFLAGS="$CFLAGS -DMP4_OUTPUT"
182 LDFLAGS="$LDFLAGS -lgpac_static"
183 if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
184 LDFLAGS="$LDFLAGS -lwinmm"
189 ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
192 CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
193 VFW_CFLAGS="${opt#--extra-cflags=}"
196 LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
197 VFW_LDFLAGS="${opt#--extra-ldflags=}"
200 CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
206 LDFLAGS="$LDFLAGS -lpthread"
216 LDFLAGS="$LDFLAGS -pg"
223 LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
224 CFLAGS="$CFLAGS -DVISUALIZE=1"
228 echo "Unknown option $opt, ignored"
234 if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
235 CFLAGS="$CFLAGS -s -fomit-frame-pointer"
236 LDFLAGS="$LDFLAGS -s"
237 VFW_LDFLAGS="$VFW_LDFLAGS -s"
241 cat > config.mak << EOF
246 includedir=$includedir
257 HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
260 if [ "$vfw" = "yes" ]; then
261 rm -f vfw/build/cygwin/config.mak
262 cat > vfw/build/cygwin/config.mak << EOF
266 echo "default: x264vfw.dll" >> config.mak
269 echo "Platform: $ARCH"
271 echo "avis input: $avis_input"
272 echo "mp4 output: $mp4_output"
273 echo "pthread: $pthread"
277 echo "visualize: $vis"
279 echo "You can run 'make' now."