File: configure

package info (click to toggle)
clfswm 20111015.git51b0a02-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 1,624 kB
  • sloc: lisp: 14,797; sh: 302; makefile: 17
file content (125 lines) | stat: -rwxr-xr-x 3,085 bytes parent folder | download | duplicates (2)
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
#! /bin/sh

CONFIGURE_VERSION=0.2

PREFIX="/usr/local"
lisp=clisp
lisp_opt=''
lisp_bin=''
dump_path="\$XDG_CACHE_HOME/clfswm/"
clfswm_asd_path="$PREFIX/lib/clfswm"
asdf_path="$PREFIX/lib/clfswm/contrib"

usage () {
    echo "'configure' configures clfswm to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

Defaults for the options are specified in brackets.

Configuration:
  -h, --help                display this help and exit
  -V, --version             display version information and exit
  --prefix=PREFIX           install architecture-independent files in PREFIX [/usr/local]
  -l, --with-lisp           use <lisp> as the common lisp implementation type [$lisp]
  -b, --lisp-bin            use <bin> as the common lisp program [$lisp_bin] (default: same as with-lisp type)
  -o, --lisp-opt            use <opt> as lisp option [$lisp_opt]
  -d, --dump-path           path to the dump directory [$dump_path]
  --with-clfswm             path to clfswm.asd file [$clfswm_asd_path]
  --with-asdf               path to the asdf.lisp file [$asdf_path]

By default, 'make install' will install all the files in
'/usr/local/bin', '/usr/local/lib' etc.  You can specify
an installation prefix other than '/usr/local' using '--prefix',
for instance '--prefix \$HOME/clfswm'."
    exit 0
}


version () {
    echo "Configure version: $CONFIGURE_VERSION"
    exit 0
}

reset_clfswm_asd_path=true
reset_asdf_path=true

while test $# != 0
do
    case "$1" in
	--prefix)
	    shift
	    PREFIX="$1" ;;
	-d|--dump-path)
	    shift
	    dump_path="$1" ;;
	--with-clfswm)
	    shift
	    clfswm_asd_path="$1"
	    reset_clfswm_asd_path=false ;;
	--with-asdf)
	    shift
	    asdf_path="$1"
	    reset_asdf_path=false ;;
	-l|--with-lisp)
	    shift
	    case "$1" in
		'')
		    usage;;
		clisp|sbcl|cmucl|ccl|ecl)
		    lisp="$1" ;;
	    esac
	    ;;
        -b|--lisp-bin)
            shift
            lisp_bin="$1" ;;
	-o|--lisp-opt)
	    shift
	    lisp_opt="$1" ;;
	--)
	    shift
	    break ;;
	*)
	    usage ;;
    esac
    shift
done


DESTDIR=$PREFIX

if [ "$reset_clfswm_asd_path" = "true" ]; then
    clfswm_asd_path="$PREFIX/lib/clfswm"
fi

if [ "$reset_asdf_path" = "true" ]; then
    asdf_path="$PREFIX/lib/clfswm/contrib"
fi


echo "  prefix=$PREFIX
  with-lisp=$lisp
  lisp-bin=$lisp_bin
  lisp-opt=$lisp_opt
  dump-path=$dump_path
  with-clfswm=$clfswm_asd_path
  with-asdf=$asdf_path"



sed -e "s?^lisp=.*# +config+?lisp=\"$lisp\"   # +config+?g" \
    -e "s?^lisp_bin=.*# +config+?lisp_bin=\"$lisp_bin\"   # +config+?g" \
    -e "s?^lisp_opt=.*# +config+?lisp_opt=\"$lisp_opt\"   # +config+?g" \
    -e "s?^dump_path=.*# +config+?dump_path=\"$dump_path\"   # +config+?g" \
    -e "s?^clfswm_asd_path=.*# +config+?clfswm_asd_path=\"$clfswm_asd_path\"   # +config+?g" \
    -e "s?^asdf_path=.*# +config+?asdf_path=\"$asdf_path\"   # +config+?g" \
    $(pwd)/contrib/clfswm > $(pwd)/clfswm

sed -e "s#+DESTDIR+#$DESTDIR#g" \
    -e "s#+BUILD_PATH+#$(pwd)/#g" \
    Makefile.template > Makefile


echo ""
echo "Type 'make' to build clfswm"
echo ""