Update of /cvsroot/alsa/alsa-driver
In directory sc8-pr-cvs1:/tmp/cvs-serv27057
Modified Files:
configure.in
Log Message:
more robust check of compiler type and version.
Index: configure.in
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/configure.in,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -r1.182 -r1.183
--- configure.in 22 Jun 2003 12:30:41 -0000 1.182
+++ configure.in 30 Jun 2003 13:33:51 -0000 1.183
@@ -210,43 +210,52 @@
dnl kernel_compiler="gcc 2.95.3 20010315 (release)"
dnl my_compiler="2.95.3"
dnl
-kernel_compiler_type=`echo $kernel_compiler | cut -d ' ' -f 1`
-kernel_compiler_version=`echo $kernel_compiler | cut -d ' ' -f 2`
-case "$kernel_compiler_type" in
-gcc-*)
- kernel_compiler_type="gcc"
- ;;
-esac
-case "$kernel_compiler_version" in
-egcs-*)
- kernel_compiler_type="egcs"
- kernel_compiler_version=`echo "$kernel_compiler_version" | cut -b 6-`
- ;;
-esac
-case "$my_compiler" in
-gcc-*)
- my_compiler_type="gcc"
- my_compiler_version=`echo "$my_compiler" | cut -b 5-`
- ;;
-*)
- case "$my_compiler" in
- egcs-*)
- my_compiler_type="egcs"
- my_compiler_version=`echo "$my_compiler" | cut -b 6-`
- ;;
- *)
- my_compiler_type=`echo $my_compiler | cut -d ' ' -f 1`
- my_compiler_version=`echo "$my_compiler" | cut -d ' ' -f 3`
- ;;
- esac
-esac
-if test "$my_compiler_type" = "${CROSS_COMPILE}gcc"; then
- my_compiler_type="gcc"
-fi
-if test "$my_compiler_type" = "${CROSS_COMPILE}cc"; then
- my_compiler_type="cc"
-fi
-if test "$my_compiler_type" = "$my_compiler_version"; then
+
+AC_DEFUN(CHECK_COMPILER, [
+ typevar=$2
+ versionvar=$3
+ ac_compiler_type=""
+ ac_compiler_version=""
+ for i in $1; do
+ case $i in
+ gcc-[[0-9]]*|*-gcc-[[0-9]]*)
+ if test -z "$ac_compiler_type"; then
+ ac_compiler_type=gcc
+ fi
+ if test -z "$ac_compiler_version"; then
+ ac_compiler_version=`echo $i | sed -e 's/^.*gcc-\([0-9.]\+\).*$/\1/'`
+ fi
+ ;;
+ *gcc*)
+ if test -z "$ac_compiler_type"; then
+ ac_compiler_type=gcc
+ fi
+ ;;
+ egcs-*)
+ ac_compiler_type=egcs
+ if test -z "$ac_compiler_version"; then
+ ac_compiler_version=`echo $i | sed -e 's/egcs-\(.\+\)$/\1/'`
+ fi
+ ;;
+ *cc*)
+ if test -z "$ac_compiler_type"; then
+ ac_compiler_type=cc
+ fi
+ ;;
+ [[0-9]].[[0-9]]*)
+ if test -z "$ac_compiler_version"; then
+ ac_compiler_version="$i"
+ fi
+ ;;
+ esac
+ done
+ eval $typevar="$ac_compiler_type"
+ eval $versionvar="$ac_compiler_version"
+])
+
+CHECK_COMPILER($kernel_compiler, kernel_compiler_type, kernel_compiler_version)
+CHECK_COMPILER($my_compiler, my_compiler_type, my_compiler_version)
+if test -z "$my_compiler_type"; then
my_compiler_type="gcc"
fi
AC_MSG_RESULT(Kernel compiler: $kernel_compiler Used compiler: $my_compiler);
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog