Skip to content

Commit 2a67033

Browse files
committed
[GR-15355] [GR-15352] Use new sulong home layout.
PullRequest: truffleruby/814
2 parents 40b5d7a + 84f1f3c commit 2a67033

File tree

6 files changed

+21
-72
lines changed

6 files changed

+21
-72
lines changed

lib/cext/include/sulong/truffle.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

lib/cext/include/truffleruby/truffleruby-pre.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ extern "C" {
2020

2121
#define TRUFFLERUBY
2222

23+
#ifdef SULONG_TRUFFLE_H
24+
#include SULONG_TRUFFLE_H
25+
#else
2326
#include <sulong/truffle.h>
27+
#endif
2428

2529
#ifdef SULONG_POLYGLOT_H
2630
#include SULONG_POLYGLOT_H

lib/truffle/rbconfig-for-mkmf.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696

9797
relative_debug_paths = "-fdebug-prefix-map=#{ruby_home}=."
9898
polyglot_h = "-DSULONG_POLYGLOT_H='\"#{ENV.fetch('SULONG_POLYGLOT_H')}\"'"
99-
mkconfig['CPPFLAGS'] = "#{relative_debug_paths} #{polyglot_h}"
99+
truffle_h = "-DSULONG_TRUFFLE_H='\"#{ENV.fetch('SULONG_TRUFFLE_H')}\"'"
100+
mkconfig['CPPFLAGS'] = "#{relative_debug_paths} #{polyglot_h} #{truffle_h}"
100101
expanded['CPPFLAGS'] = mkconfig['CPPFLAGS']
101102

102103
# Default to the ruby in $PATH to build core C extensions faster

mx.truffleruby/suite.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "tools",
1010
"subdir": True,
1111
# version must always be equal to the version of the "sulong" import below
12-
"version": "32df1a7718df4b2f76c8cbfed505177f46165f4e",
12+
"version": "636e1ca4fa50df0b7741aa1e1e12f474bee3dd5a",
1313
"urls": [
1414
{"url": "https://github.com/oracle/graal.git", "kind": "git"},
1515
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},
@@ -19,7 +19,7 @@
1919
"name": "sulong",
2020
"subdir": True,
2121
# version must always be equal to the version of the "tools" import above
22-
"version": "32df1a7718df4b2f76c8cbfed505177f46165f4e",
22+
"version": "636e1ca4fa50df0b7741aa1e1e12f474bee3dd5a",
2323
"urls": [
2424
{"url": "https://github.com/oracle/graal.git", "kind": "git"},
2525
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},
@@ -256,13 +256,16 @@
256256
"TRUFFLERUBY", # We need this jar to run extconf.rb
257257
"TRUFFLERUBY-LAUNCHER", # We need this jar to run extconf.rb
258258
"truffle:TRUFFLE_NFI_NATIVE", # trufflenfi.h
259-
"sulong:SULONG_LIBS", # polyglot.h
259+
"sulong:SULONG_HOME", # polyglot.h
260+
"sulong:SULONG_LEGACY", # truffle.h
260261
],
261262
"buildEnv": {
262263
"TRUFFLERUBYOPT": "--building-core-cexts",
263264
"NFI_HEADERS_DIR": "<path:truffle:TRUFFLE_NFI_NATIVE>/include",
264-
"SULONG_HEADERS_DIR": "<path:SULONG_LIBS>",
265-
"SULONG_POLYGLOT_H": "<path:SULONG_LIBS>/polyglot.h",
265+
"SULONG_HEADERS_DIR": "<path:SULONG_HOME>/include",
266+
"SULONG_POLYGLOT_H": "<path:SULONG_HOME>/include/polyglot.h",
267+
"SULONG_TRUFFLE_H": "<path:SULONG_LEGACY>/include/truffle.h",
268+
"SULONG_TRUFFLE_DIR": "<path:SULONG_LEGACY>/include",
266269
},
267270
"output": ".",
268271
"results": [
@@ -415,11 +418,11 @@
415418
"file:lib/cext/include/*.h",
416419
],
417420
"lib/cext/include/sulong/": [
418-
"file:lib/cext/include/sulong/truffle.h",
419-
"extracted-dependency:sulong:SULONG_LIBS/*.h",
421+
"extracted-dependency:sulong:SULONG_LEGACY/include/truffle.h",
422+
"link:../../sulong-libs/include/polyglot.h",
420423
],
421424
"lib/cext/sulong-libs/": [
422-
"extracted-dependency:sulong:SULONG_LIBS/*",
425+
"extracted-dependency:sulong:SULONG_HOME/*",
423426
],
424427
"lib/mri/": [
425428
"dependency:org.truffleruby.cext/src/main/c/etc/etc.su",

src/main/c/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CFLAGS := -Wall -Werror -Wno-unused-function -fPIC -std=c99
1717
LDFLAGS := -m64
1818

1919
TRUFFLE_POSIX := truffleposix/libtruffleposix.$(DLEXT)
20-
SULONG_HEADERS := $(ROOT)/lib/cext/include/sulong/truffle.h $(SULONG_POLYGLOT_H)
20+
SULONG_HEADERS := $(SULONG_TRUFFLE_H) $(SULONG_POLYGLOT_H)
2121
GENERATE_SULONG_MOCK := $(ROOT)/tool/generate-sulongmock.rb
2222

2323
RUBY_HEADERS := $(wildcard $(ROOT)/lib/cext/include/*.h) $(wildcard $(ROOT)/lib/cext/include/*/*.h) $(wildcard $(ROOT)/lib/cext/include/*/*/*.h)
@@ -60,11 +60,11 @@ sulongmock/sulongmock.c: $(GENERATE_SULONG_MOCK) $(SULONG_HEADERS) $(TRUFFLE_POS
6060
$(RUBY) $(GENERATE_SULONG_MOCK) $(SULONG_HEADERS)
6161

6262
sulongmock/sulongmock.o: sulongmock/sulongmock.c
63-
$(CC) -o $@ -c $(CFLAGS) $(LDFLAGS) -I$(ROOT)/lib/cext/include -I$(SULONG_HEADERS_DIR) $<
63+
$(CC) -o $@ -c $(CFLAGS) $(LDFLAGS) -I$(ROOT)/lib/cext/include -I$(SULONG_TRUFFLE_DIR) -I$(SULONG_HEADERS_DIR) $<
6464

6565
# ruby.o
6666
cext/ruby.o: cext/*.c $(RUBY_HEADERS)
67-
$(CC) -o $@ -c $(CFLAGS) $(LDFLAGS) -DSULONG_POLYGLOT_H=\"$(SULONG_POLYGLOT_H)\" -I$(ROOT)/lib/cext/include cext/ruby.c
67+
$(CC) -o $@ -c $(CFLAGS) $(LDFLAGS) -DSULONG_TRUFFLE_H=\"$(SULONG_TRUFFLE_H)\" -DSULONG_POLYGLOT_H=\"$(SULONG_POLYGLOT_H)\" -I$(ROOT)/lib/cext/include cext/ruby.c
6868

6969
# ruby.su
7070
cext/Makefile: cext/extconf.rb $(BASIC_EXTCONF_DEPS)

tool/generate-sulongmock.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
5050
#include <stdio.h>
5151
#include <stdint.h>
52-
#include <sulong/truffle.h>
52+
#include <truffle.h>
5353
#include <polyglot.h>
5454
5555
void rb_tr_mock() {

0 commit comments

Comments
 (0)