VirtualBox

Changeset 8461

Show
Ignore:
Timestamp:
04/29/08 14:42:59 (7 months ago)
Author:
vboxsync
Message:

configure: proper gcc-4.3 check

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/configure

    r8344 r8461  
    4343WITH_KMODS=1 
    4444CC="gcc" 
     45CC_COMPAT="" 
    4546CC32="" 
    4647CC64="" 
     
    111112} 
    112113 
     114log() 
     115{ 
     116  echo "$1" 
     117  echo "$1" >> $LOG 
     118} 
     119 
    113120log_success() 
    114121{ 
     
    313320  test_header gcc 
    314321  if check_avail "$CC" CC really; then 
    315     cc_ver=`$CC -dumpversion` 
     322    cc_ver=`$CC -dumpversion` 2>/dev/null 
     323    if [ $? -ne 0 ]; then 
     324      log_failure "cannot execute '$CC -dumpversion'" 
     325      fail really 
     326    fi 
    316327    if check_avail "$CXX" CXX really; then 
    317       cxx_ver=`$CXX -dumpversion` 
     328      cxx_ver=`$CXX -dumpversion` 2>/dev/null 
     329      if [ $? -ne 0 ]; then 
     330        log_failure "cannot execute '$CXX -dumpversion'" 
     331        fail really 
     332      fi 
    318333      cc_maj=`echo $cc_ver|cut -d. -f1` 
    319334      cc_min=`echo $cc_ver|cut -d. -f2` 
     
    321336        log_failure "gcc version $cc_ver does not match g++ version $cxx_ver" 
    322337        fail really 
    323       elif [ $cc_maj -eq 4 -a $cc_min -eq 0 ]; then 
    324         if [ "$OS" = "darwin" ]; then 
    325           log_success "found version $cc_ver" 
    326         else 
    327           log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with x>0" 
     338      elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "OS" = "darwin" ]; then 
     339        log_success "found version $cc_ver" 
     340      elif [ $cc_maj -eq 4 -a $cc_min -eq 3 ]; then 
     341        if [ -z "$CC_COMPAT" ]; then 
     342          log "" 
     343          log "  ** There are known problems with gcc version 4.3 when compiling the recompiler" 
     344          log "  ** stuff. You need to specify a compatibility compiler with version < 4.3. Look" 
     345          log "  ** for a package compat-gcc-34 on Fedora systems or something similar on other" 
     346          log "  ** distributions and call configure with parameter --with-gcc-compat=gcc34." 
    328347          fail really 
    329348        fi 
    330       elif [ $cc_maj -gt 3 ]; then 
    331         log_success "found version $cc_ver" 
    332       elif [ $cc_maj -lt 3 -o $cc_min -lt 2 ]; then 
    333         log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with x>0" 
     349        if check_avail "$CC_COMPAT" CC_COMPAT really; then 
     350          cc_compat_ver=`$CC_COMPAT -dumpversion` 2>/dev/null 
     351          if [ $? -ne 0 ]; then 
     352            log_failure "cannot execute '$CC_COMPAT -dumpversion'" 
     353            fail really 
     354          fi 
     355          cc_compat_maj=`echo $cc_compat_ver|cut -d. -f1` 
     356          cc_compat_min=`echo $cc_compat_ver|cut -d. -f2` 
     357          if [ $cc_compat_maj -lt 3 \ 
     358               -o \( $cc_compat_maj -eq 3 -a $cc_compat_min -lt 2 \) \ 
     359               -o \( $cc_compat_maj -eq 4 -a $cc_compat_min -lt 1 \) \ 
     360               -o \( $cc_compat_maj -eq 4 -a $cc_compat_min -gt 2 \) \ 
     361               -o $cc_compat_maj -gt 4 ]; then 
     362            log "" 
     363            log "  ** Version $cc_compat_ver of the compatibility gcc found. Expected gcc 3.x with x>1" 
     364            log "  ** or gcc 4.x with 0<x<3" 
     365            fail really 
     366          fi 
     367          cnf_append "VBOX_RECOMPILER_OP_GCC" "$CC_COMPAT" 
     368        fi 
     369      elif [ $cc_maj -lt 3 \ 
     370             -o \( $cc_maj -eq 3 -a $cc_min -lt 2 \) \ 
     371             -o \( $cc_maj -eq 4 -a $cc_min -lt 1 \) \ 
     372             -o \( $cc_maj -eq 4 -a $cc_min -gt 3 \) \ 
     373             -o $cc_maj -gt 4 ]; then 
     374        log_failure "gcc version $cc_ver found, expected gcc 3.x with x>1 or gcc 4.x with 0<x<4" 
    334375        fail really 
    335376      else 
     
    15951636      CXX=`echo $option | cut -d'=' -f2` 
    15961637      ;; 
     1638    --with-gcc-compat=*) 
     1639      CC_COMPAT=`echo $option | cut -d'=' -f2` 
     1640      ;; 
    15971641    --with-kbuild=*) 
    15981642      KBUILDDIR=`echo $option | cut -d'=' -f2` 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy