OSDN Git Service

Add arm64 build target.
[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: ["-Wno-unused-parameter", "-Wno-sign-compare"],
26     local_include_dirs: ["include"],
27     generated_headers: ["ffi_header"],
28     export_generated_headers: ["ffi_header"],
29     srcs: [
30         "src/debug.c",
31         "src/java_raw_api.c",
32         "src/prep_cif.c",
33         "src/raw_api.c",
34         "src/types.c",
35     ],
36     arch: {
37         arm: {
38             srcs: [
39                 "src/arm/sysv.S",
40                 "src/arm/ffi.c",
41             ],
42             export_include_dirs: ["linux-arm"],
43         },
44         arm64: {
45             srcs: [
46                 "src/aarch64/sysv.S",
47                 "src/aarch64/ffi.c",
48             ],
49             export_include_dirs: ["linux-arm64"],
50         },
51         x86: {
52             srcs: [
53                 "src/x86/ffi.c",
54                 "src/x86/sysv.S",
55                 "src/x86/win32.S",
56             ],
57             asflags: [
58                 "-DHAVE_AS_X86_PCREL",
59                 "-DHAVE_AS_ASCII_PSEUDO_OP",
60             ],
61             export_include_dirs: ["linux-x86"],
62         },
63         x86_64: {
64             srcs: [
65                 "src/x86/ffi64.c",
66                 "src/x86/unix64.S",
67             ],
68             asflags: [
69                 "-DHAVE_AS_X86_PCREL",
70                 "-DHAVE_AS_ASCII_PSEUDO_OP",
71             ],
72             export_include_dirs: ["linux-x86_64"],
73         },
74     },
75 }