Updated kernel config
[dragora.git] / qi / configure
blob446c9cc4be90d139dcab3c9e0e461e7f362f8623
1 #! /bin/sh -
3 # Simple "configure" script for Qi.
5 # Copyright (c) 2016-2018, 2020-2021 Matias Fonzo, <selk@dragora.org>.
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 set -e
21 usage() {
22 printf '%s' \
23 "Usage: configure [options]
25 Defaults for the options are specified in brackets.
27 Options:
28 --prefix=DIR install files in DIR [${prefix}]
29 --exec-prefix=DIR base DIR for arch-dependent files [${exec_prefix}]
30 --bindir=DIR user executables [${bindir}]
31 --sbindir=DIR system admin executables [${sbindir}]
32 --libexecdir=DIR program executables [${libexecdir}]
33 --sysconfdir=DIR read-only single-machine data [${sysconfdir}]
34 --localstatedir=DIR modifiable single-machine data [${localstatedir}]
35 --datarootdir=DIR read-only arch-independent data root [${datarootdir}]
36 --infodir=DIR info documentation [${infodir}]
37 --mandir=DIR man documentation [${mandir}]
38 --docdir=DIR documentation root [${docdir}]
39 --packagedir=DIR set directory for package installations [${packagedir}]
40 --targetdir=DIR set target directory for symbolic links [${targetdir}]
41 --arch=name set default package architecture [${arch}]
46 # Defaults
47 prefix=/usr/local
48 exec_prefix='$(prefix)'
49 bindir='$(exec_prefix)/bin'
50 sbindir='$(exec_prefix)/sbin'
51 libexecdir='$(exec_prefix)/libexec'
52 sysconfdir='$(prefix)/etc'
53 localstatedir='$(prefix)/var'
54 datarootdir='$(prefix)/share'
55 infodir='$(datarootdir)/info'
56 mandir='$(datarootdir)/man'
57 docdir='$(datarootdir)/doc'
58 packagedir='/usr/local/pkgs'
59 targetdir='/usr/local'
60 arch="$(uname -m)"
62 return_variables() {
63 printf '%s\n' \
64 "prefix = $prefix" \
65 "exec_prefix = $exec_prefix" \
66 "bindir = $bindir" \
67 "sbindir = $sbindir" \
68 "libexecdir = $libexecdir" \
69 "sysconfdir = $sysconfdir" \
70 "localstatedir = $localstatedir" \
71 "datarootdir = $datarootdir" \
72 "infodir = $infodir" \
73 "mandir = $mandir" \
74 "docdir = $docdir" \
75 "packagedir = $packagedir" \
76 "targetdir = $targetdir" \
77 "arch = $arch" \
81 # Handle options
82 while test $# -gt 0
84 case $1 in
85 --prefix)
86 prefix="$2"
87 shift
89 --prefix=*)
90 prefix="${1#*=}"
92 --exec-prefix)
93 exec_prefix="$2"
94 shift
96 --exec-prefix=*)
97 exec_prefix="${1#*=}"
99 --bindir)
100 bindir="$2"
101 shift
103 --bindir=*)
104 bindir="${1#*=}"
106 --sbindir)
107 sbindir="$2"
108 shift
110 --sbindir=*)
111 sbindir="${1#*=}"
113 --libexecdir)
114 libexecdir="$2"
115 shift
117 --libexecdir=*)
118 libexecdir="${1#*=}"
120 --sysconfdir)
121 sysconfdir="$2"
122 shift
124 --sysconfdir=*)
125 sysconfdir="${1#*=}"
127 --localstatedir)
128 localstatedir="$2"
129 shift
131 --localstatedir=*)
132 localstatedir="${1#*=}"
134 --datarootdir)
135 datarootdir="$2"
136 shift
138 --datarootdir=*)
139 datarootdir="${1#*=}"
141 --infodir)
142 infodir="$2"
143 shift
145 --infodir=*)
146 infodir="${1#*=}"
148 --mandir)
149 mandir="$2"
150 shift
152 --mandir=*)
153 mandir="${1#*=}"
155 --docdir)
156 docdir="$2"
157 shift
159 --docdir=*)
160 docdir="${1#*=}"
162 --packagedir)
163 packagedir="$2"
164 shift
166 --packagedir=*)
167 packagedir="${1#*=}"
169 --targetdir)
170 targetdir="$2"
171 shift
173 --targetdir=*)
174 targetdir="${1#*=}"
176 --arch)
177 arch="$2"
178 shift
180 --arch=*)
181 arch="${1#*=}"
183 --help | --hel | --he | --h | '--?' | -help | -hel | -he | -h | '-?' )
184 usage
185 exit
188 shift
189 break; # End of options.
192 echo "configure: WARNING: unrecognized option '${1}'" 1>&2
195 break
197 esac
198 shift
199 done
201 echo "Creating config.mak ..."
203 return_variables; # Show configured variables.
204 : > config.mak; # Clean up config.mak, first.
206 if return_variables > config.mak
207 then
208 touch src/qi.in && echo "OK, now you can run \`make'"