$NetBSD$ 1. = preferred instead of == as the latter breaks compatibility on some platforms and former is more portable. 2. As of NetBSD 9.2 pthread_*_setpshared aren't supported, hence the check is skipped for NetBSD --- configure.orig 2018-07-03 19:29:06.000000000 +0000 +++ configure @@ -17303,7 +17303,7 @@ ac_try='"$LEX" --stdout conftest.lex >/d eval ac_try_echo="\":$LINENO: $ac_try\"" echo "$ac_try_echo" >&5 (eval "$ac_try") 2>&5 -if test $? == 0; then +if test $? = 0; then ax_cv_check_flex_compat=yes else ax_cv_check_flex_compat=no @@ -17358,7 +17358,8 @@ $as_echo "no" >&6; } fi - +if [ `uname` != NetBSD ] +then ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -17410,6 +17411,8 @@ rm -f core *.core core.conftest.* gmon.o conftest.$ac_objext conftest.beam conftest.$ac_ext fi +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -28956,7 +28959,7 @@ as_fn_error $? "no acceptable atomic ope See \`config.log' for more details" "$LINENO" 5; } fi -if test "x$have_libspg" == xyes; then +if test "x$have_libspg" = xyes; then $as_echo "#define HAVE_LIBSPG /**/" >>confdefs.h $NetBSD$ As of NetBSD 9.2 pthread_*_setpshared aren't supported. Default them to error return value. --- src/hre/hre_pthread.c.orig 2018-07-03 19:28:10.000000000 +0000 +++ src/hre/hre_pthread.c @@ -17,6 +17,14 @@ #include +#if defined(__NetBSD__) +# include +# if !__NetBSD_Prereq__(11, 0, 0) +# define pthread_mutexattr_setpshared(attr, flag) 1 +# define pthread_condattr_setpshared(attr, flag) 1 +# endif +#endif + /** * For pthreads we only use a small shared region for the queues. * For forks all shared objects are allocated on the region, so we try to claim $NetBSD$ Some macros from sys/wait.h are used, #include is needed. --- src/pins-lib/modules/dve-pins.c.orig 2018-07-03 19:28:10.000000000 +0000 +++ src/pins-lib/modules/dve-pins.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include $NetBSD$ Some macros from sys/wait.h are used, #include is needed. --- src/pins-lib/modules/opaal-pins.c.orig 2018-07-03 19:28:10.000000000 +0000 +++ src/pins-lib/modules/opaal-pins.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include $NetBSD$ alloca.h inclusion is made conditional uniformly, such as in vset-lib/vset_listdd.c --- src/pins2lts-sym/pins2lts-sym.c.orig 2018-07-03 19:28:10.000000000 +0000 +++ src/pins2lts-sym/pins2lts-sym.c @@ -1,7 +1,9 @@ #include #include +#ifdef __APPLE__ #include +#endif #include #include #include $NetBSD$ NetBSD does not support qsort_r --- src/util-lib/sort_r.h.orig 2018-07-03 19:28:10.000000000 +0000 +++ src/util-lib/sort_r.h @@ -182,7 +182,7 @@ static _SORT_R_INLINE void sort_r_simple { #if defined _SORT_R_LINUX - #if defined __GLIBC__ && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 8)) + #if defined __GLIBC__ && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 8)) || defined __NetBSD__ /* no qsort_r in glibc before 2.8, need to use nested qsort */ sort_r_simple(base, nel, width, compar, arg);