Add :application-type parameter for save-lisp-and-die on Windows.
[sbcl.git] / tests / run-compiler.sh
1 #!/bin/sh
2
3 platform="${SBCL_SOFTWARE_TYPE}-${SBCL_MACHINE_TYPE}"
4
5 if [ -z "$CC" ]
6 then
7     CC=gcc
8 fi
9
10 args=
11 case "$platform" in
12     Darwin-X86-64) args="-arch x86_64" ;;
13     Darwin-X86)    args="-arch i386" ;;
14     SunOS-X86-64)  args=-m64 ;;
15     Linux-X86)     args="-m32" ;;
16     Linux-PowerPC) args="-m32" ;;
17 esac
18
19 while [ $# -gt 0 ]; do
20     arg="$1"
21     new=
22     case "$arg" in
23         -sbcl-pic)
24             case "$platform" in
25                 FreeBSD-X86-64)  new=-fPIC ;;
26                 Linux-MIPS)      new=-fPIC ;;
27                 Linux-X86-64)    new=-fPIC ;;
28                 Linux-PowerPC)   new=-fPIC ;;
29                 NetBSD-PowerPC)  new=-fPIC ;;
30                 NetBSD-X86-64)   new=-fPIC ;;
31                 OpenBSD-PowerPC) new=-fPIC ;;
32                 OpenBSD-X86-64)  new=-fPIC ;;
33                 SunOS-SPARC)     new=-fPIC ;;
34                 SunOS-X86)       new=-fPIC ;;
35                 SunOS-X86-64)    new=-fPIC ;;
36             esac
37             ;;
38
39         -sbcl-shared)
40             case "$platform" in
41                 Darwin-*)        new=-bundle ;;
42                 *)               new=-shared ;;
43             esac
44             ;;
45
46         *)
47             break
48             ;;
49     esac
50
51     shift
52     if [ x"$new" != x ]; then
53         args="$args $new"
54     fi
55 done
56
57 echo "/ $CC $args $@"
58 "$CC" $args "$@"