You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build_system.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ The main solution for the second point seems a Makefile, otherwise many of the u
16
16
## General Design
17
17
18
18
1. Templates are generated by `templates/template.rb`
19
-
4. The `Makefile` compiles both `libprism.a` and `libprism.{so,dylib,dll}` from the `src/**/*.c` and `include/**/*.h` files
20
-
5. The `Rakefile``:compile` task ensures the above prerequisites are done, then calls `make`,
21
-
and uses `Rake::ExtensionTask` to compile the C extension (using its `extconf.rb`), which uses `libprism.a`
19
+
2. The `Makefile` compiles both `libprism.a` and `libprism.{so,dylib,dll}` from the `src/**/*.c` and `include/**/*.h` files
20
+
3. The `Rakefile``:compile` task ensures the above prerequisites are done, then calls `make`,
21
+
and uses `Rake::ExtensionTask` to compile the C extension (using its `extconf.rb`)
22
22
23
23
This way there is minimal duplication, and each layer builds on the previous one and has its own responsibilities.
24
24
@@ -35,14 +35,11 @@ loaded per process (i.e., at most one version of the prism *gem* loaded in a pro
35
35
### Building the prism gem by `gem install/bundle install`
36
36
37
37
The gem contains the pre-generated templates.
38
-
When installing the gem, `extconf.rb` is used and that:
39
-
* runs `make build/libprism.a`
40
-
* compiles the C extension with mkmf
41
-
42
-
When installing the gem on JRuby and TruffleRuby, no C extension is built, so instead of the last step,
43
-
there is Ruby code using FFI which uses `libprism.{so,dylib,dll}`
44
-
to implement the same methods as the C extension, but using serialization instead of many native calls/accesses
45
-
(JRuby does not support C extensions, serialization is faster on TruffleRuby than the C extension).
38
+
39
+
When installing the gem on CRuby, `extconf.rb` is used and that compiles the C extension with mkmf, including both the extension files and the sources of prism itself.
40
+
41
+
When installing the gem on JRuby and TruffleRuby, no C extension is built, so instead the `extconf.rb` runs `make build/libprism.{so,dylib,dll}`.
42
+
There is Ruby code using FFI which uses `libprism.{so,dylib,dll}` to implement the same methods as the C extension, but using serialization instead of many native calls/accesses (JRuby does not support C extensions, serialization is faster on TruffleRuby than the C extension).
46
43
47
44
### Building the prism gem from git, e.g. `gem "prism", github: "ruby/prism"`
0 commit comments