summaryrefslogtreecommitdiff
path: root/audio/csound5/patches/patch-am
blob: abc3fdf3966f2bda4b112357489a186544f4bc32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$NetBSD: patch-am,v 1.2 2006/05/29 19:44:24 joerg Exp $

--- Top/csmodule.c.orig	2006-03-08 15:13:15.000000000 -0800
+++ Top/csmodule.c
@@ -78,7 +78,7 @@
 #include "csoundCore.h"
 #include "csmodule.h"
 
-#if defined(LINUX)
+#if defined(LINUX) || defined(__NetBSD__) || defined(__DragonFly__)
 #include <dlfcn.h>
 #elif defined(WIN32)
 #include <windows.h>
@@ -121,7 +121,7 @@ static  const   char    *plugindir_envva
 static  const   char    *plugindir64_envvar = "OPCODEDIR64";
 
 /* default directory to load plugins from if environment variable is not set */
-#if !(defined(_CSOUND_RELEASE_) && (defined(LINUX) || defined(__MACH__)))
+#if !(defined(_CSOUND_RELEASE_) && (defined(LINUX) || defined(__MACH__) || defined(__NetBSD__) || defined(__DragonFly__)))
 #  define ENABLE_OPCODEDIR_WARNINGS 1
 #  ifdef CS_DEFAULT_PLUGINDIR
 #    undef CS_DEFAULT_PLUGINDIR
@@ -131,9 +131,9 @@ static  const   char    *plugindir64_env
 #  define ENABLE_OPCODEDIR_WARNINGS 0
 #  ifndef CS_DEFAULT_PLUGINDIR
 #    ifndef USE_DOUBLE
-#      define CS_DEFAULT_PLUGINDIR  "/usr/local/lib/csound/plugins"
+#      define CS_DEFAULT_PLUGINDIR  __PKGSRC_PREFIX__ "lib/csound5/plugins"
 #    else
-#      define CS_DEFAULT_PLUGINDIR  "/usr/local/lib/csound/plugins64"
+#      define CS_DEFAULT_PLUGINDIR  __PKGSRC_PREFIX__ "lib/csound5/plugins64"
 #    endif
 #  endif
 #endif
@@ -225,7 +225,7 @@ static CS_NOINLINE int csoundLoadExterna
     /* load library */
     err = csound->OpenLibrary(&h, libraryPath);
     if (err) {
-#if defined(BETA) && defined(LINUX)
+#if defined(BETA) && (defined(LINUX) || defined(__NetBSD__) || defined(__DragonFly__))
       csound->Warning(csound, "%s", dlerror());
 #endif
       csound->Warning(csound, Str("could not open library '%s' (%d)"),
@@ -591,7 +591,7 @@ PUBLIC void *csoundGetLibrarySymbol(void
     return (void*) GetProcAddress((HMODULE) library, procedureName);
 }
 
-#elif defined(LINUX)
+#elif defined(LINUX) || defined(__NetBSD__) || defined(__DragonFly__)
 
 PUBLIC int csoundOpenLibrary(void **library, const char *libraryPath)
 {