Description:
[grader] fixed to work with free pascal
git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@221 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r53:45abc6ae27d1 - - 3 files changed: 10 inserted, 7 deleted
@@ -254,12 +254,15 | |||||
|
254 | case __NR_mmap: |
|
254 | case __NR_mmap: |
|
255 | case __NR_munmap: |
|
255 | case __NR_munmap: |
|
256 | case __NR_ioctl: |
|
256 | case __NR_ioctl: |
|
257 | case __NR_uname: |
|
257 | case __NR_uname: |
|
258 | case 252: |
|
258 | case 252: |
|
259 | case 243: |
|
259 | case 243: |
|
|
260 | + // added for free pascal | ||
|
|
261 | + case __NR_ugetrlimit: | ||
|
|
262 | + case __NR_readlink: | ||
|
260 | return 1; |
|
263 | return 1; |
|
261 | // case __NR_time: |
|
264 | // case __NR_time: |
|
262 | case __NR_alarm: |
|
265 | case __NR_alarm: |
|
263 | // case __NR_pause: |
|
266 | // case __NR_pause: |
|
264 | case __NR_signal: |
|
267 | case __NR_signal: |
|
265 | case __NR_fchmod: |
|
268 | case __NR_fchmod: |
@@ -2,30 +2,30 | |||||
|
2 |
|
2 | ||
|
3 | ############################## |
|
3 | ############################## |
|
4 | # |
|
4 | # |
|
5 | # Standard Compile Script |
|
5 | # Standard Compile Script |
|
6 | # |
|
6 | # |
|
7 | # Supported compilers: |
|
7 | # Supported compilers: |
|
8 |
- # gcc, g++, and |
|
8 | + # gcc, g++, and fpc. |
|
9 | # |
|
9 | # |
|
10 | ############################## |
|
10 | ############################## |
|
11 |
|
11 | ||
|
12 | talk () |
|
12 | talk () |
|
13 | { |
|
13 | { |
|
14 | if [ "$TALKATIVE" != "" ]; then |
|
14 | if [ "$TALKATIVE" != "" ]; then |
|
15 | echo "$1" |
|
15 | echo "$1" |
|
16 | fi |
|
16 | fi |
|
17 | } |
|
17 | } |
|
18 |
|
18 | ||
|
19 | export C_COMPILER=/usr/bin/gcc |
|
19 | export C_COMPILER=/usr/bin/gcc |
|
20 | export CPLUSPLUS_COMPILER=/usr/bin/g++ |
|
20 | export CPLUSPLUS_COMPILER=/usr/bin/g++ |
|
21 |
- export PASCAL_COMPILER=/usr/bin/ |
|
21 | + export PASCAL_COMPILER=/usr/bin/fpc |
|
22 |
|
22 | ||
|
23 | export C_OPTIONS="-O2 -s -static -lm -Wall" |
|
23 | export C_OPTIONS="-O2 -s -static -lm -Wall" |
|
24 | export CPLUSPLUS_OPTIONS="-O2 -s -static -lm -Wall" |
|
24 | export CPLUSPLUS_OPTIONS="-O2 -s -static -lm -Wall" |
|
25 |
- export PASCAL_OPTIONS="-O |
|
25 | + export PASCAL_OPTIONS="-O1 -XS" |
|
26 |
|
26 | ||
|
27 | # Check for the correct number of arguments. Otherwise, print usage. |
|
27 | # Check for the correct number of arguments. Otherwise, print usage. |
|
28 | if [ $# -eq 0 -o $# -gt 4 ] |
|
28 | if [ $# -eq 0 -o $# -gt 4 ] |
|
29 | then |
|
29 | then |
|
30 | echo "Usage: $0 <language> [<source-file>] [<output-file>] [<message-file>]" |
|
30 | echo "Usage: $0 <language> [<source-file>] [<output-file>] [<message-file>]" |
|
31 | echo |
|
31 | echo |
@@ -83,15 +83,15 | |||||
|
83 | if [ $PROG_LANG = "c" ] |
|
83 | if [ $PROG_LANG = "c" ] |
|
84 | then |
|
84 | then |
|
85 | $C_COMPILER $SOURCE_FILE -o $OUTPUT_FILE $C_OPTIONS 2>$MESSAGE_FILE |
|
85 | $C_COMPILER $SOURCE_FILE -o $OUTPUT_FILE $C_OPTIONS 2>$MESSAGE_FILE |
|
86 | elif [ $PROG_LANG = "c++" ] |
|
86 | elif [ $PROG_LANG = "c++" ] |
|
87 | then |
|
87 | then |
|
88 | $CPLUSPLUS_COMPILER $SOURCE_FILE -o $OUTPUT_FILE $CPLUSPLUS_OPTIONS 2>$MESSAGE_FILE |
|
88 | $CPLUSPLUS_COMPILER $SOURCE_FILE -o $OUTPUT_FILE $CPLUSPLUS_OPTIONS 2>$MESSAGE_FILE |
|
89 |
- elif [ $PROG_LANG = "pas |
|
89 | + elif [ $PROG_LANG = "pas" ] |
|
90 | then |
|
90 | then |
|
91 |
- $PASCAL_COMPILER $SOURCE_FILE -o |
|
91 | + $PASCAL_COMPILER $SOURCE_FILE -o$OUTPUT_FILE $PASCAL_OPTIONS >$MESSAGE_FILE |
|
92 | else |
|
92 | else |
|
93 | talk "ERROR: Invalid language specified!" |
|
93 | talk "ERROR: Invalid language specified!" |
|
94 | echo "ERROR: Invalid language specified!" > $MESSAGE_FILE |
|
94 | echo "ERROR: Invalid language specified!" > $MESSAGE_FILE |
|
95 | exit 127 |
|
95 | exit 127 |
|
96 | fi |
|
96 | fi |
|
97 |
|
97 |
@@ -33,14 +33,14 | |||||
|
33 | puts " <test-result-directory> is defaulted to ./test-result" |
|
33 | puts " <test-result-directory> is defaulted to ./test-result" |
|
34 | puts "WARNING: The judge script will forcefully create the (implicitly and explicitly) specified directories and remove anything inside it." |
|
34 | puts "WARNING: The judge script will forcefully create the (implicitly and explicitly) specified directories and remove anything inside it." |
|
35 | exit(127) |
|
35 | exit(127) |
|
36 | end |
|
36 | end |
|
37 |
|
37 | ||
|
38 | language = ARGV[0] |
|
38 | language = ARGV[0] |
|
39 |
- if language != "c" && language != "c++" && language != "pas |
|
39 | + if language != "c" && language != "c++" && language != "pas" |
|
40 | - log "You specified a language that is not supported." |
|
40 | + log "You specified a language that is not supported: #{language}." |
|
41 | exit(127) |
|
41 | exit(127) |
|
42 | end |
|
42 | end |
|
43 |
|
43 | ||
|
44 | source_file = ARGV[1] |
|
44 | source_file = ARGV[1] |
|
45 | if File.exist?(source_file) == false |
|
45 | if File.exist?(source_file) == false |
|
46 | log "The source file does not exist." |
|
46 | log "The source file does not exist." |
You need to be logged in to leave comments.
Login now