-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·244 lines (207 loc) · 6.05 KB
/
configure
File metadata and controls
executable file
·244 lines (207 loc) · 6.05 KB
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
#!/bin/sh
#
# daemon - https://libslack.org/daemon
#
# Copyright (C) 1999-2004, 2010, 2020-2023 raf <raf@raf.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# 20230824 raf <raf@raf.org>
#
# Show the usage message for --help
for opt in "$@"
do
case "$opt" in
--help|-h)
echo "$0 [options]"
echo "options:"
echo " --help - Print this message then exit"
echo " --prefix=/path - Override platform-specific installation prefix"
echo " --destdir=/path - Override DESTDIR in Makefile for building packages"
echo " --enable-logind - Enable logind/elogind support (i.e. --bind option)"
echo " --disable-logind - Disable logind/elogind support (i.e. --bind option)"
echo " --enable-mail-test - Enable sending an email during tests (default)"
echo " --disable-mail-test - Disable sending an email during tests"
echo " --enable-test - Include backup implementations of some functions (don't)"
echo " --default - Restore Makefile (et al.) to default state (for distribution)"
echo " --platform=platform - Override platform (one of the below) for --default"
echo
echo "This configure script knows what to do for several platforms:"
echo
echo " Linux, macOS, FreeBSD, OpenBSD, NetBSD, GNU/kFreeBSD, GNU/Hurd, Solaris"
echo ""
echo "To override a platform-specific install prefix, use --prefix (e.g. /opt/local)."
echo "Note: For --prefix=default and --prefix=/usr, /etc and /var/run are still used."
echo "For other values, these paths are affected by the prefix."
echo ""
echo "To override the makefile \$(DESTDIR), use --destdir."
echo "This is for building packages and doesn't affect paths in the final binary."
echo ""
echo "On Linux systems with libsystemd or libelogind headers and libraries installed,"
echo "use --enable-logind to use them for daemon's --bind option."
echo ""
echo "To undo the effects of --enable-logind, use --disable-logind."
echo ""
echo "When creating packages, use --disable-mail-test to suppress an internal"
echo "test that sends an email message."
echo ""
echo "To undo the effects of --disable-mail-test, use --enable-mail-test."
echo ""
echo "If set here, \$CC will override the compiler in the Makefile."
echo ""
echo "\$CPPFLAGS, \$CFLAGS and \$LDFLAGS additions need to be supplied to make later."
echo ""
exit 0
;;
esac
done
# Handle --default (for distribution)
default=0; export default
case "$1" in
--default|default)
set -- --platform=Linux --prefix=default --destdir= --disable-logind --enable-mail-test
CC=
default=1
;;
esac
# Fatal error message
die() { echo "$0: $@" >&2; exit 1; }
# Handle --platform (for distribution)
PLATFORM=
for opt in "$@"
do
case "$opt" in
--platform=*)
PLATFORM="${opt#--platform=}"
case "$PLATFORM" in
Linux*|GNU/kFreeBSD*|GNU*|FreeBSD*|NetBSD*|OpenBSD*|SunOS*|Solaris|Darwin*|macOS)
;;
*)
die "Unknown platform: $PLATFORM\nMust be one of: Linux, macOS, FreeBSD, OpenBSD, NetBSD, GNU/kFreeBSD, GNU/Hurd, Solaris"
;;
esac
;;
esac
done
# Operating system preferences (installation locations and manual compression)
case "${PLATFORM:-`uname -a`}" in
Linux*)
echo "Configuring for linux"
conf/linux
if [ -f /etc/slackware-version ]
then
echo "Configuring for slackware"
conf/slackware
fi
;;
GNU/kFreeBSD*)
echo "Configuring for kfreebsd"
conf/kfreebsd
;;
GNU*)
echo "Configuring for hurd"
conf/gnuhurd
;;
FreeBSD*)
echo "Configuring for freebsd"
conf/freebsd
;;
NetBSD*)
echo "Configuring for netbsd"
conf/netbsd
;;
OpenBSD*)
echo "Configuring for openbsd"
conf/openbsd
;;
SunOS*|Solaris)
cc=""
solaris="solaris10"
[ "x`uname -r`" = "x5.8" ] && solaris="solaris8"
[ "x`uname -r`" = "x5.6" ] && solaris="solaris6"
if [ "`uname -m`" = sun4u ]
then
[ -x "`command -v gcc`" ] && cc="gcc"
[ -x "`command -v cc`" ] && cc="cc"
else
[ -x "`command -v cc`" ] && cc="cc"
[ -x "`command -v gcc`" ] && cc="gcc"
fi
[ "$cc" = "" ] && die "Failed to find a compiler"
echo "Configuring for $solaris (with $cc)"
conf/$solaris-$cc
;;
Darwin*|macOS)
echo "Configuring for macos"
conf/macosx
;;
*)
die "Unknown platform: Please configure manually"
;;
esac
# Set CC from $CC (for macports)
if [ -n "$CC" ]
then
echo "Configuring CC as $CC"
conf/ccenv
fi
# Remove unsupported compiler warning options
conf/compiler_option -Wno-gnu-folding-constant
conf/compiler_option -Wno-pointer-bool-conversion
conf/compiler_option -Wno-maybe-uninitialized
# Process command line options
for opt in "$@"
do
case "$opt" in
--platform=*)
;;
--prefix=*)
echo "Configuring $opt"
conf/prefix "$opt"
;;
--destdir=*)
echo "Configuring $opt"
conf/destdir "$opt"
;;
--enable-test)
echo "Configuring to include backup function implementations."
conf/test
;;
--enable-logind)
echo "Enabling systemd-logind/elogind support"
conf/logind --enable || exit 1
;;
--disable-logind)
echo "Disabling systemd-logind/elogind support"
conf/logind --disable
;;
--enable-mail-test)
echo "Configuring to include mail tests (default)."
conf/mail-test-start
;;
--disable-mail-test)
echo "Configuring to exclude mail tests."
conf/mail-test-stop
;;
*)
echo "$0: Unknown argument: $opt" >&2
exit 1
;;
esac
done
# Prepare for parallel make
[ -x "`command -v gmake`" ] && make=gmake || make=make
$make ready
exit 0
# vi:set ts=4 sw=4: