xref: /aosp_15_r20/external/libdivsufsort/Android.bp (revision 30b9430b2d8672faf9045aa522d63599a84e8e49)
1*30b9430bSXin Li//
2*30b9430bSXin Li// Copyright (C) 2015 The Android Open Source Project
3*30b9430bSXin Li//
4*30b9430bSXin Li// Licensed under the Apache License, Version 2.0 (the "License");
5*30b9430bSXin Li// you may not use this file except in compliance with the License.
6*30b9430bSXin Li// You may obtain a copy of the License at
7*30b9430bSXin Li//
8*30b9430bSXin Li//      http://www.apache.org/licenses/LICENSE-2.0
9*30b9430bSXin Li//
10*30b9430bSXin Li// Unless required by applicable law or agreed to in writing, software
11*30b9430bSXin Li// distributed under the License is distributed on an "AS IS" BASIS,
12*30b9430bSXin Li// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*30b9430bSXin Li// See the License for the specific language governing permissions and
14*30b9430bSXin Li// limitations under the License.
15*30b9430bSXin Li//
16*30b9430bSXin Li
17*30b9430bSXin Lipackage {
18*30b9430bSXin Li    default_applicable_licenses: ["external_libdivsufsort_license"],
19*30b9430bSXin Li}
20*30b9430bSXin Li
21*30b9430bSXin Li// Added automatically by a large-scale-change that took the approach of
22*30b9430bSXin Li// 'apply every license found to every target'. While this makes sure we respect
23*30b9430bSXin Li// every license restriction, it may not be entirely correct.
24*30b9430bSXin Li//
25*30b9430bSXin Li// e.g. GPL in an MIT project might only apply to the contrib/ directory.
26*30b9430bSXin Li//
27*30b9430bSXin Li// Please consider splitting the single license below into multiple licenses,
28*30b9430bSXin Li// taking care not to lose any license_kind information, and overriding the
29*30b9430bSXin Li// default license using the 'licenses: [...]' property on targets as needed.
30*30b9430bSXin Li//
31*30b9430bSXin Li// For unused files, consider creating a 'fileGroup' with "//visibility:private"
32*30b9430bSXin Li// to attach the license to, and including a comment whether the files may be
33*30b9430bSXin Li// used in the current project.
34*30b9430bSXin Li// See: http://go/android-license-faq
35*30b9430bSXin Lilicense {
36*30b9430bSXin Li    name: "external_libdivsufsort_license",
37*30b9430bSXin Li    visibility: [":__subpackages__"],
38*30b9430bSXin Li    license_kinds: [
39*30b9430bSXin Li        "SPDX-license-identifier-Apache-2.0",
40*30b9430bSXin Li        "SPDX-license-identifier-MIT",
41*30b9430bSXin Li    ],
42*30b9430bSXin Li    license_text: [
43*30b9430bSXin Li        "LICENSE",
44*30b9430bSXin Li    ],
45*30b9430bSXin Li}
46*30b9430bSXin Li
47*30b9430bSXin Licc_defaults {
48*30b9430bSXin Li    name: "libdivsufsort_defaults",
49*30b9430bSXin Li    host_supported: true,
50*30b9430bSXin Li    recovery_available: true,
51*30b9430bSXin Li    srcs: [
52*30b9430bSXin Li        "lib/divsufsort.c",
53*30b9430bSXin Li        "lib/sssort.c",
54*30b9430bSXin Li        "lib/trsort.c",
55*30b9430bSXin Li        "lib/utils.c",
56*30b9430bSXin Li    ],
57*30b9430bSXin Li    local_include_dirs: ["include"],
58*30b9430bSXin Li    export_include_dirs: ["android_include"],
59*30b9430bSXin Li    cflags: [
60*30b9430bSXin Li        "-Wall",
61*30b9430bSXin Li        "-Werror",
62*30b9430bSXin Li        "-Wextra",
63*30b9430bSXin Li        "-DHAVE_CONFIG_H=1",
64*30b9430bSXin Li    ],
65*30b9430bSXin Li}
66*30b9430bSXin Li
67*30b9430bSXin Li// libdivsufsort defines two different libraries compiled from the same
68*30b9430bSXin Li// codebase. The libraries export different symbols and differ on the integer
69*30b9430bSXin Li// type used in the suffix array index. "libdivsufsort" uses 32-bit integers
70*30b9430bSXin Li// allowing input sizes up to 2GiB, while "libdivsufsort64" uses 64-bit integers
71*30b9430bSXin Li// allowing larger input sizes (8 EiB) but also requiring twice as much memory
72*30b9430bSXin Li// for the smaller inputs.
73*30b9430bSXin Li
74*30b9430bSXin Li// libdivsufsort using 32-bit integers for the suffix array.
75*30b9430bSXin Licc_library_static {
76*30b9430bSXin Li    name: "libdivsufsort",
77*30b9430bSXin Li    defaults: ["libdivsufsort_defaults"],
78*30b9430bSXin Li}
79*30b9430bSXin Li
80*30b9430bSXin Li// libdivsufsort using 64-bit integers for the suffix array.
81*30b9430bSXin Licc_library_static {
82*30b9430bSXin Li    name: "libdivsufsort64",
83*30b9430bSXin Li    defaults: ["libdivsufsort_defaults"],
84*30b9430bSXin Li    cflags: ["-DBUILD_DIVSUFSORT64"],
85*30b9430bSXin Li}
86