File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ LDFLAGS = -Wl,--gc-sections -ldl -lpthread -lgcc_s -lrt -lc -lm -lstdc++
1313recode_cpp : recode_cpp.o ../encoding-rs/target/release/libencoding_rs.a
1414 $(CC ) -o $@ $^ $(LDFLAGS )
1515
16+ recode_c.o : recode_c.c ../encoding-rs/target/include/encoding_rs.h
17+
1618../encoding-rs/target/release/libencoding_rs.a : cargo
1719
1820../encoding-rs/target/include/encoding_rs.h : cargo
Original file line number Diff line number Diff line change @@ -9,3 +9,44 @@ It expects encoding-rs and [GSL](https://github.com/Microsoft/GSL) to have been
99
1010Please see the file named COPYRIGHT.
1111
12+ ## Building
13+
14+ Git, GNU Make and a version of GCC recent enough to accept ` -std=c11 ` are
15+ assumed to be already installed.
16+
17+ ###0 . Install Rust (including Cargo) if you haven't already
18+
19+ See the [ Rust download page] ( https://www.rust-lang.org/downloads.html ) . For
20+ Linux and OS X, this means:
21+ ```
22+ curl -sSf https://static.rust-lang.org/rustup.sh | sh
23+ ```
24+
25+ ###1 . Clone encoding-rs
26+
27+ ```
28+ git clone https://github.com/hsivonen/encoding-rs.git
29+ ```
30+
31+ ###2 . Enable staticlib support for encoding-rs
32+
33+ Edit ` encoding-rs/Cargo.toml ` and uncomment the line
34+ ```
35+ # crate-type = ["rlib", "staticlib"]
36+ ```
37+
38+ (The line is commented out due to a
39+ [ rustfmt bug] ( https://github.com/rust-lang-nursery/rustfmt/issues/828 ) .)
40+
41+ ###3 . Clone recode-c
42+
43+ ```
44+ git clone https://github.com/hsivonen/recode-c.git
45+ ```
46+
47+ ###4 . Build recode-c
48+
49+ ```
50+ cd recode-c
51+ make
52+ ```
You can’t perform that action at this time.
0 commit comments