Mercurial > mplayer.hg
comparison configure @ 35322:5265ba612957
Move compiler check to be earlier so we can use the compiler
to detect when crosscompiling to MinGW (e.g. from cygwin).
author | reimar |
---|---|
date | Sat, 10 Nov 2012 16:12:22 +0000 |
parents | fbcd69bb7d02 |
children | dce5baccd71b |
comparison
equal
deleted
inserted
replaced
35321:fbcd69bb7d02 | 35322:5265ba612957 |
---|---|
1495 test -z "$_datadir" && _datadir="$_prefix/share/mplayer" | 1495 test -z "$_datadir" && _datadir="$_prefix/share/mplayer" |
1496 test -z "$_mandir" && _mandir="$_prefix/share/man" | 1496 test -z "$_mandir" && _mandir="$_prefix/share/man" |
1497 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer" | 1497 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer" |
1498 test -z "$_libdir" && _libdir="$_prefix/lib" | 1498 test -z "$_libdir" && _libdir="$_prefix/lib" |
1499 | 1499 |
1500 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do | |
1501 test "$tmpdir" && break | |
1502 done | |
1503 | |
1504 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$" | |
1505 mkdir $mplayer_tmpdir || die "Unable to create tmpdir." | |
1506 | |
1507 TMPLOG="config.log" | |
1508 TMPC="$mplayer_tmpdir/tmp.c" | |
1509 TMPCPP="$mplayer_tmpdir/tmp.cpp" | |
1510 TMPEXE="$mplayer_tmpdir/tmp$_exesuf" | |
1511 TMPH="$mplayer_tmpdir/tmp.h" | |
1512 TMPS="$mplayer_tmpdir/tmp.S" | |
1513 | |
1514 rm -f "$TMPLOG" | |
1515 echo configuration: $configuration > "$TMPLOG" | |
1516 echo >> "$TMPLOG" | |
1517 | |
1518 | |
1519 # Checking CC version... | |
1520 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure) | |
1521 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then | |
1522 echocheck "$_cc version" | |
1523 cc_vendor=intel | |
1524 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1) | |
1525 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3) | |
1526 _cc_major=$(echo $cc_version | cut -d '.' -f 1) | |
1527 _cc_minor=$(echo $cc_version | cut -d '.' -f 2) | |
1528 # TODO verify older icc/ecc compatibility | |
1529 case $cc_version in | |
1530 '') | |
1531 cc_version="v. ?.??, bad" | |
1532 cc_fail=yes | |
1533 ;; | |
1534 10.1|11.1|12.0) | |
1535 cc_version="$cc_version, ok" | |
1536 ;; | |
1537 *) | |
1538 cc_version="$cc_version, bad" | |
1539 cc_fail=yes | |
1540 ;; | |
1541 esac | |
1542 echores "$cc_version" | |
1543 else | |
1544 for _cc in "$_cc" gcc cc ; do | |
1545 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1) | |
1546 if test "$cc_name_tmp" = "gcc"; then | |
1547 cc_name=$cc_name_tmp | |
1548 echocheck "$_cc version" | |
1549 cc_vendor=gnu | |
1550 cc_version=$($_cc -dumpversion 2>&1) | |
1551 case $cc_version in | |
1552 2.96*) | |
1553 cc_fail=yes | |
1554 ;; | |
1555 *) | |
1556 _cc_major=$(echo $cc_version | cut -d '.' -f 1) | |
1557 _cc_minor=$(echo $cc_version | cut -d '.' -f 2) | |
1558 _cc_mini=$(echo $cc_version | cut -d '.' -f 3) | |
1559 ;; | |
1560 esac | |
1561 echores "$cc_version" | |
1562 break | |
1563 fi | |
1564 if $_cc -v 2>&1 | grep -q "clang"; then | |
1565 echocheck "$_cc version" | |
1566 cc_vendor=clang | |
1567 cc_version=$($_cc -dumpversion 2>&1) | |
1568 res_comment="experimental support only" | |
1569 echores "clang $cc_version" | |
1570 break | |
1571 fi | |
1572 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3) | |
1573 if test "$cc_name_tmp" = "Sun C"; then | |
1574 echocheck "$_cc version" | |
1575 cc_vendor=sun | |
1576 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4) | |
1577 res_comment="experimental support only" | |
1578 echores "Sun C $cc_version" | |
1579 break | |
1580 fi | |
1581 done | |
1582 fi # icc | |
1583 test "$cc_fail" = yes && die "unsupported compiler version" | |
1584 | |
1500 # Determine our OS name and CPU architecture | 1585 # Determine our OS name and CPU architecture |
1501 if test -z "$_target" ; then | 1586 if test -z "$_target" ; then |
1502 # OS name | 1587 # OS name |
1503 system_name=$(uname -s 2>&1) | 1588 system_name=$(uname -s 2>&1) |
1504 case "$system_name" in | 1589 case "$system_name" in |
1524 ;; | 1609 ;; |
1525 *) | 1610 *) |
1526 system_name="$system_name-UNKNOWN" | 1611 system_name="$system_name-UNKNOWN" |
1527 ;; | 1612 ;; |
1528 esac | 1613 esac |
1614 cpp_condition_check '' 'defined(__MINGW32__)' && system_name=MINGW32 | |
1529 | 1615 |
1530 | 1616 |
1531 # host's CPU/instruction set | 1617 # host's CPU/instruction set |
1532 case "$(uname -m 2>&1)" in | 1618 case "$(uname -m 2>&1)" in |
1533 x86_64|amd64|i[3-9]86*|i86pc|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686) host_arch=i386 ;; | 1619 x86_64|amd64|i[3-9]86*|i86pc|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686) host_arch=i386 ;; |
1629 fi | 1715 fi |
1630 | 1716 |
1631 if wine ; then | 1717 if wine ; then |
1632 extra_cflags="-fno-pic -UWIN32 -U_WIN32 -U__WIN32 -U__WIN32__ -DWINE_NOWINSOCK -Dstricmp=strcasecmp $extra_cflags" | 1718 extra_cflags="-fno-pic -UWIN32 -U_WIN32 -U__WIN32 -U__WIN32__ -DWINE_NOWINSOCK -Dstricmp=strcasecmp $extra_cflags" |
1633 fi | 1719 fi |
1634 | |
1635 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do | |
1636 test "$tmpdir" && break | |
1637 done | |
1638 | |
1639 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$" | |
1640 mkdir $mplayer_tmpdir || die "Unable to create tmpdir." | |
1641 | |
1642 TMPLOG="config.log" | |
1643 TMPC="$mplayer_tmpdir/tmp.c" | |
1644 TMPCPP="$mplayer_tmpdir/tmp.cpp" | |
1645 TMPEXE="$mplayer_tmpdir/tmp$_exesuf" | |
1646 TMPH="$mplayer_tmpdir/tmp.h" | |
1647 TMPS="$mplayer_tmpdir/tmp.S" | |
1648 | |
1649 rm -f "$TMPLOG" | |
1650 echo configuration: $configuration > "$TMPLOG" | |
1651 echo >> "$TMPLOG" | |
1652 | |
1653 | |
1654 # Checking CC version... | |
1655 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure) | |
1656 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then | |
1657 echocheck "$_cc version" | |
1658 cc_vendor=intel | |
1659 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1) | |
1660 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3) | |
1661 _cc_major=$(echo $cc_version | cut -d '.' -f 1) | |
1662 _cc_minor=$(echo $cc_version | cut -d '.' -f 2) | |
1663 # TODO verify older icc/ecc compatibility | |
1664 case $cc_version in | |
1665 '') | |
1666 cc_version="v. ?.??, bad" | |
1667 cc_fail=yes | |
1668 ;; | |
1669 10.1|11.1|12.0) | |
1670 cc_version="$cc_version, ok" | |
1671 ;; | |
1672 *) | |
1673 cc_version="$cc_version, bad" | |
1674 cc_fail=yes | |
1675 ;; | |
1676 esac | |
1677 echores "$cc_version" | |
1678 else | |
1679 for _cc in "$_cc" gcc cc ; do | |
1680 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1) | |
1681 if test "$cc_name_tmp" = "gcc"; then | |
1682 cc_name=$cc_name_tmp | |
1683 echocheck "$_cc version" | |
1684 cc_vendor=gnu | |
1685 cc_version=$($_cc -dumpversion 2>&1) | |
1686 case $cc_version in | |
1687 2.96*) | |
1688 cc_fail=yes | |
1689 ;; | |
1690 *) | |
1691 _cc_major=$(echo $cc_version | cut -d '.' -f 1) | |
1692 _cc_minor=$(echo $cc_version | cut -d '.' -f 2) | |
1693 _cc_mini=$(echo $cc_version | cut -d '.' -f 3) | |
1694 ;; | |
1695 esac | |
1696 echores "$cc_version" | |
1697 break | |
1698 fi | |
1699 if $_cc -v 2>&1 | grep -q "clang"; then | |
1700 echocheck "$_cc version" | |
1701 cc_vendor=clang | |
1702 cc_version=$($_cc -dumpversion 2>&1) | |
1703 res_comment="experimental support only" | |
1704 echores "clang $cc_version" | |
1705 break | |
1706 fi | |
1707 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3) | |
1708 if test "$cc_name_tmp" = "Sun C"; then | |
1709 echocheck "$_cc version" | |
1710 cc_vendor=sun | |
1711 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4) | |
1712 res_comment="experimental support only" | |
1713 echores "Sun C $cc_version" | |
1714 break | |
1715 fi | |
1716 done | |
1717 fi # icc | |
1718 test "$cc_fail" = yes && die "unsupported compiler version" | |
1719 | 1720 |
1720 if darwin && test "$cc_vendor" != "clang" ; then | 1721 if darwin && test "$cc_vendor" != "clang" ; then |
1721 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags" | 1722 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags" |
1722 fi | 1723 fi |
1723 | 1724 |