|
| 1 | +echo ---------------------------------------------------------------- |
| 2 | + |
| 3 | +# Ask the compiler how many bits we're targeting |
| 4 | +TCPU="$(fpc -iTP)" |
| 5 | +if [ "$TCPU" = "i386" ]; then BITS=32; fi |
| 6 | +if [ "$TCPU" = "x86_64" ]; then BITS=64; fi |
| 7 | + |
| 8 | +# Check commandline's first parameter for -n -f -d mode, -d is default |
| 9 | + |
| 10 | +mode=d$BITS |
| 11 | +if [ "$1" = "-n" ]; then mode=n$BITS; shift; fi |
| 12 | +if [ "$1" = "-f" ]; then mode=fpo$BITS; shift; fi |
| 13 | +if [ "$1" = "-d" ]; then mode=d$BITS; shift; fi |
| 14 | + |
| 15 | +echo "Compile mode: $mode" |
| 16 | + |
1 | 17 | # When switching between modes, add -B as an argument to rebuild all code
|
2 |
| -mode="d64" |
3 | 18 |
|
4 | 19 | # Normal:
|
5 |
| -if [ "$mode" = "32" ]; then fpc -CX -XXs- -O3oloopunroll,deadstore -OpPentium3 -CpPentium $*; fi |
6 |
| -if [ "$mode" = "64" ]; then fpc -CX -XXs- -O3oloopunroll,deadstore -CpAthlon64 $*; fi |
| 20 | +if [ "$mode" = "n32" ]; then fpc -CX -XXs- -O3oloopunroll,deadstore -OpPentium3 -CpPentium $1 $2 $3 $4; fi |
| 21 | +if [ "$mode" = "n64" ]; then fpc -CX -XXs- -O3oloopunroll,deadstore -CpAthlon64 $1 $2 $3 $4; fi |
7 | 22 |
|
8 | 23 | # Full-program optimised:
|
9 | 24 | if [ "$mode" = "fpo32" ]; then
|
10 |
| -fpc -FWopti.dat -CX -XXs- -O3oloopunroll,deadstore -OWall -OpPentium3 -CpPentium $* |
11 |
| -fpc -Fwopti.dat -CX -XXs -O3oloopunroll,deadstore -Owall -OpPentium3 -CpPentium $* |
12 |
| -if [-e opti.dat]; then rm opti.dat; fi |
| 25 | +fpc -FWopti.dat -CX -XXs- -O3oloopunroll,deadstore -OWall -OpPentium3 -CpPentium $1 $2 $3 $4 |
| 26 | +fpc -Fwopti.dat -CX -XXs -O3oloopunroll,deadstore -Owall -OpPentium3 -CpPentium $1 $2 $3 $4 |
| 27 | +if [ -e opti.dat ]; then rm opti.dat; fi |
13 | 28 | fi
|
14 | 29 |
|
15 | 30 | if [ "$mode" = "fpo64" ]; then
|
16 |
| -fpc -FWopti.dat -CX -XXs- -O3oloopunroll,deadstore -OWall -CpAthlon64 $* |
17 |
| -fpc -Fwopti.dat -CX -XXs -O3oloopunroll,deadstore -Owall -CpAthlon64 $* |
18 |
| -if [-e opti.dat]; then rm opti.dat; fi |
| 31 | +fpc -FWopti.dat -CX -XXs- -O3oloopunroll,deadstore -OWall -CpAthlon64 $1 $2 $3 $4 |
| 32 | +fpc -Fwopti.dat -CX -XXs -O3oloopunroll,deadstore -Owall -CpAthlon64 $1 $2 $3 $4 |
| 33 | +if [ -e opti.dat ]; then rm opti.dat; fi |
19 | 34 | fi
|
20 | 35 |
|
21 | 36 | # Debug: (-gc not supported yet)
|
22 |
| -if [ "$mode" = "d32" ]; then fpc -ghlt -vwinh -XXs- -Cotr -O3odeadstore -OpPentium3 -CpPentium $*; fi |
23 |
| -if [ "$mode" = "d64" ]; then fpc -ghlt -vwinh -XXs- -Cotr -O3odeadstore -CpAthlon64 $*; fi |
| 37 | +if [ "$mode" = "d32" ]; then fpc -ghlt -vwinh -XXs- -Cotr -O3odeadstore -OpPentium3 -CpPentium $1 $2 $3 $4; fi |
| 38 | +if [ "$mode" = "d64" ]; then fpc -ghlt -vwinh -XXs- -Cotr -O3odeadstore -CpAthlon64 $1 $2 $3 $4; fi |
0 commit comments