1// Copyright 2017 The Android Open Source Project
2
3cc_library {
4    name: "libext2fs",
5    host_supported: true,
6    recovery_available: true,
7    unique_host_soname: true,
8    defaults: ["e2fsprogs-defaults"],
9    srcs: [
10        "ext2_err.c",
11        "alloc.c",
12        "alloc_sb.c",
13        "alloc_stats.c",
14        "alloc_tables.c",
15        "atexit.c",
16        "badblocks.c",
17        "bb_inode.c",
18        "bitmaps.c",
19        "bitops.c",
20        "blkmap64_ba.c",
21        "blkmap64_rb.c",
22        "blknum.c",
23        "block.c",
24        "bmap.c",
25        "check_desc.c",
26        "crc16.c",
27        "crc32c.c",
28        "csum.c",
29        "closefs.c",
30        "dblist.c",
31        "dblist_dir.c",
32        "digest_encode.c",
33        "dirblock.c",
34        "dirhash.c",
35        "dir_iterate.c",
36        "dupfs.c",
37        "expanddir.c",
38        "ext_attr.c",
39        "extent.c",
40        "fallocate.c",
41        "fileio.c",
42        "finddev.c",
43        "flushb.c",
44        "freefs.c",
45        "gen_bitmap.c",
46        "gen_bitmap64.c",
47        "get_num_dirs.c",
48        "get_pathname.c",
49        "getsize.c",
50        "getsectsize.c",
51        "hashmap.c",
52        "i_block.c",
53        "icount.c",
54        "imager.c",
55        "ind_block.c",
56        "initialize.c",
57        "inline.c",
58        "inline_data.c",
59        "inode.c",
60        "io_manager.c",
61        "ismounted.c",
62        "link.c",
63        "llseek.c",
64        "lookup.c",
65        "mmp.c",
66        "mkdir.c",
67        "mkjournal.c",
68        "namei.c",
69        "native.c",
70        "newdir.c",
71        "openfs.c",
72        "progress.c",
73        "punch.c",
74        "qcow2.c",
75        "rbtree.c",
76        "read_bb.c",
77        "read_bb_file.c",
78        "res_gdt.c",
79        "rw_bitmaps.c",
80        "sha256.c",
81        "sha512.c",
82        "swapfs.c",
83        "symlink.c",
84        "undo_io.c",
85        "unix_io.c",
86        "sparse_io.c",
87        "unlink.c",
88        "valid_blk.c",
89        "version.c",
90        // get rid of this?!
91        "test_io.c",
92    ],
93    shared_libs: [
94        "libext2_com_err",
95        "libsparse",
96        "libz",
97    ],
98    cflags: ["-Wno-unused-parameter"],
99    target: {
100        android: {
101            shared_libs: [ "libext2_uuid" ],
102        },
103        windows: {
104            enabled: true,
105            include_dirs: [ "external/e2fsprogs/include/mingw" ],
106            cflags: [
107                "-Wno-error=cpp",
108                "-Wno-format",
109                "-Wno-unused-variable",
110            ],
111            clang_cflags: [
112                "-Wno-error=typedef-redefinition",
113            ],
114            host_ldlibs: ["-lws2_32"],
115        },
116    },
117
118    header_libs: ["libext2-headers"],
119    export_include_dirs: ["."],
120    export_header_lib_headers: ["libext2-headers"],
121}
122