| 1 | <!-- |
| 2 | SPDX-License-Identifier: CC0-1.0 |
| 3 | SPDX-FileCopyrightText: 2022 Linaro Ltd. |
| 4 | SPDX-FileCopyrightText: 2022 Viresh Kumar <[email protected]> |
| 5 | --> |
| 6 | |
| 7 | # Generated libgpiod-sys Rust FFI bindings |
| 8 | Automatically generated Rust FFI bindings via |
| 9 | [bindgen](https://github.com/rust-lang/rust-bindgen). |
| 10 | |
| 11 | Typically, you will want to use the safe `libgpiod` wrapper crate instead of |
| 12 | these unsafe wrappers around the C lib. |
| 13 | |
| 14 | ## Build requirements |
| 15 | |
| 16 | A compatible variant of the C library needs to detectable using pkg-config. |
| 17 | Alternatively, one can inform the build system about the location of the |
| 18 | libs and headers by setting environment variables. The mechanism for that is |
| 19 | documented in the |
| 20 | [system_deps crate documentation](https://docs.rs/system-deps/6.1.0/system_deps/#overriding-build-flags). |
| 21 | |
| 22 | If installing libgpiod is undesired, one can set the following environent |
| 23 | variables in order to build against the intermediate build results of a `make` |
| 24 | build of the C lib (paths are relative to the Cargo.toml): |
| 25 | |
| 26 | export SYSTEM_DEPS_LIBGPIOD_NO_PKG_CONFIG=1 |
| 27 | export SYSTEM_DEPS_LIBGPIOD_SEARCH_NATIVE="<PATH-TO-LIBGPIOD>/lib/.libs/" |
| 28 | export SYSTEM_DEPS_LIBGPIOD_LIB=gpiod |
| 29 | export SYSTEM_DEPS_LIBGPIOD_INCLUDE="<PATH-TO-LIBGPIOD>/include/" |
| 30 | |
| 31 | ## License |
| 32 | |
| 33 | This project is licensed under either of |
| 34 | |
| 35 | - [Apache License](http://www.apache.org/licenses/LICENSE-2.0), Version 2.0 |
| 36 | - [BSD-3-Clause License](https://opensource.org/licenses/BSD-3-Clause) |