I recently ran into a VERY similar problem trying to compile the GadgetLabs WavePro 8/24 ALSA driver on Ubuntu 8.04 x86_64.
My solution was to build and run a custom mainline (NOT ubuntu/canonical) kernel with ALSA included. As far as I know, since the Ubuntu kernel does not have ALSA enabled in Hardy, building a kernel is the only way. (Whether I could get an Ubuntu kernel to build with ALSA, I do not know; I haven't really given more than a quick try yet.)
I'm including my post from https://answers.launchpad.net/ubuntu/+question/35767 which details how I did this. A few steps are specific to the GadgetLabs driver (copying firmware files). However, the symlinking/copying steps at the end will probably be necessary for you, too.
Anyway, hope this is helpful! Let me know.
I finally got the GadgetLabs WavePro 8/24 ALSA driver to compile and insert on Ubuntu 8.04 (x86_64)! What's more, it plays and records sound! I have tested with Totem (playing mp3s) and Ardour/Jack (recording a track and playing it back).
I used this https://wiki.ubuntu.com/KernelTeam/GitKernelBuild for help with building the main line kernel. However, I had to fix a couple of things that came out broken in the linux-headers deb package that was generated after installing it.
I chose 126.96.36.199 as it seemed close to Ubuntu stock kernel... I'm guessing latest would work too, though. (I had tried 188.8.131.52 last week and thought it was too new, but I think now it was just showing the same two problems I had to fix with 184.108.40.206, so I may try to build 2.6.26 or 2.6.27 kernel soon too.)
Here's what I did. I'll try to keep the commands easily repeatable for others. (If you have multicore, make sure to change CONCURRENCY_LEVEL... building kernel + debs took my Athlon 64 3000+ 90 minutes...)
Now we must enable ALSA in the kernel configuration.
# First, pretty standard kernel building stuff
tar xvjf linux-220.127.116.11.tar.bz2
cp /boot/config-`uname -r` .config
Specifically, here are the settings I'm using. I'm not sure all of them are necessary (especially verbose procfs and dummy client).
Device Drivers --->
<M> Sound card support
Advanced Linux Sound Architecture --->
<M> Advanced Linux Sound Architecture
<M> Sequencer support
<M> Sequencer dummy client
<M> OSS Mixer API
<M> OSS PCM (digital audio) API[*] OSS PCM (digital audio) API[*] OSS Sequencer API[*] Support old ALSA API[*] Verbose procfs contents
then building the driver worked. It's weird that when I built the
# Now to actually make the kernel package
CONCURRENCY_LEVEL=1 fakeroot make-kpkg --initrd
--append-to-version=-bikko kernel_image kernel_headers
sudo dpkg -i linux-image-18.104.22.168-bikko_22.214.171.124-bikko-10.00.Custom_amd64.deb
sudo dpkg -i linux-headers-126.96.36.199-bikko_188.8.131.52-bikko-10.00.Custom_amd64.deb
sudo ln -sf /usr/src/linux-headers-184.108.40.206-bikko /usr/src/linux
# copy firmware
sudo mkdir /lib/firmware/220.127.116.11-bikko
sudo cp <wavepro src dir>/gl*_firmware.bin /lib/firmware/18.104.22.168-bikko/
# These next commands fix two problems which cause build errors
# with gl824 module... This is the part I figured out :)
sudo cp ~/kernel/linux-22.214.171.124/arch/x86/Makefile_64 /usr/src/linux/arch/x86/
sudo ln -sf /usr/src/linux/include
sudo ln -s asm-x86 asm
kernel package it botched the "asm" symlink and didn't include
Makefile_64! I had been getting "Makefile_64: No such file" errors and
similar errors for asm include files.
You will have to reboot into the new kernel of course before inserting the driver.
Note that any time you build a custom kernel, you pretty much lose restricted modules. I'll be working on trying to figure out how to get the nvidia driver back - for now I switched my xorg.conf to use the nv driver.
Good luck, everyone, and tell us how it goes!