recipes: x-apps/emacs: Enable emacs again, trying the -no-pie option
[dragora.git] / qi / configure
blobe7460f6600d8b11e538c2a0fc79b58534a29e4dd
1 #! /bin/sh -
3 # Simple "configure" script for Qi.
5 # Copyright (c) 2016-2018, 2020-2022 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 --arch=NAME architecture name to build packages [${arch}]
40 --packagedir=DIR directory for package installations [${packagedir}]
41 --targetdir=DIR target directory for symbolic links [${targetdir}]
42 --outdir=DIR output directory for binary packages [${outdir}]
47 # Defaults
48 prefix=/usr/local
49 exec_prefix='$(prefix)'
50 bindir='$(exec_prefix)/bin'
51 sbindir='$(exec_prefix)/sbin'
52 libexecdir='$(exec_prefix)/libexec'
53 sysconfdir='$(prefix)/etc'
54 localstatedir='$(prefix)/var'
55 datarootdir='$(prefix)/share'
56 infodir='$(datarootdir)/info'
57 mandir='$(datarootdir)/man'
58 docdir='$(datarootdir)/doc'
59 arch="$(uname -m)"
60 packagedir='$(prefix)/pkgs'
61 targetdir='$(prefix)'
62 outdir='$(localstatedir)/cache/qi/packages'
64 return_variables()
66 printf '%s\n' \
67 "prefix = $prefix" \
68 "exec_prefix = $exec_prefix" \
69 "bindir = $bindir" \
70 "sbindir = $sbindir" \
71 "libexecdir = $libexecdir" \
72 "sysconfdir = $sysconfdir" \
73 "localstatedir = $localstatedir" \
74 "datarootdir = $datarootdir" \
75 "infodir = $infodir" \
76 "mandir = $mandir" \
77 "docdir = $docdir" \
78 "arch = $arch" \
79 "packagedir = $packagedir" \
80 "targetdir = $targetdir" \
81 "outdir = $outdir" \
85 # Handle options
86 while test $# -gt 0
88 case $1 in
89 --prefix)
90 prefix="$2"
91 shift
93 --prefix=*)
94 prefix="${1#*=}"
96 --exec-prefix)
97 exec_prefix="$2"
98 shift
100 --exec-prefix=*)
101 exec_prefix="${1#*=}"
103 --bindir)
104 bindir="$2"
105 shift
107 --bindir=*)
108 bindir="${1#*=}"
110 --sbindir)
111 sbindir="$2"
112 shift
114 --sbindir=*)
115 sbindir="${1#*=}"
117 --libexecdir)
118 libexecdir="$2"
119 shift
121 --libexecdir=*)
122 libexecdir="${1#*=}"
124 --sysconfdir)
125 sysconfdir="$2"
126 shift
128 --sysconfdir=*)
129 sysconfdir="${1#*=}"
131 --localstatedir)
132 localstatedir="$2"
133 shift
135 --localstatedir=*)
136 localstatedir="${1#*=}"
138 --datarootdir)
139 datarootdir="$2"
140 shift
142 --datarootdir=*)
143 datarootdir="${1#*=}"
145 --infodir)
146 infodir="$2"
147 shift
149 --infodir=*)
150 infodir="${1#*=}"
152 --mandir)
153 mandir="$2"
154 shift
156 --mandir=*)
157 mandir="${1#*=}"
159 --docdir)
160 docdir="$2"
161 shift
163 --docdir=*)
164 docdir="${1#*=}"
166 --arch)
167 arch="$2"
168 shift
170 --arch=*)
171 arch="${1#*=}"
173 --packagedir)
174 packagedir="$2"
175 shift
177 --packagedir=*)
178 packagedir="${1#*=}"
180 --targetdir)
181 targetdir="$2"
182 shift
184 --targetdir=*)
185 targetdir="${1#*=}"
187 --outdir)
188 outdir="$2"
189 shift
191 --outdir=*)
192 outdir="${1#*=}"
194 --help | --hel | --he | --h | '--?' | -help | -hel | -he | -h | '-?' )
195 usage
196 exit
199 shift
200 break; # End of options.
203 echo "configure: WARNING: unrecognized option '${1}'" 1>&2
206 break
208 esac
209 shift
210 done
212 echo "Creating config.mak ..."
214 return_variables; # Show configured variables.
215 : > config.mak; # Clean up config.mak, first.
217 if return_variables > config.mak
218 then
219 touch src/qi.in && echo "OK, now you can run \`make'"