aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.lib16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 93b2b59..e5965c6 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -229,10 +229,24 @@ cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $<
# Bzip2 and LZMA do not include size in file... so we have to fake that;
# append the size as a 32-bit littleendian number as gzip does.
+#
+# Make will give an error like this on OSX:
+#
+# stat: illegal option -- c
+# usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]
+# expire: syntax error
+#
+# So we need to force use of gstat from macports instead
+
size_append = printf $(shell \
dec_size=0; \
+l_arch=$$(uname -s); \
for F in $1; do \
- fsize=$$(stat -c "%s" $$F); \
+ if [ "$$l_arch" == "Darwin" ]; then \
+ fsize=$$(gstat -c "%s" $$F); \
+ else \
+ fsize=$$(stat -c "%s" $$F); \
+ fi; \
dec_size=$$(expr $$dec_size + $$fsize); \
done; \
printf "%08x\n" $$dec_size | \