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