In order to get libcanberra to build on Solaris, I had to apply the attached patch.
- Note that the src/Makefile.am is hardcoded to include some GCC specific options. This part of the patch is probably not ready to go upstream. Might be better to check whether GCC is being used in configure, and then only add the map-file stuff to LDFLAGS when GCC is actually being used. The following parts of the patch I think can go upstream: - In order for var-args stuff to build on Solaris, it is necessary to add "#include <varargs.h>" to src/common.h - Solaris doesn't have strndup, so the attached patch adds it to src/sound-theme-spec.c if it isn't already defined. Brian
--- libcanberra-0.6/src/Makefile.am-orig 2008-08-14 13:06:45.705560000 -0500 +++ libcanberra-0.6/src/Makefile.am 2008-08-14 13:08:01.465327000 -0500 @@ -59,9 +59,7 @@ libcanberra_la_CFLAGS = \ libcanberra_la_LIBADD = \ $(VORBIS_LIBS) libcanberra_la_LDFLAGS = \ - -export-dynamic \ - -version-info $(LIBCANBERRA_VERSION_INFO) \ - -Wl,-version-script=$(srcdir)/map-file + -export-dynamic plugin_LTLIBRARIES = @@ -215,7 +213,7 @@ libcanberra_gtk_la_LIBADD = \ $(GTK_LIBS) \ libcanberra.la libcanberra_gtk_la_LDFLAGS = \ - -export-dynamic -version-info $(LIBCANBERRA_GTK_VERSION_INFO) + -export-dynamic $(LIBCANBERRA_GTK_VERSION_INFO) libcanberra_gtk_module_la_SOURCES = \ canberra-gtk-module.c --- libcanberra-0.6/src/common.h-orig 2008-08-14 13:00:23.334879000 -0500 +++ libcanberra-0.6/src/common.h 2008-08-14 13:06:24.572488000 -0500 @@ -21,6 +21,8 @@ <http://www.gnu.org/licenses/>. ***/ +#include <varargs.h> + #include "canberra.h" #include "macro.h" #include "mutex.h" --- libcanberra-0.6/src/sound-theme-spec.c-orig 2008-08-14 13:18:10.752437000 -0500 +++ libcanberra-0.6/src/sound-theme-spec.c 2008-08-14 13:15:04.375888000 -0500 @@ -36,6 +36,28 @@ #define DEFAULT_OUTPUT_PROFILE "stereo" #define N_THEME_DIR_MAX 8 +#ifndef strndup +static char *strndup (const char *s, size_t n) +{ + size_t length; + char *ret; + + if (!s) + return 0; + + if (strlen(s)+1 < n+1) + length = strlen(s)+1; + else + length = n+1; + + ret = malloc (length * sizeof (char)); + + memcpy (ret, s, length); + ret[length-1] = '\0'; + return ret; +} +#endif + typedef struct ca_data_dir ca_data_dir; struct ca_data_dir {
_______________________________________________ libcanberra-discuss mailing list [email protected] https://tango.0pointer.de/mailman/listinfo/libcanberra-discuss
