From alsa-devel-owner@alsa.jcu.cz  Sat Jan 30 23:49:08 1999
Received: from gs176.sp.cs.cmu.edu (GS176.SP.CS.CMU.EDU [128.2.198.136])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id XAA06570
	for <alsa-devel@alsa.jcu.cz>; Sat, 30 Jan 1999 23:47:35 +0100
Received: from gs176.sp.cs.cmu.edu (localhost [127.0.0.1])
	by gs176.sp.cs.cmu.edu (8.8.7/8.8.7) with ESMTP id RAA07835;
	Sat, 30 Jan 1999 17:47:33 -0500
Message-Id: <199901302247.RAA07835@gs176.sp.cs.cmu.edu>
To: alsa-devel@alsa.jcu.cz, perex@jcu.cz
Subject: compile problems in latest alsa
Date: Sat, 30 Jan 1999 17:47:33 -0500
From: John Carol Langford <jcl@gs176.sp.cs.cmu.edu>
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

I downloaded and compiled the latest version of alsa with a 2.2.1
kernel and ran into a couple problems.

The compile broke on 'pcm1_native.c' with
pcm1_native.c:1135: `SND_PCM1_IOCTL_MODE' undeclared (first use this function)
pcm1_native.c:1135: (Each undeclared identifier is reported only once
pcm1_native.c:1135: for each function it appears in.)
pcm1_native.c:1141: `SND_PCM1_IOCTL_VOICES' undeclared 

I worked around this by adding:
#define SND_PCM1_IOCTL_MODE     0x00000001      /* Needed to make pcm1_native.c 
compile*/
#define SND_PCM1_IOCTL_VOICES   0x00000001      /* Needed to make pcm1_native.c 
compile*/

to alsa-driver/include/pcm1.h

The compile would break around 'pcm1_expert.c' depending on a nonexistent
/usr/src/linux/include/linux/modules/sound_firmware.ver
A similar problem occurs for 
alsa-driver/lowlevel/gus/.depend
with a similar fix and a few other /lowlevel/*/*.c files

Then I ran into a bunch of warnings which look like this:
../include/modules/es1370_export.ver:7: warning: `__ver_snd_ensoniq_pcm' redefined
../include/modules/ens1370_export.ver:7: warning: this is the location of the previous definition

The last thing necessary was:
touch alsa-utils/mkinstalldirs
(apparently, there is a missing file)

After all of this, it worked.

Finally, I tweaked the build script slightly to add another option
'build install'.

-John Langford

#!/bin/sh
#
# Make everything in the ALSA package
#
# Author: Kayvan Sylvan <kayvan@sylvan.com>

# Comment this out if you don't want isapnp support in ALSA driver RPM
#
export EXTRA_ALSA_DRIVER_CONFIG_FLAGS="--with-isapnp=yes"

usage() {
    echo "Usage: `basename $0` [ prep | config | all | install | clean | rpms ]"
    exit
}

if [ $# -ne 1 ]; then usage; fi

prep()
{
    cd alsa-driver
    echo "Pre-configuring alsa-driver"
    autoconf
    
    cd ../alsa-lib
    echo "Pre-configuring alsa-lib"
    aclocal
    automake --foreign
    autoconf
    
    echo "Pre-configuring alsa-utils"
    cd ../alsa-utils
    aclocal
    automake --foreign
    autoconf

    cd ..
}

config()
{
    cd alsa-driver
    ./configure ${EXTRA_ALSA_DRIVER_CONFIG_FLAGS}
    
    cd ../alsa-lib
    ./configure

    cd ../alsa-utils
    ./configure

    cd ..
}

domake()
{
    cd alsa-driver
    make $1
    
    cd ../alsa-lib
    make $1

    cd ../alsa-utils
    make $1

    cd ..
}

makeall()
{
    domake 
}

makeinstall()
{
    cd alsa-driver
    autoconf
    ./configure ${EXTRA_ALSA_DRIVER_CONFIG_FLAGS}
    make install

    cd ../alsa-lib
    aclocal
    automake --foreign
    autoconf
    ./configure
    make install
    
    cd ../alsa-utils
    aclocal
    automake --foreign
    autoconf
    ./configure
    make install
    cd ..
}

makeclean()
{
    domake clean
}

dorpm()
{
    cd $1/utils
    ./buildrpm
    cd ../..
}
    
makerpm()
{
    dorpm alsa-driver
    dorpm alsa-lib
    dorpm alsa-utils
}

case $1 in
    prep) prep;;
    config) config;;
    all) makeall;;
    install) makeinstall;;
    clean) makeclean;;
    rpms) makerpm;;
    *) usage;;
esac

