recipes: libs/libaio: Do not compile with fstack-protector
[dragora.git] / qi / configure
blob1bcc3c9bc0301e5e200920107b4caed455a67638
1 #! /bin/sh -
3 # Simple `configure' script for Qi.
5 # Copyright (c) 2016-2018, 2020 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\\n" \
23 "Usage: configure [options]" \
24 "" \
25 "Defaults for the options are specified in brackets." \
26 "" \
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}]" \
45 # Defaults
46 prefix=/usr/local
47 exec_prefix='$(prefix)'
48 bindir='$(exec_prefix)/bin'
49 sbindir='$(exec_prefix)/sbin'
50 libexecdir='$(exec_prefix)/libexec'
51 sysconfdir='$(prefix)/etc'
52 localstatedir='$(prefix)/var'
53 datarootdir='$(prefix)/share'
54 infodir='$(datarootdir)/info'
55 mandir='$(datarootdir)/man'
56 docdir='$(datarootdir)/doc'
57 packagedir='/usr/local/pkgs'
58 targetdir='/usr/local'
59 arch="$(uname -m)"
61 return_variables() {
62 printf "%s\\n" \
63 "prefix = $prefix" \
64 "exec_prefix = $exec_prefix" \
65 "bindir = $bindir" \
66 "sbindir = $sbindir" \
67 "libexecdir = $libexecdir" \
68 "sysconfdir = $sysconfdir" \
69 "localstatedir = $localstatedir" \
70 "datarootdir = $datarootdir" \
71 "infodir = $infodir" \
72 "mandir = $mandir" \
73 "docdir = $docdir" \
74 "packagedir = $packagedir" \
75 "targetdir = $targetdir" \
76 "arch = $arch" \
80 # Handle options
81 while test $# -gt 0
83 case $1 in
84 --prefix)
85 prefix="$2"
86 shift
88 --prefix=*)
89 prefix="${1#*=}"
91 --exec-prefix)
92 exec_prefix="$2"
93 shift
95 --exec-prefix=*)
96 exec_prefix="${1#*=}"
98 --bindir)
99 bindir="$2"
100 shift
102 --bindir=*)
103 bindir="${1#*=}"
105 --sbindir)
106 sbindir="$2"
107 shift
109 --sbindir=*)
110 sbindir="${1#*=}"
112 --libexecdir)
113 libexecdir="$2"
114 shift
116 --libexecdir=*)
117 libexecdir="${1#*=}"
119 --sysconfdir)
120 sysconfdir="$2"
121 shift
123 --sysconfdir=*)
124 sysconfdir="${1#*=}"
126 --localstatedir)
127 localstatedir="$2"
128 shift
130 --localstatedir=*)
131 localstatedir="${1#*=}"
133 --datarootdir)
134 datarootdir="$2"
135 shift
137 --datarootdir=*)
138 datarootdir="${1#*=}"
140 --infodir)
141 infodir="$2"
142 shift
144 --infodir=*)
145 infodir="${1#*=}"
147 --mandir)
148 mandir="$2"
149 shift
151 --mandir=*)
152 mandir="${1#*=}"
154 --docdir)
155 docdir="$2"
156 shift
158 --docdir=*)
159 docdir="${1#*=}"
161 --packagedir)
162 packagedir="$2"
163 shift
165 --packagedir=*)
166 packagedir="${1#*=}"
168 --targetdir)
169 targetdir="$2"
170 shift
172 --targetdir=*)
173 targetdir="${1#*=}"
175 --arch)
176 arch="$2"
177 shift
179 --arch=*)
180 arch="${1#*=}"
182 --help | --hel | --he | --h | '--?' | -help | -hel | -he | -h | '-?' )
183 usage
184 exit
187 shift
188 break; # End of options.
191 echo "configure: WARNING: unrecognized option '${1}'" 1>&2
194 break
196 esac
197 shift
198 done
200 echo "Creating config.mak ..."
202 return_variables; # Show configured variables.
203 : > config.mak; # Clean up config.mak, first.
205 if return_variables > config.mak
206 then
207 touch src/qi.in && echo "OK, now you can run \`make'"