Making buildable under OpenBSD.
authorDavid Carlier <devnexen@gmail.com>
Sat, 29 Oct 2016 15:20:32 +0000 (16:20 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 29 Nov 2016 13:18:46 +0000 (13:18 +0000)
libs/fst/scanner.cc
libs/midi++2/midi++/ipmidi_port.h
wscript

index 18f4048cbbbb26f1713c61693b4583ad9a2517c0..f6478bcb5f63f5d9ae482b145d1acf0e9d674d8f 100644 (file)
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 200809L
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index d870c79ef090d782d88addb3fc5babb5595488a3..8cefe09a40888c4506abdd48cd202e9c38ac071b 100644 (file)
 #include <iostream>
 #if defined(PLATFORM_WINDOWS)
 #include <winsock.h>
 #include <iostream>
 #if defined(PLATFORM_WINDOWS)
 #include <winsock.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
+#if defined(__FreeBSD__)
 #include <sys/_sockaddr_storage.h>
 #include <sys/_sockaddr_storage.h>
+#endif
 #include <arpa/inet.h>
 #include <netinet/ip_carp.h>
 #include <sys/types.h>
 #include <arpa/inet.h>
 #include <netinet/ip_carp.h>
 #include <sys/types.h>
diff --git a/wscript b/wscript
index dbc73417b20a51e6ba7fcf61ffb25cba3d974873..4b52f2b0ce93ddb9ec3b714d62e39d9021c636df 100644 (file)
--- a/wscript
+++ b/wscript
@@ -576,7 +576,7 @@ int main() { return 0; }''',
     if opt.stl_debug:
         cxx_flags.append("-D_GLIBCXX_DEBUG")
 
     if opt.stl_debug:
         cxx_flags.append("-D_GLIBCXX_DEBUG")
 
-    if re.search ("freebsd", sys.platform) != None:
+    if re.search ("freebsd", sys.platform) != None or re.search ("openbsd", sys.platform) != None:
         linker_flags.append('-lexecinfo')
 
     if conf.env['DEBUG_RT_ALLOC']:
         linker_flags.append('-lexecinfo')
 
     if conf.env['DEBUG_RT_ALLOC']:
@@ -959,7 +959,7 @@ def configure(conf):
 
     # executing a test program is n/a when cross-compiling
     if Options.options.dist_target != 'mingw':
 
     # executing a test program is n/a when cross-compiling
     if Options.options.dist_target != 'mingw':
-        if Options.options.dist_target != 'msvc':
+        if Options.options.dist_target != 'msvc' and re.search ("openbsd", sys.platform) == None:
             if re.search ("freebsd", sys.platform) != None:
                 conf.check_cc(function_name='dlopen', header_name='dlfcn.h', uselib_store='DL')
             else:
             if re.search ("freebsd", sys.platform) != None:
                 conf.check_cc(function_name='dlopen', header_name='dlfcn.h', uselib_store='DL')
             else:
@@ -974,6 +974,9 @@ def configure(conf):
     if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw':
         autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
 
     if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw':
         autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
 
+    if re.search ("openbsd", sys.platform) != None:
+        conf.env.append_value('LDFLAGS', '-L/usr/X11R6/lib')
+
     autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.28', mandatory=True)
     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2', mandatory=True)
     autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.32.0', mandatory=True)
     autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.28', mandatory=True)
     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2', mandatory=True)
     autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.32.0', mandatory=True)
@@ -1165,7 +1168,7 @@ int main () { return 0; }
 
     if sys.platform == 'darwin':
         sub_config_and_use(conf, 'libs/appleutility')
 
     if sys.platform == 'darwin':
         sub_config_and_use(conf, 'libs/appleutility')
-    elif Options.options.dist_target != 'mingw':
+    elif Options.options.dist_target != 'mingw' and re.search ("openbsd", sys.platform) == None:
         sub_config_and_use(conf, 'tools/sanity_check')
         sub_config_and_use(conf, 'tools/gccabicheck')
 
         sub_config_and_use(conf, 'tools/sanity_check')
         sub_config_and_use(conf, 'tools/gccabicheck')
 
@@ -1290,7 +1293,7 @@ def build(bld):
 
     if sys.platform == 'darwin':
         bld.recurse('libs/appleutility')
 
     if sys.platform == 'darwin':
         bld.recurse('libs/appleutility')
-    elif bld.env['build_target'] != 'mingw':
+    elif bld.env['build_target'] != 'mingw' and re.search ("openbsd", sys.platform) == None:
         bld.recurse('tools/sanity_check')
         bld.recurse('tools/gccabicheck')
 
         bld.recurse('tools/sanity_check')
         bld.recurse('tools/gccabicheck')