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