recipes: kernel/generic: remove lines that I was using for configure it
[dragora.git] / qi / configure
blobeaec62354a9472d3857d7e76428882e3932c9843
1 #! /bin/sh -
3 # Simple `configure' script for Qi.
5 # Copyright (C) 2016-2017 Matias Andres Fonzo <selk@dragora.org>
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 usage() {
21 printf "%s\n" \
22 "Usage: configure [options]" \
23 "" \
24 "Defaults for the options are specified in brackets." \
25 "" \
26 "Options:" \
27 " --prefix=DIR install files in DIR [${prefix}]" \
28 " --exec-prefix=DIR base DIR for arch-dependent files [${exec_prefix}]" \
29 " --bindir=DIR user executables [${bindir}]" \
30 " --sbindir=DIR system admin executables [${sbindir}]" \
31 " --libexecdir=DIR program executables [${libexecdir}]" \
32 " --sysconfdir=DIR read-only single-machine data [${sysconfdir}]" \
33 " --localstatedir=DIR modifiable single-machine data [${localstatedir}]" \
34 " --datarootdir=DIR read-only arch-independent data root [${datarootdir}]" \
35 " --infodir=DIR info documentation [${infodir}]" \
36 " --mandir=DIR man documentation [${mandir}]" \
37 " --docdir=DIR documentation root [${docdir}]" \
38 " --packagedir=DIR package installation directory [${packagedir}]" \
39 " --targetdir=DIR target directory for linking [${targetdir}]" \
40 "" \
41 "All the options affect the package manager, the internal values," \
42 "including those in the configuration file." \
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='$(prefix)/pkg'
59 targetdir='/'
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" \
79 # Handle options
80 while [ $# -gt 0 ]
82 case $1 in
83 --prefix)
84 prefix="$2"
85 shift
87 --prefix=*)
88 prefix="${1#*=}"
90 --exec-prefix)
91 exec_prefix="$2"
92 shift
94 --exec-prefix=*)
95 exec_prefix="${1#*=}"
97 --bindir)
98 bindir="$2"
99 shift
101 --bindir=*)
102 bindir="${1#*=}"
104 --sbindir)
105 sbindir="$2"
106 shift
108 --sbindir=*)
109 sbindir="${1#*=}"
111 --libexecdir)
112 libexecdir="$2"
113 shift
115 --libexecdir=*)
116 libexecdir="${1#*=}"
118 --sysconfdir)
119 sysconfdir="$2"
120 shift
122 --sysconfdir=*)
123 sysconfdir="${1#*=}"
125 --localstatedir)
126 localstatedir="$2"
127 shift
129 --localstatedir=*)
130 localstatedir="${1#*=}"
132 --datarootdir)
133 datarootdir="$2"
134 shift
136 --datarootdir=*)
137 datarootdir="${1#*=}"
139 --infodir)
140 infodir="$2"
141 shift
143 --infodir=*)
144 infodir="${1#*=}"
146 --mandir)
147 mandir="$2"
148 shift
150 --mandir=*)
151 mandir="${1#*=}"
153 --docdir)
154 docdir="$2"
155 shift
157 --docdir=*)
158 docdir="${1#*=}"
160 --packagedir)
161 packagedir="$2"
162 shift
164 --packagedir=*)
165 packagedir="${1#*=}"
167 --targetdir)
168 targetdir="$2"
169 shift
171 --targetdir=*)
172 targetdir="${1#*=}"
174 -h | --help)
175 usage
176 exit
178 --) # End of options
179 shift
180 break
183 echo "configure: WARNING: unrecognized option '${1}'" 1>&2
186 break
188 esac
190 shift
191 done
193 echo "Creating config.mak ..."
194 return_variables
195 : > config.mak
196 return_variables > config.mak
197 echo "OK, now you can run \`make'"