summaryrefslogtreecommitdiffstats
path: root/tools/mtd-utils
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-09-27 17:03:36 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-09-27 17:03:36 +0000
commit652d9073459fce55104f0db8f64fc5b9100c979d (patch)
tree383d10976ebfed64d1ca7a7d25bffd6635876626 /tools/mtd-utils
parent44af1866aa41cfbbad48583106cb82201ded4fcb (diff)
add portability fixes for toolchain/tools (full tools/toolchain build works on osx now)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4867 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'tools/mtd-utils')
-rw-r--r--tools/mtd-utils/Makefile7
-rw-r--r--tools/mtd-utils/patches/110-portability_fix.patch63
2 files changed, 69 insertions, 1 deletions
diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile
index a0a26776f..55dd88a78 100644
--- a/tools/mtd-utils/Makefile
+++ b/tools/mtd-utils/Makefile
@@ -18,8 +18,13 @@ PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).orig
include $(INCLUDE_DIR)/host-build.mk
+CFLAGS := $(HOSTCFLAGS) -O2 -I../include
+ifneq ($(OS),Linux)
+CFLAGS += -Dloff_t=off_t -D__BYTE_ORDER=BYTE_ORDER -I$(STAGING_DIR)/include-host -include getline.h
+endif
+
define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR)/util LINUXDIR=$(LINUX_HEADERS_DIR)
+ $(MAKE) -C $(PKG_BUILD_DIR)/util LINUXDIR="$(LINUX_HEADERS_DIR)" CFLAGS="$(CFLAGS)" TARGETS=mkfs.jffs2
endef
define Build/Install
diff --git a/tools/mtd-utils/patches/110-portability_fix.patch b/tools/mtd-utils/patches/110-portability_fix.patch
new file mode 100644
index 000000000..b5e91d576
--- /dev/null
+++ b/tools/mtd-utils/patches/110-portability_fix.patch
@@ -0,0 +1,63 @@
+diff -urN mtd.old/include/asm/types.h mtd.dev/include/asm/types.h
+--- mtd.old/include/asm/types.h 1970-01-01 01:00:00.000000000 +0100
++++ mtd.dev/include/asm/types.h 2006-09-27 16:50:03.000000000 +0200
+@@ -0,0 +1,3 @@
++#ifdef linux
++#include_next <asm/types.h>
++#endif
+diff -urN mtd.old/util/mkfs.jffs2.c mtd.dev/util/mkfs.jffs2.c
+--- mtd.old/util/mkfs.jffs2.c 2004-11-27 00:00:13.000000000 +0100
++++ mtd.dev/util/mkfs.jffs2.c 2006-09-27 16:51:56.000000000 +0200
+@@ -68,6 +68,7 @@
+ #include <zlib.h>
+ #undef crc32
+ #include "crc32.h"
++#include <endian.h>
+
+ /* Do not use the wierd XPG version of basename */
+ #undef basename
+@@ -1032,7 +1033,7 @@
+ case S_IFDIR:
+ if (verbose) {
+ printf("\td %04o %9lu %5d:%-3d %s\n",
+- e->sb.st_mode & ~S_IFMT, e->sb.st_size,
++ e->sb.st_mode & ~S_IFMT, (unsigned long)e->sb.st_size,
+ (int) (e->sb.st_uid), (int) (e->sb.st_gid),
+ e->name);
+ }
+@@ -1041,7 +1042,7 @@
+ case S_IFSOCK:
+ if (verbose) {
+ printf("\ts %04o %9lu %5d:%-3d %s\n",
+- e->sb.st_mode & ~S_IFMT, e->sb.st_size,
++ e->sb.st_mode & ~S_IFMT, (unsigned long)e->sb.st_size,
+ (int) e->sb.st_uid, (int) e->sb.st_gid, e->name);
+ }
+ write_pipe(e);
+@@ -1049,7 +1050,7 @@
+ case S_IFIFO:
+ if (verbose) {
+ printf("\tp %04o %9lu %5d:%-3d %s\n",
+- e->sb.st_mode & ~S_IFMT, e->sb.st_size,
++ e->sb.st_mode & ~S_IFMT, (unsigned long)e->sb.st_size,
+ (int) e->sb.st_uid, (int) e->sb.st_gid, e->name);
+ }
+ write_pipe(e);
+@@ -1075,7 +1076,7 @@
+ case S_IFLNK:
+ if (verbose) {
+ printf("\tl %04o %9lu %5d:%-3d %s -> %s\n",
+- e->sb.st_mode & ~S_IFMT, e->sb.st_size,
++ e->sb.st_mode & ~S_IFMT, (unsigned long)e->sb.st_size,
+ (int) e->sb.st_uid, (int) e->sb.st_gid, e->name,
+ e->link);
+ }
+@@ -1084,7 +1085,7 @@
+ case S_IFREG:
+ if (verbose) {
+ printf("\tf %04o %9lu %5d:%-3d %s\n",
+- e->sb.st_mode & ~S_IFMT, e->sb.st_size,
++ e->sb.st_mode & ~S_IFMT, (unsigned long)e->sb.st_size,
+ (int) e->sb.st_uid, (int) e->sb.st_gid, e->name);
+ }
+ write_regular_file(e);