@@ -18,6 +18,7 @@ PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/host-build.mk
ifneq ($(HOST_OS),Linux)
+ifneq (CYGWIN,$(findstring CYGWIN,$(HOST_OS)))
HOST_CFLAGS += \
-I$(CURDIR)/include \
-Dloff_t=off_t \
@@ -25,6 +26,14 @@ ifneq ($(HOST_OS),Linux)
-include endian.h \
-DNO_NATIVE_SUPPORT \
-include fls.h
+else
+ HOST_CFLAGS += \
+ -I$(CURDIR)/include \
+ -include endian.h \
+ -DNO_NATIVE_SUPPORT \
+ -include fls.h \
+ -D__USE_LINUX_IOCTL_DEFS
+endif
endif
HOST_CONFIGURE_VARS+= \
@@ -37,8 +46,14 @@ HOST_CONFIGURE_ARGS+= \
--without-zstd \
--without-lzo
+ifeq (CYGWIN,$(findstring CYGWIN,$(HOST_OS)))
+EXEC_SUFFIX:=.exe
+else
+EXEC_SUFFIX:=
+endif
+
HOST_MAKE_FLAGS += \
- PROGRAMS="mkfs.jffs2 ubinize mkfs.ubifs"
+ PROGRAMS="mkfs.jffs2$(EXEC_SUFFIX) ubinize$(EXEC_SUFFIX) mkfs.ubifs$(EXEC_SUFFIX)"
define Host/Install
$(CP) \
new file mode 100644
@@ -0,0 +1,35 @@
+#ifndef __LINUX_BLKPG_H
+#define __LINUX_BLKPG_H
+
+/*#include <linux/ioctl.h> */
+
+#define BLKPG _IO(0x12,105)
+
+/* The argument structure */
+struct blkpg_ioctl_arg {
+ int op;
+ int flags;
+ int datalen;
+ void *data;
+};
+
+/* The subfunctions (for the op field) */
+#define BLKPG_ADD_PARTITION 1
+#define BLKPG_DEL_PARTITION 2
+#define BLKPG_RESIZE_PARTITION 3
+
+/* Sizes of name fields. Unused at present. */
+#define BLKPG_DEVNAMELTH 64
+#define BLKPG_VOLNAMELTH 64
+
+/* The data structure for ADD_PARTITION and DEL_PARTITION */
+struct blkpg_partition {
+ long long start; /* starting offset in bytes */
+ long long length; /* length in bytes */
+ int pno; /* partition number */
+ char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
+ to be used in kernel messages */
+ char volname[BLKPG_VOLNAMELTH]; /* volume label */
+};
+
+#endif /* __LINUX_BLKPG_H */
@@ -5,7 +5,13 @@
typedef uint16_t __u16;
typedef uint32_t __u32;
+
+#if defined(__CYGWIN__)
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#else
typedef uint64_t __u64;
+#endif
typedef __u16 __le16;
typedef __u32 __le32;