Skip to content

Commit 3d44a05

Browse files
committed
Update README.md to reflect the current situation
There are several changes: * Announce that Clang 3.9 is the new default * Update the install steps for 3.9 * Add installing steps for Windows * Update stylo's usage of bindgen
1 parent 3ba3a76 commit 3d44a05

File tree

1 file changed

+38
-46
lines changed

1 file changed

+38
-46
lines changed

README.md

Lines changed: 38 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,84 +10,77 @@ the [Stylo](https://public.etherpad-mozilla.org/p/stylo) project.
1010

1111
## Requirements
1212

13-
The current generator runs on with clang 3.8, but can also run with clang 3.9
14-
with more features (such as detection of inlined functions).
13+
It is recommended to use clang 3.9 with the current generator. It can run with
14+
clang 3.8 with some features unavailable.
1515

16-
### Installing clang 3.8
16+
### Installing Clang 3.9
1717

18-
#### OSX
18+
#### Windows
1919

20-
```
21-
# brew install llvm38
22-
```
20+
Download and install the official pre-built binary from
21+
[LLVM download page](http://releases.llvm.org/download.html).
2322

24-
#### On Debian-based Linuxes
23+
#### OSX
2524

25+
If you use Homebrew:
2626
```
27-
# apt-get install llvm-3.8-dev libclang-3.8-dev
27+
$ brew install llvm
2828
```
29-
Adding the LLVM repos to get version 3.8 may be necessary, see http://apt.llvm.org/.
30-
#### Arch
3129

30+
If you use MacPorts:
3231
```
33-
# pacman -S clang clang-tools-extra
32+
$ port install clang-3.9
3433
```
3534

36-
### Getting clang 3.9
37-
38-
#### From a package manager
39-
40-
Clang 3.9 has ben released about a month ago, and some package managers already
41-
provide it.
42-
43-
For example, for MacPorts:
35+
#### Debian-based Linuxes
4436

4537
```
46-
$ port install clang-3.9
47-
$ LIBCLANG_PATH=/opt/local/libexec/llvm-3.9/lib \
48-
LD_LIBRARY_PATH=/opt/local/libexec/llvm-3.9/lib \
49-
cargo build
38+
# apt-get install llvm-3.9-dev libclang-3.9-dev
5039
```
5140

52-
#### From source
53-
54-
If your package manager doesn't yet offer Clang 3.9, you'll need to build from
55-
source. For that, follow the instructions
56-
[here](http://clang.llvm.org/get_started.html).
41+
Ubuntu 16.10 provides the necessary packages directly. If you are using older
42+
version of Ubuntu or other Debian-based distros, you may need to add the LLVM
43+
repos to get version 3.9. See http://apt.llvm.org/.
5744

58-
Those instructions list optional steps. For bindgen:
45+
#### Arch
5946

60-
* Checkout and build clang
61-
* Checkout and build the extra-clang-tools
62-
* Checkout and build the compiler-rt
63-
* You do not need to checkout or build libcxx
47+
```
48+
# pacman -S clang
49+
```
6450

6551
## Building
6652

6753
```
68-
$ cargo build --features llvm_stable
54+
$ cd bindgen
55+
$ cargo build
6956
```
7057

71-
If you want a build with extra features (llvm 3.9) then you can use:
72-
58+
If you installed multiple versions of llvm, it may not be able to locate the
59+
latest version of libclang. In that case, you may want to either uninstall
60+
other versions of llvm, or specify the path of the desired libclang explicitly:
7361
```
74-
$ LIBCLANG_PATH=path/to/clang-3.9/build/lib \
75-
LD_LIBRARY_PATH=path/to/clang-3.9/build/lib \
76-
cargo build
62+
$ export LIBCLANG_PATH=path/to/clang-3.9/lib
7763
```
7864

65+
To build with Clang 3.8, you need to append `--feature llvm_stable` in addition
66+
to `cargo build` above.
67+
7968
# Library usage with `build.rs`
8069

70+
See [the Stylo build script][stylo-script] to see how is it used inside the
71+
Servo organisation.
72+
73+
[stylo-script]: https://github.com/servo/servo/blob/master/components/style/build_gecko.rs
74+
8175
In `Cargo.toml`:
8276

8377
```toml
8478
[package]
8579
# ...
8680
build = "build.rs"
8781

88-
[build-dependencies.libbindgen]
89-
git = "https://github.com/servo/rust-bindgen"
90-
features = ["llvm_stable"]
82+
[build-dependencies]
83+
libbindgen = "0.1"
9184
```
9285

9386
In `build.rs`:
@@ -117,11 +110,10 @@ include!(concat!(env!("OUT_DIR"), "/example.rs"));
117110
# Command Line Usage
118111

119112
There are a few options documented when running `./bindgen --help`. Other
120-
options might exist (see [the SpiderMonkey script][sm-script] and [the Stylo
121-
scripts][stylo-scripts] to see how is it used inside the Servo organisation.
113+
options might exist (see [the SpiderMonkey script][sm-script] to see how is
114+
it used inside the Servo organisation.
122115

123116
[sm-script]: https://github.com/servo/rust-mozjs/blob/master/etc/bindings.sh
124-
[stylo-scripts]: https://github.com/servo/servo/tree/master/components/style/binding_tools
125117

126118
## C++ Usage
127119

0 commit comments

Comments
 (0)