mesa upgraded to version 17.3.1
[dragora.git] / qi / configure
blobc05ca096862602267b632eabde86afd69c529d76
1 #! /bin/sh -
3 # Simple `configure' script for Qi.
5 # Copyright (c) 2016-2017 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 usage() {
20 printf "%s\n" \
21 "Usage: configure [options]" \
22 "" \
23 "Defaults for the options are specified in brackets." \
24 "" \
25 "Options:" \
26 " --prefix=DIR install files in DIR [${prefix}]" \
27 " --exec-prefix=DIR base DIR for arch-dependent files [${exec_prefix}]" \
28 " --bindir=DIR user executables [${bindir}]" \
29 " --sbindir=DIR system admin executables [${sbindir}]" \
30 " --libexecdir=DIR program executables [${libexecdir}]" \
31 " --sysconfdir=DIR read-only single-machine data [${sysconfdir}]" \
32 " --localstatedir=DIR modifiable single-machine data [${localstatedir}]" \
33 " --datarootdir=DIR read-only arch-independent data root [${datarootdir}]" \
34 " --infodir=DIR info documentation [${infodir}]" \
35 " --mandir=DIR man documentation [${mandir}]" \
36 " --docdir=DIR documentation root [${docdir}]" \
37 " --packagedir=DIR package installation directory [${packagedir}]" \
38 " --targetdir=DIR target directory for linking [${targetdir}]" \
39 "" \
40 "All the options affect the package manager, the internal values," \
41 "including those in the configuration file." \
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='$(prefix)/pkg'
58 targetdir='/'
60 return_variables() {
61 printf "%s\n" \
62 "prefix = $prefix" \
63 "exec_prefix = $exec_prefix" \
64 "bindir = $bindir" \
65 "sbindir = $sbindir" \
66 "libexecdir = $libexecdir" \
67 "sysconfdir = $sysconfdir" \
68 "localstatedir = $localstatedir" \
69 "datarootdir = $datarootdir" \
70 "infodir = $infodir" \
71 "mandir = $mandir" \
72 "docdir = $docdir" \
73 "packagedir = $packagedir" \
74 "targetdir = $targetdir" \
78 # Handle options
79 while [ $# -gt 0 ]
81 case $1 in
82 --prefix)
83 prefix="$2"
84 shift
86 --prefix=*)
87 prefix="${1#*=}"
89 --exec-prefix)
90 exec_prefix="$2"
91 shift
93 --exec-prefix=*)
94 exec_prefix="${1#*=}"
96 --bindir)
97 bindir="$2"
98 shift
100 --bindir=*)
101 bindir="${1#*=}"
103 --sbindir)
104 sbindir="$2"
105 shift
107 --sbindir=*)
108 sbindir="${1#*=}"
110 --libexecdir)
111 libexecdir="$2"
112 shift
114 --libexecdir=*)
115 libexecdir="${1#*=}"
117 --sysconfdir)
118 sysconfdir="$2"
119 shift
121 --sysconfdir=*)
122 sysconfdir="${1#*=}"
124 --localstatedir)
125 localstatedir="$2"
126 shift
128 --localstatedir=*)
129 localstatedir="${1#*=}"
131 --datarootdir)
132 datarootdir="$2"
133 shift
135 --datarootdir=*)
136 datarootdir="${1#*=}"
138 --infodir)
139 infodir="$2"
140 shift
142 --infodir=*)
143 infodir="${1#*=}"
145 --mandir)
146 mandir="$2"
147 shift
149 --mandir=*)
150 mandir="${1#*=}"
152 --docdir)
153 docdir="$2"
154 shift
156 --docdir=*)
157 docdir="${1#*=}"
159 --packagedir)
160 packagedir="$2"
161 shift
163 --packagedir=*)
164 packagedir="${1#*=}"
166 --targetdir)
167 targetdir="$2"
168 shift
170 --targetdir=*)
171 targetdir="${1#*=}"
173 -h | --help)
174 usage
175 exit
177 --) # End of options
178 shift
179 break
182 echo "configure: WARNING: unrecognized option '${1}'" 1>&2
185 break
187 esac
189 shift
190 done
192 echo "Creating config.mak ..."
193 return_variables
194 : > config.mak
195 return_variables > config.mak
196 echo "OK, now you can run \`make'"