README
1-------------------------------------------------------------------------------
2flashrom rust bindings README
3-------------------------------------------------------------------------------
4
5Included within this folder are rust foreign function interface bindings for the
6libflashrom API. libflashrom-sys is an automatically generated binding built
7from the header file by the rust `bindgen` utility. It can be used for 'unsafe'
8raw access to the libflashrom API. libflashrom is a library built on
9libflashrom-sys, exporting a convential rust API.
10
11See the /util/flashrom_tester/flashrom/src/flashromlib.rs file for an example of
12usage.
13
14Build Instructions
15------------------
16
17A rust toolchain is required, rustup is one source for that: https://rustup.rs/
18
19From within child folders of this directory, where the Cargo.toml files live,
20run:
21
22 cargo build
23 cargo test
24 cargo doc --open
25
26The build process uses pkg-config to find the installed version of libflashrom.
27To override the desired version you wish to compile against pkg-config can be
28told where to find the desired header and library, for example:
29
30 env PKG_CONFIG_PATH=$HOME/src/flashrom/build/install/lib/x86_64-linux-gnu/pkgconfig \
31 LD_LIBRARY_PATH=$HOME/src/flashrom/build/install/lib/x86_64-linux-gnu \
32 cargo test
33