techmik

Untitled

Jun 2nd, 2011
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.58 KB | None | 0 0
  1.   typevar=my_compiler_type
  2.   versionvar=my_compiler_version
  3.   ac_compiler_type=""
  4.   ac_compiler_version=""
  5.   for i in $my_compiler; do
  6.     case $i in
  7.     gcc-[0-9]*|*-gcc-[0-9]*)
  8.       if test -z "$ac_compiler_type"; then
  9.         ac_compiler_type=gcc
  10.       fi
  11.       if test -z "$ac_compiler_version"; then
  12.         ac_compiler_version=`echo $i | sed -e 's/^.*gcc-\([0-9.]\+\).*$/\1/'`
  13.       fi
  14.       ;;
  15.     *gcc*|*GCC*)
  16.       if test -z "$ac_compiler_type"; then
  17.         ac_compiler_type=gcc
  18.       fi
  19.       ;;
  20.     egcs-*)
  21.       ac_compiler_type=egcs
  22.       if test -z "$ac_compiler_version"; then
  23.         ac_compiler_version=`echo $i | sed -e 's/egcs-\(.\+\)$/\1/'`
  24.       fi
  25.       ;;
  26.     *cc*)
  27.       if test -z "$ac_compiler_type"; then
  28.         ac_compiler_type=cc
  29.       fi
  30.       ;;
  31.     [0-9].[0-9]*)
  32.       if test -z "$ac_compiler_version"; then
  33.         ac_compiler_version="$i"
  34.       fi
  35.       ;;
  36.     esac
  37.   done
  38.   eval $typevar="$ac_compiler_type"
  39.   eval $versionvar="$ac_compiler_version"
  40.  
  41. if test -z "$my_compiler_type"; then
  42.   my_compiler_type="gcc"
  43. fi
  44. { echo "$as_me:$LINENO: result: Kernel compiler: $kernel_compiler Used compiler: $my_compiler" >&5
  45. echo "${ECHO_T}Kernel compiler: $kernel_compiler Used compiler: $my_compiler" >&6; };
  46. if test -z "$kernel_compiler"; then
  47.   echo
  48.   echo "*** NO PREDEFINED KERNEL COMPILER IS DETECTED"
  49.   echo "*** Assuming the same compiler is used with the current system compiler."
  50.   echo
  51.   echo "*** Please make sure that the same compiler version was used for building kernel."
  52.   echo
  53. else
  54. if test "$my_compiler_type" != "$kernel_compiler_type"; then
  55.   echo "Fatal error: Compiler type does not match"
  56.   echo "Decoded kernel compiler: type=$kernel_compiler_type version=$kernel_compiler_version"
  57.   echo "Decoded used compiler: type=$my_compiler_type version=$my_compiler_version"
  58.   echo "Please, send ./configure output to <[email protected]>"
  59.   exit 1
  60. fi
  61. if test "$my_compiler_type" = "gcc" ; then
  62.   kernel_major=`echo $kernel_compiler_version | cut -d '.' -f 1`
  63.   my_major=`echo $my_compiler_version | cut -d '.' -f 1`
  64.   if test $kernel_major -eq 2 -a $my_major -eq 3 ; then
  65.     echo "Fatal error: Kernel is compiled with GCC 2.x and you are trying to use GCC 3.x."
  66.     echo "             These two version of GCC are incompatible for binary code."
  67.     exit 1
  68.   fi
  69.   if test $kernel_major -eq 3 -a $my_major -eq 2 ; then
  70.     echo "Fatal error: Kernel is compiled with GCC 3.x and you are trying to use GCC 2.x."
  71.     echo "             These two version of GCC are incompatible for binary code."
  72.     exit 1
  73.   fi
  74. fi
  75. fi
Advertisement
Add Comment
Please, Sign In to add comment