Skip to content

Commit e0d1365

Browse files
committed
Remove copy of truffle.h
1 parent 77264d9 commit e0d1365

File tree

6 files changed

+14
-65
lines changed

6 files changed

+14
-65
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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,15 @@
257257
"TRUFFLERUBY-LAUNCHER", # We need this jar to run extconf.rb
258258
"truffle:TRUFFLE_NFI_NATIVE", # trufflenfi.h
259259
"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",
264265
"SULONG_HEADERS_DIR": "<path:SULONG_HOME>/include",
265266
"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,7 +418,7 @@
415418
"file:lib/cext/include/*.h",
416419
],
417420
"lib/cext/include/sulong/": [
418-
"file:lib/cext/include/sulong/truffle.h",
421+
"extracted-dependency:sulong:SULONG_LEGACY/include/truffle.h",
419422
"link:../../sulong-libs/include/polyglot.h",
420423
],
421424
"lib/cext/sulong-libs/": [

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)