$NetBSD$

Add preprocessor checks for sysinfo.h and sysctl.h.

--- unsquashfs.c.orig	2014-05-12 18:18:35.000000000 -0400
+++ unsquashfs.c	2016-04-08 13:09:53.000000000 -0400
@@ -31,13 +31,25 @@
 #include "unsquashfs_info.h"
 #include "stdarg.h"
 
-#include <sys/sysinfo.h>
+/* XXX need autoconf */
+#if ( defined(__linux__) )
+ #include <sys/sysinfo.h>
+#endif
+
+/* XXX need autoconf HAVE_SYS_SYSCTL_H */
+#if ( defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__) || \
+      defined(__FreeBSD__) || defined(__OpenBSD__) )
+ #include <sys/sysctl.h>
+#endif
+
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <limits.h>
 #include <ctype.h>
 
+#include "fnm_extmatch.h"
+
 struct cache *fragment_cache, *data_cache;
 struct queue *to_reader, *to_inflate, *to_writer, *from_writer;
 pthread_t *thread, *inflator_thread;
