Index: jackd2-1.9.22~dfsg/common/JackMetadata.cpp
===================================================================
--- jackd2-1.9.22~dfsg.orig/common/JackMetadata.cpp
+++ jackd2-1.9.22~dfsg/common/JackMetadata.cpp
@@ -55,7 +55,7 @@ JackMetadata::JackMetadata(bool isEngine
 JackMetadata::~JackMetadata()
 {
 #if HAVE_DB
-    char dbpath[PATH_MAX + 1];
+    char dbpath[JACK_PATH_MAX + 1];
 
     if (fDB) {
         fDB->close (fDB, 0);
@@ -93,16 +93,16 @@ int JackMetadata::PropertyInit()
 #if HAVE_DB
 
     int ret;
-    char dbpath[PATH_MAX + 1];
+    char dbpath[JACK_PATH_MAX + 1];
 
 #ifdef WIN32
-    ret = GetTempPathA (PATH_MAX, fDBFilesDir);
-    if ((ret > PATH_MAX) || (ret == 0)) {
+    ret = GetTempPathA (JACK_PATH_MAX, fDBFilesDir);
+    if ((ret > JACK_PATH_MAX) || (ret == 0)) {
         jack_error ("cannot get path for temp files");
         return -1;
     }
 #else
-    strncpy (fDBFilesDir, jack_server_dir, PATH_MAX);
+    strncpy (fDBFilesDir, jack_server_dir, JACK_PATH_MAX);
 #endif
 
     /* idempotent */
Index: jackd2-1.9.22~dfsg/common/wscript
===================================================================
--- jackd2-1.9.22~dfsg.orig/common/wscript
+++ jackd2-1.9.22~dfsg/common/wscript
@@ -31,6 +31,8 @@ def create_jack_process_obj(bld, target,
         env_includes = ['../macosx', '../posix', '../macosx/coreaudio']
     if bld.env['IS_LINUX']:
         env_includes = ['../linux', '../posix', '../linux/alsa']
+    if bld.env['IS_HURD']:
+        env_includes = ['../gnu', '../posix', '../solaris/oss']
     if bld.env['IS_FREEBSD']:
         env_includes = ['../freebsd', '../posix', '../solaris/oss']
     if bld.env['IS_SUN']:
@@ -41,7 +43,7 @@ def create_jack_process_obj(bld, target,
     process.name = target
     process.target = target
     process.source = sources
-    if bld.env['IS_LINUX'] or bld.env['IS_MACOSX'] or bld.env['IS_FREEBSD']:
+    if bld.env['IS_LINUX'] or bld.env['IS_MACOSX'] or bld.env['IS_FREEBSD'] or bld.env['IS_HURD']:
         process.env.append_value('CPPFLAGS', '-fvisibility=hidden')
     process.install_path = '${ADDON_DIR}/'
     process.use = [uselib.name]
@@ -98,6 +100,20 @@ def build(bld):
         uselib.append('RT')
         uselib.append('DL')
 
+    if bld.env['IS_HURD']:
+        common_libsources += [
+            'JackDebugClient.cpp',
+            'timestamps.c',
+            'promiscuous.c',
+            '../posix/JackPosixThread.cpp',
+            '../posix/JackPosixProcessSync.cpp',
+            '../posix/JackPosixMutex.cpp',
+            '../posix/JackPosixSemaphore.cpp',
+            '../posix/JackSocket.cpp',
+            '../posix/JackPosixTime.c',
+            ]
+        includes = ['../gnu', '../posix'] + includes
+
     if bld.env['IS_FREEBSD']:
         common_libsources += [
             'JackDebugClient.cpp',
@@ -197,6 +213,12 @@ def build(bld):
             '../posix/JackPosixServerLaunch.cpp',
             ]
 
+    if bld.env['IS_HURD']:
+        clientlib.source += [
+            '../posix/JackSocketClientChannel.cpp',
+            '../posix/JackPosixServerLaunch.cpp',
+            ]
+
     if bld.env['IS_FREEBSD']:
         clientlib.source += [
             '../posix/JackSocketClientChannel.cpp',
@@ -232,6 +254,9 @@ def build(bld):
     if bld.env['IS_LINUX']:
         clientlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
 
+    if bld.env['IS_HURD']:
+        clientlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
+
     if bld.env['IS_FREEBSD']:
         clientlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
 
@@ -311,6 +336,14 @@ def build(bld):
             '../posix/JackNetUnixSocket.cpp',
             ]
 
+    if bld.env['IS_HURD']:
+        serverlib.source += [
+            '../posix/JackSocketServerChannel.cpp',
+            '../posix/JackSocketNotifyChannel.cpp',
+            '../posix/JackSocketServerNotifyChannel.cpp',
+            '../posix/JackNetUnixSocket.cpp',
+            ]
+
     if bld.env['IS_FREEBSD']:
         serverlib.source += [
             '../posix/JackSocketServerChannel.cpp',
@@ -403,6 +436,15 @@ def build(bld):
             ]
             netlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
 
+        if bld.env['IS_HURD']:
+            netlib.source += [
+                '../posix/JackNetUnixSocket.cpp',
+                '../posix/JackPosixThread.cpp',
+                '../posix/JackPosixMutex.cpp',
+                '../linux/JackLinuxTime.c',
+            ]
+            netlib.env.append_value('CPPFLAGS', '-fvisibility=hidden')
+
         if bld.env['IS_FREEBSD']:
             netlib.source += [
                 '../posix/JackNetUnixSocket.cpp',
@@ -490,7 +532,7 @@ def build(bld):
         process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib)
         process.use += ['ALSA', 'SAMPLERATE']
 
-    if bld.env['BUILD_ADAPTER'] and (bld.env['IS_SUN'] or bld.env['IS_FREEBSD']):
+    if bld.env['BUILD_ADAPTER'] and (bld.env['IS_SUN'] or bld.env['IS_FREEBSD'] or bld.env['IS_HURD']):
         audio_adapter_sources += ['../solaris/oss/JackOSSAdapter.cpp', 'memops.c']
         process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib)
         process.use += 'SAMPLERATE'
Index: jackd2-1.9.22~dfsg/dbus/wscript
===================================================================
--- jackd2-1.9.22~dfsg.orig/dbus/wscript
+++ jackd2-1.9.22~dfsg/dbus/wscript
@@ -51,6 +51,8 @@ def build(bld):
     obj = bld(features=['c', 'cprogram'], idx=17)
     if bld.env['IS_LINUX']:
         sysdeps_dbus_include = ['../linux', '../posix']
+    if bld.env['IS_HURD']:
+        sysdeps_dbus_include = ['../gnu', '../posix']
     if bld.env['IS_FREEBSD']:
         sysdeps_dbus_include = ['../freebsd', '../posix']
     if bld.env['IS_MACOSX']:
@@ -80,6 +82,11 @@ def build(bld):
             '../linux/uptime.c',
         ]
         obj.use += ['PTHREAD', 'DL', 'RT', 'DBUS-1', 'EXPAT', 'STDC++']
+    if bld.env['IS_HURD']:
+        obj.source += [
+            '../linux/uptime.c',
+        ]
+        obj.use += ['PTHREAD', 'DBUS-1', 'EXPAT']
     if bld.env['IS_FREEBSD']:
         obj.source += [
             '../linux/uptime.c',
Index: jackd2-1.9.22~dfsg/wscript
===================================================================
--- jackd2-1.9.22~dfsg.orig/wscript
+++ jackd2-1.9.22~dfsg/wscript
@@ -213,7 +213,8 @@ def detect_platform(conf):
     # GNU/kFreeBSD and GNU/Hurd are treated as Linux
     platforms = [
         # ('KEY, 'Human readable name', ['strings', 'to', 'check', 'for'])
-        ('IS_LINUX',   'Linux',   ['gnu0', 'gnukfreebsd', 'linux', 'posix']),
+        ('IS_LINUX',   'Linux',   ['gnukfreebsd', 'linux', 'posix']),
+        ('IS_HURD',    'GNU/Hurd',['gnu0']),
         ('IS_FREEBSD', 'FreeBSD', ['freebsd']),
         ('IS_MACOSX',  'MacOS X', ['darwin']),
         ('IS_SUN',     'SunOS',   ['sunos']),
@@ -537,6 +538,9 @@ def obj_add_includes(bld, obj):
     if bld.env['IS_LINUX']:
         obj.includes += ['linux', 'posix']
 
+    if bld.env['IS_HURD']:
+        obj.includes += ['gnu', 'posix']
+
     if bld.env['IS_FREEBSD']:
         obj.includes += ['freebsd', 'posix']
 
@@ -568,6 +572,9 @@ def build_jackd(bld):
     if bld.env['IS_LINUX']:
         jackd.use += ['DL', 'M', 'PTHREAD', 'RT', 'STDC++']
 
+    if bld.env['IS_HURD']:
+        jackd.use += ['DL', 'M', 'PTHREAD', 'RT', 'STDC++']
+
     if bld.env['IS_FREEBSD']:
         jackd.use += ['M', 'PTHREAD']
 
@@ -796,6 +803,12 @@ def build_drivers(bld):
             use=['serverlib'],  # FIXME: Is this needed?
             framework=['AudioUnit', 'CoreMIDI', 'CoreServices', 'Foundation'])
 
+    if bld.env['IS_HURD']:
+        create_driver_obj(
+            bld,
+            target='oss',
+            source=oss_src)
+
     if bld.env['IS_FREEBSD']:
         create_driver_obj(
             bld,
@@ -831,8 +844,9 @@ def build(bld):
 
     build_drivers(bld)
 
-    if bld.env['IS_LINUX'] or bld.env['IS_FREEBSD']:
+    if bld.env['IS_LINUX'] or bld.env['IS_HURD'] or bld.env['IS_FREEBSD']:
         bld.recurse('man')
+    if bld.env['IS_LINUX'] or bld.env['IS_FREEBSD']:
         bld.recurse('systemd')
     if not bld.env['IS_WINDOWS'] and bld.env['BUILD_TESTS']:
         bld.recurse('tests')
Index: jackd2-1.9.22~dfsg/tests/wscript
===================================================================
--- jackd2-1.9.22~dfsg.orig/tests/wscript
+++ jackd2-1.9.22~dfsg/tests/wscript
@@ -21,6 +21,8 @@ def build(bld):
             prog.includes = ['..', '../macosx', '../posix', '../common/jack', '../common']
         if bld.env['IS_LINUX']:
             prog.includes = ['..', '../linux', '../posix', '../common/jack', '../common']
+        if bld.env['IS_HURD']:
+            prog.includes = ['..', '../gnu', '../posix', '../common/jack', '../common']
         if bld.env['IS_FREEBSD']:
             prog.includes = ['..', '../freebsd', '../posix', '../common/jack', '../common']
         if bld.env['IS_SUN']:
Index: jackd2-1.9.22~dfsg/gnu/JackPlatformPlug_os.h
===================================================================
--- /dev/null
+++ jackd2-1.9.22~dfsg/gnu/JackPlatformPlug_os.h
@@ -0,0 +1,85 @@
+/*
+Copyright (C) 2004-2008 Grame
+Copyright (C) 2018 Greg V
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; if not, write to the Free Software 
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef __JackPlatformPlug_gnu__
+#define __JackPlatformPlug_gnu__
+
+#define jack_server_dir "/tmp"
+#define jack_client_dir "/tmp"
+#define JACK_DEFAULT_DRIVER "oss"
+
+namespace Jack
+{
+    struct JackRequest;
+    struct JackResult;
+
+    class JackPosixMutex;
+    class JackPosixThread;
+    class JackPosixSemaphore;
+
+    class JackSocketServerChannel;
+    class JackSocketClientChannel;
+    class JackSocketServerNotifyChannel;
+    class JackSocketNotifyChannel;
+    class JackClientSocket;
+    class JackNetUnixSocket;
+}
+
+/* __JackPlatformMutex__ */
+#include "JackPosixMutex.h"
+namespace Jack {typedef JackPosixMutex JackMutex; }
+
+/* __JackPlatformThread__ */
+#include "JackPosixThread.h"
+namespace Jack { typedef JackPosixThread JackThread; }
+
+/* __JackPlatformSynchro__  client activation */
+#include "JackPosixSemaphore.h"
+namespace Jack { typedef JackPosixSemaphore JackSynchro; }
+
+/* __JackPlatformChannelTransaction__ */
+#include "JackSocket.h"
+namespace Jack { typedef JackClientSocket JackChannelTransaction; }
+
+/* __JackPlatformProcessSync__ */
+#include "JackPosixProcessSync.h"
+namespace Jack { typedef JackPosixProcessSync JackProcessSync; }
+
+/* __JackPlatformServerChannel__ */ 
+#include "JackSocketServerChannel.h"
+namespace Jack { typedef JackSocketServerChannel JackServerChannel; }
+
+/* __JackPlatformClientChannel__ */
+#include "JackSocketClientChannel.h"
+namespace Jack { typedef JackSocketClientChannel JackClientChannel; }
+
+/* __JackPlatformServerNotifyChannel__ */
+#include "JackSocketServerNotifyChannel.h"
+namespace Jack { typedef JackSocketServerNotifyChannel JackServerNotifyChannel; }
+
+/* __JackPlatformNotifyChannel__ */
+#include "JackSocketNotifyChannel.h"
+namespace Jack { typedef JackSocketNotifyChannel JackNotifyChannel; }
+
+/* __JackPlatformNetSocket__ */
+#include "JackNetUnixSocket.h"
+namespace Jack { typedef JackNetUnixSocket JackNetSocket; }
+
+#endif
Index: jackd2-1.9.22~dfsg/gnu/driver.h
===================================================================
--- /dev/null
+++ jackd2-1.9.22~dfsg/gnu/driver.h
@@ -0,0 +1 @@
+#include "../linux/driver.h"
Index: jackd2-1.9.22~dfsg/gnu/uptime.h
===================================================================
--- /dev/null
+++ jackd2-1.9.22~dfsg/gnu/uptime.h
@@ -0,0 +1 @@
+#include "../linux/uptime.h"
Index: jackd2-1.9.22~dfsg/gnu/JackAtomic_os.h
===================================================================
--- /dev/null
+++ jackd2-1.9.22~dfsg/gnu/JackAtomic_os.h
@@ -0,0 +1,32 @@
+
+/*
+Copyright (C) 2004-2008 Grame
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef __JackAtomic_gnu__
+#define __JackAtomic_gnu__
+
+#include "JackTypes.h"
+
+static inline char CAS(volatile UInt32 value, UInt32 newvalue, volatile void* addr)
+{
+    return __sync_bool_compare_and_swap ((UInt32*)addr, value, newvalue);
+}
+
+#endif
+
Index: jackd2-1.9.22~dfsg/common/JackMetadata.h
===================================================================
--- jackd2-1.9.22~dfsg.orig/common/JackMetadata.h
+++ jackd2-1.9.22~dfsg/common/JackMetadata.h
@@ -39,6 +39,8 @@
 
 #include <jack/uuid.h>
 
+#include "driver_interface.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -89,7 +91,7 @@ class JackMetadata
         DB* fDB;
         DB_ENV* fDBenv;
         const bool fIsEngine;
-        char fDBFilesDir[PATH_MAX + 1];
+        char fDBFilesDir[JACK_PATH_MAX + 1];
     #endif
 
         int PropertyInit();
Index: jackd2-1.9.22~dfsg/solaris/oss/JackOSSAdapter.cpp
===================================================================
--- jackd2-1.9.22~dfsg.orig/solaris/oss/JackOSSAdapter.cpp
+++ jackd2-1.9.22~dfsg/solaris/oss/JackOSSAdapter.cpp
@@ -87,14 +87,18 @@ void JackOSSAdapter::SetSampleFormat()
 {
     switch (fBits) {
 
+#ifdef AFMT_S24_NE
 	    case 24:	/* native-endian LSB aligned 24-bits in 32-bits  integer */
             fSampleFormat = AFMT_S24_NE;
             fSampleSize = sizeof(int);
 			break;
+#endif
+#ifdef AFMT_S32_NE
 		case 32:	/* native-endian 32-bit integer */
             fSampleFormat = AFMT_S32_NE;
             fSampleSize = sizeof(int);
 			break;
+#endif
 		case 16:	/* native-endian 16-bit integer */
 		default:
             fSampleFormat = AFMT_S16_NE;
@@ -197,7 +201,9 @@ JackOSSAdapter::JackOSSAdapter(jack_nfra
 void JackOSSAdapter::DisplayDeviceInfo()
 {
     audio_buf_info info;
+#ifdef SNDCTL_AUDIOINFO
     oss_audioinfo ai_in, ai_out;
+#endif
     memset(&info, 0, sizeof(audio_buf_info));
     int cap = 0;
 
@@ -208,6 +214,7 @@ void JackOSSAdapter::DisplayDeviceInfo()
 
     if (fRWMode & kWrite) {
 
+#ifdef OSS_SYSINFO
        oss_sysinfo si;
         if (ioctl(fOutFD, OSS_SYSINFO, &si) == -1) {
             jack_error("JackOSSAdapter::DisplayDeviceInfo OSS_SYSINFO failed : %s@%i, errno = %d", __FILE__, __LINE__, errno);
@@ -219,6 +226,7 @@ void JackOSSAdapter::DisplayDeviceInfo()
             jack_info("OSS numaudioengines %d", si.numaudioengines);
             jack_info("OSS numcards %d", si.numcards);
         }
+#endif
 
         jack_info("Output capabilities - %d channels : ", fPlaybackChannels);
         jack_info("Output block size = %d", fOutputBufferSize);
@@ -246,6 +254,7 @@ void JackOSSAdapter::DisplayDeviceInfo()
 
     if (fRWMode & kRead) {
 
+#ifdef OSS_SYSINFO
         oss_sysinfo si;
         if (ioctl(fInFD, OSS_SYSINFO, &si) == -1) {
             jack_error("JackOSSAdapter::DisplayDeviceInfo OSS_SYSINFO failed : %s@%i, errno = %d", __FILE__, __LINE__, errno);
@@ -257,6 +266,7 @@ void JackOSSAdapter::DisplayDeviceInfo()
             jack_info("OSS numaudioengines %d", si.numaudioengines);
             jack_info("OSS numcards %d", si.numcards);
         }
+#endif
 
         jack_info("Input capabilities - %d channels : ", fCaptureChannels);
         jack_info("Input block size = %d", fInputBufferSize);
@@ -282,6 +292,7 @@ void JackOSSAdapter::DisplayDeviceInfo()
         }
     }
 
+#ifdef SNDCTL_AUDIOINFO
     if (ioctl(fInFD, SNDCTL_AUDIOINFO, &ai_in) != -1) {
         jack_info("Using audio engine %d = %s for input", ai_in.dev, ai_in.name);
     }
@@ -293,6 +304,7 @@ void JackOSSAdapter::DisplayDeviceInfo()
     if (ai_in.rate_source != ai_out.rate_source) {
         jack_info("Warning : input and output are not necessarily driven by the same clock!");
     }
+#endif
 }
 
 int JackOSSAdapter::OpenInput()
@@ -310,10 +322,15 @@ int JackOSSAdapter::OpenInput()
     }
 
     if (fExcl) {
+#ifdef SNDCTL_DSP_COOKEDMODE
         if (ioctl(fInFD, SNDCTL_DSP_COOKEDMODE, &flags) == -1) {
             jack_error("JackOSSAdapter::OpenInput failed to set cooked mode : %s@%i, errno = %d", __FILE__, __LINE__, errno);
             goto error;
         }
+#else
+            jack_error("JackOSSAdapter::OpenInput failed to set cooked mode : not supported");
+            goto error;
+#endif
     }
 
     gFragFormat = (2 << 16) + int2pow2(fAdaptedBufferSize * fSampleSize * fCaptureChannels);
@@ -396,10 +413,15 @@ int JackOSSAdapter::OpenOutput()
     }
 
     if (fExcl) {
+#ifdef SNDCTL_DSP_COOKEDMODE
         if (ioctl(fOutFD, SNDCTL_DSP_COOKEDMODE, &flags) == -1) {
             jack_error("JackOSSAdapter::OpenOutput failed to set cooked mode : %s@%i, errno = %d", __FILE__, __LINE__, errno);
             goto error;
         }
+#else
+	jack_error("JackOSSAdapter::OpenOutput failed to set cooked mode : not supported");
+	goto error;
+#endif
     }
 
     gFragFormat = (2 << 16) + int2pow2(fAdaptedBufferSize * fSampleSize * fPlaybackChannels);
Index: jackd2-1.9.22~dfsg/common/JackAudioAdapterFactory.cpp
===================================================================
--- jackd2-1.9.22~dfsg.orig/common/JackAudioAdapterFactory.cpp
+++ jackd2-1.9.22~dfsg/common/JackAudioAdapterFactory.cpp
@@ -35,7 +35,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg
 #define JackPlatformAdapter JackAlsaAdapter
 #endif
 
-#if defined(__sun__) || defined(sun) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__sun__) || defined(sun) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
 #include "JackOSSAdapter.h"
 #define JackPlatformAdapter JackOSSAdapter
 #endif
Index: jackd2-1.9.22~dfsg/solaris/oss/JackOSSDriver.cpp
===================================================================
--- jackd2-1.9.22~dfsg.orig/solaris/oss/JackOSSDriver.cpp
+++ jackd2-1.9.22~dfsg/solaris/oss/JackOSSDriver.cpp
@@ -121,14 +121,18 @@ void JackOSSDriver::SetSampleFormat()
 {
     switch (fBits) {
 
+#ifdef AFMT_S24_NE
 	    case 24:	/* native-endian LSB aligned 24-bits in 32-bits integer */
             fSampleFormat = AFMT_S24_NE;
             fSampleSize = sizeof(int);
 			break;
+#endif
+#ifdef AFMT_S32_NE
 		case 32:	/* native-endian 32-bit integer */
             fSampleFormat = AFMT_S32_NE;
             fSampleSize = sizeof(int);
 			break;
+#endif
 		case 16:	/* native-endian 16-bit integer */
 		default:
             fSampleFormat = AFMT_S16_NE;
@@ -140,7 +144,9 @@ void JackOSSDriver::SetSampleFormat()
 void JackOSSDriver::DisplayDeviceInfo()
 {
     audio_buf_info info;
+#ifdef SNDCTL_AUDIOINFO
     oss_audioinfo ai_in, ai_out;
+#endif
     memset(&info, 0, sizeof(audio_buf_info));
     int cap = 0;
 
@@ -150,6 +156,7 @@ void JackOSSDriver::DisplayDeviceInfo()
 
     if (fRWMode & kWrite) {
 
+#ifdef OSS_SYSINFO
         oss_sysinfo si;
         if (ioctl(fOutFD, OSS_SYSINFO, &si) == -1) {
             jack_error("JackOSSDriver::DisplayDeviceInfo OSS_SYSINFO failed : %s@%i, errno = %d", __FILE__, __LINE__, errno);
@@ -160,7 +167,9 @@ void JackOSSDriver::DisplayDeviceInfo()
             jack_info("OSS numaudios %d", si.numaudios);
             jack_info("OSS numaudioengines %d", si.numaudioengines);
             jack_info("OSS numcards %d", si.numcards);
+
         }
+#endif
 
         jack_info("Output capabilities - %d channels : ", fPlaybackChannels);
         jack_info("Output block size = %d", fOutputBufferSize);
@@ -188,6 +197,7 @@ void JackOSSDriver::DisplayDeviceInfo()
 
     if (fRWMode & kRead) {
 
+#ifdef OSS_SYSINFO
       	oss_sysinfo si;
         if (ioctl(fInFD, OSS_SYSINFO, &si) == -1) {
             jack_error("JackOSSDriver::DisplayDeviceInfo OSS_SYSINFO failed : %s@%i, errno = %d", __FILE__, __LINE__, errno);
@@ -199,6 +209,7 @@ void JackOSSDriver::DisplayDeviceInfo()
             jack_info("OSS numaudioengines %d", si.numaudioengines);
             jack_info("OSS numcards %d", si.numcards);
         }
+#endif
 
         jack_info("Input capabilities - %d channels : ", fCaptureChannels);
         jack_info("Input block size = %d", fInputBufferSize);
@@ -224,9 +235,11 @@ void JackOSSDriver::DisplayDeviceInfo()
         }
     }
 
+#ifdef SNDCTL_AUDIOINFO
     if (ai_in.rate_source != ai_out.rate_source) {
         jack_info("Warning : input and output are not necessarily driven by the same clock!");
     }
+#endif
 }
 
 int JackOSSDriver::OpenInput()
@@ -247,10 +260,15 @@ int JackOSSDriver::OpenInput()
     jack_log("JackOSSDriver::OpenInput input fInFD = %d", fInFD);
 
     if (fExcl) {
+#ifdef SNDCTL_DSP_COOKEDMODE
         if (ioctl(fInFD, SNDCTL_DSP_COOKEDMODE, &flags) == -1) {
             jack_error("JackOSSDriver::OpenInput failed to set cooked mode : %s@%i, errno = %d", __FILE__, __LINE__, errno);
             goto error;
         }
+#else
+        jack_error("JackOSSDriver::OpenInput failed to set cooked mode : not supported");
+        goto error;
+#endif
     }
 
     gFragFormat = (2 << 16) + int2pow2(fEngineControl->fBufferSize * fSampleSize * fCaptureChannels);
@@ -330,10 +348,15 @@ int JackOSSDriver::OpenOutput()
     jack_log("JackOSSDriver::OpenOutput output fOutFD = %d", fOutFD);
 
     if (fExcl) {
+#ifdef SNDCTL_DSP_COOKEDMODE
         if (ioctl(fOutFD, SNDCTL_DSP_COOKEDMODE, &flags) == -1) {
             jack_error("JackOSSDriver::OpenOutput failed to set cooked mode : %s@%i, errno = %d", __FILE__, __LINE__, errno);
             goto error;
         }
+#else
+        jack_error("JackOSSDriver::OpenInput failed to set cooked mode : not supported");
+        goto error;
+#endif
     }
 
     gFragFormat = (2 << 16) + int2pow2(fEngineControl->fBufferSize * fSampleSize * fPlaybackChannels);
@@ -561,7 +584,6 @@ int JackOSSDriver::Read()
     gCycleTable.fTable[gCycleCount].fBeforeRead = GetMicroSeconds();
 #endif
 
-    audio_errinfo ei_in;
     count = ::read(fInFD, fInputBuffer, fInputBufferSize);
 
 #ifdef JACK_MONITOR
@@ -570,6 +592,8 @@ int JackOSSDriver::Read()
     gCycleTable.fTable[gCycleCount].fAfterRead = GetMicroSeconds();
 #endif
 
+#ifdef SNDCTL_DSP_GETERROR
+    audio_errinfo ei_in;
     // XRun detection
     if (ioctl(fInFD, SNDCTL_DSP_GETERROR, &ei_in) == 0) {
 
@@ -583,6 +607,7 @@ int JackOSSDriver::Read()
             jack_error("%d OSS rec event(s), last=%05d:%d", ei_in.rec_errorcount, ei_in.rec_lasterror, ei_in.rec_errorparm);
         }
     }
+#endif
 
     if (count < 0) {
         jack_log("JackOSSDriver::Read error = %s", strerror(errno));
@@ -617,7 +642,6 @@ int JackOSSDriver::Write()
     }
 
     ssize_t count;
-    audio_errinfo ei_out;
 
     // Maybe necessary to write an empty output buffer first time : see http://manuals.opensound.com/developer/fulldup.c.html
     if (fFirstCycle) {
@@ -670,6 +694,8 @@ int JackOSSDriver::Write()
     gCycleCount = (gCycleCount == CYCLE_POINTS - 1) ? gCycleCount: gCycleCount + 1;
   #endif
 
+#ifdef SNDCTL_DSP_GETERROR
+    audio_errinfo ei_out;
     // XRun detection
     if (ioctl(fOutFD, SNDCTL_DSP_GETERROR, &ei_out) == 0) {
 
@@ -683,6 +709,7 @@ int JackOSSDriver::Write()
             jack_error("%d OSS play event(s), last=%05d:%d",ei_out.play_errorcount, ei_out.play_lasterror, ei_out.play_errorparm);
         }
     }
+#endif
 
     if (count < 0) {
         jack_log("JackOSSDriver::Write error = %s", strerror(errno));
