Update of /cvsroot/alsa/alsa-driver
In directory sc8-pr-cvs1:/tmp/cvs-serv3773

Modified Files:
        configure.in 
Log Message:
More robust compiler detection

Index: configure.in
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/configure.in,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -r1.176 -r1.177
--- configure.in        31 May 2003 12:03:09 -0000      1.176
+++ configure.in        31 May 2003 17:33:09 -0000      1.177
@@ -4,7 +4,7 @@
 
 AC_INIT(acore/sound.patch)
 AC_PREFIX_DEFAULT(/usr)
-CONFIG_SND_VERSION="0.9.3c"
+CONFIG_SND_VERSION="0.9.4"
 
 dnl Checks for programs.
 AC_PROG_CC
@@ -191,15 +191,37 @@
 kernel_compiler="",
 kernel_compiler="")])
 CFLAGS="$ac_save_CFLAGS"
+my_compiler=`$CROSS_COMPILE$CC --version | head -n 1`
+dnl
+dnl Test section, uncomment any of these double lines to verify the bellow code:
+dnl
+dnl 
+dnl kernel_compiler="gcc 3.2"
+dnl my_compiler="gcc (GCC) 3.2"
+dnl
+dnl kernel_compiler="gcc 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)"
+dnl my_compiler="gcc-3.2.2 (GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)"
+dnl
+dnl kernel_compiler="gcc egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)"
+dnl my_compiler="egcs-2.91.66"
+dnl
 kernel_compiler_type=`echo $kernel_compiler | cut -d ' ' -f 1`
 kernel_compiler_version=`echo $kernel_compiler | cut -d ' ' -f 2`
-my_compiler=`$CROSS_COMPILE$CC --version | head -n 1`
-my_compiler_type=`echo $my_compiler | cut -d ' ' -f 1`
-my_compiler_version=`echo $my_compiler | cut -d ' ' -f 3`
-if test -z "$my_compiler_version" -o "$my_compiler_type" = "$my_compiler_version" ; 
then
-  my_compiler_version="$my_compiler_type"
+if test "${kernel_compiler_version:0:5}" = "egcs-"; then
+  kernel_compiler_type="egcs"
+  kernel_compiler_version=`echo ${kernel_compiler_version:5} | cut -d ' ' -f 1`
+fi
+if test "${my_compiler:0:4}" = "gcc-"; then
   my_compiler_type="gcc"
-  my_compiler="gcc $my_compiler"
+  my_compiler_version=`echo ${my_compiler:4} | cut -d ' ' -f 1`
+else
+  if test "${my_compiler:0:5}" = "egcs-"; then
+    my_compiler_type="egcs"
+    my_compiler_version=`echo ${my_compiler:5} | cut -d ' ' -f 1`
+  else
+    my_compiler_type=`echo $my_compiler | cut -d ' ' -f 1`
+    my_compiler_version=`echo $my_compiler | cut -d ' ' -f 3`
+  fi
 fi
 AC_MSG_RESULT(Kernel compiler: $kernel_compiler Used compiler: $my_compiler);
 if test -z "$kernel_compiler"; then
@@ -212,6 +234,9 @@
 else
 if test "$my_compiler_type" != "$kernel_compiler_type"; then
   echo "Fatal error: Compiler type does not match"
+  echo "Decoded kernel compiler: type=$kernel_compiler_type 
version=$kernel_compiler_version"
+  echo "Decoded used compiler: type=$my_compiler_type version=$my_compiler_version"
+  echo "Please, send ./configure output to <[EMAIL PROTECTED]>"
   exit 1
 fi
 if test "$my_compiler_type" = "gcc" ; then
@@ -220,10 +245,12 @@
   if test $kernel_major -eq 2 -a $my_major -eq 3 ; then
     echo "Fatal error: Kernel is compiled with GCC 2.x and you are trying to use GCC 
3.x."
     echo "             These two version of GCC are incompatible for binary code."
+    exit 1
   fi
   if test $kernel_major -eq 3 -a $my_major -eq 2 ; then
     echo "Fatal error: Kernel is compiled with GCC 3.x and you are trying to use GCC 
2.x."
     echo "             These two version of GCC are incompatible for binary code."
+    exit 1
   fi
 fi
 fi



-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to