Mercurial > mplayer.hg
comparison configure @ 5947:5b8b0027c1e8
Add Darwin (MacOS X) detection and configuration and modify compiler check to check through defined-cc, gcc3, cc to find good compiler. Abort on first good compiler.
author | atmos4 |
---|---|
date | Fri, 03 May 2002 19:00:54 +0000 |
parents | 470d830cb9d9 |
children | 70b326241d52 |
comparison
equal
deleted
inserted
replaced
5946:9243f7464324 | 5947:5b8b0027c1e8 |
---|---|
63 netbsd() { issystem "NetBSD" ; return "$?" ; } | 63 netbsd() { issystem "NetBSD" ; return "$?" ; } |
64 bsdos() { issystem "BSD/OS" ; return "$?" ; } | 64 bsdos() { issystem "BSD/OS" ; return "$?" ; } |
65 openbsd() { issystem "OpenBSD" ; return "$?" ; } | 65 openbsd() { issystem "OpenBSD" ; return "$?" ; } |
66 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; } | 66 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; } |
67 qnx() { issystem "QNX" ; return "$?" ; } | 67 qnx() { issystem "QNX" ; return "$?" ; } |
68 darwin() { issystem "Darwin" ; return "$?" ; } | |
68 | 69 |
69 # arch test boolean functions | 70 # arch test boolean functions |
70 x86() { | 71 x86() { |
71 case "$host_arch" in | 72 case "$host_arch" in |
72 i[3-9]86|x86*) return 0 ;; | 73 i[3-9]86|x86*) return 0 ;; |
278 # Determine our OS name and CPU architecture | 279 # Determine our OS name and CPU architecture |
279 if test -z "$_target" ; then | 280 if test -z "$_target" ; then |
280 # OS name | 281 # OS name |
281 system_name=`( uname -s ) 2>&1` | 282 system_name=`( uname -s ) 2>&1` |
282 case "$system_name" in | 283 case "$system_name" in |
283 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX) | 284 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin) |
284 ;; | 285 ;; |
285 IRIX*) | 286 IRIX*) |
286 system_name=IRIX | 287 system_name=IRIX |
287 ;; | 288 ;; |
288 [cC][yY][gG][wW][iI][nN]*) | 289 [cC][yY][gG][wW][iI][nN]*) |
297 # host's CPU/instruction set | 298 # host's CPU/instruction set |
298 host_arch=`( uname -p ) 2>&1` | 299 host_arch=`( uname -p ) 2>&1` |
299 case "$host_arch" in | 300 case "$host_arch" in |
300 i386|sparc|ppc|alpha|arm|mips) | 301 i386|sparc|ppc|alpha|arm|mips) |
301 ;; | 302 ;; |
302 | 303 powerpc) # Darwin returns 'powerpc' |
304 host_arch=ppc | |
305 ;; | |
303 *) # uname -p on Linux returns 'unknown' for the processor type, | 306 *) # uname -p on Linux returns 'unknown' for the processor type, |
304 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)' | 307 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)' |
305 | 308 |
306 # Maybe uname -m (machine hardware name) returns something we | 309 # Maybe uname -m (machine hardware name) returns something we |
307 # recognize. | 310 # recognize. |
361 | 364 |
362 | 365 |
363 # Checking CC version... | 366 # Checking CC version... |
364 # gcc-3.0 merges optimizations coming from egcs, pgcc, agcc, ... | 367 # gcc-3.0 merges optimizations coming from egcs, pgcc, agcc, ... |
365 if test "$_skip_cc_check" != yes ; then | 368 if test "$_skip_cc_check" != yes ; then |
369 for _cc in $_cc gcc3 cc; do | |
366 echocheck "$_cc version" | 370 echocheck "$_cc version" |
367 # also check for name (the version checking is only for _gcc_ up for now) | |
368 # FIXME implement this in ver. check. | |
369 cc_name=`$_cc -v 2>&1 | tail -1 | cut -d ' ' -f 1` | 371 cc_name=`$_cc -v 2>&1 | tail -1 | cut -d ' ' -f 1` |
370 cc_version=`$_cc -v 2>&1 | sed -n 's/^.*version \([aegcygnustp-]*[0-9.]*\).*$/\1/p'` | 372 cc_version=`$_cc -v 2>&1 | sed -n 's/^.*version \([aegcygnustp-]*[0-9.]*\).*$/\1/p'` |
371 case $cc_version in | 373 case $cc_version in |
372 '') | 374 '') |
373 cc_version="v. ?.??, bad" | 375 cc_version="v. ?.??, bad" |
381 cc_version="$cc_version, bad" | 383 cc_version="$cc_version, bad" |
382 cc_verc_fail=yes | 384 cc_verc_fail=yes |
383 ;; | 385 ;; |
384 esac | 386 esac |
385 echores "$cc_version" | 387 echores "$cc_version" |
386 # If gcc version is crappy RH one, then check if the user has installed the optional | 388 (test "$cc_verc_fail" = "no") && break |
387 # (at least in Rh7.2) gcc3 packages to save them some pain - malc@tmbg.co.uk | 389 done |
388 if test "$cc_verc_fail" = yes ; then | |
389 echocheck "gcc3 version" | |
390 _cc=gcc3 | |
391 cc_version=`$_cc -v 2>&1 | sed -n 's/^.*version \([aegcygnustp-]*[0-9.]*\).*$/\1/p'` | |
392 case $cc_version in | |
393 '') | |
394 cc_version="v. ?.??, bad" | |
395 cc_verc_fail=yes | |
396 ;; | |
397 2.95.[2-9]|2.95.[2-9].[0-9]|3.[0-9]|3.[0-9].[0-9]) | |
398 cc_version="$cc_version, ok" | |
399 cc_verc_fail=no | |
400 ;; | |
401 *) | |
402 cc_version="$cc_version, bad" | |
403 cc_verc_fail=yes | |
404 ;; | |
405 esac | |
406 echores "$cc_version" | |
407 fi | |
408 if test "$cc_verc_fail" = yes ; then | 390 if test "$cc_verc_fail" = yes ; then |
409 cat <<EOF | 391 cat <<EOF |
410 | 392 |
411 *** Please downgrade/upgrade C compiler to gcc-2.95.x or gcc-3.x version! *** | 393 *** Please downgrade/upgrade C compiler to gcc-2.95.x or gcc-3.x version! *** |
412 | 394 |
3479 It is strongly recommended you let MPlayer choose the correct CFLAGS! | 3461 It is strongly recommended you let MPlayer choose the correct CFLAGS! |
3480 To do so, execute 'CFLAGS= ./configure <options>' | 3462 To do so, execute 'CFLAGS= ./configure <options>' |
3481 | 3463 |
3482 EOF | 3464 EOF |
3483 fi | 3465 fi |
3484 | 3466 if darwin ; then |
3467 # use gnu style cpp on Darwin | |
3468 CFLAGS="$CFLAGS -no-cpp-precomp" | |
3469 fi | |
3485 # Thread support | 3470 # Thread support |
3486 if linux ; then | 3471 if linux ; then |
3487 CFLAGS="$CFLAGS -D_REENTRANT" | 3472 CFLAGS="$CFLAGS -D_REENTRANT" |
3488 elif bsd ; then | 3473 elif bsd ; then |
3489 # FIXME bsd needs this so maybe other OS'es | 3474 # FIXME bsd needs this so maybe other OS'es |