File: configure

package info (click to toggle)
racket 8.16%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 167,812 kB
  • sloc: ansic: 306,492; lisp: 211,972; pascal: 79,874; sh: 20,446; asm: 15,252; makefile: 1,738; cpp: 1,715; javascript: 1,340; exp: 789; python: 452; csh: 369; perl: 275; xml: 106
file content (143 lines) | stat: -rwxr-xr-x 3,463 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#! /bin/sh

set -e

dir=`dirname "$0"`

pb_dir="$dir/ChezScheme/boot/pb"

use_cs=maybe
use_bc=maybe
default_vm=cs
supplied_racket=no
supplied_scheme=no
enable_boothelp=
CC_FOR_BUILD='$(CC) -O2'

# We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`,
# since the `configure` scripts will do that, but  we have to figure out which
# configure scripts to run

for arg in $*; do 
    case "$arg" in
        --enable-cs)
            use_cs=yes
            ;;
        --enable-csdefault)
            use_cs=yes
            default_vm=cs
            ;;
        --enable-bc)
            use_bc=yes
            ;;
        --enable-bcdefault | --enable-cgcdefault)
            use_bc=yes
            default_vm=bc
            ;;
        --enable-csonly)
            use_cs=yes
            use_bc=no
            default_vm=cs
            ;;
        --enable-bconly)
            use_cs=no
            use_bc=yes
            default_vm=bc
            ;;
        --enable-racket=*)
            supplied_racket=yes
            ;;
        --enable-scheme=*)
            supplied_scheme=yes
            ;;
        --help | -h)
            echo $0:
            echo see --help-bc or --help-cs, since the Racket CS build and the
            echo Racket BC build support different options. If you use options
            echo that build both CS and BC, then you can mix options that apply
            echo to both or either kind of build.
            exit 0
            ;;
        --help-bc)
            exec "$dir/bc/configure" --help
            ;;
        --help-cs)
            exec "$dir/cs/c/configure" --help
            ;;
        CC_FOR_BUILD=*)
            CC_FOR_BUILD=`echo $arg | sed -e 's/^CC_FOR_BUILD=//'`
            ;;
    esac
done

# Select default build if none specified:
if test "$use_bc" = maybe ; then
    if test "$use_cs" = maybe ; then
        use_cs=yes
        use_bc=no
        default_vm=cs
    elif test "$use_cs" = no ; then
        use_bc=yes
    elif test -d "$pb_dir" -o $supplied_racket = yes ; then
        use_bc=no
    else
        echo No "$pb_dir", so enabling BC build
        use_bc=yes
        enable_boothelp=--enable-boothelp
    fi
elif test "$use_cs" = "maybe" ; then
    use_cs=no
    default_vm=bc
fi

if test "$use_cs" = "yes" ; then
    if test $use_bc = no  -a $supplied_racket = no  -a $supplied_scheme = no  -a ! -d "$pb_dir" ; then
        echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly
        exit 1
    fi

    echo "=== Racket CS enabled"

    mkdir -p cs/c
    case "$dir" in
        /*)
            (cd cs/c && "$dir/cs/c/configure" ${1+"$@"})
            ;;
        *)
            (cd cs/c && "../../$dir/cs/c/configure" ${1+"$@"})
            ;;
    esac
fi

if test "$use_bc" = "yes" ; then
    echo "=== Racket BC enabled"

    mkdir -p bc
    case "$dir" in
        /*)
            (cd bc && "$dir/bc/configure" ${1+"$@"})
            ;;
        *)
            (cd bc && "../$dir/bc/configure" ${1+"$@"})
            ;;
    esac
fi

case "$dir" in
    /*)
        upsrcdir="$dir"
        ;;
    *)
        upsrcdir="../$dir"
        ;;
esac

echo "srcdir=$dir" > Makefile
echo "upsrcdir=$upsrcdir" >> Makefile
echo "default_vm=${default_vm}" >> Makefile
echo "use_cs=${use_cs}" >> Makefile
echo "use_bc=${use_bc}" >> Makefile
echo "CC_FOR_BUILD=${CC_FOR_BUILD}" >> Makefile
cat "$dir/Makefile.in" >> Makefile

cp "$dir/buildmain.zuo" main.zuo