OSDN Git Service

Snap for 4425573 from a051dfe384c0e42b383d1759400b80e4a8223502 to pi-release
[android-x86/external-libffi.git] / Android.bp
1 // Copyright (C) 2017 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 genrule {
16     name: "ffi_header",
17     cmd: "$(location gen_ffi_header.sh) < $(in) > $(out)",
18     srcs: ["include/ffi.h.in"],
19     out: ["ffi_gen.h"],
20     tool_files: ["gen_ffi_header.sh"],
21 }
22
23 cc_library_static {
24     name: "libffi",
25     cflags: [
26         "-Wall",
27         "-Werror",
28         "-Wno-error=incompatible-pointer-types",
29         "-Wno-pointer-arith",
30         "-Wno-sign-compare",
31         "-Wno-unused-parameter",
32     ],
33     local_include_dirs: ["include"],
34     generated_headers: ["ffi_header"],
35     export_generated_headers: ["ffi_header"],
36     srcs: [
37         "src/debug.c",
38         "src/java_raw_api.c",
39         "src/prep_cif.c",
40         "src/raw_api.c",
41         "src/types.c",
42     ],
43     arch: {
44         arm: {
45             srcs: [
46                 "src/arm/sysv.S",
47                 "src/arm/ffi.c",
48             ],
49             export_include_dirs: ["linux-arm"],
50         },
51         arm64: {
52             srcs: [
53                 "src/aarch64/sysv.S",
54                 "src/aarch64/ffi.c",
55             ],
56             export_include_dirs: ["linux-arm64"],
57         },
58         x86: {
59             srcs: [
60                 "src/x86/ffi.c",
61                 "src/x86/sysv.S",
62                 "src/x86/win32.S",
63             ],
64             asflags: [
65                 "-DHAVE_AS_X86_PCREL",
66                 "-DHAVE_AS_ASCII_PSEUDO_OP",
67             ],
68             export_include_dirs: ["linux-x86"],
69         },
70         x86_64: {
71             srcs: [
72                 "src/x86/ffi64.c",
73                 "src/x86/unix64.S",
74             ],
75             asflags: [
76                 "-DHAVE_AS_X86_PCREL",
77                 "-DHAVE_AS_ASCII_PSEUDO_OP",
78             ],
79             export_include_dirs: ["linux-x86_64"],
80         },
81     },
82 }