📄 configure
字号:
;; esacdone# Determine our OS name and CPU architectureif test -z "$_target" ; then # OS name system_name=`( uname -s ) 2>&1` case "$system_name" in Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS) ;; IRIX*) system_name=IRIX ;; HP-UX*) system_name=HP-UX ;; [cC][yY][gG][wW][iI][nN]*) system_name=CYGWIN ;; MINGW32*) system_name=MINGW32 ;; MorphOS) system_name=MorphOS ;; *) system_name="$system_name-UNKNOWN" ;; esac # host's CPU/instruction set host_arch=`( uname -p ) 2>&1` case "$host_arch" in i386|sparc|ppc|alpha|arm|mips|vax) ;; powerpc) # Darwin returns 'powerpc' host_arch=ppc ;; *) # uname -p on Linux returns 'unknown' for the processor type, # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)' # Maybe uname -m (machine hardware name) returns something we # recognize. # x86/x86pc is used by QNX case "`( uname -m ) 2>&1`" in i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;; ia64) host_arch=ia64 ;; x86_64|amd64) if [ "`$_cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \ -z "`echo $CFLAGS | grep -- -m32`" ]; then host_arch=x86_64 else host_arch=i386 fi ;; macppc|ppc) host_arch=ppc ;; alpha) host_arch=alpha ;; sparc) host_arch=sparc ;; sparc64) host_arch=sparc64 ;; parisc*|hppa*|9000*) host_arch=hppa ;; arm*) host_arch=arm ;; s390) host_arch=s390 ;; s390x) host_arch=s390x ;; mips) host_arch=mips ;; vax) host_arch=vax ;; *) host_arch=UNKNOWN ;; esac ;; esacelse system_name=`echo $_target | cut -d '-' -f 2` case "`echo $system_name | tr A-Z a-z`" in linux) system_name=Linux ;; freebsd) system_name=FreeBSD ;; netbsd) system_name=NetBSD ;; bsd/os) system_name=BSD/OS ;; openbsd) system_name=OpenBSD ;; sunos) system_name=SunOS ;; qnx) system_name=QNX ;; morphos) system_name=MorphOS ;; mingw32msvc) system_name=MINGW32 ;; esac # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`fiecho "Detected operating system: $system_name"echo "Detected host architecture: $host_arch"# LGB: temporary filesfor I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do test "$I" && breakdoneTMPLOG="configure.log"rm -f "$TMPLOG"TMPC="$I/mplayer-conf-$RANDOM-$$.c"TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"TMPO="$I/mplayer-conf-$RANDOM-$$.o"TMPS="$I/mplayer-conf-$RANDOM-$$.S"# config files# FIXME: A lot of stuff is installed under /usr/local# NK: But we should never use this stuff implicitly since we call compiler# from /usr we should be sure that there no effects from other compilers# (libraries) which might be installed into /usr/local. Let users use this# stuff explicitly as command line argument. In other words: It would be# resonable to have only /usr/include or only /usr/local/include.if freebsd ; then _ld_extra="$_ld_extra -L/usr/local/lib" _inc_extra="$_inc_extra -I/usr/local/include"fiif netbsd ; then for I in `echo $_ld_extra | sed 's/-L//g'` ; do tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`" done _ld_extra=$tmpfi_ldd=lddif darwin; then _ldd="otool -L"fi# Check how to call 'head' and 'tail'. Newer versions spit out warnings# if used as 'head -1' instead of 'head -n 1', but older versions don't# know about '-n'.if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then _head() { head -$1 2>/dev/null ; }else _head() { head -n $1 2>/dev/null ; }fiif test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then _tail() { tail -$1 2>/dev/null ; }else _tail() { tail -n $1 2>/dev/null ; }fi# Checking CC version...if test "$_skip_cc_check" != yes ; then # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure) if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then echocheck "$_cc version" cc_vendor=intel cc_name=`( $_cc -V ) 2>&1 | _head 1 | cut -d ',' -f 1` cc_version=`( $_cc -V ) 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3` _cc_major=`echo $cc_version | cut -d '.' -f 1` _cc_minor=`echo $cc_version | cut -d '.' -f 2` # TODO verify older icc/ecc compatibility case $cc_version in '') cc_version="v. ?.??, bad" cc_verc_fail=yes ;; 8.0) cc_version="$cc_version, ok" cc_verc_fail=no ;; *) cc_version="$cc_version, bad" cc_verc_fail=yes ;; esac echores "$cc_version" else for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do echocheck "$_cc version" cc_vendor=gnu cc_name=`( $_cc -v ) 2>&1 | _tail 1 | cut -d ' ' -f 1` cc_version=`( $_cc -dumpversion ) 2>&1` if test "$?" -gt 0; then cc_version="not found" fi case $cc_version in '') cc_version="v. ?.??, bad" cc_verc_fail=yes ;; 2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9]) _cc_major=`echo $cc_version | cut -d '.' -f 1` _cc_minor=`echo $cc_version | cut -d '.' -f 2` _cc_mini=`echo $cc_version | cut -d '.' -f 3` cc_version="$cc_version, ok" cc_verc_fail=no ;; 'not found') cc_verc_fail=yes ;; *) cc_version="$cc_version, bad" cc_verc_fail=yes ;; esac echores "$cc_version" (test "$cc_verc_fail" = "no") && break done fi # icc if test "$cc_verc_fail" = yes ; then cat <<EOF*** Please downgrade/upgrade C compiler to version gcc-2.95.x or gcc-3.x! ***You are not using a supported compiler. We do not have the time to make sureeverything works with compilers other than the ones we use. Use either thesame compiler as we do, or use --disable-gcc-checking but DO *NOT* REPORT BUGSunless you can reproduce them after recompiling with a 2.95.x or 3.x version!Note for gcc 2.96 users: Some versions of this compiler are known to miscompilemplayer and lame (which is used for mencoder). If you get compile errors,first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reportingbugs! GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US ! *** For details please read DOCS/HTML/en/users-vs-dev.html ***EOF die "Bad gcc version" fielsecat <<EOF******************************************************************************Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!Lame which is used by mencoder produces weird errors, too.If you have any problem, install a GCC 2.95.x or 3.x version and try again.If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html ! *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! *********************************************************************************EOFread _answerfiechocheck "host cc"if not test "$_host_cc" ; then _host_cc=$_ccfiechores $_host_cc # ---# now that we know what compiler should be used for compilation, try to find# out which assembler is used by the $_cc compilerif test "$_as" = auto ; then _as=`$_cc -print-prog-name=as` test -z "$_as" && _as=asfi# XXX: this should be ok.._cpuinfo="echo"# Cygwin has /proc/cpuinfo, but only supports Intel CPUs# FIXME: Remove the cygwin check once AMD CPUs are supportedif test -r /proc/cpuinfo && not cygwin; then # Linux with /proc mounted, extract CPU information from it _cpuinfo="cat /proc/cpuinfo"elif test -r /compat/linux/proc/cpuinfo && not x86 ; then # FreeBSD with Linux emulation /proc mounted, # extract CPU information from it _cpuinfo="cat /compat/linux/proc/cpuinfo"elif darwin ; then # use hostinfo on Darwin _cpuinfo="hostinfo"elif x86; then # all other OSes try to extract CPU information from a small helper # program TOOLS/cpuinfo instead $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c _cpuinfo="TOOLS/cpuinfo"fix86_exts_check(){ pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | _head 1` if test -z "$pparam" ; then pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | _head 1` fi _mmx=no _3dnow=no _3dnowex=no _mmx2=no _sse=no _sse2=no _mtrr=no for i in $pparam ; do case "$i" in 3dnow) _3dnow=yes ;; 3dnowext) _3dnow=yes _3dnowex=yes ;; mmx) _mmx=yes ;; mmxext) _mmx2=yes ;; mtrr|k6_mtrr|cyrix_arr) _mtrr=yes ;; xmm|sse|kni) _sse=yes _mmx2=yes ;; sse2) _sse2=yes ;; esac done}case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) _def_arch="#define ARCH_X86 1" _target_arch="TARGET_ARCH_X86 = yes" pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1` pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` x86_exts_check echocheck "CPU vendor" echores "$pvendor ($pfamily:$pmodel:$pstepping)" echocheck "CPU type" echores "$pname" case "$pvendor" in AuthenticAMD) case "$pfamily" in 3) proc=i386 iproc=386 ;; 4) proc=i486 iproc=486 ;; 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size. if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then proc=k6-3 elif test "$pmodel" -ge 8; then proc=k6-2 elif test "$pmodel" -ge 6; then proc=k6 else proc=i586 iproc=586 fi ;; 6) iproc=686 if test "$pmodel" -ge 7; then proc=athlon-4 elif test "$pmodel" -ge 6; then # only Athlon XP supports ssem MP, Duron etc not # but most of them are CPUID 666, so check if sse detected # btw. there is also athlon-mp opt, but we need extended # CPUID to detect if CPU is SMP capable -> athlon-mp ::atmos if test "$_sse" = yes && test "$pstepping" -ge 2; then proc=athlon-xp else proc=athlon-4 fi elif test "$pmodel" -ge 4; then proc=athlon-tbird else proc=athlon # TODO: should the Duron Spitfire be considered a Thunderbird instead? fi ;; *) proc=athlon-xp iproc=686 ;; esac ;; GenuineIntel) case "$pfamily" in 3) proc=i386 iproc=386 ;; 4) proc=i486 iproc=486 ;; 5) iproc=586 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then proc=pentium-mmx # 4 is desktop, 8 is mobile else proc=i586 fi ;; 6) iproc=686 if test "$pmodel" -ge 7; then proc=pentium3 elif test "$pmodel" -ge 3; then proc=pentium2 else proc=i686 fi ;; 15) proc=pentium4 iproc=686 ;; *) proc=pentium4 iproc=686 ;; esac ;; unknown) case "$pfamily" in 3) proc=i386 iproc=386 ;; 4) proc=i486 iproc=486 ;; *) proc=i586 iproc=586 ;; esac ;; *) proc=i586 iproc=586 ;; esac # check that gcc supports our CPU, if not, fall back to earlier ones # LGB: check -mcpu and -march swithing step by step with enabling # to fall back till 386. # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then cpuopt=-mtune else cpuopt=-mcpu fi echocheck "GCC & CPU optimization abilities"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -