[alsa-devel] ALSA and SALSA install

Alan Horstmann gineera at aspect135.co.uk
Wed Mar 19 16:20:49 CET 2008

On Monday 17 March 2008 22:43, I wrote:
> On Friday 07 March 2008 20:31, Alan Horstmann wrote:
> > On Thursday 06 March 2008 16:46, Clemens Ladisch wrote:
> > > Alan Horstmann wrote:
> > > > Is there a way to install both at the same time, so on a PC code can
> > > > be compiled and experimented with first -lasound and then -lsalsa
> > > > without alternately re-installing the libraries with make install?
> > >
> > > It should be possible to install salsa-lib into another directory (by
> > > using the *prefix configure options) and then to change the include
> > > and library paths when compiling the program that uses it.
> >
> > Thanks, that is the sort of thing I had hoped was possible; will try that
> > at the next opportunity.
> Just to tidy off this thread, here's what I have done to achieve this.  (I
> know it's not rocket science!)  The problem is actually with the headers,
> not the library, as both libs exist in /usr/lib.
> First I manually created the salsa headers seperately in
> /usr/include/salsa. Then in the code put:
> 	#ifdef SALSA
> 	#include <salsa/asoundlib.h>
> 	#else
> 	#include <alsa/asoundlib.h>
> 	#endif
> Then on the gcc command line
> 	... -D SALSA -lsalsa
> builds with salsa, or
> 	... -lasound
> with standard Alsa.  Is this all OK?
> The salsa standard install prefixes etc seemed to always put the headers
> under a alsa/ subdirectory.  By editing salsa-lib..../src/Makefile.in
> 	L244    alsaincludedir = $(includedir)/salsa
> the headers are put in usr/include/salsa.
> I think the option of automatically installing salsa headers as above (ie /
> usr/include/salsa/asoundlib.h, etc) would be useful but it doesn't seem
> that the value of 'alsaincludedir' can be set as a configure option.  Might
> it be worth adding it so
> 	./configure --alsaincludedir=...
> is available?

Well, I had a go at this just for interest, guessing at how to alter configure 
script and src/Makefile.in though I have little idea how they work.  In case 
the principle is of any interest, the 2 attached patches enable the salsa 
include sub-directory to be set by configure option '--alsaincludedir=', 
otherwise it is (includedir)/alsa.  In my case the reason is to be able to 
put it in (includedir)/salsa so the headers are separate.  The patches are 
from 0.0.14 but apply to 0.0.17 OK.

I am sure the alterations are not complete, and perhaps the variable should be 
renamed 'salsaincludedir' in this case, but that won't matter unless there is 
any interest in adding this option.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: salsa-lib-configure-alsainclude.diff
Type: text/x-diff
Size: 2274 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20080319/be2d8257/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: salsa-lib-srcMakefile-alsainclude.diff
Type: text/x-diff
Size: 706 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20080319/be2d8257/attachment-0001.bin 

More information about the Alsa-devel mailing list