summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSASANO Takayoshi <uaa@uaa.org.uk>2022-07-13 21:36:59 +0900
committerJaroslav Kysela <perex@perex.cz>2022-10-17 13:11:47 +0200
commit60c1430b43a0e8f3fcf1a3402dc0a9b2060d9a9c (patch)
tree68e80e326bec37476ce970ea043dca22db02e914
parentf89245ee662cda4c56c0422dc634cc1a07188b05 (diff)
downloadalsa-lib-60c1430b43a0e8f3fcf1a3402dc0a9b2060d9a9c.tar.gz
add DragonFlyBSD build support (except test/)
due to undefined reference to 'environ' error, ucm_exec.c uses workaround. Fixes: https://github.com/alsa-project/alsa-lib/pull/250 Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--src/conf.c2
-rw-r--r--src/pcm/pcm_direct.c2
-rw-r--r--src/ucm/parser.c2
-rw-r--r--src/ucm/ucm_exec.c6
4 files changed, 8 insertions, 4 deletions
diff --git a/src/conf.c b/src/conf.c
index 029a0db4..eb38c344 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -4115,7 +4115,7 @@ static int config_file_load(snd_config_t *root, const char *fn, int errors)
if (!S_ISDIR(st.st_mode))
return config_file_open(root, fn);
#ifndef DOC_HIDDEN
-#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sun) && !defined(ANDROID)
+#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) && !defined(__sun) && !defined(ANDROID)
#define SORTFUNC versionsort64
#else
#define SORTFUNC alphasort64
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index c16956f1..4803b81b 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -44,7 +44,7 @@
*
*/
-#if !defined(__OpenBSD__)
+#if !defined(__OpenBSD__) && !defined(__DragonFly__)
union semun {
int val; /* Value for SETVAL */
struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */
diff --git a/src/ucm/parser.c b/src/ucm/parser.c
index 56d67e50..f7c0b527 100644
--- a/src/ucm/parser.c
+++ b/src/ucm/parser.c
@@ -2907,7 +2907,7 @@ int uc_mgr_scan_master_configs(const char **_list[])
snprintf(filename, sizeof(filename), "%s/ucm2/conf.virt.d",
snd_config_topdir());
-#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sun) && !defined(ANDROID)
+#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) && !defined(__sun) && !defined(ANDROID)
#define SORTFUNC versionsort64
#else
#define SORTFUNC alphasort64
diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c
index 500a3b13..276cf592 100644
--- a/src/ucm/ucm_exec.c
+++ b/src/ucm/ucm_exec.c
@@ -33,10 +33,14 @@
#include <limits.h>
#include <dirent.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
#include <signal.h>
+#if defined(__DragonFly__)
+#define environ NULL /* XXX */
+#else
extern char **environ;
#endif
+#endif
static pthread_mutex_t fork_lock = PTHREAD_MUTEX_INITIALIZER;