aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJavier Ferrer <javi.f.o@gmail.com>2012-03-12 17:34:51 +0100
committerJavier Ferrer <javi.f.o@gmail.com>2012-03-12 17:34:51 +0100
commit325e4ba3174b733b95f98138e18b11393643a7ab (patch)
treeba249b833f3e1a02e82aad78e4827074c8939e2d /scripts
parent5585d2accabbee676e4ae9d0632db42597c88892 (diff)
downloadkernel_samsung_aries-325e4ba3174b733b95f98138e18b11393643a7ab.zip
kernel_samsung_aries-325e4ba3174b733b95f98138e18b11393643a7ab.tar.gz
kernel_samsung_aries-325e4ba3174b733b95f98138e18b11393643a7ab.tar.bz2
Enable building on OSX
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 | \