Skip to content

Commit e8a2dad

Browse files
committed
fix build on windows (?)
jnthn++ for the bug report.
1 parent 9f82380 commit e8a2dad

File tree

3 files changed

+35
-13
lines changed

3 files changed

+35
-13
lines changed

tools/build/Makefile.in

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ PARROT_BIN_DIR = @bindir@
1212
PARROT_LIB_DIR = @libdir@$(PARROT_VERSION)
1313

1414
# locations of parrot resources
15-
PARROT = $(PARROT_BIN_DIR)/parrot$(EXE)
16-
NQP = $(PARROT_BIN_DIR)/nqp$(EXE)
17-
PBC_TO_EXE = $(PARROT_BIN_DIR)/pbc_to_exe$(EXE)
15+
PARROT = $(PARROT_BIN_DIR)/parrot$(EXE)
16+
NQP = $(PARROT_BIN_DIR)/nqp$(EXE)
17+
PBC_TO_EXE = $(PARROT_BIN_DIR)/pbc_to_exe$(EXE)
18+
19+
ECHO = $(NQP) tools/build/echo.nqp
20+
CAT = $(NQP) tools/build/cat.nqp
1821

1922
# install path
2023
PARTCL_LANG_DIR = $(PARROT_LIB_DIR)/languages/partcl
@@ -121,16 +124,16 @@ src/Partcl.pir: $(GEN_SOURCES)
121124
src/Partcl/commands.pm: $(COMMANDS) $(HELPERS) src/init.pir src/TclList.pir \
122125
src/Partcl/Actions.pm src/Partcl/Compiler.pm src/Partcl/Grammar.pm\
123126
src/Internals.pm
124-
echo "use src::init;" > src/Partcl/commands.pm
125-
echo "use src::TclList;" >> src/Partcl/commands.pm
126-
cat src/Partcl/Grammar.pm >> src/Partcl/commands.pm
127-
cat src/Partcl/Actions.pm >> src/Partcl/commands.pm
128-
cat src/Partcl/Compiler.pm >> src/Partcl/commands.pm
129-
echo "class Builtins {" >> src/Partcl/commands.pm
130-
cat $(COMMANDS) >> src/Partcl/commands.pm
131-
echo "}" >> src/Partcl/commands.pm
132-
cat src/Internals.pm >> src/Partcl/commands.pm
133-
cat $(HELPERS) >> src/Partcl/commands.pm
127+
$(ECHO) "use src::init;" > src/Partcl/commands.pm
128+
$(ECHO) "use src::TclList;" >> src/Partcl/commands.pm
129+
$(CAT) src/Partcl/Grammar.pm >> src/Partcl/commands.pm
130+
$(CAT) src/Partcl/Actions.pm >> src/Partcl/commands.pm
131+
$(CAT) src/Partcl/Compiler.pm >> src/Partcl/commands.pm
132+
$(ECHO) "class Builtins {" >> src/Partcl/commands.pm
133+
$(CAT) $(COMMANDS) >> src/Partcl/commands.pm
134+
$(ECHO) "}" >> src/Partcl/commands.pm
135+
$(CAT) src/Internals.pm >> src/Partcl/commands.pm
136+
$(CAT) $(HELPERS) >> src/Partcl/commands.pm
134137

135138
src/init.pm: src/TclLexPad.pir src/TclArray.pir
136139
src/FileGlob/Actions.pm: src/StringGlob/Actions.pir

tools/build/cat.nqp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# nqp
2+
3+
# cat substitute to avoid issues on windows
4+
5+
sub MAIN(*@ARGS) {
6+
@ARGS.shift; # ignore our filename
7+
for @ARGS -> $file {
8+
my $a := open($file);
9+
say($a.readall());
10+
}
11+
}

tools/build/echo.nqp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# nqp
2+
3+
# cat substitute to avoid issues on windows
4+
5+
sub MAIN(*@ARGS) {
6+
@ARGS.shift; # ignore our filename
7+
say(nqp::join(" ", @ARGS));
8+
}

0 commit comments

Comments
 (0)