--- configure.orig	2015-05-30 17:35:28.000000000 +0200
+++ configure	2017-03-14 00:11:37.359755000 +0100
@@ -8418,7 +8418,7 @@
     # need special flags to disable these optimizations. For example, the
     # definition of 'errno' in <errno.h>.
     case "$host_os" in
-      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+      aix* | bsdsunix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
       solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
     esac
   fi
@@ -20827,7 +20827,7 @@
              gl_cv_func_dup2_works="guessing no" ;;
            cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
              gl_cv_func_dup2_works="guessing no" ;;
-           aix* | freebsd*)
+           aix* | bsdsunix* | freebsd*)
                    # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
                    # not EBADF.
              gl_cv_func_dup2_works="guessing no" ;;
@@ -24012,7 +24012,7 @@
   if test "$cross_compiling" = yes; then :
   case "$host_os" in
           # Guess yes on platforms where we know the result.
-          *-gnu* | freebsd* | netbsd* | openbsd* \
+          *-gnu* | bsdsunix* | freebsd* | netbsd* | openbsd* \
           | hpux* | solaris* | cygwin* | mingw*)
             ac_cv_func_malloc_0_nonnull=yes ;;
           # If we don't know, assume the worst.
@@ -25640,7 +25640,7 @@
           if test "$cross_compiling" = yes; then :
 
              case "$host_os" in
-               freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+               bsdsunix* | freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
                  gl_cv_func_open_slash="guessing no" ;;
                *)
                  gl_cv_func_open_slash="guessing yes" ;;
@@ -26688,7 +26688,7 @@
   if test "$cross_compiling" = yes; then :
   case "$host_os" in
           # Guess yes on platforms where we know the result.
-          *-gnu* | freebsd* | netbsd* | openbsd* \
+          *-gnu* | bsdsunix* | freebsd* | netbsd* | openbsd* \
           | hpux* | solaris* | cygwin* | mingw*)
             ac_cv_func_realloc_0_nonnull=yes ;;
           # If we don't know, assume the worst.