From 321f3446f38d429bbfafec2885e7e6a6353cce1f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 28 Feb 2015 01:09:06 -0500 Subject: [PATCH] Add files to build on Android The Android.mk files were taken from the Android AOSP sources, and updated for the 1.43 next branch. The intention is that this will allow the repository which is currently located in external/e2fsprogs with one which is based off of the upstream e2fsprogs. Right now external/e2fsprogs was not created using "git clone", so it means that git merges don't work. After the external/e2fsprogs Android repository is replaced, with one based off the upstream repository, Android will be able to synchronize with the upstream repository by pulling and merging from upstream, and then running the script "./util/gen-android-files" to update any generated files. (This is necessary because in the Android build system, the Android.mk files are rather stylized and don't make it easy to run arbitrary shell scripts during the build phase.) Signed-off-by: "Theodore Ts'o" --- Android.mk | 1 + CleanSpec.mk | 49 +++++ e2fsck/Android.mk | 164 ++++++++++++++++ lib/Android.mk | 1 + lib/blkid/Android.mk | 77 ++++++++ lib/e2p/Android.mk | 74 +++++++ lib/et/Android.mk | 65 +++++++ lib/ext2fs/Android.mk | 144 ++++++++++++++ lib/quota/Android.mk | 60 ++++++ lib/uuid/Android.mk | 89 +++++++++ misc/Android.mk | 431 +++++++++++++++++++++++++++++++++++++++++ resize/Android.mk | 69 +++++++ util/android_config.h | 7 + util/android_types.h | 39 ++++ util/gen-android-files | 39 ++++ 15 files changed, 1309 insertions(+) create mode 100644 Android.mk create mode 100644 CleanSpec.mk create mode 100644 e2fsck/Android.mk create mode 100644 lib/Android.mk create mode 100644 lib/blkid/Android.mk create mode 100644 lib/e2p/Android.mk create mode 100644 lib/et/Android.mk create mode 100644 lib/ext2fs/Android.mk create mode 100644 lib/quota/Android.mk create mode 100644 lib/uuid/Android.mk create mode 100644 misc/Android.mk create mode 100644 resize/Android.mk create mode 100644 util/android_config.h create mode 100644 util/android_types.h create mode 100755 util/gen-android-files diff --git a/Android.mk b/Android.mk new file mode 100644 index 000000000..5053e7d64 --- /dev/null +++ b/Android.mk @@ -0,0 +1 @@ +include $(call all-subdir-makefiles) diff --git a/CleanSpec.mk b/CleanSpec.mk new file mode 100644 index 000000000..b84e1b65e --- /dev/null +++ b/CleanSpec.mk @@ -0,0 +1,49 @@ +# Copyright (C) 2007 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# If you don't need to do a full clean build but would like to touch +# a file or delete some intermediate files, add a clean step to the end +# of the list. These steps will only be run once, if they haven't been +# run before. +# +# E.g.: +# $(call add-clean-step, touch -c external/sqlite/sqlite3.h) +# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) +# +# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with +# files that are missing or have been moved. +# +# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. +# Use $(OUT_DIR) to refer to the "out" directory. +# +# If you need to re-do something that's already mentioned, just copy +# the command and add it to the bottom of the list. E.g., if a change +# that you made last week required touching a file and a change you +# made today requires touching the same file, just copy the old +# touch step and add it to the end of the list. +# +# ************************************************ +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST +# ************************************************ + +# For example: +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) +#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) +#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) + +# ************************************************ +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST +# ************************************************ diff --git a/e2fsck/Android.mk b/e2fsck/Android.mk new file mode 100644 index 000000000..a95bae478 --- /dev/null +++ b/e2fsck/Android.mk @@ -0,0 +1,164 @@ +LOCAL_PATH := $(call my-dir) + +######################### +# Build the libext2 profile library + +libext2_profile_src_files := \ + prof_err.c \ + profile.c + +libext2_profile_shared_libraries := \ + libext2_com_err + +libext2_profile_system_shared_libraries := libc + +libext2_profile_c_includes := external/e2fsprogs/lib + +libext2_profile_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF \ + -DDISABLE_BACKTRACE=1 + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_profile_src_files) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_profile_system_shared_libraries) +LOCAL_SHARED_LIBRARIES := $(libext2_profile_shared_libraries) +LOCAL_C_INCLUDES := $(libext2_profile_c_includes) +LOCAL_CFLAGS := $(libext2_profile_cflags) +LOCAL_MODULE := libext2_profile +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_profile_src_files) +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(libext2_profile_shared_libraries)) +LOCAL_C_INCLUDES := $(libext2_profile_c_includes) +LOCAL_CFLAGS := $(libext2_profile_cflags) +LOCAL_MODULE := libext2_profile_host +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_SHARED_LIBRARY) + +######################### +# Build the e2fsck binary + +e2fsck_src_files := \ + e2fsck.c \ + dict.c \ + super.c \ + pass1.c \ + pass1b.c \ + pass2.c \ + pass3.c \ + pass4.c \ + pass5.c \ + logfile.c \ + journal.c \ + recovery.c \ + revoke.c \ + badblocks.c \ + util.c \ + unix.c \ + dirinfo.c \ + dx_dirinfo.c \ + ehandler.c \ + problem.c \ + message.c \ + ea_refcount.c \ + quota.c \ + rehash.c \ + region.c \ + sigcatcher.c \ + plausible.c + +e2fsck_shared_libraries := \ + libext2fs \ + libext2_blkid \ + libext2_uuid \ + libext2_profile \ + libext2_quota \ + libext2_com_err \ + libext2_e2p +e2fsck_system_shared_libraries := libc + +e2fsck_c_includes := external/e2fsprogs/lib + +e2fsck_cflags := -O2 -g -W -Wall -fno-strict-aliasing \ + -DHAVE_DIRENT_H \ + -DHAVE_ERRNO_H \ + -DHAVE_INTTYPES_H \ + -DHAVE_LINUX_FD_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SETJMP_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_UNISTD_H \ + -DHAVE_UTIME_H \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_INTPTR_T \ + -DENABLE_HTREE=1 \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF \ + -DDISABLE_BACKTRACE=1 + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(e2fsck_src_files) +LOCAL_C_INCLUDES := $(e2fsck_c_includes) +LOCAL_CFLAGS := $(e2fsck_cflags) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(e2fsck_system_shared_libraries) +LOCAL_SHARED_LIBRARIES := $(e2fsck_shared_libraries) +LOCAL_MODULE := e2fsck +LOCAL_MODULE_TAGS := optional +include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(e2fsck_src_files) +LOCAL_C_INCLUDES := $(e2fsck_c_includes) +LOCAL_CFLAGS := $(e2fsck_cflags) +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(e2fsck_shared_libraries)) +LOCAL_MODULE := e2fsck_host +LOCAL_MODULE_STEM := e2fsck +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_EXECUTABLE) diff --git a/lib/Android.mk b/lib/Android.mk new file mode 100644 index 000000000..5053e7d64 --- /dev/null +++ b/lib/Android.mk @@ -0,0 +1 @@ +include $(call all-subdir-makefiles) diff --git a/lib/blkid/Android.mk b/lib/blkid/Android.mk new file mode 100644 index 000000000..53925a39a --- /dev/null +++ b/lib/blkid/Android.mk @@ -0,0 +1,77 @@ +LOCAL_PATH := $(call my-dir) + +libext2_blkid_src_files := \ + cache.c \ + dev.c \ + devname.c \ + devno.c \ + getsize.c \ + llseek.c \ + probe.c \ + read.c \ + resolve.c \ + save.c \ + tag.c \ + version.c \ + + +libext2_blkid_shared_libraries := libext2_uuid + +libext2_blkid_system_shared_libraries := libc + +libext2_blkid_c_includes := external/e2fsprogs/lib + +libext2_blkid_cflags := -O2 -g -W -Wall -fno-strict-aliasing \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +libext2_blkid_cflags_linux := \ + -DHAVE_LINUX_FD_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_blkid_src_files) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_blkid_system_shared_libraries) +LOCAL_SHARED_LIBRARIES := $(libext2_blkid_shared_libraries) +LOCAL_C_INCLUDES := $(libext2_blkid_c_includes) +LOCAL_CFLAGS := $(libext2_blkid_cflags) $(libext2_blkid_cflags_linux) -fno-strict-aliasing +LOCAL_MODULE := libext2_blkid +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_blkid_src_files) +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(libext2_blkid_shared_libraries)) +LOCAL_C_INCLUDES := $(libext2_blkid_c_includes) +ifeq ($(HOST_OS),linux) +LOCAL_CFLAGS := $(libext2_blkid_cflags) $(libext2_blkid_cflags_linux) +else +LOCAL_CFLAGS := $(libext2_blkid_cflags) +endif +LOCAL_MODULE := libext2_blkid_host +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_SHARED_LIBRARY) diff --git a/lib/e2p/Android.mk b/lib/e2p/Android.mk new file mode 100644 index 000000000..7fd6e51f8 --- /dev/null +++ b/lib/e2p/Android.mk @@ -0,0 +1,74 @@ +LOCAL_PATH := $(call my-dir) + +libext2_e2p_src_files := \ + feature.c \ + fgetflags.c \ + fsetflags.c \ + fgetversion.c \ + fsetversion.c \ + getflags.c \ + getversion.c \ + hashstr.c \ + iod.c \ + ls.c \ + mntopts.c \ + parse_num.c \ + pe.c \ + pf.c \ + ps.c \ + setflags.c \ + setversion.c \ + uuid.c \ + ostype.c \ + percent.c + +libext2_e2p_c_includes := external/e2fsprogs/lib + +libext2_e2p_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +libext2_e2p_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_e2p_src_files) +LOCAL_C_INCLUDES := $(libext2_e2p_c_includes) +LOCAL_CFLAGS := $(libext2_e2p_cflags) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_e2p_system_shared_libraries) +LOCAL_MODULE := libext2_e2p +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_e2p_src_files) +LOCAL_C_INCLUDES := $(libext2_e2p_c_includes) +LOCAL_CFLAGS := $(libext2_e2p_cflags) +LOCAL_MODULE := libext2_e2p_host +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_SHARED_LIBRARY) diff --git a/lib/et/Android.mk b/lib/et/Android.mk new file mode 100644 index 000000000..42af71c47 --- /dev/null +++ b/lib/et/Android.mk @@ -0,0 +1,65 @@ +LOCAL_PATH := $(call my-dir) + +libext2_com_err_src_files := \ + error_message.c \ + et_name.c \ + init_et.c \ + com_err.c \ + com_right.c + +libext2_com_err_c_includes := external/e2fsprogs/lib + +libext2_com_err_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +libext2_com_err_cflags_linux := \ + -DHAVE_LINUX_FD_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE + +libext2_com_err_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_com_err_src_files) +LOCAL_C_INCLUDES := $(libext2_com_err_c_includes) +LOCAL_CFLAGS := $(libext2_com_err_cflags) $(libext2_com_err_cflags_linux) +LOCAL_SYSTEM_SHARED_LIBRARIES := libc +LOCAL_MODULE := libext2_com_err +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_com_err_src_files) +LOCAL_C_INCLUDES := $(libext2_com_err_c_includes) +ifeq ($(HOST_OS),linux) +LOCAL_CFLAGS := $(libext2_com_err_cflags) $(libext2_com_err_cflags_linux) +else +LOCAL_CFLAGS := $(libext2_com_err_cflags) +endif +LOCAL_MODULE := libext2_com_err_host +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_SHARED_LIBRARY) diff --git a/lib/ext2fs/Android.mk b/lib/ext2fs/Android.mk new file mode 100644 index 000000000..96f587cb3 --- /dev/null +++ b/lib/ext2fs/Android.mk @@ -0,0 +1,144 @@ +LOCAL_PATH := $(call my-dir) + +libext2fs_src_files := \ + ext2_err.c \ + alloc.c \ + alloc_sb.c \ + alloc_stats.c \ + alloc_tables.c \ + badblocks.c \ + bb_inode.c \ + bitmaps.c \ + bitops.c \ + blkmap64_ba.c \ + blkmap64_rb.c \ + blknum.c \ + block.c \ + bmap.c \ + check_desc.c \ + crc16.c \ + crc32c.c \ + csum.c \ + closefs.c \ + dblist.c \ + dblist_dir.c \ + dirblock.c \ + dirhash.c \ + dir_iterate.c \ + dupfs.c \ + expanddir.c \ + ext_attr.c \ + extent.c \ + fileio.c \ + finddev.c \ + flushb.c \ + freefs.c \ + gen_bitmap.c \ + gen_bitmap64.c \ + get_num_dirs.c \ + get_pathname.c \ + getsize.c \ + getsectsize.c \ + i_block.c \ + icount.c \ + ind_block.c \ + initialize.c \ + inline.c \ + inline_data.c \ + inode.c \ + io_manager.c \ + ismounted.c \ + link.c \ + llseek.c \ + lookup.c \ + mmp.c \ + mkdir.c \ + mkjournal.c \ + namei.c \ + native.c \ + newdir.c \ + openfs.c \ + progress.c \ + punch.c \ + rbtree.c \ + read_bb.c \ + read_bb_file.c \ + res_gdt.c \ + rw_bitmaps.c \ + swapfs.c \ + symlink.c \ + tdb.c \ + undo_io.c \ + unix_io.c \ + unlink.c \ + valid_blk.c \ + version.c + +# get rid of this?! +libext2fs_src_files += test_io.c + +libext2fs_shared_libraries := \ + libext2_com_err \ + libext2_uuid \ + libext2_blkid \ + libext2_e2p + +libext2fs_system_shared_libraries := libc + +libext2fs_c_includes := external/e2fsprogs/lib + +libext2fs_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +libext2fs_cflags_linux := \ + -DHAVE_MALLOC_H=1 \ + -DHAVE_LINUX_FD_H=1 \ + -DHAVE_SYS_PRCTL_H=1 \ + -DHAVE_LSEEK64=1 \ + -DHAVE_LSEEK64_PROTOTYPE=1 + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2fs_src_files) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2fs_system_shared_libraries) +LOCAL_SHARED_LIBRARIES := $(libext2fs_shared_libraries) +LOCAL_C_INCLUDES := $(libext2fs_c_includes) +LOCAL_CFLAGS := $(libext2fs_cflags) $(libext2fs_cflags_linux) +LOCAL_MODULE := libext2fs +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2fs_src_files) +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(libext2fs_shared_libraries)) +LOCAL_C_INCLUDES := $(libext2fs_c_includes) +ifeq ($(HOST_OS),linux) +LOCAL_CFLAGS := $(libext2fs_cflags) $(libext2fs_cflags_linux) +else +LOCAL_CFLAGS := $(libext2fs_cflags) +endif +LOCAL_MODULE := libext2fs_host +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_SHARED_LIBRARY) diff --git a/lib/quota/Android.mk b/lib/quota/Android.mk new file mode 100644 index 000000000..888591b34 --- /dev/null +++ b/lib/quota/Android.mk @@ -0,0 +1,60 @@ +LOCAL_PATH := $(call my-dir) + +libext2_quota_src_files := \ + mkquota.c \ + quotaio.c \ + quotaio_tree.c \ + quotaio_v2.c \ + ../../e2fsck/dict.c + +libext2_quota_c_includes := external/e2fsprogs/lib + +libext2_quota_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +libext2_quota_shared_libraries := libext2fs libext2_com_err + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_quota_src_files) +LOCAL_C_INCLUDES := $(libext2_quota_c_includes) +LOCAL_CFLAGS := $(libext2_quota_cflags) +LOCAL_SYSTEM_SHARED_LIBRARIES := libc $(libext2_quota_shared_libraries) +LOCAL_MODULE := libext2_quota +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_quota_src_files) +LOCAL_C_INCLUDES := $(libext2_quota_c_includes) +LOCAL_CFLAGS := $(libext2_quota_cflags) +LOCAL_MODULE := libext2_quota_host +LOCAL_MODULE_TAGS := optional +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(libext2_quota_shared_libraries)) + +include $(BUILD_HOST_SHARED_LIBRARY) diff --git a/lib/uuid/Android.mk b/lib/uuid/Android.mk new file mode 100644 index 000000000..f89516002 --- /dev/null +++ b/lib/uuid/Android.mk @@ -0,0 +1,89 @@ +LOCAL_PATH := $(call my-dir) + +libext2_uuid_src_files := \ + clear.c \ + compare.c \ + copy.c \ + gen_uuid.c \ + isnull.c \ + pack.c \ + parse.c \ + unpack.c \ + unparse.c \ + uuid_time.c + + +libext2_uuid_c_includes := external/e2fsprogs/lib + +libext2_uuid_cflags := -O2 -g -W -Wall \ + -DHAVE_INTTYPES_H \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +libext2_uuid_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_uuid_src_files) +LOCAL_C_INCLUDES := $(libext2_uuid_c_includes) +LOCAL_CFLAGS := $(libext2_uuid_cflags) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_uuid_system_shared_libraries) +LOCAL_MODULE := libext2_uuid +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_uuid_src_files) +LOCAL_C_INCLUDES := $(libext2_uuid_c_includes) +LOCAL_CFLAGS := $(libext2_uuid_cflags) +LOCAL_MODULE := libext2_uuid_host +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_SHARED_LIBRARY) + + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_uuid_src_files) +LOCAL_C_INCLUDES := $(libext2_uuid_c_includes) +LOCAL_CFLAGS := $(libext2_uuid_cflags) +LOCAL_STATIC_LIBRARIES := libc +LOCAL_MODULE := libext2_uuid_static +LOCAL_MODULE_TAGS := optional + +include $(BUILD_STATIC_LIBRARY) + + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libext2_uuid_src_files) +LOCAL_C_INCLUDES := $(libext2_uuid_c_includes) +LOCAL_CFLAGS := $(libext2_uuid_cflags) +LOCAL_MODULE := libext2_uuid_host +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_STATIC_LIBRARY) diff --git a/misc/Android.mk b/misc/Android.mk new file mode 100644 index 000000000..b596b7862 --- /dev/null +++ b/misc/Android.mk @@ -0,0 +1,431 @@ +LOCAL_PATH := $(call my-dir) + +######################################################################### +# Build mke2fs +mke2fs_src_files := \ + mke2fs.c \ + util.c \ + mk_hugefiles.c \ + default_profile.c \ + create_inode.c \ + plausible.c + +mke2fs_c_includes := \ + external/e2fsprogs/lib \ + external/e2fsprogs/e2fsck + +mke2fs_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRCASECMP \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_GETOPT_H \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +mke2fs_cflags_linux := \ + -DHAVE_LINUX_FD_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE + +mke2fs_cflags += -DNO_CHECK_BB + +mke2fs_shared_libraries := \ + libext2fs \ + libext2_blkid \ + libext2_uuid \ + libext2_profile \ + libext2_quota \ + libext2_com_err \ + libext2_e2p + +mke2fs_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(mke2fs_src_files) +LOCAL_C_INCLUDES := $(mke2fs_c_includes) +LOCAL_CFLAGS := $(mke2fs_cflags) $(mke2fs_cflags_linux) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(mke2fs_system_shared_libraries) +LOCAL_SHARED_LIBRARIES := $(mke2fs_shared_libraries) +LOCAL_MODULE := mke2fs +LOCAL_MODULE_TAGS := optional +include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(mke2fs_src_files) +LOCAL_C_INCLUDES := $(mke2fs_c_includes) +ifeq ($(HOST_OS),linux) +LOCAL_CFLAGS := $(mke2fs_cflags) $(mke2fs_cflags_linux) +else +LOCAL_CFLAGS := $(mke2fs_cflags) +endif +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(mke2fs_shared_libraries)) +LOCAL_MODULE := mke2fs_host +LOCAL_MODULE_STEM := mke2fs +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_EXECUTABLE) + +########################################################################### +# Build tune2fs +# +tune2fs_src_files := \ + tune2fs.c \ + plausible.c \ + util.c + +tune2fs_c_includes := \ + external/e2fsprogs/lib \ + external/e2fsprogs/e2fsck + +tune2fs_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRCASECMP \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_GETOPT_H \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +tune2fs_cflags += -DNO_CHECK_BB + +tune2fs_shared_libraries := \ + libext2fs \ + libext2_com_err \ + libext2_blkid \ + libext2_quota \ + libext2_uuid \ + libext2_e2p + +tune2fs_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(tune2fs_src_files) +LOCAL_C_INCLUDES := $(tune2fs_c_includes) +LOCAL_CFLAGS := $(tune2fs_cflags) +LOCAL_SHARED_LIBRARIES := $(tune2fs_shared_libraries) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(tune2fs_system_shared_libraries) +LOCAL_MODULE := tune2fs +LOCAL_MODULE_TAGS := optional + +include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(tune2fs_src_files) +LOCAL_C_INCLUDES := $(tune2fs_c_includes) +LOCAL_CFLAGS := $(tune2fs_cflags) +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(tune2fs_shared_libraries)) +LOCAL_MODULE := tune2fs_host +LOCAL_MODULE_STEM := tune2fs +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_EXECUTABLE) + +######################################################################### +# Build badblocks +# +include $(CLEAR_VARS) + +badblocks_src_files := \ + badblocks.c + +badblocks_c_includes := \ + external/e2fsprogs/lib + +badblocks_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRCASECMP \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_GETOPT_H \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +badblocks_shared_libraries := \ + libext2fs \ + libext2_com_err \ + libext2_uuid \ + libext2_blkid \ + libext2_e2p + +badblocks_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(badblocks_src_files) +LOCAL_C_INCLUDES := $(badblocks_c_includes) +LOCAL_CFLAGS := $(badblocks_cflags) +LOCAL_SHARED_LIBRARIES := $(badblocks_shared_libraries) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(badblocks_system_shared_libraries) +LOCAL_MODULE := badblocks +LOCAL_MODULE_TAGS := optional + +include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(badblocks_src_files) +LOCAL_C_INCLUDES := $(badblocks_c_includes) +LOCAL_CFLAGS := $(badblocks_cflags) +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(badblocks_shared_libraries)) +LOCAL_MODULE := badblocks_host +LOCAL_MODULE_STEM := badblocks +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_EXECUTABLE) + +######################################################################### +# Build chattr +# +include $(CLEAR_VARS) + +chattr_src_files := \ + chattr.c + +chattr_c_includes := \ + external/e2fsprogs/lib + +chattr_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRCASECMP \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_GETOPT_H \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +chattr_shared_libraries := \ + libext2_com_err \ + libext2_e2p + +chattr_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(chattr_src_files) +LOCAL_C_INCLUDES := $(chattr_c_includes) +LOCAL_CFLAGS := $(chattr_cflags) +LOCAL_SHARED_LIBRARIES := $(chattr_shared_libraries) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(chattr_system_shared_libraries) +LOCAL_MODULE := chattr +LOCAL_MODULE_TAGS := optional + +include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(chattr_src_files) +LOCAL_C_INCLUDES := $(chattr_c_includes) +LOCAL_CFLAGS := $(chattr_cflags) +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(chattr_shared_libraries)) +LOCAL_MODULE := chattr_host +LOCAL_MODULE_STEM := chattr +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_EXECUTABLE) + +######################################################################### +# Build lsattr +# +include $(CLEAR_VARS) + +lsattr_src_files := \ + lsattr.c + +lsattr_c_includes := \ + external/e2fsprogs/lib + +lsattr_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRCASECMP \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_GETOPT_H \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +lsattr_shared_libraries := \ + libext2_com_err \ + libext2_e2p + +lsattr_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(lsattr_src_files) +LOCAL_C_INCLUDES := $(lsattr_c_includes) +LOCAL_CFLAGS := $(lsattr_cflags) +LOCAL_SHARED_LIBRARIES := $(lsattr_shared_libraries) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(lsattr_system_shared_libraries) +LOCAL_MODULE := lsattr +LOCAL_MODULE_TAGS := optional + +include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(lsattr_src_files) +LOCAL_C_INCLUDES := $(lsattr_c_includes) +LOCAL_CFLAGS := $(lsattr_cflags) +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(lsattr_shared_libraries)) +LOCAL_MODULE := lsattr_host +LOCAL_MODULE_STEM := lsattr +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_EXECUTABLE) + +######################################################################### +# Build blkid +# +include $(CLEAR_VARS) + +blkid_src_files := \ + blkid.c + +blkid_c_includes := \ + external/e2fsprogs/lib + +blkid_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRCASECMP \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_GETOPT_H \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF \ + -DHAVE_TERMIO_H + +blkid_shared_libraries := \ + libext2fs \ + libext2_blkid \ + libext2_com_err \ + libext2_e2p + +blkid_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(blkid_src_files) +LOCAL_C_INCLUDES := $(blkid_c_includes) +LOCAL_CFLAGS := $(blkid_cflags) +LOCAL_SHARED_LIBRARIES := $(blkid_shared_libraries) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(blkid_system_shared_libraries) +LOCAL_MODULE := blkid +LOCAL_MODULE_TAGS := optional + +include $(BUILD_EXECUTABLE) diff --git a/resize/Android.mk b/resize/Android.mk new file mode 100644 index 000000000..41f9fe08b --- /dev/null +++ b/resize/Android.mk @@ -0,0 +1,69 @@ +LOCAL_PATH := $(call my-dir) + +resize2fs_src_files := \ + extent.c \ + resize2fs.c \ + main.c \ + online.c \ + sim_progress.c \ + resource_track.c + +resize2fs_c_includes := external/e2fsprogs/lib + +resize2fs_cflags := -O2 -g -W -Wall \ + -DHAVE_UNISTD_H \ + -DHAVE_ERRNO_H \ + -DHAVE_NETINET_IN_H \ + -DHAVE_SYS_IOCTL_H \ + -DHAVE_SYS_MMAN_H \ + -DHAVE_SYS_MOUNT_H \ + -DHAVE_SYS_PRCTL_H \ + -DHAVE_SYS_RESOURCE_H \ + -DHAVE_SYS_SELECT_H \ + -DHAVE_SYS_STAT_H \ + -DHAVE_SYS_TYPES_H \ + -DHAVE_STDLIB_H \ + -DHAVE_STRDUP \ + -DHAVE_MMAP \ + -DHAVE_UTIME_H \ + -DHAVE_GETPAGESIZE \ + -DHAVE_LSEEK64 \ + -DHAVE_LSEEK64_PROTOTYPE \ + -DHAVE_EXT2_IOCTLS \ + -DHAVE_LINUX_FD_H \ + -DHAVE_TYPE_SSIZE_T \ + -DHAVE_SYS_TIME_H \ + -DHAVE_SYS_PARAM_H \ + -DHAVE_SYSCONF + +resize2fs_shared_libraries := \ + libext2fs \ + libext2_com_err \ + libext2_e2p \ + libext2_uuid \ + libext2_blkid + +resize2fs_system_shared_libraries := libc + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(resize2fs_src_files) +LOCAL_C_INCLUDES := $(resize2fs_c_includes) +LOCAL_CFLAGS := $(resize2fs_cflags) +LOCAL_SHARED_LIBRARIES := $(resize2fs_shared_libraries) +LOCAL_SYSTEM_SHARED_LIBRARIES := $(resize2fs_system_shared_libraries) +LOCAL_MODULE := resize2fs +LOCAL_MODULE_TAGS := optional +include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(resize2fs_src_files) +LOCAL_C_INCLUDES := $(resize2fs_c_includes) +LOCAL_CFLAGS := $(resize2fs_cflags) +LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(resize2fs_shared_libraries)) +LOCAL_MODULE := resize2fs_host +LOCAL_MODULE_STEM := resize2fs +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_EXECUTABLE) diff --git a/util/android_config.h b/util/android_config.h new file mode 100644 index 000000000..f88c6d15d --- /dev/null +++ b/util/android_config.h @@ -0,0 +1,7 @@ +/* work around bug in AndroidConfig.h */ +#ifdef HAVE_MALLOC_H +#undef HAVE_MALLOC_H +#define HAVE_MALLOC_H 1 +#endif + +#define ROOT_SYSCONFDIR "/etc" diff --git a/util/android_types.h b/util/android_types.h new file mode 100644 index 000000000..2b3e78f66 --- /dev/null +++ b/util/android_types.h @@ -0,0 +1,39 @@ +/* + * If linux/types.h is already been included, assume it has defined + * everything we need. (cross fingers) Other header files may have + * also defined the types that we need. + */ +#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \ + !defined(_EXT2_TYPES_H)) +#define _EXT2_TYPES_H + +typedef unsigned char __u8; +typedef __signed__ char __s8; +typedef unsigned short __u16; +typedef __signed__ short __s16; +typedef unsigned int __u32; +typedef __signed__ int __s32; +typedef unsigned long long __u64; +typedef __signed__ long long __s64; +#endif + +/* endian checking stuff */ +#ifndef EXT2_ENDIAN_H_ +#define EXT2_ENDIAN_H_ + +#ifdef __CHECKER__ +#define __bitwise __attribute__((bitwise)) +#define __force __attribute__((force)) +#else +#define __bitwise +#define __force +#endif + +typedef __u16 __bitwise __le16; +typedef __u32 __bitwise __le32; +typedef __u64 __bitwise __le64; +typedef __u16 __bitwise __be16; +typedef __u32 __bitwise __be32; +typedef __u64 __bitwise __be64; + +#endif /* EXT2_ENDIAN_H_ */ diff --git a/util/gen-android-files b/util/gen-android-files new file mode 100755 index 000000000..240b93054 --- /dev/null +++ b/util/gen-android-files @@ -0,0 +1,39 @@ +#!/bin/sh + +ANDROID_GENERATED_FILES="lib/ext2fs/ext2_err.c lib/ext2fs/ext2_err.h \ + lib/ss/ss_err.c lib/ss/ss_err.h e2fsck/prof_err.c \ + e2fsck/prof_err.h misc/prof_err.c misc/prof_err.h \ + e2fsck/nls-enable.h e2fsck/plausible.c e2fsck/plausible.h \ + lib/blkid/blkid_types.h lib/uuid/uuid_types.h \ + lib/ext2fs/ext2_types.h lib/config.h lib/blkid/blkid.h \ + lib/uuid/uuid.h lib/ext2fs/crc32c_table.h misc/default_profile.c" + +sed -e "s/@E2FSPROGS_VERSION@/$(git describe)/" < lib/ext2fs/ext2_err.et.in > lib/ext2fs/ext2_err.et + +for i in lib/ss/ss_err e2fsck/prof_err lib/ext2fs/ext2_err +do + rm -f $i.c $i.h + awk -f lib/et/et_c.awk outfile=$i.c outfn=$(basename $i.c) $i.et + awk -f lib/et/et_h.awk outfile=$i.h outfn=$(basename $i.h) $i.et +done +rm -f misc/prof_err.[ch] +cp e2fsck/prof_err.[ch] misc/ + +cp lib/blkid/blkid.h.in lib/blkid/blkid.h +cp lib/uuid/uuid.h.in lib/uuid/uuid.h +cp util/android_types.h lib/ext2fs/ext2_types.h +cp util/android_types.h lib/blkid/blkid_types.h +cp util/android_types.h lib/uuid/uuid_types.h +cp util/android_config.h lib/config.h +cp misc/plausible.? e2fsck/ +cp misc/nls-enable.h e2fsck/ + +gcc -o gen_crc32ctable lib/ext2fs/gen_crc32ctable.c +./gen_crc32ctable > lib/ext2fs/crc32c_table.h + +awk -f misc/profile-to-c.awk < misc/mke2fs.conf.in > misc/default_profile.c + +rm -f ./gen_crc32table ./gen_crc32ctable lib/ext2fs/ext2_err.et + +git add -f $ANDROID_GENERATED_FILES +git commit -m "Update generated files for Android" -- 2.39.2