diff -Naur squashfs-tools.orig/mksquashfs.c squashfs-tools/mksquashfs.c
--- squashfs-tools.orig/mksquashfs.c	2012-07-23 06:00:00.000000000 +0200
+++ squashfs-tools/mksquashfs.c	2012-07-23 06:00:00.000000000 +0200
@@ -3468,10 +3468,15 @@
 		struct pathname *path = paths->path[n];
 
 		for(i = 0; i < path->names; i++) {
+#ifdef __APPLE__
 			int match = use_regex ?
 				regexec(path->name[i].preg, name, (size_t) 0, NULL, 0) == 0 :
-				fnmatch(path->name[i].name, name, FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == 0;
-
+				fnmatch(path->name[i].name, name, FNM_PATHNAME|FNM_PERIOD) == 0;
+#else
+				int match = use_regex ?
+					regexec(path->name[i].preg, name, (size_t) 0, NULL, 0) == 0 :
+					fnmatch(path->name[i].name, name, FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == 0;
+#endif
 			if(match && path->name[i].paths == NULL) {
 				/* match on a leaf component, any subdirectories in the
 				 * filesystem should be excluded */
diff -Naur squashfs-tools.orig/unsquashfs.c squashfs-tools/unsquashfs.c
--- squashfs-tools.orig/unsquashfs.c	2012-07-23 06:00:00.000000000 +0200
+++ squashfs-tools/unsquashfs.c	2012-07-23 06:00:00.000000000 +0200
@@ -28,6 +28,9 @@
 #define FALSE 0
 #include <stdio.h>
 #include <sys/types.h>
+#ifdef __APPLE__
+#include <sys/sysctl.h>
+#endif
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
@@ -1966,9 +1969,15 @@
 	for(n = 0; n < paths->count; n++) {
 		struct pathname *path = paths->path[n];
 		for(i = 0; i < path->names; i++) {
+#ifdef __APPLE__
 			int match = use_regex ?
 				regexec(path->name[i].preg, name, (size_t) 0, NULL, 0) == 0 :
-				fnmatch(path->name[i].name, name, FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == 0;
+				fnmatch(path->name[i].name, name, FNM_PATHNAME|FNM_PERIOD) == 0;
+#else
+			int match = use_regex ?
+				regexec(path->name[i].preg, name, (size_t) 0, NULL, 0) == 0 :
+				fnmatch(path->name[i].name, name, FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == 0;
+#endif
 			if(match && path->name[i].paths == NULL)
 				/* match on a leaf component, any subdirectories will
 				 * implicitly match, therefore return an empty new search set */
