OSDN Git Service

libext2fs: Export the library include path.
authorAlex Deymo <deymo@google.com>
Thu, 3 Sep 2015 02:07:46 +0000 (19:07 -0700)
committerAlex Deymo <deymo@google.com>
Mon, 16 Nov 2015 18:49:10 +0000 (10:49 -0800)
When adding 'libext2fs' as a library dependency from any other binary,
the binary needs to find the library headers. Users of this library
should not hard-code the include path themselves. This patch exports the
library headers on all three version of the libext2fs library and
removes the redundant include path from executables in e2fsprogs.

Bug: b/23084776
TEST=mma

Change-Id: Idfbfcd2b671a9cddd08c322bc916a5efcc3cffe1
(cherry picked from commit 941ca9e47429b8e0ee86b7b72ca0a107ddc09d22)

e2fsck/Android.mk
lib/ext2fs/Android.mk
misc/Android.mk

index b4b2aef..afae91f 100644 (file)
@@ -37,7 +37,7 @@ libext2_profile_cflags := -O2 -g -W -Wall \
        -DHAVE_LINUX_FD_H \
        -DHAVE_TYPE_SSIZE_T \
        -DHAVE_SYS_TIME_H \
-        -DHAVE_SYS_PARAM_H \
+       -DHAVE_SYS_PARAM_H \
        -DHAVE_SYSCONF \
        -DDISABLE_BACKTRACE=1
 
@@ -106,7 +106,7 @@ e2fsck_shared_libraries := \
        libext2_e2p
 e2fsck_system_shared_libraries := libc
 
-e2fsck_c_includes := external/e2fsprogs/lib
+e2fsck_c_includes :=
 
 e2fsck_cflags := -O2 -g -W -Wall -fno-strict-aliasing \
        -DHAVE_DIRENT_H \
@@ -136,7 +136,7 @@ e2fsck_cflags := -O2 -g -W -Wall -fno-strict-aliasing \
        -DHAVE_INTPTR_T \
        -DENABLE_HTREE=1 \
        -DHAVE_SYS_TIME_H \
-        -DHAVE_SYS_PARAM_H \
+       -DHAVE_SYS_PARAM_H \
        -DHAVE_SYSCONF \
        -DDISABLE_BACKTRACE=1
 
index 467ca7e..4755ade 100644 (file)
@@ -124,6 +124,7 @@ 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_EXPORT_C_INCLUDE_DIRS := $(libext2fs_c_includes)
 LOCAL_CFLAGS := $(libext2fs_cflags) $(libext2fs_cflags_linux)
 LOCAL_MODULE := libext2fs
 LOCAL_MODULE_TAGS := optional
@@ -135,6 +136,7 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := $(libext2fs_src_files)
 LOCAL_STATIC_LIBRARIES := $(libext2fs_static_libraries) $(libext2fs_system_static_libraries)
 LOCAL_C_INCLUDES := $(libext2fs_c_includes)
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(libext2fs_c_includes)
 LOCAL_CFLAGS := $(libext2fs_cflags) $(libext2fs_cflags_linux)
 LOCAL_MODULE := libext2fs
 LOCAL_MODULE_TAGS := optional
@@ -146,6 +148,7 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := $(libext2fs_src_files)
 LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(libext2fs_shared_libraries))
 LOCAL_C_INCLUDES := $(libext2fs_c_includes)
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(libext2fs_c_includes)
 ifeq ($(HOST_OS),linux)
 LOCAL_CFLAGS := $(libext2fs_cflags) $(libext2fs_cflags_linux)
 else
index 645fc9c..b5af5c2 100644 (file)
@@ -8,7 +8,6 @@ mke2fs_src_files := \
        default_profile.c
 
 mke2fs_c_includes := \
-       external/e2fsprogs/lib \
        external/e2fsprogs/e2fsck
 
 mke2fs_cflags := -O2 -g -W -Wall \
@@ -32,7 +31,7 @@ mke2fs_cflags := -O2 -g -W -Wall \
        -DHAVE_TYPE_SSIZE_T \
        -DHAVE_GETOPT_H \
        -DHAVE_SYS_TIME_H \
-        -DHAVE_SYS_PARAM_H \
+       -DHAVE_SYS_PARAM_H \
        -DHAVE_SYSCONF
 
 mke2fs_cflags_linux := \
@@ -89,7 +88,6 @@ tune2fs_src_files := \
        util.c
 
 tune2fs_c_includes := \
-       external/e2fsprogs/lib \
        external/e2fsprogs/e2fsck
 
 tune2fs_cflags := -O2 -g -W -Wall \
@@ -117,7 +115,7 @@ tune2fs_cflags := -O2 -g -W -Wall \
        -DHAVE_TYPE_SSIZE_T \
        -DHAVE_GETOPT_H \
        -DHAVE_SYS_TIME_H \
-        -DHAVE_SYS_PARAM_H \
+       -DHAVE_SYS_PARAM_H \
        -DHAVE_SYSCONF
 
 tune2fs_cflags += -DNO_CHECK_BB
@@ -198,8 +196,7 @@ include $(CLEAR_VARS)
 badblocks_src_files := \
        badblocks.c
 
-badblocks_c_includes := \
-       external/e2fsprogs/lib
+badblocks_c_includes :=
 
 badblocks_cflags := -O2 -g -W -Wall \
        -DHAVE_UNISTD_H \
@@ -226,7 +223,7 @@ badblocks_cflags := -O2 -g -W -Wall \
        -DHAVE_TYPE_SSIZE_T \
        -DHAVE_GETOPT_H \
        -DHAVE_SYS_TIME_H \
-        -DHAVE_SYS_PARAM_H \
+       -DHAVE_SYS_PARAM_H \
        -DHAVE_SYSCONF
 
 badblocks_shared_libraries := \
@@ -298,7 +295,7 @@ chattr_cflags := -O2 -g -W -Wall \
        -DHAVE_TYPE_SSIZE_T \
        -DHAVE_GETOPT_H \
        -DHAVE_SYS_TIME_H \
-        -DHAVE_SYS_PARAM_H \
+       -DHAVE_SYS_PARAM_H \
        -DHAVE_SYSCONF
 
 chattr_shared_libraries := \
@@ -367,7 +364,7 @@ lsattr_cflags := -O2 -g -W -Wall \
        -DHAVE_TYPE_SSIZE_T \
        -DHAVE_GETOPT_H \
        -DHAVE_SYS_TIME_H \
-        -DHAVE_SYS_PARAM_H \
+       -DHAVE_SYS_PARAM_H \
        -DHAVE_SYSCONF
 
 lsattr_shared_libraries := \
@@ -408,8 +405,7 @@ include $(CLEAR_VARS)
 blkid_src_files := \
     blkid.c
 
-blkid_c_includes := \
-    external/e2fsprogs/lib
+blkid_c_includes :=
 
 blkid_cflags := -O2 -g -W -Wall \
     -DHAVE_UNISTD_H \