diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-11-11 21:33:16 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-11-11 21:33:16 +0000 |
commit | 3f15f46db384dfd42ea2a3a4e173bc8939a3812e (patch) | |
tree | b70dabdd050cf86bf2514482e379850908dfa018 | |
parent | a373f23216120dfa63ec6613ec99639880e35505 (diff) | |
parent | 0f0a929337d327faea386440b9934df833d55e9f (diff) | |
download | kmod-3f15f46db384dfd42ea2a3a4e173bc8939a3812e.tar.gz |
Snap for 6001391 from 0f0a929337d327faea386440b9934df833d55e9f to qt-aml-resolv-releaseandroid-mainline-10.0.0_r8android10-mainline-resolv-release
Change-Id: I0162fac370cb94d8f6fe82ec0296556c7034ce51
-rw-r--r-- | Android.bp | 56 | ||||
-rw-r--r-- | port-gnu/config.h | 11 | ||||
-rw-r--r-- | shared/missing.h | 2 |
3 files changed, 49 insertions, 20 deletions
@@ -1,4 +1,32 @@ -cc_binary_host { +cc_defaults { + name: "libkmod_cflags_common", + local_include_dirs: ["port-gnu"], + cflags: [ + "-include config.h", + "-ffunction-sections", + "-fdata-sections", + "-Wall", + "-Werror", + "-Wno-format", + "-Wno-unused-parameter", + "-Wno-unused-variable", + "-Dsecure_getenv=getenv", + "-DHAVE_CONFIG_H", + "-DANOTHER_BRICK_IN_THE", + "-DSYSCONFDIR=\"/tmp\"", + ], + target: { + linux_glibc: { + cflags: ["-DHAVE_DECL_STRNDUPA"] + } + } +} + +cc_library_static { + defaults: ["libkmod_cflags_common"], + export_include_dirs: ["libkmod"], + host_supported: true, + name: "libkmod", srcs: [ "libkmod/libkmod.c", "libkmod/libkmod-file.c", @@ -13,6 +41,14 @@ cc_binary_host { "shared/util.c", "shared/hash.c", "shared/strbuf.c", + ], + visibility: ["//external/igt-gpu-tools"], +} + +cc_binary_host { + defaults: ["libkmod_cflags_common"], + name: "depmod", + srcs: [ "tools/port.c", "tools/depmod.c", "tools/kmod.c", @@ -26,21 +62,5 @@ cc_binary_host { "tools/lsmod.c", "tools/remove.c", ], - - name: "depmod", - local_include_dirs: ["port-gnu"], - cflags: [ - "-include config.h", - "-ffunction-sections", - "-fdata-sections", - "-Wall", - "-Werror", - "-Wno-format", - "-Wno-unused-parameter", - "-Wno-unused-variable", - "-Dsecure_getenv=getenv", - "-DHAVE_CONFIG_H", - "-DANOTHER_BRICK_IN_THE", - "-DSYSCONFDIR=\"/tmp\"", - ], + static_libs: ["libkmod"], } diff --git a/port-gnu/config.h b/port-gnu/config.h index 8f527cb..eb4ce84 100644 --- a/port-gnu/config.h +++ b/port-gnu/config.h @@ -22,7 +22,7 @@ /* Define to 1 if you have the declaration of `strndupa', and to 0 if you don't. */ -#define HAVE_DECL_STRNDUPA 1 +/* #define HAVE_DECL_STRNDUPA */ /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 @@ -181,3 +181,12 @@ char* basename(const char*); #include <endian.h> #endif + +#if defined(__ANDROID__) +#include <stdlib.h> +#include <unistd.h> +static inline char *get_current_dir_name(void) +{ + return getcwd(malloc(PATH_MAX), PATH_MAX); +} +#endif diff --git a/shared/missing.h b/shared/missing.h index 4c0d136..72aaa95 100644 --- a/shared/missing.h +++ b/shared/missing.h @@ -33,7 +33,7 @@ static inline int finit_module(int fd, const char *uargs, int flags) } #endif -#if !HAVE_DECL_STRNDUPA +#if (!HAVE_DECL_STRNDUPA && !defined(__APPLE__)) #define strndupa(s, n) \ ({ \ const char *__old = (s); \ |