Browse Source

Sol Part 70: If I Had a Dollar for Every Time Sol Worked When It Shouldn't Have...

...I'd probably be able to afford a pretty fancy dinner right about now.

Credit to Robert Newman (@xperia64) for finding and fixing these
problems on another platform.
Graham Northup 2 years ago
parent
commit
f42f57d663
Signed by: Graham Northup <grissess@nexusg.org> GPG Key ID: 5D000E6F539376FB
4 changed files with 14 additions and 10 deletions
  1. 10
    8
      Makefile
  2. 1
    1
      RECIPES
  3. 2
    0
      programs/interp.sol
  4. 1
    1
      solrun.c

+ 10
- 8
Makefile View File

@@ -1,6 +1,6 @@
1 1
 _CFLAGS= -g $(BUILD_DEFINES) $(CFLAGS)
2 2
 _LDFLAGS= -lfl -lm -ldl -lreadline $(LDFLAGS)
3
-OBJ= lex.yy.o parser.tab.o dsl/seq.o dsl/list.o dsl/array.o dsl/generic.o astprint.o runtime.o gc.o object.o state.o builtins.o solrun.o ser.o
3
+OBJ= lex.yy.o parser.tab.o dsl/seq.o dsl/list.o dsl/array.o dsl/generic.o astprint.o runtime.o gc.o object.o state.o builtins.o solrun.o ser.o sol_help.o
4 4
 
5 5
 ifndef CC
6 6
 	CC:= gcc
@@ -18,16 +18,18 @@ ifndef DESTDIR
18 18
 	DESTDIR:= /usr/local/
19 19
 endif
20 20
 
21
-ifdef NO_HELP
22
-	_CFLAGS+= -DNO_HELP
23
-else
24
-	OBJ+= sol_help.o
25
-endif
26
-
27 21
 ifndef STDOUT_FILENAME
28 22
 	STDOUT_FILENAME:=/dev/fd/1
29 23
 endif
30 24
 
25
+ifneq (,$(findstring -DNO_READLINE,$(_CFLAGS)))
26
+	_LDFLAGS := $(filter-out -lreadline,$(_LDFLAGS))
27
+endif
28
+
29
+ifneq (,$(findstring -DNO_HELP,$(_CFLAGS)))
30
+	OBJ := $(filter-out sol_help.o,$(OBJ))
31
+endif
32
+
31 33
 include VERSION_INFO
32 34
 include ARCH_INFO
33 35
 
@@ -67,7 +69,7 @@ $(LINKED_VERS): sol$(SOL_VER)
67 69
 	rm $@; ln -s $? $@
68 70
 	
69 71
 sol$(SOL_VER): $(OBJ)
70
-	$(CC) $(_CFLAGS) $^ $(_LDFLAGS) -o $@
72
+	$(CC) $(_CFLAGS) $(_LDFLAGS) $^ -o $@
71 73
 
72 74
 libsol.a: $(OBJ)
73 75
 	$(AR) rcs $@ $^

+ 1
- 1
RECIPES View File

@@ -1,5 +1,5 @@
1 1
 WASM/asm.js:
2
-make CC=emcc CFLAGS=-DNO_READLINE NO_HELP=1
2
+make CC=emcc CFLAGS="-DNO_READLINE -DNO_HELP"
3 3
 
4 4
 clang for profiling:
5 5
 make CC=clang CFLAGS="-fprofile-instr-generate -fcoverage-mapping"

+ 2
- 0
programs/interp.sol View File

@@ -27,6 +27,8 @@ while __interp.running do
27 27
 		__interp.line = readline.readline(__interp.prompt)
28 28
 		if #__interp.line then readline.add_history(__interp.line) end
29 29
 	else
30
+		io.stdout:write(__interp.prompt)
31
+		io.stdout:flush()
30 32
 		__interp.line = io.stdin:read(io.LINE):sub(0, -1)
31 33
 	end
32 34
 	7

+ 1
- 1
solrun.c View File

@@ -99,7 +99,7 @@ int main(int argc, char **argv) {
99 99
 	} else {
100 100
 		if(html) {
101 101
 			sol_write_html(prgstream);
102
-			return;
102
+			return 0;
103 103
 		}
104 104
 		program = sol_compile_file(prgstream);
105 105
 	}

Loading…
Cancel
Save