Add a configure/make procedure to build clfswm
[clfswm.git] / configure
blob140f402e9060a2b1c4d6eb01f68487195c6e4106
1 #! /bin/sh
3 PROJECT_NAME=clfswm
4 CONFIGURE_VERSION=0.1
7 usage () {
8 echo "'configure' configures $PROJECT_NAME to adapt to many kinds of systems.
10 Usage: ./configure [OPTION]... [VAR=VALUE]...
12 Defaults for the options are specified in brackets.
14 Configuration:
15 -h, --help display this help and exit
16 -V, --version display version information and exit
17 --with-lisp=LISP use a particular Lisp implementation [ask]
18 --with-lisp-eval-opt=OPT use a particular Lisp eval command line option
19 --with-lisp-load-opt=OPT use a particular Lisp load command line option
20 --with-lisp-ext=OPT use a particular Lisp extension filename
21 --with-lisp-core=CORE use a particular Lisp core (initial memory image)
22 --prefix=PREFIX install architecture-independent files in PREFIX
23 [/usr/local]
25 By default, 'make install' will install all the files in
26 '/usr/local/bin', '/usr/local/lib' etc. You can specify
27 an installation prefix other than '/usr/local' using '--prefix',
28 for instance '--prefix=$HOME'."
29 exit 0
33 version () {
34 echo "Configure version: $CONFIGURE_VERSION"
35 exit 0
40 TEMP=`getopt -o hV: --long help,version,srcdir:,with-lisp:,with-lisp-eval-opt:,with-lisp-load-opt:,with-lisp-ext:,with-lisp-core:,prefix: -- "$@"`
41 PREFIX=/usr/local
43 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
45 eval set -- "$TEMP"
47 while true ; do
48 case "$1" in
49 -h|--help) usage ; shift ;;
50 -V|--version) version ; shift ;;
51 --srcdir) SRCDIR=$2 ; shift 2 ;;
52 --with-lisp) LISP=$2 ; shift 2 ;;
53 --with-lisp-eval-opt) EVAL_OPT=$2 ; shift 2 ;;
54 --with-lisp-load-opt) LOAD_OPT=$2 ; shift 2 ;;
55 --with-lisp-ext) EXT=$2 ; shift 2 ;;
56 --with-lisp-core) CORE=$2 ; shift 2 ;;
57 --prefix) PREFIX=$2 ; shift 2 ;;
58 --) shift ; break ;;
59 *) echo "Internal error!" ; exit 1 ;;
60 esac
61 done
63 DESTDIR=$PREFIX
66 if [ "x$LISP" = "x" ]; then
67 echo "Please, choose a Lisp implementation in:
68 1) SBCL 2) CMUCL 3) CLISP 4) ECL 5) CCL 6) Other"
69 read REP_LISP
70 case $REP_LISP in
71 1) LISP=sbcl ;;
72 2) LISP=cmucl ;;
73 3) LISP=clisp ;;
74 4) LISP=ecl ;;
75 5) LISP=ccl ;;
76 6) echo -n "Please, enter your Lisp implementation: "
77 read LISP ;;
78 *) echo "Error"; exit -1 ;;
79 esac
83 case $LISP in
84 clisp) LISP=$(which clisp)
85 EVAL_OPT="-x -q"
86 LOAD_OPT=""
87 EXT=fas ;;
88 sbcl) LISP=$(which sbcl)
89 EVAL_OPT="--eval"
90 LOAD_OPT="--load"
91 EXT=fasl ;;
92 cmucl) LISP=$(which cmucl)
93 EVAL_OPT="-eval"
94 LOAD_OPT="-load"
95 EXT=x86f ;;
96 ecl) LISP=$(which ecl)
97 EVAL_OPT="-eval"
98 LOAD_OPT="-load"
99 EXT=fas ;;
100 ccl) LISP=$(which ccl)
101 EVAL_OPT="-e"
102 LOAD_OPT="-l"
103 EXT=lx32fsl ;;
104 esac
106 echo "Configuration:"
107 echo SRCDIR = $SRCDIR
108 echo PREFIX = $PREFIX
109 echo "LISP=$LISP EVAL_OPT=$EVAL_OPT LOAD_OPT=$LOAD_OPT EXT=$EXT CORE=$CORE"
111 sed -e "s#+PROJECT_NAME+#$PROJECT_NAME#g" \
112 -e "s#+DESTDIR+#$DESTDIR#g" \
113 -e "s#+LISP+#$LISP#g" \
114 -e "s#+EVAL_OPT+#$EVAL_OPT#g" \
115 -e "s#+LOAD_OPT+#$LOAD_OPT#g" \
116 -e "s#+EXT+#$EXT#g" \
117 -e "s#+CORE+#$CORE#g" \
118 Makefile.template > Makefile
120 echo ""
121 echo "Type 'make' to build $PROJECT_NAME"
122 echo ""