]> git.sesse.net Git - x264/blob - configure
ICL: fix out of tree building and resource file usage on Windows
[x264] / configure
1 #!/bin/bash
2
3 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
4 cat <<EOF
5 Usage: ./configure [options]
6
7 Help:
8   -h, --help               print this message
9
10 Standard options:
11   --prefix=PREFIX          install architecture-independent files in PREFIX
12                            [/usr/local]
13   --exec-prefix=EPREFIX    install architecture-dependent files in EPREFIX
14                            [PREFIX]
15   --bindir=DIR             install binaries in DIR [EPREFIX/bin]
16   --libdir=DIR             install libs in DIR [EPREFIX/lib]
17   --includedir=DIR         install includes in DIR [PREFIX/include]
18   --extra-asflags=EASFLAGS add EASFLAGS to ASFLAGS
19   --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS
20   --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS
21
22 Configuration options:
23   --disable-cli            disable cli
24   --system-libx264         use system libx264 instead of internal
25   --enable-shared          build shared library
26   --enable-static          build static library
27   --disable-gpl            disable GPL-only features
28   --disable-thread         disable multithreaded encoding
29   --enable-win32thread     use win32threads (windows only)
30   --disable-interlaced     disable interlaced encoding support
31   --enable-visualize       enable visualization (X11 only)
32   --bit-depth=BIT_DEPTH    set output bit depth (8-10) [8]
33   --chroma-format=FORMAT   output chroma format (420, 422, 444, all) [all]
34
35 Advanced options:
36   --disable-asm            disable platform-specific assembly optimizations
37   --enable-debug           add -g
38   --enable-gprof           add -pg
39   --enable-strip           add -s
40   --enable-pic             build position-independent code
41
42 Cross-compilation:
43   --host=HOST              build programs to run on HOST
44   --cross-prefix=PREFIX    use PREFIX for compilation tools
45   --sysroot=SYSROOT        root of cross-build tree
46
47 External library support:
48   --disable-avs            disable avisynth support (windows only)
49   --disable-swscale        disable swscale support
50   --disable-lavf           disable libavformat support
51   --disable-ffms           disable ffmpegsource support
52   --disable-gpac           disable gpac support
53
54 EOF
55 exit 1
56 fi
57
58 log_check() {
59     echo -n "checking $1... " >> config.log
60 }
61
62 log_ok() {
63     echo "yes" >> config.log
64 }
65
66 log_fail() {
67     echo "no" >> config.log
68 }
69
70 log_msg() {
71     echo "$1" >> config.log
72 }
73
74 intel_cflags() {
75     # Intel Compiler issues an incredibly large number of warnings on any warning level,
76     # suppress them by disabling all warnings rather than having to use #pragmas to disable most of them
77     for arg in $*; do
78         [ $arg = -ffast-math ] && arg=
79         [[ "$arg" = -falign-loops* ]] && arg=
80         [ "$arg" = -fno-tree-vectorize ] && arg=
81         [ "$arg" = -Wshadow ] && arg=
82         if [ $compiler = ICL ]; then
83             [ "$arg" = -Wall ] && arg=-W0
84             [ "$arg" = -g ] && arg=-Z7
85             [ "$arg" = -fomit-frame-pointer ] && arg=
86             [ "$arg" = -s ] && arg=
87             [ "$arg" = -fPIC ] && arg=
88         else
89             [ "$arg" = -Wall ] && arg=-w0
90         fi
91
92         [ -n "$arg" ] && echo -n "$arg "
93     done
94 }
95
96 icl_ldflags() {
97     for arg in $*; do
98         arg=${arg/LIBPATH/libpath}
99         [ ${arg#-libpath:} == $arg -a ${arg#-l} != $arg ] && arg=${arg#-l}.lib
100         [ ${arg#-L} != $arg ] && arg=-libpath:${arg#-L}
101         [ $arg = -Wl,--large-address-aware ] && arg=-largeaddressaware
102         [ $arg = -s ] && arg=
103         [ "$arg" = -Wl,-Bsymbolic ] && arg=
104
105         arg=${arg/pthreadGC/pthreadVC}
106         [ "$arg" = avifil32.lib ] && arg=vfw32.lib
107         [ "$arg" = gpac_static.lib ] && arg=libgpac_static.lib
108
109         [ -n "$arg" ] && echo -n "$arg "
110     done
111 }
112
113 cc_check() {
114     if [ -z "$3" ]; then
115         if [ -z "$1$2" ]; then
116             log_check "whether $CC works"
117         elif [ -z "$1" ]; then
118             log_check "for $2"
119         else
120             log_check "for $1"
121         fi
122     elif [ -z "$1" ]; then
123         if [ -z "$2" ]; then
124             log_check "whether $CC supports $3"
125         else
126             log_check "whether $CC supports $3 with $2"
127         fi
128     else
129         log_check "for $3 in $1";
130     fi
131     rm -f conftest.c
132     [ -n "$1" ] && echo "#include <$1>" > conftest.c
133     echo "int main () { $3 return 0; }" >> conftest.c
134     if [ $compiler = ICL ]; then
135         cc_cmd="$CC conftest.c $CFLAGS $2 -link $(icl_ldflags $2 $LDFLAGSCLI $LDFLAGS)"
136     else
137         cc_cmd="$CC conftest.c $CFLAGS $2 $LDFLAGSCLI $LDFLAGS -o conftest"
138     fi
139     if $cc_cmd >conftest.log 2>&1; then
140         res=$?
141         log_ok
142     else
143         res=$?
144         log_fail
145         log_msg "Failed commandline was:"
146         log_msg "--------------------------------------------------"
147         log_msg "$cc_cmd"
148         cat conftest.log >> config.log
149         log_msg "--------------------------------------------------"
150         log_msg "Failed program was:"
151         log_msg "--------------------------------------------------"
152         cat conftest.c >> config.log
153         log_msg "--------------------------------------------------"
154     fi
155     return $res
156 }
157
158 cpp_check() {
159     log_check "whether $3 is true"
160     rm -f conftest.c
161     [ -n "$1" ] && echo "#include <$1>" > conftest.c
162     echo -e "#if !($3) \n#error $4 \n#endif " >> conftest.c
163
164     if $CC conftest.c $CFLAGS $2 -E -o conftest >conftest.log 2>&1; then
165         res=$?
166         log_ok
167     else
168         res=$?
169         log_fail
170         log_msg "--------------------------------------------------"
171         cat conftest.log >> config.log
172         log_msg "--------------------------------------------------"
173         log_msg "Failed program was:"
174         log_msg "--------------------------------------------------"
175         cat conftest.c >> config.log
176         log_msg "--------------------------------------------------"
177     fi
178     return $res
179 }
180
181 as_check() {
182     log_check "whether $AS supports $1"
183     echo "$1" > conftest.asm
184     if $AS conftest.asm $ASFLAGS $2 -o conftest.o >conftest.log 2>&1; then
185         res=$?
186         log_ok
187     else
188         res=$?
189         log_fail
190         log_msg "Failed commandline was:"
191         log_msg "--------------------------------------------------"
192         log_msg "$AS conftest.asm $ASFLAGS $2 -o conftest.o"
193         cat conftest.log >> config.log
194         log_msg "--------------------------------------------------"
195         log_msg "Failed program was:"
196         log_msg "--------------------------------------------------"
197         cat conftest.asm >> config.log
198         log_msg "--------------------------------------------------"
199     fi
200     return $res
201 }
202
203 rc_check() {
204     log_check "whether $RC works"
205     echo "$1" > conftest.rc
206     if [ $compiler = ICL ]; then
207         rc_cmd="$RC -foconftest.o conftest.rc"
208     else
209         rc_cmd="$RC -o conftest.o conftest.rc"
210     fi
211     if $rc_cmd >conftest.log 2>&1; then
212         res=$?
213         log_ok
214     else
215         res=$?
216         log_fail
217         log_msg "Failed commandline was:"
218         log_msg "--------------------------------------------------"
219         log_msg "$rc_cmd"
220         cat conftest.log >> config.log
221         log_msg "--------------------------------------------------"
222         log_msg "Failed program was:"
223         log_msg "--------------------------------------------------"
224         cat conftest.rc >> config.log
225         log_msg "--------------------------------------------------"
226     fi
227     return $res
228 }
229
230 define() {
231     echo "#define $1$([ -n "$2" ] && echo " $2" || echo " 1")" >> config.h
232 }
233
234 die() {
235     log_msg "DIED: $@"
236     echo "$@"
237     exit 1
238 }
239
240 rm -f x264_config.h config.h config.mak config.log x264.pc x264.def conftest*
241
242 SRCPATH="$(cd $(dirname $0); pwd)"
243 [ "$SRCPATH" = "$(pwd)" ] && SRCPATH=.
244 [ -n "$(echo $SRCPATH | grep ' ')" ] && die "Out of tree builds are impossible with whitespace in source path."
245 [ -e "$SRCPATH/config.h" -o -e "$SRCPATH/x264_config.h" ] && die "Out of tree builds are impossible with config.h/x264_config.h in source dir."
246
247 prefix='/usr/local'
248 exec_prefix='${prefix}'
249 bindir='${exec_prefix}/bin'
250 libdir='${exec_prefix}/lib'
251 includedir='${prefix}/include'
252 DEVNULL='/dev/null'
253
254 cli="yes"
255 cli_libx264="internal"
256 shared="no"
257 static="no"
258 avs="auto"
259 lavf="auto"
260 ffms="auto"
261 gpac="auto"
262 gpl="yes"
263 thread="auto"
264 swscale="auto"
265 asm="auto"
266 interlaced="yes"
267 debug="no"
268 gprof="no"
269 strip="no"
270 pic="no"
271 vis="no"
272 bit_depth="8"
273 chroma_format="all"
274 compiler="GNU"
275
276 CFLAGS="$CFLAGS -Wall -I. -I\$(SRCPATH)"
277 LDFLAGS="$LDFLAGS"
278 LDFLAGSCLI="$LDFLAGSCLI"
279 ASFLAGS="$ASFLAGS"
280 HAVE_GETOPT_LONG=1
281 cross_prefix=""
282
283 EXE=""
284
285 # list of all preprocessor HAVE values we can define
286 CONFIG_HAVE="MALLOC_H ALTIVEC ALTIVEC_H MMX ARMV6 ARMV6T2 NEON BEOSTHREAD POSIXTHREAD WIN32THREAD THREAD LOG2F VISUALIZE SWSCALE LAVF FFMS GPAC GF_MALLOC AVS GPL VECTOREXT INTERLACED CPU_COUNT"
287
288 # parse options
289
290 for opt do
291     optarg="${opt#*=}"
292     case "$opt" in
293         --prefix=*)
294             prefix="$optarg"
295             ;;
296         --exec-prefix=*)
297             exec_prefix="$optarg"
298             ;;
299         --bindir=*)
300             bindir="$optarg"
301             ;;
302         --libdir=*)
303             libdir="$optarg"
304             ;;
305         --includedir=*)
306             includedir="$optarg"
307             ;;
308         --disable-cli)
309             cli="no"
310             ;;
311         --system-libx264)
312             cli_libx264="system"
313             ;;
314         --enable-shared)
315             shared="yes"
316             ;;
317         --enable-static)
318             static="yes"
319             ;;
320         --disable-asm)
321             asm="no"
322             ;;
323         --disable-interlaced)
324             interlaced="no"
325             ;;
326         --disable-avs)
327             avs="no"
328             ;;
329         --disable-lavf)
330             lavf="no"
331             ;;
332         --disable-ffms)
333             ffms="no"
334             ;;
335         --disable-gpac)
336             gpac="no"
337             ;;
338         --disable-gpl)
339             gpl="no"
340             ;;
341         --extra-asflags=*)
342             ASFLAGS="$ASFLAGS $optarg"
343             ;;
344         --extra-cflags=*)
345             CFLAGS="$CFLAGS $optarg"
346             ;;
347         --extra-ldflags=*)
348             LDFLAGS="$LDFLAGS $optarg"
349             ;;
350         --disable-thread)
351             thread="no"
352             ;;
353         --enable-win32thread)
354             thread="win32"
355             ;;
356         --disable-swscale)
357             swscale="no"
358             ;;
359         --enable-debug)
360             debug="yes"
361             ;;
362         --enable-gprof)
363             CFLAGS="$CFLAGS -pg"
364             LDFLAGS="$LDFLAGS -pg"
365             gprof="yes"
366             ;;
367         --enable-strip)
368             strip="yes"
369             ;;
370         --enable-pic)
371             pic="yes"
372             ;;
373         --enable-visualize)
374             vis="yes"
375             ;;
376         --host=*)
377             host="$optarg"
378             ;;
379         --cross-prefix=*)
380             cross_prefix="$optarg"
381             ;;
382         --sysroot=*)
383             CFLAGS="$CFLAGS --sysroot=$optarg"
384             LDFLAGS="$LDFLAGS --sysroot=$optarg"
385             ;;
386         --bit-depth=*)
387             bit_depth="$optarg"
388             if [ "$bit_depth" -lt "8" -o "$bit_depth" -gt "10" ]; then
389                 echo "Supplied bit depth must be in range [8,10]."
390                 exit 1
391             fi
392             bit_depth=`expr $bit_depth + 0`
393             ;;
394         --chroma-format=*)
395             chroma_format="$optarg"
396             if [ $chroma_format != "420" -a $chroma_format != "422" -a $chroma_format != "444" -a $chroma_format != "all" ]; then
397                 echo "Supplied chroma format must be 420, 422, 444 or all."
398                 exit 1
399             fi
400             ;;
401         *)
402             echo "Unknown option $opt, ignored"
403             ;;
404     esac
405 done
406
407 [ "$cli" = "no" -a "$shared" = "no" -a "$static" = "no" ] && die "Nothing to build. Enable cli, shared or static."
408
409 CC="${CC-${cross_prefix}gcc}"
410 AR="${AR-${cross_prefix}ar}"
411 RANLIB="${RANLIB-${cross_prefix}ranlib}"
412 STRIP="${STRIP-${cross_prefix}strip}"
413
414 if [ "x$host" = x ]; then
415     host=`${SRCPATH}/config.guess`
416 fi
417 # normalize a triplet into a quadruplet
418 host=`${SRCPATH}/config.sub $host`
419
420 # split $host
421 host_cpu="${host%%-*}"
422 host="${host#*-}"
423 host_vendor="${host%%-*}"
424 host_os="${host#*-}"
425
426 # test for use of Intel Compiler
427 if [[ $host_os = mingw* || $host_os = cygwin* ]]; then
428     if [[ `basename "$CC"` = icl* ]]; then
429         # Windows Intel Compiler creates dependency generation with absolute Windows paths, Cygwin's make does not support Windows paths.
430         [[ $host_os = cygwin* ]] && die "Windows Intel Compiler support requires MSYS"
431         compiler=ICL
432         CFLAGS="$CFLAGS -Qstd=c99 -nologo -Qms0 -DHAVE_STRING_H -I\$(SRCPATH)/extras"
433         QPRE="-Q"
434         `$CC 2>&1 | grep -q IA-32` && host_cpu=i486
435         `$CC 2>&1 | grep -q "Intel(R) 64"` && host_cpu=x86_64
436         cpp_check "" "" "_MSC_VER >= 1400" || die "Windows Intel Compiler support requires Visual Studio 2005 or newer"
437     fi
438 else
439     if [[ `basename "$CC"` = icc* ]]; then
440         AR="xiar"
441         compiler=ICC
442         QPRE="-"
443     fi
444 fi
445
446 case $host_os in
447     beos*)
448         SYS="BEOS"
449         define HAVE_MALLOC_H
450         ;;
451     darwin*)
452         SYS="MACOSX"
453         CFLAGS="$CFLAGS -falign-loops=16"
454         LDFLAGS="$LDFLAGS -lm"
455         if [ "$pic" = "no" ]; then
456             cc_check "" -mdynamic-no-pic && CFLAGS="$CFLAGS -mdynamic-no-pic"
457         fi
458         ;;
459     freebsd*)
460         SYS="FREEBSD"
461         LDFLAGS="$LDFLAGS -lm"
462         ;;
463     kfreebsd*-gnu)
464         SYS="FREEBSD"
465         define HAVE_MALLOC_H
466         LDFLAGS="$LDFLAGS -lm"
467         ;;
468     netbsd*)
469         SYS="NETBSD"
470         LDFLAGS="$LDFLAGS -lm"
471         ;;
472     openbsd*)
473         SYS="OPENBSD"
474         LDFLAGS="$LDFLAGS -lm"
475         ;;
476     *linux*)
477         SYS="LINUX"
478         define HAVE_MALLOC_H
479         LDFLAGS="$LDFLAGS -lm"
480         ;;
481     gnu*)
482         SYS="HURD"
483         define HAVE_MALLOC_H
484         LDFLAGS="$LDFLAGS -lm"
485         ;;
486     cygwin*)
487         EXE=".exe"
488         if cc_check "" -mno-cygwin; then
489             CFLAGS="$CFLAGS -mno-cygwin"
490             LDFLAGS="$LDFLAGS -mno-cygwin"
491         fi
492         if cpp_check "" "" "defined(__CYGWIN32__)" ; then
493             define HAVE_MALLOC_H
494             SYS="CYGWIN"
495         else
496             SYS="WINDOWS"
497             DEVNULL="NUL"
498         fi
499         ;;
500     mingw*)
501         SYS="WINDOWS"
502         EXE=".exe"
503         DEVNULL="NUL"
504         ;;
505     sunos*|solaris*)
506         SYS="SunOS"
507         define HAVE_MALLOC_H
508         LDFLAGS="$LDFLAGS -lm"
509         if cc_check "" /usr/lib/64/values-xpg6.o; then
510             LDFLAGS="$LDFLAGS /usr/lib/64/values-xpg6.o"
511         else
512             LDFLAGS="$LDFLAGS /usr/lib/values-xpg6.o"
513         fi
514         HAVE_GETOPT_LONG=0
515         ;;
516     *)
517         die "Unknown system $host, edit the configure"
518         ;;
519 esac
520
521 case $host_cpu in
522     i*86)
523         ARCH="X86"
524         AS="yasm"
525         ASFLAGS="$ASFLAGS -O2"
526         if [ $compiler = GNU ]; then
527             if [[ "$asm" == auto && "$CFLAGS" != *-march* ]]; then
528                 CFLAGS="$CFLAGS -march=i686"
529             fi
530             if [[ "$asm" == auto && "$CFLAGS" != *-mfpmath* ]]; then
531                 CFLAGS="$CFLAGS -mfpmath=sse -msse"
532             fi
533         else
534             # icc on linux has various degrees of mod16 stack support
535             if [ $SYS = LINUX ]; then
536                 # < 11 is completely incapable of keeping a mod16 stack
537                 if cpp_check "" "" "__INTEL_COMPILER < 1100" ; then
538                     define BROKEN_STACK_ALIGNMENT
539                 # 11 <= x < 12 is capable of keeping a mod16 stack, but defaults to not doing so.
540                 elif cpp_check "" "" "__INTEL_COMPILER < 1200" ; then
541                     CFLAGS="$CFLAGS -falign-stack=assume-16-byte"
542                 fi
543                 # >= 12 defaults to a mod16 stack
544             fi
545             # icl on windows has no mod16 stack support
546             [ $SYS = WINDOWS ] && define BROKEN_STACK_ALIGNMENT
547         fi
548         if [ "$SYS" = MACOSX ]; then
549             ASFLAGS="$ASFLAGS -f macho -DPREFIX"
550         elif [ "$SYS" = WINDOWS -o "$SYS" = CYGWIN ]; then
551             ASFLAGS="$ASFLAGS -f win32 -DPREFIX"
552             LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
553         else
554             ASFLAGS="$ASFLAGS -f elf"
555         fi
556         ;;
557     x86_64)
558         ARCH="X86_64"
559         AS="yasm"
560         if [ "$SYS" = MACOSX ]; then
561             ASFLAGS="$ASFLAGS -f macho64 -m amd64 -DPIC -DPREFIX"
562             if cc_check '' "-arch x86_64"; then
563                 CFLAGS="$CFLAGS -arch x86_64"
564                 LDFLAGS="$LDFLAGS -arch x86_64"
565             fi
566         elif [ "$SYS" = WINDOWS ]; then
567             ASFLAGS="$ASFLAGS -f win32 -m amd64"
568             # only the GNU toolchain is inconsistent in prefixing function names with _
569             [ $compiler = GNU ] && cc_check "" "-S" && grep -q "_main:" conftest && ASFLAGS="$ASFLAGS -DPREFIX"
570         else
571             ASFLAGS="$ASFLAGS -f elf -m amd64"
572         fi
573         ;;
574     powerpc|powerpc64)
575         ARCH="PPC"
576         if [ $asm = auto ] ; then
577             define HAVE_ALTIVEC
578             AS="${AS-${cross_prefix}gcc}"
579             if [ $SYS = MACOSX ] ; then
580                 CFLAGS="$CFLAGS -faltivec -fastf -mcpu=G4"
581             else
582                 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
583                 define HAVE_ALTIVEC_H
584             fi
585         fi
586         ;;
587     sparc)
588         ARCH="SPARC"
589         case $(uname -m) in
590             sun4u|sun4v)
591                 if [ $asm = auto ]; then
592                     ARCH="UltraSPARC"
593                     if ! echo $CFLAGS | grep -Eq '\-mcpu' ; then
594                         CFLAGS="$CFLAGS -mcpu=ultrasparc"
595                         LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
596                     fi
597                     AS="${AS-${cross_prefix}as}"
598                     ASFLAGS="$ASFLAGS -xarch=v8plusa"
599                 fi
600                 ;;
601         esac
602         ;;
603     mips|mipsel|mips64|mips64el)
604         ARCH="MIPS"
605         ;;
606     arm*)
607         ARCH="ARM"
608         if [ "$SYS" = MACOSX ] ; then
609             AS="${AS-extras/gas-preprocessor.pl $CC}"
610             ASFLAGS="$ASFLAGS -DPREFIX -DPIC"  # apple's ld doesn't support movw/movt relocations at all
611             # build for armv7 by default
612             if ! echo $CFLAGS | grep -Eq '\-arch' ; then
613                 CFLAGS="$CFLAGS -arch armv7"
614                 LDFLAGS="$LDFLAGS -arch armv7"
615             fi
616         else
617             AS="${AS-${cross_prefix}gcc}"
618         fi
619         ;;
620     s390|s390x)
621         ARCH="S390"
622         ;;
623     hppa*|parisc*)
624         ARCH="PARISC"
625         ;;
626     ia64)
627         ARCH="IA64"
628         ;;
629     alpha*)
630         ARCH="ALPHA"
631         ;;
632     *)
633         ARCH="$(echo $host_cpu | tr a-z A-Z)"
634         ;;
635 esac
636
637 RC=""
638 if [ $SYS = WINDOWS ]; then
639     [ $compiler = ICL ] && RC="rc" || RC="${cross_prefix}windres"
640     if ! rc_check "0 RCDATA {0}" ; then
641         RC=""
642     fi
643 fi
644
645 log_msg "x264 configure script"
646 if [ -n "$*" ]; then
647     msg="Command line options:"
648     for i in $@; do
649         msg="$msg \"$i\""
650     done
651     log_msg "$msg"
652 fi
653 log_msg ""
654
655 # check requirements
656
657 cc_check || die "No working C compiler found."
658
659 if [ $compiler != ICL ]; then
660     if cc_check '' -std=gnu99 'for( int i = 0; i < 9; i++ );' ; then
661         CFLAGS="$CFLAGS -std=gnu99"
662     elif cc_check '' -std=c99 'for( int i = 0; i < 9; i++ );' ; then
663         CFLAGS="$CFLAGS -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE"
664     elif ! cc_check '' '' 'for( int i = 0; i < 9; i++ );' ; then
665         die "C99 compiler is needed for compilation."
666     fi
667 fi
668
669 if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" -o $ARCH = "IA64" -o $ARCH = "PARISC" -o $ARCH = "MIPS" \) ] ; then
670     pic="yes"
671 fi
672
673 if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
674     if ! as_check "vpperm xmm0, xmm0, xmm0, xmm0" ; then
675         VER=`($AS --version || echo no assembler) 2>/dev/null | head -n 1`
676         echo "Found $VER"
677         echo "Minimum version is yasm-1.0.0"
678         echo "If you really want to compile without asm, configure with --disable-asm."
679         exit 1
680     fi
681     if ! cc_check '' '' '__asm__("pabsw %xmm0, %xmm0");' ; then
682         VER=`(${cross_prefix}as --version || echo no gnu as) 2>/dev/null | head -n 1`
683         echo "Found $VER"
684         echo "Minimum version is binutils-2.17"
685         echo "Your compiler can't handle inline SSSE3 asm."
686         echo "If you really want to compile without asm, configure with --disable-asm."
687         exit 1
688     fi
689     define HAVE_MMX
690 fi
691
692 if [ $asm = auto -a $ARCH = ARM ] ; then
693     # set flags so neon is built by default
694     echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon"
695
696     if  cc_check '' '' '__asm__("rev ip, ip");' ; then      define HAVE_ARMV6
697         cc_check '' '' '__asm__("movt r0, #0");'         && define HAVE_ARMV6T2
698         cc_check '' '' '__asm__("vadd.i16 q0, q0, q0");' && define HAVE_NEON
699         ASFLAGS="$ASFLAGS $CFLAGS -c"
700     else
701         echo "You specified a pre-ARMv6 or Thumb-1 CPU in your CFLAGS."
702         echo "If you really want to run on such a CPU, configure with --disable-asm."
703         exit 1
704     fi
705 fi
706
707 [ $asm = no ] && AS=""
708 [ "x$AS" = x ] && asm="no" || asm="yes"
709
710 define ARCH_$ARCH
711 define SYS_$SYS
712
713 # skip endianness check for Intel Compiler, as all supported platforms are little. the -ipo flag will also cause the check to fail
714 if [ $compiler = GNU ]; then
715     echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
716     $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
717     if (${cross_prefix}strings -a conftest.o | grep -q BIGE) && (${cross_prefix}strings -a conftest.o | grep -q FPendian) ; then
718         define WORDS_BIGENDIAN
719     elif !(${cross_prefix}strings -a conftest.o | grep -q EGIB && ${cross_prefix}strings -a conftest.o | grep -q naidnePF) ; then
720         die "endian test failed"
721     fi
722 fi
723
724 # autodetect options that weren't forced nor disabled
725
726 # pthread-win32 is lgpl, prevent its use if --disable-gpl is specified and targeting windows
727 [ "$SYS" = "WINDOWS" -a "$gpl" = "no" -a "$thread" = "auto" ] && thread="win32"
728
729 libpthread=""
730 if [ "$thread" = "auto" ]; then
731     thread="no"
732     case $SYS in
733         BEOS)
734             thread="beos"
735             define HAVE_BEOSTHREAD
736             ;;
737         WINDOWS)
738             if cc_check pthread.h -lpthread "pthread_create(0,0,0,0);" ; then
739                 thread="posix"
740                 libpthread="-lpthread"
741             elif cc_check pthread.h -lpthreadGC2 "pthread_create(0,0,0,0);" ; then
742                 thread="posix"
743                 libpthread="-lpthreadGC2"
744             elif cc_check pthread.h "-lpthreadGC2 -lwsock32 -DPTW32_STATIC_LIB" "pthread_create(0,0,0,0);" ; then
745                 thread="posix"
746                 libpthread="-lpthreadGC2 -lwsock32"
747                 define PTW32_STATIC_LIB
748             elif cc_check pthread.h "-lpthreadGC2 -lws2_32 -DPTW32_STATIC_LIB" "pthread_create(0,0,0,0);" ; then
749                 thread="posix"
750                 libpthread="-lpthreadGC2 -lws2_32"
751                 define PTW32_STATIC_LIB
752             else
753                 # default to native threading if pthread-win32 is unavailable
754                 thread="win32"
755             fi
756             ;;
757         OPENBSD)
758             cc_check pthread.h -pthread && thread="posix" && libpthread="-pthread"
759             ;;
760         *)
761             cc_check pthread.h -lpthread && thread="posix" && libpthread="-lpthread"
762             ;;
763     esac
764 fi
765 if [ "$thread" = "posix" ]; then
766     LDFLAGS="$LDFLAGS $libpthread"
767     define HAVE_POSIXTHREAD
768     if [ "$SYS" = "LINUX" ] && cc_check sched.h "-D_GNU_SOURCE -Werror" "cpu_set_t p_aff; return CPU_COUNT(&p_aff);" ; then
769         define HAVE_CPU_COUNT
770     fi
771 fi
772 if [ "$thread" = "win32" ]; then
773     # cygwin does not support win32 threads
774     if [ "$SYS" = "WINDOWS" ]; then
775         define HAVE_WIN32THREAD
776     else
777         thread="no"
778     fi
779 fi
780 [ "$thread" != "no" ] && define HAVE_THREAD
781
782 if cc_check "math.h" "-Werror" "return log2f(2);" ; then
783     define HAVE_LOG2F
784 fi
785
786 if [ "$vis" = "yes" ] ; then
787     save_CFLAGS="$CFLAGS"
788     CFLAGS="$CFLAGS -I/usr/X11R6/include"
789     if cc_check "X11/Xlib.h" "-L/usr/X11R6/lib -lX11" "XOpenDisplay(0);" ; then
790         LDFLAGS="-L/usr/X11R6/lib -lX11 $LDFLAGS"
791         define HAVE_VISUALIZE
792     else
793         vis="no"
794         CFLAGS="$save_CFLAGS"
795    fi
796 fi
797
798 if [ "$swscale" = "auto" ] ; then
799     swscale="no"
800     if ${cross_prefix}pkg-config --exists libswscale 2>/dev/null; then
801         SWSCALE_LIBS="$SWSCALE_LIBS $(${cross_prefix}pkg-config --libs libswscale libavutil)"
802         SWSCALE_CFLAGS="$SWSCALE_CFLAGS $(${cross_prefix}pkg-config --cflags libswscale libavutil)"
803     fi
804     [ -z "$SWSCALE_LIBS" ] && SWSCALE_LIBS="-lswscale -lavutil"
805
806     if cc_check "libswscale/swscale.h" "$SWSCALE_CFLAGS $SWSCALE_LIBS" "sws_init_context(0,0,0);" ; then
807         if cpp_check "libavutil/pixdesc.h" "$SWSCALE_CFLAGS $SWSCALE_LIBS" "defined(PIX_FMT_RGB)" ; then
808             swscale="yes"
809         else
810             echo "Warning: PIX_FMT_RGB is missing from libavutil, update for swscale support"
811         fi
812     fi
813 fi
814
815 if [ "$lavf" = "auto" ] ; then
816     lavf="no"
817     if ${cross_prefix}pkg-config --exists libavformat libavcodec libswscale 2>/dev/null; then
818         LAVF_LIBS="$LAVF_LIBS $(${cross_prefix}pkg-config --libs libavformat libavcodec libavutil libswscale)"
819         LAVF_CFLAGS="$LAVF_CFLAGS $(${cross_prefix}pkg-config --cflags libavformat libavcodec libavutil libswscale)"
820     fi
821     if [ -z "$LAVF_LIBS" -a -z "$LAVF_CFLAGS" ]; then
822         LAVF_LIBS="-lavformat"
823         for lib in -lpostproc -lavcodec -lavcore -lswscale -lavutil -lm -lz -lbz2 $libpthread -lavifil32; do
824             cc_check "" $lib && LAVF_LIBS="$LAVF_LIBS $lib"
825         done
826     fi
827     LAVF_LIBS="-L. $LAVF_LIBS"
828     if cc_check libavformat/avformat.h "$LAVF_CFLAGS $LAVF_LIBS" "avformat_find_stream_info(0,0); avcodec_open2(0,0,0);" ; then
829         if [ "$swscale" = "yes" ]; then
830             lavf="yes"
831         else
832             echo "Warning: libavformat is not supported without swscale support"
833         fi
834     fi
835 fi
836
837 if [ "$ffms" = "auto" ] ; then
838     ffms_major="2"; ffms_minor="16"; ffms_micro="2"; ffms_bump="0"
839     ffms="no"
840
841     if ${cross_prefix}pkg-config --exists ffms2 2>/dev/null; then
842         FFMS2_LIBS="$FFMS2_LIBS $(${cross_prefix}pkg-config --libs ffms2)"
843         FFMS2_CFLAGS="$FFMS2_CFLAGS $(${cross_prefix}pkg-config --cflags ffms2)"
844     fi
845     [ -z "$FFMS2_LIBS" ] && FFMS2_LIBS="-lffms2"
846
847     if cc_check ffms.h "$FFMS2_CFLAGS $FFMS2_LIBS" "FFMS_DestroyVideoSource(0);" ; then
848         ffms="yes"
849     elif cc_check ffms.h "$FFMS2_CFLAGS $FFMS2_LIBS -lstdc++ $LAVF_LIBS" "FFMS_DestroyVideoSource(0);" ; then
850         ffms="yes"
851         FFMS2_LIBS="$FFMS2_LIBS -lstdc++ $LAVF_LIBS"
852     fi
853
854     error="ffms must be at least version $ffms_major.$ffms_minor.$ffms_micro.$ffms_bump"
855     if [ $ffms = "yes" ] && ! cpp_check "ffms.h" "$FFMS2_CFLAGS" "FFMS_VERSION >= (($ffms_major << 24) | ($ffms_minor << 16) | ($ffms_micro << 8) | $ffms_bump)" "$error"; then
856        ffms="no"
857        echo "Warning: $error"
858     fi
859     if [ "$ffms" = "yes" -a "$swscale" = "no" ]; then
860         echo "Warning: ffms is not supported without swscale support"
861         ffms="no"
862     fi
863 fi
864
865 if [ "$swscale" = "yes" ]; then
866     LDFLAGSCLI="$SWSCALE_LIBS $LDFLAGSCLI"
867     CFLAGS="$CFLAGS $SWSCALE_CFLAGS"
868     define HAVE_SWSCALE
869     if [ "$lavf" = "yes" ]; then
870         LDFLAGSCLI="$LAVF_LIBS $LDFLAGSCLI"
871         CFLAGS="$CFLAGS $LAVF_CFLAGS"
872         define HAVE_LAVF
873     fi
874     if [ "$ffms" = "yes" ]; then
875         LDFLAGSCLI="$FFMS2_LIBS $LDFLAGSCLI"
876         CFLAGS="$CFLAGS $FFMS2_CFLAGS"
877         define HAVE_FFMS
878     fi
879 fi
880
881 if [ "$gpac" = "auto" ] ; then
882     gpac="no"
883     cc_check "" -lz && GPAC_LIBS="-lgpac_static -lz" || GPAC_LIBS="-lgpac_static"
884     if [ "$SYS" = "WINDOWS" ] ; then
885         GPAC_LIBS="$GPAC_LIBS -lwinmm"
886     fi
887     if cc_check gpac/isomedia.h "$GPAC_LIBS" ; then
888         if cc_check gpac/isomedia.h "$GPAC_LIBS" "gf_isom_set_pixel_aspect_ratio(0,0,0,0,0);" ; then
889             gpac="yes"
890         else
891             echo "Warning: gpac is too old, update to 2007-06-21 UTC or later"
892         fi
893     fi
894 fi
895 if [ "$gpac" = "yes" ] ; then
896     define HAVE_GPAC
897     if cc_check gpac/isomedia.h "-Werror $GPAC_LIBS" "gf_malloc(1); gf_free(NULL);" ; then
898         define HAVE_GF_MALLOC
899     fi
900     LDFLAGSCLI="$GPAC_LIBS $LDFLAGSCLI"
901 fi
902
903 if [ "$avs" = "auto" ] ; then
904     avs="no"
905     # cygwin can use avisynth if it can use LoadLibrary
906     if [ $SYS = WINDOWS ] || ([ $SYS = CYGWIN ] && cc_check windows.h "" "LoadLibrary(0);") ; then
907         avs="yes"
908         define HAVE_AVS
909     fi
910 fi
911
912 cc_check "stdint.h" "" "uint32_t test_vec __attribute__ ((vector_size (16))) = {0,1,2,3};" && define HAVE_VECTOREXT
913
914 if [ "$pic" = "yes" ] ; then
915     CFLAGS="$CFLAGS -fPIC"
916     ASFLAGS="$ASFLAGS -DPIC"
917     # resolve textrels in the x86 asm
918     cc_check stdio.h "-shared -Wl,-Bsymbolic" && SOFLAGS="$SOFLAGS -Wl,-Bsymbolic"
919     [ $SYS = SunOS -a "$ARCH" = "X86" ] && SOFLAGS="$SOFLAGS -mimpure-text"
920 fi
921
922 if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
923     CFLAGS="$CFLAGS -fomit-frame-pointer"
924 fi
925
926 if [ "$strip" = "yes" ]; then
927     CFLAGS="$CFLAGS -s"
928     LDFLAGS="$LDFLAGS -s"
929 fi
930
931 if [ "$debug" = "yes" ]; then
932     CFLAGS="-O1 -g $CFLAGS"
933 elif [ $ARCH = ARM ]; then
934     # arm-gcc-4.2 produces incorrect output with -ffast-math
935     # and it doesn't save any speed anyway on 4.4, so disable it
936     CFLAGS="-O3 -fno-fast-math $CFLAGS"
937 else
938     CFLAGS="-O3 -ffast-math $CFLAGS"
939 fi
940
941 if cc_check '' -fno-tree-vectorize ; then
942     CFLAGS="$CFLAGS -fno-tree-vectorize"
943 fi
944
945 if [ $SYS = WINDOWS -a $ARCH = X86 -a $compiler = GNU ] ; then
946     # workaround gcc/ld bug with alignment of static variables/arrays that are initialized to zero
947     cc_check '' -fno-zero-initialized-in-bss && CFLAGS="$CFLAGS -fno-zero-initialized-in-bss"
948 fi
949
950 if cc_check "stdio.h" "" "fseeko(stdin,0,0);" ; then
951     define fseek fseeko
952     define ftell ftello
953 elif cc_check "stdio.h" "" "fseeko64(stdin,0,0);" ; then
954     define fseek fseeko64
955     define ftell ftello64
956 elif cc_check "stdio.h" "" "_fseeki64(stdin,0,0);" ; then
957     define fseek _fseeki64
958     define ftell _ftelli64
959 fi
960
961 if cc_check '' -Wshadow ; then
962     CFLAGS="-Wshadow $CFLAGS"
963 fi
964
965 if [ "$bit_depth" -gt "8" ]; then
966     define HIGH_BIT_DEPTH
967     ASFLAGS="$ASFLAGS -DHIGH_BIT_DEPTH=1"
968 else
969     ASFLAGS="$ASFLAGS -DHIGH_BIT_DEPTH=0"
970 fi
971
972 if [ "$chroma_format" != "all" ]; then
973     define CHROMA_FORMAT CHROMA_$chroma_format
974 fi
975
976 ASFLAGS="$ASFLAGS -DBIT_DEPTH=$bit_depth"
977
978 [ $gpl = yes ] && define HAVE_GPL && x264_gpl=1 || x264_gpl=0
979
980 [ $interlaced = yes ] && define HAVE_INTERLACED && x264_interlaced=1 || x264_interlaced=0
981
982 #define undefined vars as 0
983 for var in $CONFIG_HAVE; do
984     grep -q "HAVE_$var 1" config.h || define HAVE_$var 0
985 done
986
987 if [ $compiler = ICL ]; then
988     AR="xilib -nologo -out:"
989     DEPMM=-QMM
990     DEPMT=-QMT
991     HAVE_GETOPT_LONG=0
992     LD="xilink -out:"
993     LDFLAGS="-nologo -incremental:no $(icl_ldflags $LDFLAGS)"
994     LDFLAGSCLI="$(icl_ldflags $LDFLAGSCLI)"
995     LIBX264=libx264.lib
996     RANLIB=
997     [ -n "$RC" ] && RC="$RC -I. -I\$(SRCPATH)/extras -fo"
998     STRIP=
999     if [ $debug = yes ]; then
1000         LDFLAGS="-debug $LDFLAGS"
1001         CFLAGS="-D_DEBUG $CFLAGS"
1002     else
1003         CFLAGS="-DNDEBUG $CFLAGS"
1004     fi
1005 else
1006     AR="$AR rc "
1007     DEPMM="-MM -g0"
1008     DEPMT="-MT"
1009     LD="$CC -o "
1010     LIBX264=libx264.a
1011     [ -n "$RC" ] && RC="$RC -I. -o "
1012 fi
1013 if [ $compiler = GNU ]; then
1014     PROF_GEN_CC="-fprofile-generate"
1015     PROF_GEN_LD="-fprofile-generate"
1016     PROF_USE_CC="-fprofile-use"
1017     PROF_USE_LD="-fprofile-use"
1018 else
1019     CFLAGS="$(intel_cflags $CFLAGS)"
1020     # icc does not define __SSE__ until SSE2 optimization and icl never defines it or _M_IX86_FP
1021     [ \( $ARCH = X86_64 -o $ARCH = X86 \) -a $asm = yes ] && ! cpp_check "" "" "defined(__SSE__)" && define __SSE__
1022     PROF_GEN_CC="${QPRE}prof-gen ${QPRE}prof-dir."
1023     PROF_GEN_LD=
1024     PROF_USE_CC="${QPRE}prof-use ${QPRE}prof-dir."
1025     PROF_USE_LD=
1026 fi
1027
1028 rm -f conftest*
1029
1030 # generate exported config file
1031
1032 config_chroma_format="X264_CSP_I$chroma_format"
1033 [ "$config_chroma_format" == "X264_CSP_Iall" ] && config_chroma_format="0"
1034 cat > x264_config.h << EOF
1035 #define X264_BIT_DEPTH     $bit_depth
1036 #define X264_GPL           $x264_gpl
1037 #define X264_INTERLACED    $x264_interlaced
1038 #define X264_CHROMA_FORMAT $config_chroma_format
1039 EOF
1040
1041 # generate config files
1042
1043 cat > config.mak << EOF
1044 SRCPATH=$SRCPATH
1045 prefix=$prefix
1046 exec_prefix=$exec_prefix
1047 bindir=$bindir
1048 libdir=$libdir
1049 includedir=$includedir
1050 ARCH=$ARCH
1051 SYS=$SYS
1052 CC=$CC
1053 CFLAGS=$CFLAGS
1054 DEPMM=$DEPMM
1055 DEPMT=$DEPMT
1056 LD=$LD
1057 LDFLAGS=$LDFLAGS
1058 LIBX264=$LIBX264
1059 AR=$AR
1060 RANLIB=$RANLIB
1061 STRIP=$STRIP
1062 AS=$AS
1063 ASFLAGS=$ASFLAGS
1064 RC=$RC
1065 EXE=$EXE
1066 HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
1067 DEVNULL=$DEVNULL
1068 PROF_GEN_CC=$PROF_GEN_CC
1069 PROF_GEN_LD=$PROF_GEN_LD
1070 PROF_USE_CC=$PROF_USE_CC
1071 PROF_USE_LD=$PROF_USE_LD
1072 EOF
1073
1074 if [ $compiler = ICL ]; then
1075     echo '%.o: %.c' >> config.mak
1076     echo '      $(CC) $(CFLAGS) -c -Fo$@ $<' >> config.mak
1077 fi
1078
1079 if [ "$cli" = "yes" ]; then
1080     echo 'default: cli' >> config.mak
1081     echo 'install: install-cli' >> config.mak
1082 fi
1083
1084 if [ "$shared" = "yes" ]; then
1085     API=$(grep '#define X264_BUILD' < ${SRCPATH}/x264.h | cut -f 3 -d ' ')
1086     if [ "$SYS" = "WINDOWS" -o "$SYS" = "CYGWIN" ]; then
1087         echo "SONAME=libx264-$API.dll" >> config.mak
1088         if [ $compiler = ICL ]; then
1089             echo 'IMPLIBNAME=libx264.dll.lib' >> config.mak
1090             # GNU ld on windows defaults to exporting all global functions if there are no explicit __declspec(dllexport) declarations
1091             # MSVC link does not act similarly, so it is required to make an export definition out of x264.h and use it at link time
1092             echo "SOFLAGS=-dll -def:x264.def -implib:\$(IMPLIBNAME) $SOFLAGS" >> config.mak
1093             echo "EXPORTS" > x264.def
1094             grep "^\(int\|void\|x264_t\|extern\).*x264.*[\[(;]" ${SRCPATH}/x264.h | sed -e "s/.*\(x264.*\)[\[(].*/\1/;s/.*\(x264.*\);/\1/;s/open/open_$API/g" >> x264.def
1095         else
1096             echo 'IMPLIBNAME=libx264.dll.a' >> config.mak
1097             echo "SOFLAGS=-shared -Wl,--out-implib,\$(IMPLIBNAME) -Wl,--enable-auto-image-base $SOFLAGS" >> config.mak
1098         fi
1099     elif [ "$SYS" = "MACOSX" ]; then
1100         echo "SOSUFFIX=dylib" >> config.mak
1101         echo "SONAME=libx264.$API.dylib" >> config.mak
1102         echo "SOFLAGS=-shared -dynamiclib -Wl,-single_module -Wl,-read_only_relocs,suppress -install_name \$(DESTDIR)\$(libdir)/\$(SONAME) $SOFLAGS" >> config.mak
1103     elif [ "$SYS" = "SunOS" ]; then
1104         echo "SOSUFFIX=so" >> config.mak
1105         echo "SONAME=libx264.so.$API" >> config.mak
1106         echo "SOFLAGS=-shared -Wl,-h,\$(SONAME) $SOFLAGS" >> config.mak
1107     else
1108         echo "SOSUFFIX=so" >> config.mak
1109         echo "SONAME=libx264.so.$API" >> config.mak
1110         echo "SOFLAGS=-shared -Wl,-soname,\$(SONAME) $SOFLAGS" >> config.mak
1111     fi
1112     echo 'default: lib-shared' >> config.mak
1113     echo 'install: install-lib-shared' >> config.mak
1114 fi
1115
1116 if [ "$static" = "yes" ]; then
1117     echo 'default: lib-static' >> config.mak
1118     echo 'install: install-lib-static' >> config.mak
1119 fi
1120
1121 if [ "$cli_libx264" = "system" ] ; then
1122     if [ "$shared" = "yes" ]; then
1123         CLI_LIBX264='$(SONAME)'
1124     elif ${cross_prefix}pkg-config --exists x264 2>/dev/null; then
1125         LDFLAGSCLI="$LDFLAGSCLI $(${cross_prefix}pkg-config --libs x264)"
1126         CLI_LIBX264=
1127     else
1128         die "Can not find system libx264"
1129     fi
1130 else
1131     CLI_LIBX264='$(LIBX264)'
1132 fi
1133 echo "LDFLAGSCLI = $LDFLAGSCLI" >> config.mak
1134 echo "CLI_LIBX264 = $CLI_LIBX264" >> config.mak
1135
1136 ${SRCPATH}/version.sh "${SRCPATH}" >> x264_config.h
1137
1138 pclibs="-L$libdir -lx264 $libpthread"
1139
1140 cat > x264.pc << EOF
1141 prefix=$prefix
1142 exec_prefix=$exec_prefix
1143 libdir=$libdir
1144 includedir=$includedir
1145
1146 Name: x264
1147 Description: H.264 (MPEG4 AVC) encoder library
1148 Version: $(grep POINTVER < x264_config.h | sed -e 's/.* "//; s/".*//')
1149 Libs: $pclibs
1150 Cflags: -I$includedir
1151 EOF
1152
1153 filters="crop select_every"
1154 gpl_filters=""
1155 [ $swscale = yes ] && filters="resize $filters"
1156 [ $gpl = yes ] && filters="$filters $gpl_filters"
1157
1158 cat > conftest.log <<EOF
1159 platform:      $ARCH
1160 system:        $SYS
1161 cli:           $cli
1162 libx264:       $cli_libx264
1163 shared:        $shared
1164 static:        $static
1165 asm:           $asm
1166 interlaced:    $interlaced
1167 avs:           $avs
1168 lavf:          $lavf
1169 ffms:          $ffms
1170 gpac:          $gpac
1171 gpl:           $gpl
1172 thread:        $thread
1173 filters:       $filters
1174 debug:         $debug
1175 gprof:         $gprof
1176 strip:         $strip
1177 PIC:           $pic
1178 visualize:     $vis
1179 bit depth:     $bit_depth
1180 chroma format: $chroma_format
1181 EOF
1182
1183 echo >> config.log
1184 cat conftest.log >> config.log
1185 cat conftest.log
1186 rm conftest.log
1187
1188 [ "$SRCPATH" != "." ] && ln -sf ${SRCPATH}/Makefile ./Makefile
1189 mkdir -p common/{arm,ppc,sparc,x86} encoder extras filters/video input output tools
1190
1191 echo
1192 echo "You can run 'make' or 'make fprofiled' now."
1193