summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2014-06-17 23:43:18 -0700
committerJP Abgrall <jpa@google.com>2014-06-17 23:43:18 -0700
commit6bd72beff6136a8e83f781a47d76cd395e673799 (patch)
tree8a3738253a6bd9e9767330c62444d2e8e8503509
parente14efeac9a75edfa0cc58d8bb98b8a5ae56689b6 (diff)
downloadsystem_core-6bd72beff6136a8e83f781a47d76cd395e673799.zip
system_core-6bd72beff6136a8e83f781a47d76cd395e673799.tar.gz
system_core-6bd72beff6136a8e83f781a47d76cd395e673799.tar.bz2
fastboot: fix windows sdk build (don't do f2fs dyn load on windows)
Only do f2fs dynamic loading on linux. Adds a stub for windows builds. Change-Id: I7bbaaa1b2ff5992709d904b7ace40ae263d32922 Signed-off-by: JP Abgrall <jpa@google.com>
-rw-r--r--fastboot/Android.mk18
-rw-r--r--fastboot/fs.c9
2 files changed, 17 insertions, 10 deletions
diff --git a/fastboot/Android.mk b/fastboot/Android.mk
index 8fc1f0b..44b9651 100644
--- a/fastboot/Android.mk
+++ b/fastboot/Android.mk
@@ -51,24 +51,28 @@ ifeq ($(HOST_OS),windows)
LOCAL_C_INCLUDES += development/host/windows/usb/api
endif
-# The following libf2fs_* are from system/extras/f2fs_utils,
-# and do not use code in external/f2fs-tools.
LOCAL_STATIC_LIBRARIES := \
$(EXTRA_STATIC_LIBS) \
libzipfile \
libunz \
libext4_utils_host \
- libf2fs_utils_host \
- libf2fs_dlutils_host \
libsparse_host \
libz
-# libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn")
-LOCAL_LDLIBS := -ldl
-LOCAL_SHARED_LIBRARIES := libf2fs_fmt_host_dyn
+
ifneq ($(HOST_OS),windows)
LOCAL_STATIC_LIBRARIES += libselinux
endif # HOST_OS != windows
+ifneq ($(HOST_OS),windows)
+# libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn")
+LOCAL_CFLAGS += -DUSE_F2FS
+LOCAL_LDLIBS += -ldl
+LOCAL_SHARED_LIBRARIES := libf2fs_fmt_host_dyn
+# The following libf2fs_* are from system/extras/f2fs_utils,
+# and do not use code in external/f2fs-tools.
+LOCAL_STATIC_LIBRARIES += libf2fs_utils_host libf2fs_dlutils_host
+endif
+
include $(BUILD_HOST_EXECUTABLE)
diff --git a/fastboot/fs.c b/fastboot/fs.c
index 11e391b..8a15e6f 100644
--- a/fastboot/fs.c
+++ b/fastboot/fs.c
@@ -29,11 +29,12 @@ static int generate_ext4_image(int fd, long long partSize)
return 0;
}
-int generate_f2fs_image(int fd, long long partSize)
+#ifdef USE_F2FS
+static int generate_f2fs_image(int fd, long long partSize)
{
- make_f2fs_sparse_fd(fd, partSize, NULL, NULL);
- return 0;
+ return make_f2fs_sparse_fd(fd, partSize, NULL, NULL);
}
+#endif
static const struct fs_generator {
@@ -42,7 +43,9 @@ static const struct fs_generator {
} generators[] = {
{ "ext4", generate_ext4_image},
+#ifdef USE_F2FS
{ "f2fs", generate_f2fs_image},
+#endif
};
const struct fs_generator* fs_get_generator(const char *fs_type)