diff options
-rw-r--r-- | libhb/fifo.c | 2 | ||||
-rw-r--r-- | libhb/module.defs | 2 | ||||
-rw-r--r-- | libhb/ports.c | 12 | ||||
-rw-r--r-- | make/configure.py | 8 | ||||
-rw-r--r-- | test/module.defs | 2 |
5 files changed, 14 insertions, 12 deletions
diff --git a/libhb/fifo.c b/libhb/fifo.c index 6a279fbb3..551224b05 100644 --- a/libhb/fifo.c +++ b/libhb/fifo.c @@ -16,7 +16,7 @@ #endif #ifndef SYS_DARWIN -#if defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) +#if defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) || defined(SYS_NETBSD) #include <stdlib.h> #else #include <malloc.h> diff --git a/libhb/module.defs b/libhb/module.defs index 80cc52b34..bd6ac789d 100644 --- a/libhb/module.defs +++ b/libhb/module.defs @@ -64,6 +64,8 @@ else ifeq ($(HOST.system),linux) LIBHB.GCC.D += SYS_LINUX _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64 else ifeq ($(HOST.system),freebsd) LIBHB.GCC.D += SYS_FREEBSD _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64 +else ifeq ($(HOST.system),netbsd) + LIBHB.GCC.D += SYS_NETBSD _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64 else ifeq ($(HOST.system),mingw) LIBHB.GCC.D += SYS_MINGW ifneq ($(HAS.pthread),1) diff --git a/libhb/ports.c b/libhb/ports.c index 3beab47a3..6eb34e3fd 100644 --- a/libhb/ports.c +++ b/libhb/ports.c @@ -25,7 +25,7 @@ #include <kernel/OS.h> #endif -#if defined(SYS_DARWIN) || defined(SYS_FREEBSD) +#if defined(SYS_DARWIN) || defined(SYS_FREEBSD) || defined(SYS_NETBSD) #include <sys/types.h> #include <sys/sysctl.h> #if HB_PROJECT_FEATURE_QSV && defined(SYS_FREEBSD) @@ -222,7 +222,7 @@ void hb_snooze( int delay ) } #if defined( SYS_BEOS ) snooze( 1000 * delay ); -#elif defined( SYS_DARWIN ) || defined( SYS_LINUX ) || defined( SYS_FREEBSD) || defined( SYS_SunOS ) +#elif defined( SYS_DARWIN ) || defined( SYS_LINUX ) || defined( SYS_FREEBSD) || defined(SYS_NETBSD) || defined( SYS_SunOS ) usleep( 1000 * delay ); #elif defined( SYS_CYGWIN ) || defined( SYS_MINGW ) Sleep( delay ); @@ -447,9 +447,9 @@ static int init_cpu_count() get_system_info( &info ); cpu_count = info.cpu_count; -#elif defined(SYS_DARWIN) || defined(SYS_FREEBSD) || defined(SYS_OPENBSD) +#elif defined(SYS_DARWIN) || defined(SYS_FREEBSD) || defined(SYS_NETBSD) || defined(SYS_OPENBSD) size_t length = sizeof( cpu_count ); -#ifdef SYS_OPENBSD +#ifdef SYS_OPENBSD || defined(SYS_NETBSD) int mib[2] = { CTL_HW, HW_NCPU }; if( sysctl(mib, 2, &cpu_count, &length, NULL, 0) ) #else @@ -862,7 +862,7 @@ static void attribute_align_thread hb_thread_func( void * _t ) { hb_thread_t * t = (hb_thread_t *) _t; -#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) +#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) || defined(SYS_NETBSD) /* Set the thread priority */ struct sched_param param; memset( ¶m, 0, sizeof( struct sched_param ) ); @@ -1009,7 +1009,7 @@ hb_lock_t * hb_lock_init() pthread_mutexattr_init(&mta); -#if defined( SYS_CYGWIN ) || defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) +#if defined( SYS_CYGWIN ) || defined( SYS_FREEBSD ) || defined ( __FreeBSD__ ) || defined(SYS_NETBSD) pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_NORMAL); #endif diff --git a/make/configure.py b/make/configure.py index e8c721f71..4daaac9a8 100644 --- a/make/configure.py +++ b/make/configure.py @@ -1378,10 +1378,10 @@ def createCLI( cross = None ): h = IfHost( 'enable assembly code in non-contrib modules', 'NOMATCH*-*-darwin*', 'NOMATCH*-*-linux*', none=argparse.SUPPRESS ).value grp.add_argument( '--enable-asm', default=False, action='store_true', help=h ) - h = IfHost( 'disable GTK GUI', '*-*-linux*', '*-*-freebsd*', none=argparse.SUPPRESS ).value + h = IfHost( 'disable GTK GUI', '*-*-linux*', '*-*-freebsd*', '*-*-netbsd*', none=argparse.SUPPRESS ).value grp.add_argument( '--disable-gtk', default=False, action='store_true', help=h ) - h = IfHost( 'disable GTK GUI update checks', '*-*-linux*', '*-*-freebsd*', none=argparse.SUPPRESS ).value + h = IfHost( 'disable GTK GUI update checks', '*-*-linux*', '*-*-freebsd*', '*-*-netbsd*', none=argparse.SUPPRESS ).value grp.add_argument( '--disable-gtk-update-checks', default=False, action='store_true', help=h ) h = 'enable GTK GUI for Windows' if (cross is not None and 'mingw' in cross) else argparse.SUPPRESS @@ -1390,7 +1390,7 @@ def createCLI( cross = None ): h = IfHost( 'Build GUI with GTK4', '*-*-linux*', '*-*-freebsd*', none=argparse.SUPPRESS ).value grp.add_argument( '--enable-gtk4', default=False, action='store_true', help=h ) - h = IfHost( 'disable GStreamer (live preview)', '*-*-linux*', '*-*-freebsd*', none=argparse.SUPPRESS ).value + h = IfHost( 'disable GStreamer (live preview)', '*-*-linux*', '*-*-freebsd*', '*-*-netbsd*', none=argparse.SUPPRESS ).value grp.add_argument( '--disable-gst', default=False, action='store_true', help=h ) h = IfHost( 'x265 video encoder', '*-*-*', none=argparse.SUPPRESS ).value @@ -2042,7 +2042,7 @@ int main() else: doc.addBlank() - if host_tuple.system == 'freebsd': + if host_tuple.system in ('freebsd', 'netbsd'): doc.add( 'HAS.pthread', 1 ) if not strerror_r.fail: doc.add( 'HAS.strerror_r', 1 ) diff --git a/test/module.defs b/test/module.defs index 798f13e8a..678be7173 100644 --- a/test/module.defs +++ b/test/module.defs @@ -71,7 +71,7 @@ ifeq (1, $(FEATURE.numa)) endif else ifeq ($(HOST.system),kfreebsd) TEST.GCC.l += pthread dl m -else ifeq ($(HOST.system),freebsd) +else ifneq (,$(filter $(HOST.system),freebsd netbsd)) TEST.GCC.L += $(LOCALBASE)/lib TEST.GCC.l += pthread m else ifeq ($(HOST.system),solaris) |