--- squashfs-tools/action.c
+++ squashfs-tools/action.c
@@ -2236,6 +2236,9 @@
 	return 1;
 }
 
+#ifndef FNM_EXTMATCH
+#define FNM_EXTMATCH 0
+#endif
 
 TEST_FN(name, ACTION_ALL_LNK, \
 	return fnmatch(atom->argv[0], action_data->name,
--- squashfs-tools/mksquashfs.c
+++ squashfs-tools/mksquashfs.c
@@ -4665,6 +4665,9 @@
 	return paths;
 }
 
+#ifndef FNM_EXTMATCH
+#define FNM_EXTMATCH 0
+#endif
 
 int excluded_match(char *name, struct pathname *path, struct pathnames **new)
 {
--- squashfs-tools/unsquashfs.c
+++ squashfs-tools/unsquashfs.c
@@ -1457,6 +1457,9 @@
 	free(paths);
 }
 
+#ifndef FNM_EXTMATCH
+#define FNM_EXTMATCH 0
+#endif
 
 int matches(struct pathnames *paths, char *name, struct pathnames **new)
 {