ALSA and SALSA install
Following on from thread 'Problems with ALSA in embedded device', running code such as aplay with both ALSA and SALSA libs.
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?
Thanks
Alan
At Thu, 6 Mar 2008 16:41:33 +0000,
Quoted 7 lines · Alan Horstmann
Following on from thread 'Problems with ALSA in embedded device', running code such as aplay with both ALSA and SALSA libs.
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?
Right now, no. SALSA-lib provides only the source-level API compatibility, not binary compatibility at all. The reason is that the binary-compatibility would expand the size of library greatly. As its name suggests, "small and spicy" is the advantage of SALSA :)
Of course, it'd be welcome if someone writes a patch to add the binary-compatibility feature, but it must be still optional.
BTW, I proposed SALSA in the last thread because a static library was in the question.
Takashi
Quoted 3 lines · Alan Horstmann
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.
HTH
Clemens
Quoted 9 lines · Clemens Ladisch
Quoted 3 lines · Alan Horstmann
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.
Alan
Quoted 6 lines · On Friday 07 March 2008 20:31, I wrote:
Quoted 5 lines · Clemens Ladisch
Quoted 3 lines · Alan Horstmann
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?
Quoted 6 lines
Quoted 3 lines
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?
Alan
Quoted 35 lines · On Monday 17 March 2008 22:43, I wrote:
Quoted 6 lines · Alan Horstmann
Quoted 5 lines · Clemens Ladisch
Quoted 3 lines · Alan Horstmann
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?
Quoted 6 lines
Quoted 3 lines
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> #endifThen on the gcc command line
... -D SALSA -lsalsa
builds with salsa, or... -lasoundwith 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
Quoted 8 lines
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.
Alan
configure renamed from configure-orig +10 -2
@@ -787,6 +787,7 @@ sharedstatedir localstatedir includedir +alsaincludedir oldincludedir docdir infodir
@@ -952,6 +953,7 @@ sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' +alsaincludedir='${prefix}/include/alsa' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info'
@@ -985,6 +987,10 @@ --) ac_dashdash=yes ;; + -alsaincludedir=* | --alsaincludedir=* | --alsaincludedi=* | --alsaincluded=* | --alsainclude=* \ + | --alsainclud=* | --alsainclu=* | --alsaincl=* | --alsainc=*) + alsaincludedir=$ac_optarg ;; + -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
@@ -1303,7 +1309,7 @@ # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + alsaincludedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var
@@ -1451,6 +1457,7 @@ For better control, use the options below. Fine tuning of the installation directories: + --alsaincludedir=DIR alsa C header files [PREFIX/include/alsa] --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec]
@@ -20594,6 +20601,7 @@ sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim +alsaincludedir!$alsaincludedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim
@@ -20674,7 +20682,7 @@ am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 98; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Makefile.in renamed from Makefile-orig.in +1 -1
@@ -191,6 +191,7 @@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ +alsaincludedir = @alsaincludedir@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@
@@ -241,7 +242,6 @@ $(am__append_2) $(am__append_3) $(am__append_4) \ $(am__append_5) $(am__append_6) libsalsa_la_LDFLAGS = -version-info 0:1:0 -alsaincludedir = $(includedir)/alsa alsainclude_HEADERS = asoundlib.h version.h recipe.h asound.h \ asoundef.h global.h input.h output.h error.h control.h \ ctl_types.h ctl_macros.h pcm.h pcm_types.h pcm_macros.h \
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel