Index: configure.ac
--- configure.ac.orig	2017-08-08 18:08:29.000000000 +0200
+++ configure.ac	2018-04-28 10:23:39.925704000 +0200
@@ -299,8 +299,8 @@
 
 # Do this after we've looked for functions
 if test -n "$GCC" ; then
-  CFLAGS="$CFLAGS -Wall -Wextra -Wdeclaration-after-statement -g -gdwarf-2 -fno-omit-frame-pointer"
-  CXXFLAGS="$CXXFLAGS -Wall -Wextra -g -gdwarf-2 -fno-omit-frame-pointer"
+  CFLAGS="$CFLAGS -fno-omit-frame-pointer"
+  CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
 fi
 if test -n "$GCC" -a "x$enable_opt" = "xno" ; then
   CFLAGS="$CFLAGS -O0"
@@ -318,7 +318,7 @@
 fi
 IRONMANCFLAGS=""
 if test -n "$GCC" -a "$lenient" = "no" ; then
-  IRONMANCFLAGS="-Werror"
+  IRONMANCFLAGS=""
 fi
 AC_SUBST(IRONMANCFLAGS)
 
Index: stream_unix.cpp
--- stream_unix.cpp.orig	2017-08-08 18:08:29.000000000 +0200
+++ stream_unix.cpp	2018-04-28 10:22:47.571303000 +0200
@@ -82,9 +82,12 @@
     socklen_t len = sizeof(cred);
 #ifdef SO_PEERCRED
     credvalid = getsockopt(fd.fd(), SOL_SOCKET, SO_PEERCRED, &cred, &len) == 0;
-#elif defined(LOCAL_PEERCRED)
+#elif defined(SOL_LOCAL) && defined(LOCAL_PEERCRED)
     credvalid =
         getsockopt(fd.fd(), SOL_LOCAL, LOCAL_PEERCRED, &cred, &len) == 0;
+#elif defined(LOCAL_PEERCRED)
+    credvalid =
+        getsockopt(fd.fd(), 0, LOCAL_PEERCRED, &cred, &len) == 0;
 #endif
   }
 
Index: watchman_string.h
--- watchman_string.h.orig	2017-08-08 18:08:29.000000000 +0200
+++ watchman_string.h	2018-04-28 10:22:47.571465000 +0200
@@ -18,6 +18,7 @@
 #endif
 #include <stdexcept>
 #include <vector>
+#include <cstdarg>
 
 struct watchman_string;
 typedef struct watchman_string w_string_t;
