1LOCAL_PATH := $(call my-dir)
2
3libext2fs_src_files := \
4	ext2_err.c \
5	alloc.c \
6	alloc_sb.c \
7	alloc_stats.c \
8	alloc_tables.c \
9	badblocks.c \
10	bb_inode.c \
11	bitmaps.c \
12	bitops.c \
13	block.c \
14	bmap.c \
15	check_desc.c \
16	crc16.c \
17	csum.c \
18	closefs.c \
19	dblist.c \
20	dblist_dir.c \
21	dirblock.c \
22	dirhash.c \
23	dir_iterate.c \
24	dupfs.c \
25	expanddir.c \
26	ext_attr.c \
27	extent.c \
28	finddev.c \
29	flushb.c \
30	freefs.c \
31	gen_bitmap.c \
32	get_pathname.c \
33	getsize.c \
34	getsectsize.c \
35	i_block.c \
36	icount.c \
37	ind_block.c \
38	initialize.c \
39	inline.c \
40	inode.c \
41	io_manager.c \
42	ismounted.c \
43	link.c \
44	llseek.c \
45	lookup.c \
46	mkdir.c \
47	mkjournal.c \
48	native.c \
49	newdir.c \
50	openfs.c \
51	read_bb.c \
52	read_bb_file.c \
53	res_gdt.c \
54	rw_bitmaps.c \
55	swapfs.c \
56	tdb.c \
57	undo_io.c \
58	unix_io.c \
59	unlink.c \
60	valid_blk.c \
61	version.c
62
63# get rid of this?!
64libext2fs_src_files += test_io.c
65
66libext2fs_shared_libraries := \
67	libext2_com_err \
68	libext2_uuid \
69	libext2_blkid \
70	libext2_e2p
71
72libext2fs_system_shared_libraries := libc
73
74libext2fs_c_includes := external/e2fsprogs/lib
75
76libext2fs_cflags := -O2 -g -W -Wall \
77	-DHAVE_UNISTD_H \
78	-DHAVE_ERRNO_H \
79	-DHAVE_NETINET_IN_H \
80	-DHAVE_SYS_IOCTL_H \
81	-DHAVE_SYS_MMAN_H \
82	-DHAVE_SYS_MOUNT_H \
83	-DHAVE_SYS_RESOURCE_H \
84	-DHAVE_SYS_SELECT_H \
85	-DHAVE_SYS_STAT_H \
86	-DHAVE_SYS_TYPES_H \
87	-DHAVE_STDLIB_H \
88	-DHAVE_STRDUP \
89	-DHAVE_MMAP \
90	-DHAVE_UTIME_H \
91	-DHAVE_GETPAGESIZE \
92	-DHAVE_EXT2_IOCTLS \
93	-DHAVE_TYPE_SSIZE_T \
94	-DHAVE_SYS_TIME_H \
95        -DHAVE_SYS_PARAM_H \
96	-DHAVE_SYSCONF
97
98libext2fs_cflags_linux := \
99	-DHAVE_LINUX_FD_H \
100	-DHAVE_SYS_PRCTL_H \
101	-DHAVE_LSEEK64 \
102	-DHAVE_LSEEK64_PROTOTYPE
103
104include $(CLEAR_VARS)
105
106LOCAL_SRC_FILES := $(libext2fs_src_files)
107LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2fs_system_shared_libraries)
108LOCAL_SHARED_LIBRARIES := $(libext2fs_shared_libraries)
109LOCAL_C_INCLUDES := $(libext2fs_c_includes)
110LOCAL_CFLAGS := $(libext2fs_cflags) $(libext2fs_cflags_linux)
111LOCAL_PRELINK_MODULE := false
112LOCAL_MODULE := libext2fs
113LOCAL_MODULE_TAGS := optional
114
115include $(BUILD_SHARED_LIBRARY)
116
117include $(CLEAR_VARS)
118
119LOCAL_SRC_FILES := $(libext2fs_src_files)
120LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(libext2fs_shared_libraries))
121LOCAL_C_INCLUDES := $(libext2fs_c_includes)
122ifeq ($(HOST_OS),linux)
123LOCAL_CFLAGS := $(libext2fs_cflags) $(libext2fs_cflags_linux)
124else
125LOCAL_CFLAGS := $(libext2fs_cflags)
126endif
127LOCAL_MODULE := libext2fs_host
128LOCAL_MODULE_TAGS := optional
129
130include $(BUILD_HOST_SHARED_LIBRARY)
131