From a8b1a6ef6e713eaeaae727e23d9c916015432b60 Mon Sep 17 00:00:00 2001 From: Qiheng Lin Date: Tue, 28 Feb 2023 13:16:27 +0000 Subject: [PATCH] Add configs Signed-off-by: Qiheng Lin --- .gitignore | 1 - BUILD.gn | 83 +++++++++++++++++++++++++++++++++++++++++++++++ OAT.xml | 52 +++++++++++++++++++++++++++++ README.OpenSource | 11 +++++++ bundle.json | 34 +++++++++++++++++++ config.h | 59 +++++++++++++++++++++++++++++++++ 6 files changed, 239 insertions(+), 1 deletion(-) create mode 100644 BUILD.gn create mode 100644 OAT.xml create mode 100644 README.OpenSource create mode 100644 bundle.json create mode 100644 config.h diff --git a/.gitignore b/.gitignore index 97045f6..4d300dd 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,6 @@ Makefile.in Makefile *.m4 stamp-h* -config.* /ltmain.sh /configure /install-sh diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 0000000..9419499 --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,83 @@ +# Copyright (C) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +libfuse_source = [ + "//third_party/libfuse/lib/fuse.c", + "//third_party/libfuse/lib/fuse_loop.c", + "//third_party/libfuse/lib/fuse_loop_mt.c", + "//third_party/libfuse/lib/fuse_lowlevel.c", + "//third_party/libfuse/lib/fuse_opt.c", + "//third_party/libfuse/lib/fuse_signals.c", + "//third_party/libfuse/lib/buffer.c", + "//third_party/libfuse/lib/cuse_lowlevel.c", + "//third_party/libfuse/lib/helper.c", + "//third_party/libfuse/lib/modules/subdir.c", + "//third_party/libfuse/lib/mount_util.c", + "//third_party/libfuse/lib/fuse_log.c", + "//third_party/libfuse/lib/mount.c", + "//third_party/libfuse/lib/modules/iconv.c", +] + +import("//build/ohos.gni") + +config("libfuse_config") { + visibility = [ ":*" ] + + include_dirs = [ + "//third_party/libfuse/include", + "//third_party/libfuse/lib", + "//third_party/libfuse", + ] + + cflags = [ + "-fdiagnostics-color=always", + "-pipe", + "-D_FILE_OFFSET_BITS=64", + "-Winvalid-pch", + "-Wextra", + "-O2", + "-g", + "-D_REENTRANT", + "-Wno-sign-compare", + "-Wmissing-declarations", + "-Wwrite-strings", + "-Wno-unused-result", + "-DFUSE_USE_VERSION=35", + "-DFUSERMOUNT_DIR=\"/usr/local/bin\"", + "-U_GNU_SOURCE", + "-pthread" + ] +} + +ohos_shared_library("libfuse") { + configs = [ "//third_party/libfuse:libfuse_config" ] + sources = libfuse_source + ldflags = [ + "-ldl", + "-Wl,--version-script", + rebase_path("//third_party/libfuse/lib/fuse_versionscript", root_build_dir), + "-Wl,-soname,libfuse3.so.3", + "-Wl,--no-undefined", + "-Wl,--as-needed", + "-shared", + "-fPIC", + ] + external_deps = [ "c_utils:utils" ] + subsystem_name = "thirdparty" + part_name = "libfuse" + output_name = "libfuse" + install_enable = true + install_images = [ "system" ] +} diff --git a/OAT.xml b/OAT.xml new file mode 100644 index 0000000..99735c4 --- /dev/null +++ b/OAT.xml @@ -0,0 +1,52 @@ + + + + + LICENSE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.OpenSource b/README.OpenSource new file mode 100644 index 0000000..bb62185 --- /dev/null +++ b/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name" : "libfuse", + "License" : "LGPL V2.0, BSD 3-Clause License, GPL V2.0, MIT License", + "License File" : "LICENSE", + "Version Number" : "3.10.5", + "Owner" : "maojingjing1@huawei.com", + "Upstream URL" : "https://github.com/libfuse/libfuse/releases/tag/fuse-3.10.5", + "Description" : "libfuse provides the reference implementation for communicating with the FUSE kernel module." + } +] diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000..c2d300b --- /dev/null +++ b/bundle.json @@ -0,0 +1,34 @@ +{ + "name": "@ohos/libfuse", + "description": "libfuse provides the reference implementation for communicating with the FUSE kernel module.", + "version": "3.10.5", + "license": "LGPL V2.0, BSD 3-Clause License, GPL V2.0, MIT License", + "publishAs": "code-segment", + "segment": { + "destPath": "third_party/libfuse" + }, + "dirs": {}, + "scripts": {}, + "licensePath": "LICENSE", + "readmePath": { + "en": "README" + }, + "component": { + "name": "libfuse", + "subsystem": "thirdparty", + "syscap": [], + "features": [], + "adapted_system_type": [], + "rom": "", + "ram": "", + "deps": { + "components": [], + "third_party": [] + }, + "build": { + "sub_component": [], + "inner_kits": [], + "test": [] + } + } +} \ No newline at end of file diff --git a/config.h b/config.h new file mode 100644 index 0000000..a996739 --- /dev/null +++ b/config.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBFUSE_CONFIG_H +#define LIBFUSE_CONFIG_H + +#define HAVE_COPY_FILE_RANGE + +#define HAVE_FALLOCATE + +#define HAVE_FDATASYNC + +#define HAVE_FORK + +#define HAVE_FSTATAT + +#define HAVE_ICONV + +#define HAVE_OPENAT + +#define HAVE_PIPE2 + +#define HAVE_POSIX_FALLOCATE + +#define HAVE_READLINKAT + +#define HAVE_SETXATTR + +#define HAVE_SPLICE + +#define HAVE_STRUCT_STAT_ST_ATIM + +#undef HAVE_STRUCT_STAT_ST_ATIMESPEC + +#define HAVE_UTIMENSAT + +#define HAVE_VMSPLICE + +#define PACKAGE_VERSION "3.10.5" + +#define pthread_setcancelstate(state, p) +#define pthread_cancel(thread) + +#define PTHREAD_CANCEL_ENABLE 0 +#define PTHREAD_CANCEL_DISABLE 0 + +#endif