Added patch for compilation on sparc64.
authorJeremy Huddleston <eradicator@gentoo.org>
Fri, 19 Nov 2004 10:59:25 +0000 (10:59 +0000)
committerJeremy Huddleston <eradicator@gentoo.org>
Fri, 19 Nov 2004 10:59:25 +0000 (10:59 +0000)
media-sound/alsa-driver/ChangeLog
media-sound/alsa-driver/Manifest
media-sound/alsa-driver/alsa-driver-1.0.7.ebuild
media-sound/alsa-driver/files/alsa-driver-1.0.7-configure.patch [new file with mode: 0644]

index fa44aae8e0d986164c25d8d47c37d55369217c39..1968425c1ea42849929af6575b9eb6e1e13a475d 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for media-sound/alsa-driver
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/ChangeLog,v 1.102 2004/11/19 08:45:53 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/ChangeLog,v 1.103 2004/11/19 10:59:25 eradicator Exp $
+
+  19 Nov 2004; Jeremy Huddleston <eradicator@gentoo.org>
+  +files/alsa-driver-1.0.7-configure.patch, alsa-driver-1.0.7.ebuild:
+  Added patch for compilation on sparc64.
 
   18 Nov 2004; Jeremy Huddleston <eradicator@gentoo.org>
   alsa-driver-1.0.7.ebuild:
index 4493221210fdd874d117fde9942f6b2db0a67f0a..b67518dcd38e906bae44ebf9654746e0088a4689 100644 (file)
@@ -1,14 +1,15 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 64cc78b0cdd71250e4b6033a0b8af63d alsa-driver-1.0.7.ebuild 3522
+MD5 b3314f35a8f4e3b466be0dfde1488767 alsa-driver-1.0.7.ebuild 3699
 MD5 d388a1b0706024ddccccc99045b976f9 alsa-driver-0.9.8.ebuild 2341
 MD5 e5de43659b629d1e9f0ee8d3f1864840 alsa-driver-1.0.3.ebuild 3363
-MD5 dbeef08ad7f51e224831321afdfeacaf ChangeLog 17278
+MD5 a1ceb086104c2bd3edbe9bf07b4bf353 ChangeLog 17448
 MD5 a1eaeb2ae801daeb712c90c060e922dc metadata.xml 158
 MD5 9f0283e4e9611766ad3110532d4976d7 alsa-driver-1.0.5a.ebuild 3603
 MD5 45f95cf50aad5f544f0fa05dcf94d1ad alsa-driver-1.0.6a.ebuild 3501
 MD5 479ee887025f4ce7944adee1e4a6fdf3 files/digest-alsa-driver-1.0.7 71
+MD5 2d66a81aa4bef486ad5a40b392cac999 files/alsa-driver-1.0.7-configure.patch 31374
 MD5 8c120f7730b91118d0a8148d2deb3a43 files/alsa-driver-0.9.8-au-fix.patch 1267
 MD5 1d70561326ef89e94179634d92782610 files/alsa-driver-1.0.4-devfix.patch 2756
 MD5 08af7cfec9cd33819c62880d6219f3a5 files/alsa-driver-1.0.5-devfix.patch 763
@@ -24,7 +25,7 @@ MD5 8bb31a005a1db2e306c51d017fd44e70 files/alsa-driver-1.0.5a-xbox-ac97.patch 72
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.6 (GNU/Linux)
 
-iD8DBQFBnbLOArHZZzCEUG0RAuw/AJ0Uq/prqCIVsYv0703yHhv08pIXJgCbBKBj
-lvo5UcVwDz+rcQXhhUn9VYk=
-=Vdy8
+iD8DBQFBndIfArHZZzCEUG0RAiTnAJ9vsezzNQqPXp+MoSIOGo+cX8RuZACfb8N1
+00Ibuu6wRK+dhOil30PC42w=
+=W2oW
 -----END PGP SIGNATURE-----
index 8b23261eace65f6a3618e804d298d2e43c7bfd22..ce79a811879333170dff2ddbd3487b9834e5f4c7 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/alsa-driver-1.0.7.ebuild,v 1.5 2004/11/19 08:45:53 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/alsa-driver-1.0.7.ebuild,v 1.6 2004/11/19 10:59:25 eradicator Exp $
 
 IUSE="oss"
 
@@ -22,7 +22,7 @@ RDEPEND="virtual/modutils
 
 DEPEND="${RDEPEND}
        virtual/linux-sources
-       sys-devel/autoconf
+       >=sys-devel/autoconf-2.50
        sys-apps/debianutils"
 
 PROVIDE="virtual/alsa"
@@ -65,6 +65,12 @@ src_unpack() {
                # SUBDIRS -> M
                epatch ${FILESDIR}/${PN}-1.0.6a-kbuild.patch
        fi
+
+       # Fix order of configure operations so the kernel compiler isn't used
+       # for tests.
+       epatch ${FILESDIR}/${PN}-1.0.7-configure.patch
+       export WANT_AUTOCONF=2.5
+       autoconf
 }
 
 src_compile() {
diff --git a/media-sound/alsa-driver/files/alsa-driver-1.0.7-configure.patch b/media-sound/alsa-driver/files/alsa-driver-1.0.7-configure.patch
new file mode 100644 (file)
index 0000000..772b0d5
--- /dev/null
@@ -0,0 +1,1019 @@
+--- configure.in.orig  2004-11-19 02:48:35.682952736 -0800
++++ configure.in       2004-11-19 02:48:39.089434872 -0800
+@@ -734,366 +734,6 @@
+ CONFIG_ISA=probe
+ fi
+ 
+-dnl Check processor type...
+-AC_MSG_CHECKING(for processor type)
+-CONFIG_X86=
+-CONFIG_ALPHA=
+-CONFIG_L3=
+-CONFIG_ARM=
+-CONFIG_PPC=
+-CONFIG_SPARC32=
+-CONFIG_SPARC64=
+-CONFIG_SBUS=
+-CONFIG_SND_BIT32_EMUL=
+-processor=""
+-rm -f processor.id
+-ac_save_CFLAGS="$CFLAGS"
+-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+-if test -n "$kernelbuild" -a -f "$kernelbuild/include/linux/autoconf.h"; then
+-  KERNDIR=$kernelbuild
+-else
+-  KERNDIR=$CONFIG_SND_KERNELDIR
+-fi
+-AC_TRY_RUN([
+-#include <stdio.h>
+-#include "$KERNDIR/include/linux/autoconf.h"
+-int main(void) {
+-      FILE *file = fopen("processor.id", "w+");
+-      if (file == NULL)
+-              exit(1);
+-#if defined(CONFIG_M386)
+-      fprintf(file, "i386");
+-#elif defined(CONFIG_M486)
+-      fprintf(file, "i486");
+-#elif defined(CONFIG_M586)
+-      fprintf(file, "i586");
+-#elif defined(CONFIG_X86_64) /* this needs to be chcked before K8 */
+-      fprintf(file, "x86_64");
+-#elif defined(CONFIG_M586TSC)
+-      fprintf(file, "i586tsc");
+-#elif defined(CONFIG_M586MMX)
+-      fprintf(file, "i586mmx");
+-#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUM4) || defined(CONFIG_MPENTIUMM)
+-      fprintf(file, "i686");
+-#elif defined(CONFIG_MK6)
+-      fprintf(file, "k6");
+-#elif defined(CONFIG_MK7)
+-      fprintf(file, "k7");
+-#elif defined(CONFIG_MK8)
+-      fprintf(file, "k8");
+-#elif defined(CONFIG_MCRUSOE)
+-      fprintf(file, "crusoe");
+-#elif defined(CONFIG_MWINCHIPC6) || defined(CONFIG_MWINCHIP2) || defined(CONFIG_MWINCHIP3D)
+-      fprintf(file, "mwinchip");
+-#elif defined(CONFIG_MCYRIXIII)
+-      fprintf(file, "mcyrixiii");
+-#elif defined(CONFIG_IA64)
+-      fprintf(file, "ia64");
+-#elif defined(CONFIG_ALPHA_GENERIC)
+-      fprintf(file, "alpha_generic");
+-#elif defined(CONFIG_ALPHA_SX164)
+-      fprintf(file, "alpha_sx164");
+-#elif defined(CONFIG_ALPHA_PYXIS)
+-      fprintf(file, "alpha_pyxis");
+-#elif defined(CONFIG_ALPHA_POLARIS)
+-      fprintf(file, "alpha_polaris");
+-#elif defined(CONFIG_EV4) || defined(CONFIG_ALPHA_EV4)
+-      fprintf(file, "alpha_ev4");
+-#elif defined(CONFIG_EV5) || defined(CONFIG_ALPHA_EV5)
+-      fprintf(file, "alpha_ev5");
+-#elif defined(CONFIG_EV6) || defined(CONFIG_ALPHA_EV6)
+-      fprintf(file, "alpha_ev6");
+-#elif defined(CONFIG_ALPHA_NONAME) || defined(CONFIG_ALPHA)
+-      fprintf(file, "alpha_noname");
+-#elif defined(CONFIG_PPC64)
+-      fprintf(file, "ppc64");
+-#elif defined(CONFIG_PPC)
+-      fprintf(file, "ppc");
+-#elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_R6000)
+-      fprintf(file, "mips");
+-#elif defined(CONFIG_CPU_R4300) || defined(CONFIG_CPU_R4X00)
+-      fprintf(file, "mips");
+-#elif defined(CONFIG_CPU_R5000) || defined(CONFIG_CPU_NEVADA)
+-      fprintf(file, "mips");
+-#elif defined(CONFIG_CPU_R8000) || defined(CONFIG_CPU_R10000)
+-      fprintf(file, "mips");
+-#elif defined(CONFIG_SPARC32)
+-      fprintf(file, "sparc");
+-#elif defined(CONFIG_SPARC64)
+-      fprintf(file, "sparc64");
+-#elif defined(CONFIG_ARCH_SA1100)
+-      fprintf(file, "sa1100");
+-#elif defined(CONFIG_ARCH_PXA)
+-      fprintf(file, "pxa");
+-#elif defined(CONFIG_PARISC)
+-      fprintf(file, "parisc");
+-#else
+-      fclose(file);
+-      exit(1);
+-#endif
+-      fclose(file);
+-      exit(0);
+-}
+-],
+-  processor=`cat processor.id`;AC_MSG_RESULT($processor),
+-  AC_MSG_RESULT("unknown");processor="",
+-  AC_MSG_RESULT("unknown");processor=""
+-)
+-CFLAGS="$ac_save_CFLAGS"
+-rm -f processor.id
+-c_opts=""
+-LD=ld
+-case "$processor" in
+-  i386*)
+-    c_opts="-march=i386"
+-    ;;
+-  i486*)
+-    c_opts="-march=i486"
+-    ;;
+-  i586* | mwinchip)
+-    c_opts="-march=i586"
+-    ;;
+-  i686*)
+-    c_opts="-march=i686"
+-    ;;
+-  k6)
+-    if $CC -march=k6  -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
+-      c_opts="-march=k6"
+-    else
+-      c_opts="-march=i586"
+-    fi
+-    ;;
+-  k7|k8)
+-    if $CC -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
+-      c_opts="-march=athlon"
+-    else
+-      if $CC -falign-functions=0 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
+-        c_opts="-march=i686 -falign-functions=4"
+-      else
+-      c_opts="-march=i686 -malign-functions=4"
+-      fi
+-    fi
+-    ;;
+-  crusoe)
+-    if $CC -falign-functions=0 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
+-      c_opts="-march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0"
+-    else
+-      c_opts="-march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0"
+-    fi
+-    ;;
+-  mcyrixiii)
+-    if $CC -march=c3 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
+-      c_opts="-march=c3"
+-    else
+-      c_opts="-march=i486"
+-    fi
+-    if $CC -falign-functions=0 -falign-jumps=0 -falign-loops=0 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
+-      c_opts="$c_opts -falign-functions=0 -falign-jumps=0 -falign-loops=0"
+-    else
+-      c_opts="$c_opts -malign-functions=0 -malign-jumps=0 -malign-loops=0"
+-    fi
+-    ;;
+-  ia64)
+-    c_opts="-Wa,-x -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -funwind-tables -falign-functions=32"
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    CONFIG_IA64=y
+-    ;;
+-  alpha*)
+-    c_opts="-mno-fp-regs -ffixed-8"
+-    if $CC -mcpu=pca56 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
+-      have_pca56=yes
+-    fi
+-    if $CC -mcpu=ev5 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
+-      case "$processor" in
+-      alpha_generic)
+-        c_opts="$c_opts -mcpu=ev5"
+-        ;;
+-      alpha_sx164|alpha_polaris)
+-      if test x$have_pca56 = xyes; then
+-          c_opts="$c_opts -mcpu=pca56"
+-      else
+-          c_opts="$c_opts -mcpu=ev56"
+-        fi
+-      ;;
+-      alpha_pyxis)
+-        c_opts="$c_opts -mcpu=ev56"
+-        ;;
+-      alpha_ev4)
+-        c_opts="$c_opts -mcpu=ev4"
+-        ;;
+-      alpha_ev6)
+-        if $CC -mcpu=ev6 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
+-        c_opts="$c_opts -mcpu=ev6"
+-      elif test x$have_pca56 = xyes; then
+-        c_opts="$c_opts -mcpu=pca56"
+-        else
+-        c_opts="$c_opts -mcpu=ev56"
+-        fi
+-        ;;
+-      esac
+-    fi
+-    c_opts="$c_opts -Wa,-mev6"
+-    processor="alpha"
+-    CONFIG_ALPHA=y
+-  cat > $SRCDIR/include/asm/hack-current.h << EOF
+-#ifndef _ALPHA_CURRENT_H
+-#define _ALPHA_CURRENT_H
+-
+-extern struct task_struct *current;
+-
+-#endif /* !(_ALPHA_CURRENT_H) */
+-EOF
+-    HACK_KERNEL_INC="$HACK_KERNEL_INC --include $SRCDIR/include/asm/hack-current.h"
+-    ;;
+-  ppc)
+-    c_opts="-D__powerpc__ -fsigned-char -fno-builtin -msoft-float -ffixed-r2 -Wno-uninitialized -mmultiple -mstring"
+-    CONFIG_PPC=y
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-  ppc64)
+-    c_opts="-D__powerpc__ -fsigned-char -msoft-float -Wno-uninitialized -mminimal-toc -fno-builtin"
+-    CONFIG_SND_BIT32_EMUL=m
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-  mips*)
+-    if $CC -mtune=mips32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
+-      c_opts="-mtune=mips32"
+-    else
+-      c_opts="-mcpu=r4600"
+-    fi
+-    if $CC -mips32 -mabi=32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
+-      c_opts="$c_opts -mips32 -mabi=32"
+-    else
+-      c_opts="$_opts -mips2"
+-    fi
+-    c_opts="$c_opts -G 0 -fno-pic -mno-abicalls -mlong-calls"
+-    processor="mips"
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-  sparc)
+-    CONFIG_SPARC32=y
+-    IS_EGCS=n
+-    NEW_GAS=n
+-    test $CC -m32 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && IS_EGCS=y
+-    test $LD --version 2>&1 | grep 'elf64_sparc' > /dev/null && NEW_GAS=y
+-    if test $NEW_GAS = y; then
+-      LD="$LD -m elf32_sparc"
+-    fi
+-    if test $IS_EGCS = y; then
+-      c_opts="-mno-fpu -fcall-used-g5 -fcall-used-g7"
+-    else
+-      c_opts="-m32 -mno-fpu -fcall-used-g5 -fcall-used-g7"
+-    fi
+-    processor="sparc";
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-  sparc64)
+-    CONFIG_SPARC64=y
+-    CC=gcc
+-    test gcc -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 || CC=sparc64-linux-gcc
+-    NEW_GCC=n
+-    NEW_GAS=n
+-    CC_UNDECL=""
+-    $CC -m64 -mcmodel=medlow -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && NEW_GCC=y
+-    $LD --version 2>&1 | grep 'elf64_sparc' > /dev/null && NEW_GAS=y
+-    $CC -c -x assembler /dev/null -Wa,--help | grep undeclared-regs > /dev/null || CC_UNDECL="-Wa,--undeclared-regs"
+-    if test $NEW_GAS != y; then
+-      LD=sparc64-linux-ld
+-    else
+-      LD="$LD -m elf64_sparc"
+-    fi
+-    if test $NEW_GCC=y; then
+-      c_opts="-m64 -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare $CC_UNDECL"
+-    else
+-      c_opts="-mno-fpu -mtune=ultrasparc -mmedlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare"
+-    fi
+-    processor="sparc64"
+-    CONFIG_SND_BIT32_EMUL=m
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-  x86_64)
+-    LD="ld -m elf_x86_64 -e stext"
+-    c_opts="-mno-red-zone -mcmodel=kernel -fno-reorder-blocks -fno-strength-reduce -finline-limit=2000"
+-    CONFIG_SND_BIT32_EMUL=m
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-  sa1100)
+-    c_opts="-march=armv4 -mtune=strongarm1100 -msoft-float"
+-    CONFIG_ARM=y
+-    CONFIG_L3=y
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-  pxa)
+-    c_opts="-O2 -mapcs-32 -march=armv4 -Wa,-mxscale -mtune=strongarm -mshort-load-bytes -msoft-float"
+-    CONFIG_ARM=y
+-    CONFIG_L3=y
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-  parisc)
+-    c_opts="-mno-space-regs -mfast-indirect-calls -mschedule=7200 -mdisable-fpregs"
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-  *)
+-    processor="unknown"
+-    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
+-    ;;
+-esac
+-
+-dnl set ia32 (X86)
+-case "$processor" in
+-  i?86*|k?|crusoe|mcyrixiii|mwinchip)
+-    if $CC -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
+-      c_opts="-mpreferred-stack-boundary=2 $c_opts"
+-      CONFIG_X86=y
+-    fi
+-    if test -d $CONFIG_SND_KERNELDIR/include/asm-i386/mach-default; then
+-      AC_MSG_CHECKING(for i386 machine type)
+-      machine="default"
+-      ac_save_CFLAGS="$CFLAGS"
+-      CFLAGS="$CFLAGS -I$CONFIG_SND_KERNELDIR/include"
+-      rm -f machine.id
+-      if test -n "$kernelbuild" -a -f "$kernelbuild/include/linux/autoconf.h"; then
+-        KERNDIR=$kernelbuild
+-      else
+-        KERNDIR=$CONFIG_SND_KERNELDIR
+-      fi
+-      AC_TRY_RUN([
+-#include <stdio.h>
+-#include "$KERNDIR/include/linux/autoconf.h"
+-int main(void) {
+-      FILE *file = fopen("machine.id", "w+");
+-      if (file == NULL)
+-              exit(1);
+-#if defined(CONFIG_X86_VOYAGER)
+-      fprintf(file, "voyager");
+-#elif defined(CONFIG_X86_VISWS)
+-      fprintf(file, "visws");
+-#elif defined(CONFIG_X86_NUMAQ)
+-      fprintf(file, "numaq");
+-#elif defined(CONFIG_X86_BIGSMP)
+-      fprintf(file, "bigsmp");
+-#elif defined(CONFIG_X86_SUMMIT)
+-      fprintf(file, "summit");
+-#elif defined(CONFIG_X86_PC9800)
+-      fprintf(file, "pc9800");
+-#else
+-      fprintf(file, "default");
+-#endif
+-      fclose(file);
+-      exit(0);
+-}
+-],      
+-      machine=`cat machine.id`;AC_MSG_RESULT($machine))
+-      CFLAGS="$ac_save_CFLAGS"
+-      rm -f machine.id
+-      KERNEL_INC="$KERNEL_INC -I$CONFIG_SND_KERNELDIR/include/asm-i386/mach-$machine"
+-    fi
+-    ;;
+-esac
+-
+-dnl ia32 and alpha
+-test "$CONFIG_ISA" = "probe" && CONFIG_ISA=y
+-
+ dnl Check for SBUS support for sparc...
+ if test -n "$CONFIG_SPARC32" -o -n "$CONFIG_SPARC64"; then
+   CHECK_KERNEL_CONFIG(CONFIG_SBUS, [SBUS support in kernel])
+@@ -1692,154 +1332,514 @@
+     rm include/linux/pnp.h
+   fi
+ else
+-  if test ! -f include/linux/pnp.h; then
+-    echo "Symlinking <linux/pnp.h>..."
+-    mkdir -p include/linux
+-    ln -sf ../../support/pnp/pnp.h include/linux/pnp.h
++  if test ! -f include/linux/pnp.h; then
++    echo "Symlinking <linux/pnp.h>..."
++    mkdir -p include/linux
++    ln -sf ../../support/pnp/pnp.h include/linux/pnp.h
++  fi
++fi
++
++dnl Check for version...
++AC_MSG_CHECKING(for driver version)
++AC_DEFINE_UNQUOTED(CONFIG_SND_VERSION, "$CONFIG_SND_VERSION")
++AC_SUBST(CONFIG_SND_VERSION)
++CONFIG_SND_DATE=""
++AC_DEFINE_UNQUOTED(CONFIG_SND_DATE, "$CONFIG_SND_DATE")
++AC_SUBST(CONFIG_SND_DATE)
++AC_MSG_RESULT($CONFIG_SND_VERSION)
++
++dnl Check for sequencer support...
++AC_MSG_CHECKING(for sequencer support)
++AC_ARG_WITH(sequencer,
++  [  --with-sequencer=yes,no  driver will (not) be compiled with sequencer support],
++  sequencer="$withval", sequencer="yes")
++CONFIG_SND_SEQUENCER=""
++if test "$sequencer" = "yes"; then
++  CONFIG_SND_SEQUENCER="m"
++fi
++AC_SUBST(CONFIG_SND_SEQUENCER)
++if test "$CONFIG_SND_SEQUENCER" = "m"; then
++  AC_DEFINE(CONFIG_SND_SEQUENCER_MODULE)
++  AC_DEFINE(CONFIG_SND_SEQ_DUMMY_MODULE)
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
++dnl Check for OSS/Free emulation...
++AC_MSG_CHECKING(for OSS/Free emulation)
++AC_ARG_WITH(oss,
++  [  --with-oss=no,yes       driver will (not) be compiled with OSS/Free emulation],
++  ossemul="$withval", ossemul="yes")
++CONFIG_SND_OSSEMUL=""
++if test "$ossemul" = "yes"; then
++  CONFIG_SND_OSSEMUL="y"
++fi
++if test "$CONFIG_SND_OSSEMUL" = "y"; then
++  AC_DEFINE(CONFIG_SND_OSSEMUL)
++  AC_DEFINE(CONFIG_SND_MIXER_OSS_MODULE)
++  AC_DEFINE(CONFIG_SND_PCM_OSS_MODULE)
++  if test "$CONFIG_SND_SEQUENCER" = "m"; then
++    AC_DEFINE(CONFIG_SND_SEQUENCER_OSS)
++  fi
++  AC_MSG_RESULT(yes)
++else
++  AC_MSG_RESULT(no)
++fi
++
++dnl Check for RTC timer support...
++AC_MSG_CHECKING(for RTC callback support in kernel)
++rtcsup="0"
++ac_save_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
++AC_TRY_RUN([
++#include <linux/autoconf.h>
++#if defined(__alpha__) || (!defined(CONFIG_RTC) && !defined(CONFIG_RTC_MODULE))
++int main(void) { exit(1); }
++#else
++#define __KERNEL__
++#include <linux/version.h>
++#include <linux/config.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 12)     /* FIXME: which 2.2.x kernel? */
++#include <linux/rtc.h>
++#else
++#include <linux/mc146818rtc.h>
++#endif
++int main(void)
++{
++  rtc_task_t *cb = 0;
++  exit(0);
++}
++#endif
++],
++  AC_MSG_RESULT("yes");rtcsup="m",
++  AC_MSG_RESULT("no");rtcsup="",
++  AC_MSG_RESULT("unknown");rtcsup=""
++)
++CFLAGS="$ac_save_CFLAGS"
++CONFIG_SND_RTCTIMER=$rtcsup
++AC_SUBST(CONFIG_SND_RTCTIMER)
++test "$CONFIG_SND_RTCTIMER" = "m" && AC_DEFINE(CONFIG_SND_RTCTIMER_MODULE)
++CONFIG_RTC=$CONFIG_SND_RTCTIMER
++AC_SUBST(CONFIG_RTC)
++
++dnl Check for procfs
++CHECK_KERNEL_CONFIG(CONFIG_PROC_FS, [Procfs support])
++AC_SUBST(CONFIG_PROC_FS)
++
++dnl Check for USB
++CHECK_KERNEL_CONFIG(CONFIG_USB, [USB support])
++if test "$CONFIG_USB" != "y"; then
++  CHECK_KERNEL_CONFIG(CONFIG_USB_MODULE, [USB module support])
++  CONFIG_USB=$CONFIG_USB_MODULE
++fi
++AC_SUBST(CONFIG_USB)
++
++dnl PCMCIA stuff
++AC_ARG_WITH(pcmcia,
++  [  --with-pcmcia=kernel,external   support kernel PCMCIA driver or external PCMCIA driver],
++  pcmcia="$withval", pcmcia="kernel")
++AC_ARG_WITH(pcmcia_root,
++  [  --with-pcmcia-root=dir  specify the root directory of external PCMCIA source-tree],
++  pcmciaroot="$withval", pcmciaroot="")
++EXTRA_INCLUDES=""
++if test "$pcmcia" = "kernel"; then
++  echo "checking for kernel PCMCIA"
++  CHECK_KERNEL_CONFIG(CONFIG_PCMCIA, [PCMCIA support])
++  if test "$CONFIG_PCMCIA" != "y"; then
++    CHECK_KERNEL_CONFIG(CONFIG_PCMCIA_MODULE, [PCMCIA module support])
++    CONFIG_PCMCIA=$CONFIG_PCMCIA_MODULE
++  fi
++else
++  echo "checking for external PCMCIA"
++  if test "$pcmciaroot" = ""; then
++    AC_MSG_ERROR(Please set the PCMCIA root directory via --with-pcmcia-root option)
+   fi
++  if test ! -d "$pcmciaroot"; then
++    AC_MSG_ERROR(PCMCIA root $pcmciaroot is not a directory)
++  fi
++  echo "PCMCIA root directory is $pcmciaroot"
++  EXTRA_INCLUDES="-I$pcmciaroot/include"
++  CONFIG_PCMCIA=y
+ fi
++  
++AC_SUBST(CONFIG_PCMCIA)
+ 
+-dnl Check for version...
+-AC_MSG_CHECKING(for driver version)
+-AC_DEFINE_UNQUOTED(CONFIG_SND_VERSION, "$CONFIG_SND_VERSION")
+-AC_SUBST(CONFIG_SND_VERSION)
+-CONFIG_SND_DATE=""
+-AC_DEFINE_UNQUOTED(CONFIG_SND_DATE, "$CONFIG_SND_DATE")
+-AC_SUBST(CONFIG_SND_DATE)
+-AC_MSG_RESULT($CONFIG_SND_VERSION)
++dnl Check for PC98 architecture support...
++CHECK_KERNEL_CONFIG(CONFIG_X86_PC9800, [PC9800 support in kernel])
++AC_SUBST(CONFIG_X86_PC9800)
+ 
+-dnl Check for sequencer support...
+-AC_MSG_CHECKING(for sequencer support)
+-AC_ARG_WITH(sequencer,
+-  [  --with-sequencer=yes,no  driver will (not) be compiled with sequencer support],
+-  sequencer="$withval", sequencer="yes")
+-CONFIG_SND_SEQUENCER=""
+-if test "$sequencer" = "yes"; then
+-  CONFIG_SND_SEQUENCER="m"
++dnl Check for parallel port support
++if test "$kversion.$kpatchlevel" = "2.2"; then
++  CONFIG_PARPORT=""
++else
++  CHECK_KERNEL_CONFIG(CONFIG_PARPORT, [parallel port support])
++  if test "$CONFIG_PARPORT" != "y"; then
++    CHECK_KERNEL_CONFIG(CONFIG_PARPORT_MODULE, [parallel port module support])
++    CONFIG_PARPORT=$CONFIG_PARPORT_MODULE
++  fi
+ fi
+-AC_SUBST(CONFIG_SND_SEQUENCER)
+-if test "$CONFIG_SND_SEQUENCER" = "m"; then
+-  AC_DEFINE(CONFIG_SND_SEQUENCER_MODULE)
+-  AC_DEFINE(CONFIG_SND_SEQ_DUMMY_MODULE)
+-  AC_MSG_RESULT(yes)
++AC_SUBST(CONFIG_PARPORT)
++
++dnl Check processor type...
++AC_MSG_CHECKING(for processor type)
++CONFIG_X86=
++CONFIG_ALPHA=
++CONFIG_L3=
++CONFIG_ARM=
++CONFIG_PPC=
++CONFIG_SPARC32=
++CONFIG_SPARC64=
++CONFIG_SBUS=
++CONFIG_SND_BIT32_EMUL=
++processor=""
++rm -f processor.id
++ac_save_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
++if test -n "$kernelbuild" -a -f "$kernelbuild/include/linux/autoconf.h"; then
++  KERNDIR=$kernelbuild
+ else
+-  AC_MSG_RESULT(no)
++  KERNDIR=$CONFIG_SND_KERNELDIR
+ fi
++AC_TRY_RUN([
++#include <stdio.h>
++#include "$KERNDIR/include/linux/autoconf.h"
++int main(void) {
++      FILE *file = fopen("processor.id", "w+");
++      if (file == NULL)
++              exit(1);
++#if defined(CONFIG_M386)
++      fprintf(file, "i386");
++#elif defined(CONFIG_M486)
++      fprintf(file, "i486");
++#elif defined(CONFIG_M586)
++      fprintf(file, "i586");
++#elif defined(CONFIG_X86_64) /* this needs to be chcked before K8 */
++      fprintf(file, "x86_64");
++#elif defined(CONFIG_M586TSC)
++      fprintf(file, "i586tsc");
++#elif defined(CONFIG_M586MMX)
++      fprintf(file, "i586mmx");
++#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUM4) || defined(CONFIG_MPENTIUMM)
++      fprintf(file, "i686");
++#elif defined(CONFIG_MK6)
++      fprintf(file, "k6");
++#elif defined(CONFIG_MK7)
++      fprintf(file, "k7");
++#elif defined(CONFIG_MK8)
++      fprintf(file, "k8");
++#elif defined(CONFIG_MCRUSOE)
++      fprintf(file, "crusoe");
++#elif defined(CONFIG_MWINCHIPC6) || defined(CONFIG_MWINCHIP2) || defined(CONFIG_MWINCHIP3D)
++      fprintf(file, "mwinchip");
++#elif defined(CONFIG_MCYRIXIII)
++      fprintf(file, "mcyrixiii");
++#elif defined(CONFIG_IA64)
++      fprintf(file, "ia64");
++#elif defined(CONFIG_ALPHA_GENERIC)
++      fprintf(file, "alpha_generic");
++#elif defined(CONFIG_ALPHA_SX164)
++      fprintf(file, "alpha_sx164");
++#elif defined(CONFIG_ALPHA_PYXIS)
++      fprintf(file, "alpha_pyxis");
++#elif defined(CONFIG_ALPHA_POLARIS)
++      fprintf(file, "alpha_polaris");
++#elif defined(CONFIG_EV4) || defined(CONFIG_ALPHA_EV4)
++      fprintf(file, "alpha_ev4");
++#elif defined(CONFIG_EV5) || defined(CONFIG_ALPHA_EV5)
++      fprintf(file, "alpha_ev5");
++#elif defined(CONFIG_EV6) || defined(CONFIG_ALPHA_EV6)
++      fprintf(file, "alpha_ev6");
++#elif defined(CONFIG_ALPHA_NONAME) || defined(CONFIG_ALPHA)
++      fprintf(file, "alpha_noname");
++#elif defined(CONFIG_PPC64)
++      fprintf(file, "ppc64");
++#elif defined(CONFIG_PPC)
++      fprintf(file, "ppc");
++#elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_R6000)
++      fprintf(file, "mips");
++#elif defined(CONFIG_CPU_R4300) || defined(CONFIG_CPU_R4X00)
++      fprintf(file, "mips");
++#elif defined(CONFIG_CPU_R5000) || defined(CONFIG_CPU_NEVADA)
++      fprintf(file, "mips");
++#elif defined(CONFIG_CPU_R8000) || defined(CONFIG_CPU_R10000)
++      fprintf(file, "mips");
++#elif defined(CONFIG_SPARC32)
++      fprintf(file, "sparc");
++#elif defined(CONFIG_SPARC64)
++      fprintf(file, "sparc64");
++#elif defined(CONFIG_ARCH_SA1100)
++      fprintf(file, "sa1100");
++#elif defined(CONFIG_ARCH_PXA)
++      fprintf(file, "pxa");
++#elif defined(CONFIG_PARISC)
++      fprintf(file, "parisc");
++#else
++      fclose(file);
++      exit(1);
++#endif
++      fclose(file);
++      exit(0);
++}
++],
++  processor=`cat processor.id`;AC_MSG_RESULT($processor),
++  AC_MSG_RESULT("unknown");processor="",
++  AC_MSG_RESULT("unknown");processor=""
++)
++CFLAGS="$ac_save_CFLAGS"
++rm -f processor.id
++c_opts=""
++LD=ld
++case "$processor" in
++  i386*)
++    c_opts="-march=i386"
++    ;;
++  i486*)
++    c_opts="-march=i486"
++    ;;
++  i586* | mwinchip)
++    c_opts="-march=i586"
++    ;;
++  i686*)
++    c_opts="-march=i686"
++    ;;
++  k6)
++    if $CC -march=k6  -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
++      c_opts="-march=k6"
++    else
++      c_opts="-march=i586"
++    fi
++    ;;
++  k7|k8)
++    if $CC -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
++      c_opts="-march=athlon"
++    else
++      if $CC -falign-functions=0 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
++        c_opts="-march=i686 -falign-functions=4"
++      else
++      c_opts="-march=i686 -malign-functions=4"
++      fi
++    fi
++    ;;
++  crusoe)
++    if $CC -falign-functions=0 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
++      c_opts="-march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0"
++    else
++      c_opts="-march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0"
++    fi
++    ;;
++  mcyrixiii)
++    if $CC -march=c3 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
++      c_opts="-march=c3"
++    else
++      c_opts="-march=i486"
++    fi
++    if $CC -falign-functions=0 -falign-jumps=0 -falign-loops=0 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
++      c_opts="$c_opts -falign-functions=0 -falign-jumps=0 -falign-loops=0"
++    else
++      c_opts="$c_opts -malign-functions=0 -malign-jumps=0 -malign-loops=0"
++    fi
++    ;;
++  ia64)
++    c_opts="-Wa,-x -ffixed-r13 -mfixed-range=f10-f15,f32-f127 -funwind-tables -falign-functions=32"
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    CONFIG_IA64=y
++    ;;
++  alpha*)
++    c_opts="-mno-fp-regs -ffixed-8"
++    if $CC -mcpu=pca56 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
++      have_pca56=yes
++    fi
++    if $CC -mcpu=ev5 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
++      case "$processor" in
++      alpha_generic)
++        c_opts="$c_opts -mcpu=ev5"
++        ;;
++      alpha_sx164|alpha_polaris)
++      if test x$have_pca56 = xyes; then
++          c_opts="$c_opts -mcpu=pca56"
++      else
++          c_opts="$c_opts -mcpu=ev56"
++        fi
++      ;;
++      alpha_pyxis)
++        c_opts="$c_opts -mcpu=ev56"
++        ;;
++      alpha_ev4)
++        c_opts="$c_opts -mcpu=ev4"
++        ;;
++      alpha_ev6)
++        if $CC -mcpu=ev6 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
++        c_opts="$c_opts -mcpu=ev6"
++      elif test x$have_pca56 = xyes; then
++        c_opts="$c_opts -mcpu=pca56"
++        else
++        c_opts="$c_opts -mcpu=ev56"
++        fi
++        ;;
++      esac
++    fi
++    c_opts="$c_opts -Wa,-mev6"
++    processor="alpha"
++    CONFIG_ALPHA=y
++  cat > $SRCDIR/include/asm/hack-current.h << EOF
++#ifndef _ALPHA_CURRENT_H
++#define _ALPHA_CURRENT_H
++
++extern struct task_struct *current;
+ 
+-dnl Check for OSS/Free emulation...
+-AC_MSG_CHECKING(for OSS/Free emulation)
+-AC_ARG_WITH(oss,
+-  [  --with-oss=no,yes       driver will (not) be compiled with OSS/Free emulation],
+-  ossemul="$withval", ossemul="yes")
+-CONFIG_SND_OSSEMUL=""
+-if test "$ossemul" = "yes"; then
+-  CONFIG_SND_OSSEMUL="y"
+-fi
+-if test "$CONFIG_SND_OSSEMUL" = "y"; then
+-  AC_DEFINE(CONFIG_SND_OSSEMUL)
+-  AC_DEFINE(CONFIG_SND_MIXER_OSS_MODULE)
+-  AC_DEFINE(CONFIG_SND_PCM_OSS_MODULE)
+-  if test "$CONFIG_SND_SEQUENCER" = "m"; then
+-    AC_DEFINE(CONFIG_SND_SEQUENCER_OSS)
+-  fi
+-  AC_MSG_RESULT(yes)
+-else
+-  AC_MSG_RESULT(no)
+-fi
++#endif /* !(_ALPHA_CURRENT_H) */
++EOF
++    HACK_KERNEL_INC="$HACK_KERNEL_INC --include $SRCDIR/include/asm/hack-current.h"
++    ;;
++  ppc)
++    c_opts="-D__powerpc__ -fsigned-char -fno-builtin -msoft-float -ffixed-r2 -Wno-uninitialized -mmultiple -mstring"
++    CONFIG_PPC=y
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++  ppc64)
++    c_opts="-D__powerpc__ -fsigned-char -msoft-float -Wno-uninitialized -mminimal-toc -fno-builtin"
++    CONFIG_SND_BIT32_EMUL=m
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++  mips*)
++    if $CC -mtune=mips32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
++      c_opts="-mtune=mips32"
++    else
++      c_opts="-mcpu=r4600"
++    fi
++    if $CC -mips32 -mabi=32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then
++      c_opts="$c_opts -mips32 -mabi=32"
++    else
++      c_opts="$_opts -mips2"
++    fi
++    c_opts="$c_opts -G 0 -fno-pic -mno-abicalls -mlong-calls"
++    processor="mips"
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++  sparc)
++    CONFIG_SPARC32=y
++    IS_EGCS=n
++    NEW_GAS=n
++    test $CC -m32 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && IS_EGCS=y
++    test $LD --version 2>&1 | grep 'elf64_sparc' > /dev/null && NEW_GAS=y
++    if test $NEW_GAS = y; then
++      LD="$LD -m elf32_sparc"
++    fi
++    if test $IS_EGCS = y; then
++      c_opts="-mno-fpu -fcall-used-g5 -fcall-used-g7"
++    else
++      c_opts="-m32 -mno-fpu -fcall-used-g5 -fcall-used-g7"
++    fi
++    processor="sparc";
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++  sparc64)
++    CONFIG_SPARC64=y
++    CC=gcc
++    test gcc -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 || CC=sparc64-linux-gcc
++    NEW_GCC=n
++    NEW_GAS=n
++    CC_UNDECL=""
++    $CC -m64 -mcmodel=medlow -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && NEW_GCC=y
++    $LD --version 2>&1 | grep 'elf64_sparc' > /dev/null && NEW_GAS=y
++    $CC -c -x assembler /dev/null -Wa,--help | grep undeclared-regs > /dev/null || CC_UNDECL="-Wa,--undeclared-regs"
++    if test $NEW_GAS != y; then
++      LD=sparc64-linux-ld
++    else
++      LD="$LD -m elf64_sparc"
++    fi
++    if test $NEW_GCC=y; then
++      c_opts="-m64 -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare $CC_UNDECL"
++    else
++      c_opts="-mno-fpu -mtune=ultrasparc -mmedlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare"
++    fi
++    processor="sparc64"
++    CONFIG_SND_BIT32_EMUL=m
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++  x86_64)
++    LD="ld -m elf_x86_64 -e stext"
++    c_opts="-mno-red-zone -mcmodel=kernel -fno-reorder-blocks -fno-strength-reduce -finline-limit=2000"
++    CONFIG_SND_BIT32_EMUL=m
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++  sa1100)
++    c_opts="-march=armv4 -mtune=strongarm1100 -msoft-float"
++    CONFIG_ARM=y
++    CONFIG_L3=y
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++  pxa)
++    c_opts="-O2 -mapcs-32 -march=armv4 -Wa,-mxscale -mtune=strongarm -mshort-load-bytes -msoft-float"
++    CONFIG_ARM=y
++    CONFIG_L3=y
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++  parisc)
++    c_opts="-mno-space-regs -mfast-indirect-calls -mschedule=7200 -mdisable-fpregs"
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++  *)
++    processor="unknown"
++    test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
++    ;;
++esac
+ 
+-dnl Check for RTC timer support...
+-AC_MSG_CHECKING(for RTC callback support in kernel)
+-rtcsup="0"
+-ac_save_CFLAGS="$CFLAGS"
+-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
+-AC_TRY_RUN([
+-#include <linux/autoconf.h>
+-#if defined(__alpha__) || (!defined(CONFIG_RTC) && !defined(CONFIG_RTC_MODULE))
+-int main(void) { exit(1); }
+-#else
+-#define __KERNEL__
+-#include <linux/version.h>
+-#include <linux/config.h>
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 12)     /* FIXME: which 2.2.x kernel? */
+-#include <linux/rtc.h>
++dnl set ia32 (X86)
++case "$processor" in
++  i?86*|k?|crusoe|mcyrixiii|mwinchip)
++    if $CC -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then
++      c_opts="-mpreferred-stack-boundary=2 $c_opts"
++      CONFIG_X86=y
++    fi
++    if test -d $CONFIG_SND_KERNELDIR/include/asm-i386/mach-default; then
++      AC_MSG_CHECKING(for i386 machine type)
++      machine="default"
++      ac_save_CFLAGS="$CFLAGS"
++      CFLAGS="$CFLAGS -I$CONFIG_SND_KERNELDIR/include"
++      rm -f machine.id
++      if test -n "$kernelbuild" -a -f "$kernelbuild/include/linux/autoconf.h"; then
++        KERNDIR=$kernelbuild
++      else
++        KERNDIR=$CONFIG_SND_KERNELDIR
++      fi
++      AC_TRY_RUN([
++#include <stdio.h>
++#include "$KERNDIR/include/linux/autoconf.h"
++int main(void) {
++      FILE *file = fopen("machine.id", "w+");
++      if (file == NULL)
++              exit(1);
++#if defined(CONFIG_X86_VOYAGER)
++      fprintf(file, "voyager");
++#elif defined(CONFIG_X86_VISWS)
++      fprintf(file, "visws");
++#elif defined(CONFIG_X86_NUMAQ)
++      fprintf(file, "numaq");
++#elif defined(CONFIG_X86_BIGSMP)
++      fprintf(file, "bigsmp");
++#elif defined(CONFIG_X86_SUMMIT)
++      fprintf(file, "summit");
++#elif defined(CONFIG_X86_PC9800)
++      fprintf(file, "pc9800");
+ #else
+-#include <linux/mc146818rtc.h>
++      fprintf(file, "default");
+ #endif
+-int main(void)
+-{
+-  rtc_task_t *cb = 0;
+-  exit(0);
++      fclose(file);
++      exit(0);
+ }
+-#endif
+-],
+-  AC_MSG_RESULT("yes");rtcsup="m",
+-  AC_MSG_RESULT("no");rtcsup="",
+-  AC_MSG_RESULT("unknown");rtcsup=""
+-)
+-CFLAGS="$ac_save_CFLAGS"
+-CONFIG_SND_RTCTIMER=$rtcsup
+-AC_SUBST(CONFIG_SND_RTCTIMER)
+-test "$CONFIG_SND_RTCTIMER" = "m" && AC_DEFINE(CONFIG_SND_RTCTIMER_MODULE)
+-CONFIG_RTC=$CONFIG_SND_RTCTIMER
+-AC_SUBST(CONFIG_RTC)
+-
+-dnl Check for procfs
+-CHECK_KERNEL_CONFIG(CONFIG_PROC_FS, [Procfs support])
+-AC_SUBST(CONFIG_PROC_FS)
+-
+-dnl Check for USB
+-CHECK_KERNEL_CONFIG(CONFIG_USB, [USB support])
+-if test "$CONFIG_USB" != "y"; then
+-  CHECK_KERNEL_CONFIG(CONFIG_USB_MODULE, [USB module support])
+-  CONFIG_USB=$CONFIG_USB_MODULE
+-fi
+-AC_SUBST(CONFIG_USB)
+-
+-dnl PCMCIA stuff
+-AC_ARG_WITH(pcmcia,
+-  [  --with-pcmcia=kernel,external   support kernel PCMCIA driver or external PCMCIA driver],
+-  pcmcia="$withval", pcmcia="kernel")
+-AC_ARG_WITH(pcmcia_root,
+-  [  --with-pcmcia-root=dir  specify the root directory of external PCMCIA source-tree],
+-  pcmciaroot="$withval", pcmciaroot="")
+-EXTRA_INCLUDES=""
+-if test "$pcmcia" = "kernel"; then
+-  echo "checking for kernel PCMCIA"
+-  CHECK_KERNEL_CONFIG(CONFIG_PCMCIA, [PCMCIA support])
+-  if test "$CONFIG_PCMCIA" != "y"; then
+-    CHECK_KERNEL_CONFIG(CONFIG_PCMCIA_MODULE, [PCMCIA module support])
+-    CONFIG_PCMCIA=$CONFIG_PCMCIA_MODULE
+-  fi
+-else
+-  echo "checking for external PCMCIA"
+-  if test "$pcmciaroot" = ""; then
+-    AC_MSG_ERROR(Please set the PCMCIA root directory via --with-pcmcia-root option)
+-  fi
+-  if test ! -d "$pcmciaroot"; then
+-    AC_MSG_ERROR(PCMCIA root $pcmciaroot is not a directory)
+-  fi
+-  echo "PCMCIA root directory is $pcmciaroot"
+-  EXTRA_INCLUDES="-I$pcmciaroot/include"
+-  CONFIG_PCMCIA=y
+-fi
+-  
+-AC_SUBST(CONFIG_PCMCIA)
+-
+-dnl Check for PC98 architecture support...
+-CHECK_KERNEL_CONFIG(CONFIG_X86_PC9800, [PC9800 support in kernel])
+-AC_SUBST(CONFIG_X86_PC9800)
++],      
++      machine=`cat machine.id`;AC_MSG_RESULT($machine))
++      CFLAGS="$ac_save_CFLAGS"
++      rm -f machine.id
++      KERNEL_INC="$KERNEL_INC -I$CONFIG_SND_KERNELDIR/include/asm-i386/mach-$machine"
++    fi
++    ;;
++esac
+ 
+-dnl Check for parallel port support
+-if test "$kversion.$kpatchlevel" = "2.2"; then
+-  CONFIG_PARPORT=""
+-else
+-  CHECK_KERNEL_CONFIG(CONFIG_PARPORT, [parallel port support])
+-  if test "$CONFIG_PARPORT" != "y"; then
+-    CHECK_KERNEL_CONFIG(CONFIG_PARPORT_MODULE, [parallel port module support])
+-    CONFIG_PARPORT=$CONFIG_PARPORT_MODULE
+-  fi
+-fi
+-AC_SUBST(CONFIG_PARPORT)
++dnl ia32 and alpha
++test "$CONFIG_ISA" = "probe" && CONFIG_ISA=y
+ 
+ dnl Check for HPK tree (for ASIHPI driver)
+ CONFIG_ASIHPK=""