File: configure

package info (click to toggle)
zmk 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,132 kB
  • sloc: makefile: 1,749; sh: 313; ansic: 42; awk: 12; cpp: 12
file content (297 lines) | stat: -rwxr-xr-x 15,920 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
#!/bin/sh
# Copyright 2019-2021 Zygmunt Krynicki.
#
# This file is part of zmk.
#
# Zmk is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# Zmk is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Zmk.  If not, see <https://www.gnu.org/licenses/>.

# This script was automatically generated by zmk version 0.5.1
# for the zmk project. Executing this script creates a
# configuration file called config.zmk.mk which influences the
# build process of zmk.

while [ "$#" -ge 1 ]; do
    case "$1" in
        -h|--help)
            echo "Usage: ./configure [OPTIONS]"
            echo
            echo "Compilation options:"
            echo "  --build=GNU_TRIPLET         Describe the build machine with the given GNU_TRIPLET"
            echo "  --host=GNU_TRIPLET          Describe the host machine with the given GNU_TRIPLET"
            echo "  --target=GNU_TRIPLET        Describe the target machine with the given GNU_TRIPLET"
            echo "  --enable-dependency-tracking"
            echo "                              Track dependencies between files (implicit)"
            echo "  --disable-dependency-tracking"
            echo "                              Do not generate or use dependency data during builds"
            echo "  --enable-maintainer-mode    Enable maintainer mode (implicit)"
            echo "  --disable-maintainer-mode   Disable maintainer mode"
            echo "  --enable-static             Enable static libraries"
            echo "  --disable-static            Disable static libraries"
            echo "  --enable-dynamic            Enable dynamic or shared libraries"
            echo "  --disable-dynamic           Disable dynamic or shared libraries"
            echo
            echo "Autotools compatibility options"
            echo "  --with-libtool-sysroot=DIR  Set the compiler sysroot to DIR"
            echo
            echo "Build-time directory selection:"
            echo "  --prefix=PREFIX             Set prefix for all directories to PREFIX"
            echo "  --exec-prefix=PREFIX        Set prefix for libraries and programs to PREFIX"
            echo "  --exec_prefix=PREFIX        Alternate spelling --exec-prefix"
            echo
            echo "  --bindir=DIR                Install user programs to DIR"
            echo "  --sbindir=DIR               Install super-user programs to DIR"
            echo "  --libdir=DIR                Install runtime and development libraries to DIR"
            echo "  --libexecdir=DIR            Install library-internal programs to DIR"
            echo "  --includedir=DIR            Install development header files to DIR"
            echo "  --oldincludedir=DIR         For compatibility with autotools, ignored"
            echo "  --mandir=DIR                Install manual pages to DIR"
            echo "  --infodir=DIR               Install GNU info pages to DIR"
            echo "  --sysconfdir=DIR            Install system configuration files to DIR"
            echo "  --datadir=DIR               Install read-only data files to DIR"
            echo
            echo "  --localstatedir=DIR         Store persistent state specific to a machine in DIR"
            echo "  --runstatedir=DIR           Store ephemeral state specific to a machine in DIR"
            echo "  --sharedstatedir=DIR        Store state shared across machines in DIR"
            echo
            echo "Options for altering program names:"
            echo "  --program-prefix=PREFIX     Put PREFIX before installed program names"
            echo "  --program-suffix=SUFFIX     Put SUFFIX after installed program names"
            echo "  --program-transform-name=PROGRAM"
            echo "                              Use sed PROGRAM to transform installed program names"
            echo
            echo "Miscellaneous options:"
            echo "  --enable-option-checking    Report unrecognized configuration options (implicit)"
            echo "  --disable-option-checking   Ignore unrecognized configuration options"
            echo "  --enable-silent-rules       Do not display commands while building"
            echo "  --disable-silent-rules      Display commands while building (implicit)"
            echo
            echo "Memorized environment variables:"
            echo "  CC                          Name of the C compiler"
            echo "  CXX                         Name of the C++ compiler"
            echo "  CFLAGS                      Options for the C compiler"
            echo "  CXXFLAGS                    Options for the C++ compiler"
            echo "  CPPFLAGS                    Options for the preprocessor"
            echo "  LDFLAGS                     Options for the linker"
            exit 0
            ;;
        --version)
            echo "z.mk configure script version 0.5.1"
            exit 0
            ;;
        *)
            break
            ;;
    esac
done

# Given key=value or key="value value", print the value
rhs() {
    echo "$*" | cut -d '=' -f 2- | sed -e 's/^"//' -e 's/"$//'
}

configureOptions="$*"
srcdir="$(dirname "$0")"

while [ "$#" -ge 1 ]; do
    case "$1" in
        --build=*)                      buildArchTriplet="$(rhs "$1")" && shift ;;
        --host=*)                       hostArchTriplet="$(rhs "$1")" && shift ;;
        --target=*)                     targetArchTriplet="$(rhs "$1")" && shift ;;
        --with-libtool-sysroot=*)       sysRoot="$(rhs "$1")" && shift ;;

        --enable-dependency-tracking)   dependencyTracking=yes && shift ;;
        --disable-dependency-tracking)  dependencyTracking=no && shift ;;

        --enable-maintainer-mode)       maintainerMode=yes && shift ;;
        --disable-maintainer-mode)      maintainerMode=no && shift ;;

        --enable-silent-rules)          silentRules=yes && shift ;;
        --disable-silent-rules)         silentRules=no && shift ;;

        --enable-option-checking)       disableOptionChecking=no && shift ;;
        --disable-option-checking)      disableOptionChecking=yes && shift ;;

        --enable-static)                staticLibraries=yes && shift ;;
        --disable-static)               staticLibraries=no && shift ;;
        --enable-dynamic)               dynamicLibraries=yes && shift ;;
        --disable-dynamic)              dynamicLibraries=no && shift ;;

        --program-prefix=*)             programPrefix="$(rhs "$1")" && shift ;;
        --program-suffix=*)             programSuffix="$(rhs "$1")" && shift ;;
        --program-transform-name=*)     programTransformName="$(rhs "$1")" && shift ;;

        --exec-prefix=*|--exec_prefix=*)exec_prefix="$(rhs "$1")" && shift ;;
        --prefix=*)                     prefix="$(rhs "$1")" && shift ;;

        --bindir=*)                     bindir="$(rhs "$1")" && shift ;;
        --sbindir=*)                    sbindir="$(rhs "$1")" && shift ;;
        --libdir=*)                     libdir="$(rhs "$1")" && shift ;;
        --libexecdir=*)                 libexecdir="$(rhs "$1")" && shift ;;
        --datadir=*)                    datadir="$(rhs "$1")" && shift ;;
        --includedir=*)                 includedir="$(rhs "$1")" && shift ;;
        --oldincludedir=*)              shift ;; # ignored for compatibility
        --infodir=*)                    infodir="$(rhs "$1")" && shift ;;
        --mandir=*)                     mandir="$(rhs "$1")" && shift ;;
        --sysconfdir=*)                 sysconfdir="$(rhs "$1")" && shift ;;

        --localstatedir=*)              localstatedir="$(rhs "$1")" && shift ;;
        --runstatedir=*)                runstatedir="$(rhs "$1")" && shift ;;
        --sharedstatedir=*)             sharedstatedir="$(rhs "$1")" && shift ;;

        CC=*)                           CC="$(rhs "$1")" && shift ;;
        CXX=*)                          CXX="$(rhs "$1")" && shift ;;
        CFLAGS=*)                       CFLAGS="$(rhs "$1")" && shift ;;
        CXXFLAGS=*)                     CXXFLAGS="$(rhs "$1")" && shift ;;
        OBJCFLAGS=*)                    OBJCFLAGS="$(rhs "$1")" && shift ;;
        OBJCXXFLAGS=*)                  OBJCXXFLAGS="$(rhs "$1")" && shift ;;
        CPPFLAGS=*)                     CPPFLAGS="$(rhs "$1")" && shift ;;
        LDFLAGS=*)                      LDFLAGS="$(rhs "$1")" && shift ;;
        ZMK.SrcDir=*)                   srcdir="$(rhs "$1")" && shift ;;

        *)
            if [ "${disableOptionChecking:-}" != yes ]; then
                echo "configure: unknown option $1" >&2
                exit 1
            fi
            shift
            ;;
    esac
done

{
    echo "# Generated by zmk configuration script version 0.5.1"
    echo "# Invoked as: $srcdir/configure $configureOptions"
    echo
    echo "# Location of the source code."
    echo "ZMK.SrcDir=$srcdir"
    echo
    echo "# Build and host architecture triplets."
    echo "# Note that those impact compiler selection unless CC and CXX are overridden."
    test -n "${buildArchTriplet:-}"    && echo "Configure.BuildArchTriplet=$buildArchTriplet"     || echo "#   Configure.BuildArchTriplet was not specified."
    test -n "${hostArchTriplet:-}"     && echo "Configure.HostArchTriplet=$hostArchTriplet"       || echo "#   Configure.HostArchTriplet was not specified."
    test -n "${targetArchTriplet:-}"   && echo "Configure.TargetArchTriplet=$targetArchTriplet"   || echo "#   Configure.TargetArchTriplet was not specified."
    test -n "${sysRoot:-}"             && echo "Configure.SysRoot=$sysRoot"                       || echo "#   Configure.SysRoot was not specified."
    echo
    echo "# Build-time configuration of application directories."
    test -n "${prefix:-}"          && echo "prefix=$prefix"                   || echo "#   prefix was not specified."
    test -n "${exec_prefix:-}"     && echo "exec_prefix=$exec_prefix"         || echo "#   exec_prefix was not specified."
    test -n "${bindir:-}"          && echo "bindir=$bindir"                   || echo "#   bindir was not specified."
    test -n "${sbindir:-}"         && echo "sbindir=$sbindir"                 || echo "#   sbindir was not specified."
    test -n "${datadir:-}"         && echo "datadir=$datadir"                 || echo "#   datadir was not specified."
    test -n "${includedir:-}"      && echo "includedir=$includedir"           || echo "#   includedir was not specified."
    test -n "${infodir:-}"         && echo "infodir=$infodir"                 || echo "#   infodir was not specified."
    test -n "${libdir:-}"          && echo "libdir=$libdir"                   || echo "#   libdir was not specified."
    test -n "${libexecdir:-}"      && echo "libexecdir=$libexecdir"           || echo "#   libexecdir was not specified."
    test -n "${localstatedir:-}"   && echo "localstatedir=$localstatedir"     || echo "#   localstatedir was not specified."
    test -n "${mandir:-}"          && echo "mandir=$mandir"                   || echo "#   mandir was not specified."
    test -n "${runstatedir:-}"     && echo "runstatedir=$runstatedir"         || echo "#   runstatedir was not specified."
    test -n "${sharedstatedir:-}"  && echo "sharedstatedir=$sharedstatedir"   || echo "#   sharedstatedir was not specified."
    test -n "${sysconfdir:-}"      && echo "sysconfdir=$sysconfdir"           || echo "#   sysconfdir was not specified."
    echo
    echo "# Inherited environment variables and overrides."
    test -n "$CC"                  && echo "CC=$CC"                           || echo "#   CC was not specified."
    test -n "$CXX"                 && echo "CXX=$CXX"                         || echo "#   CXX was not specified."
    test -n "$CFLAGS"              && echo "CFLAGS=$CFLAGS"                   || echo "#   CFLAGS was not specified."
    test -n "$CXXFLAGS"            && echo "CXXFLAGS=$CXXFLAGS"               || echo "#   CXXFLAGS was not specified."
    test -n "$OBJCFLAGS"           && echo "OBJCFLAGS=$OBJCFLAGS"             || echo "#   OBJCFLAGS was not specified."
    test -n "$OBJCXXFLAGS"         && echo "OBJCXXFLAGS=$OBJCXXFLAGS"         || echo "#   OBJCXXFLAGS was not specified."
    test -n "$CPPFLAGS"            && echo "CPPFLAGS=$CPPFLAGS"               || echo "#   CPPFLAGS was not specified."
    test -n "$LDFLAGS"             && echo "LDFLAGS=$LDFLAGS"                 || echo "#   LDFLAGS was not specified."
    echo
    echo "# Track dependencies between objects and source and header files."
    case "${dependencyTracking:-implicit}" in
        yes)
            echo "Configure.DependencyTracking=yes"
            ;;
        no)
            echo "Configure.DependencyTracking="
            ;;
        implicit)
            echo "#   Configure.DependencyTracking was not specified."
            echo "#   This feature is enabled by default."
            ;;
    esac
    echo
    echo "# Additional options for package maintainers."
    case "${maintainerMode:-implicit}" in
        yes)
            echo "Configure.MaintainerMode=yes"
            ;;
        no)
            echo "Configure.MaintainerMode="
            ;;
        implicit)
            echo "#   Configure.MaintainerMode was not specified."
            echo "#   This feature is enabled by default."
            ;;
    esac
    echo
    echo "# Silence shell commands used by make."
    case "${silentRules:-implicit}" in
        yes)
            echo "Configure.SilentRules=yes"
            ;;
        no)
            echo "Configure.SilentRules="
            ;;
        implicit)
            echo "#   Configure.SilentRules was not specified."
            echo "#   This feature is disabled by default."
            ;;
    esac
    echo "# Support for static libraries."
    case "${staticLibraries:-implicit}" in
        yes)
            echo "Configure.StaticLibraries=yes"
            ;;
        no)
            echo "Configure.StaticLibraries="
            ;;
        implicit)
            echo "#   Configure.StaticLibraries was not specified."
            echo "#   This feature is enabled by default."
            ;;
    esac
    echo
    echo "# Support for dynamic or shared libraries."
    case "${dynamicLibraries:-implicit}" in
        yes)
            echo "Configure.DynamicLibraries=yes"
            ;;
        no)
            echo "Configure.DynamicLibraries="
            ;;
        implicit)
            echo "#   Configure.DynamicLibraries was not specified."
            echo "#   This feature is enabled by default, if supported."
            ;;
    esac
    echo
    echo "# Program name customization options."
    test -n "${programPrefix:-}"           && echo "Configure.ProgramPrefix=$programPrefix"               || echo "#   Configure.ProgramPrefix was not specified."
    test -n "${programSuffix:-}"           && echo "Configure.ProgramSuffix=$programSuffix"               || echo "#   Configure.ProgramSuffix was not specified."
    test -n "${programTransformName:-}"    && echo "Configure.ProgramTransformName=$programTransformName" || echo "#   Configure.ProgramTransformName was not specified."
    echo
    echo "# Remember that the configuration script was executed."
    echo "Configure.Configured=yes"
    echo "Configure.Options=$configureOptions"
} >"${ZMK_CONFIGURE_MAKEFILE:=config.zmk.mk}"

if [ ! -e Makefile ] && [ ! -e GNUmakefile ]; then
    if [ -e "$srcdir"/GNUmakefile ]; then
        ln -s "$srcdir"/GNUmakefile GNUmakefile
    fi
    if [ -e "$srcdir"/Makefile ]; then
        ln -s "$srcdir"/Makefile Makefile
    fi
fi