forked from cockpit-project/cockpit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
626 lines (521 loc) · 19.7 KB
/
configure.ac
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
# This file is part of Cockpit.
#
# Copyright (C) 2013 Red Hat, Inc.
#
# Cockpit is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Cockpit 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 Cockpit; If not, see <http://www.gnu.org/licenses/>.
AC_INIT([Cockpit],
[m4_esyscmd_s([if [ -f .tarball ]; then cat .tarball; else echo $(git describe | tr - . ); fi])],
[cockpit],
[https://cockpit-project.org/])
# The above command needs to run in a git repository or `.tarball` file needs to be
# present. If that didn't work bail early. Cockpit needs to know its own version number
AC_MSG_CHECKING(that PACKAGE_VERSION is properly set)
if test -z "$PACKAGE_VERSION"; then
AC_MSG_RESULT(no)
AC_MSG_ERROR(Please build from a .git checkout or .tar.xz tarball)
else
AC_MSG_RESULT(yes)
fi
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([tools])
AC_CONFIG_MACRO_DIR([tools])
AM_INIT_AUTOMAKE([1.9 foreign dist-xz no-dist-gzip subdir-objects tar-pax])
AM_MAINTAINER_MODE([enable])
AC_USE_SYSTEM_EXTENSIONS
AM_PROG_AR
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_RANLIB
AC_ISC_POSIX
AC_HEADER_STDC
AC_PROG_LN_S
# HACK - Prevent valgrind false-positives due to GHashTable trickery
AC_CHECK_SIZEOF([void *])
AM_CONDITIONAL([VALGRIND_MINADDR_HACK], [test "$ac_cv_sizeof_void_p" -eq 8])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_MSG_CHECKING([whether to install to prefix only])
AC_ARG_ENABLE([prefix-only],
[AS_HELP_STRING([--enable-prefix-only], [Whether to install to prefix only])],
[], [enable_prefix_only=no])
AC_MSG_RESULT($enable_prefix_only)
# Initialization
#
GLIB_VERSION="2.44"
LIBSSH_VERSION="0.8.5"
GIO_VERSION="2.37.4" # For appropriate version of TLS logic
GIO_REQUIREMENT="gio-unix-2.0 >= $GIO_VERSION gio-2.0 >= $GIO_VERSION"
LIBSYSTEMD_REQUIREMENT="libsystemd >= 235"
JSON_GLIB_REQUIREMENT="json-glib-1.0 >= 0.14.0"
POLKIT_REQUIREMENT="polkit-agent-1 >= 0.105"
GNUTLS_REQUIREMENT="gnutls >= 3.4.3"
KRB5_REQUIREMENT="krb5-gssapi >= 1.11 krb5 >= 1.11"
PKG_CHECK_MODULES(GIO, [$GIO_REQUIREMENT])
GLIB_VERSION_DEF="GLIB_VERSION_$(echo $GLIB_VERSION | tr '.' '_')"
GIO_CFLAGS="$GIO_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB_VERSION_DEF"
GIO_CFLAGS="$GIO_CFLAGS -DGLIB_VERSION_MAX_ALLOWED=$GLIB_VERSION_DEF"
PKG_CHECK_MODULES(LIBSYSTEMD, [$LIBSYSTEMD_REQUIREMENT])
PKG_CHECK_MODULES(JSON_GLIB, [$JSON_GLIB_REQUIREMENT])
PKG_CHECK_MODULES(POLKIT, [$POLKIT_REQUIREMENT],enable_polkit="yes",enable_polkit="no")
PKG_CHECK_MODULES(GNUTLS, [$GNUTLS_REQUIREMENT])
PKG_CHECK_MODULES(KRB5, [$KRB5_REQUIREMENT])
COCKPIT_CFLAGS="$GIO_CFLAGS $JSON_GLIB_CFLAGS $LIBSYSTEMD_CFLAGS"
COCKPIT_LIBS="$GIO_LIBS $JSON_GLIB_LIBS $LIBSYSTEMD_LIBS -lutil -lm"
AC_SUBST(COCKPIT_CFLAGS)
AC_SUBST(COCKPIT_LIBS)
# bridge with optional polkit
if test "$enable_polkit" = "yes"; then
COCKPIT_BRIDGE_CFLAGS="$COCKPIT_CFLAGS $POLKIT_CFLAGS"
COCKPIT_BRIDGE_LIBS="$COCKPIT_LIBS $POLKIT_LIBS"
AC_DEFINE_UNQUOTED([WITH_POLKIT], [], [Build with polkit])
else
COCKPIT_BRIDGE_CFLAGS="$COCKPIT_CFLAGS"
COCKPIT_BRIDGE_LIBS="$COCKPIT_LIBS"
fi
AM_CONDITIONAL(WITH_POLKIT, test "$enable_polkit" = "yes")
AC_SUBST(COCKPIT_BRIDGE_CFLAGS)
AC_SUBST(COCKPIT_BRIDGE_LIBS)
COCKPIT_PCP_CFLAGS="$COCKPIT_CFLAGS"
COCKPIT_PCP_LIBS="$COCKPIT_LIBS"
AC_SUBST(COCKPIT_PCP_CFLAGS)
AC_SUBST(COCKPIT_PCP_LIBS)
COCKPIT_SESSION_CFLAGS="$KRB5_CFLAGS"
COCKPIT_SESSION_LIBS="$KRB5_LIBS"
AC_SUBST(COCKPIT_SESSION_CFLAGS)
AC_SUBST(COCKPIT_SESSION_LIBS)
PAM_COCKPIT_CERT_CFLAGS="$COCKPIT_CFLAGS $LIBSYSTEMD_CFLAGS"
PAM_COCKPIT_CERT_LIBS="$LIBSYSTEMD_LIBS"
AC_SUBST(PAM_COCKPIT_CERT_CFLAGS)
AC_SUBST(PAM_COCKPIT_CERT_LIBS)
COCKPIT_WS_CFLAGS="$COCKPIT_CFLAGS"
COCKPIT_WS_LIBS="$COCKPIT_LIBS"
AC_SUBST(COCKPIT_WS_CFLAGS)
AC_SUBST(COCKPIT_WS_LIBS)
COCKPIT_TLS_CFLAGS="$GNUTLS_CFLAGS"
COCKPIT_TLS_LIBS="$GNUTLS_LIBS"
AC_SUBST(COCKPIT_TLS_CFLAGS)
AC_SUBST(COCKPIT_TLS_LIBS)
# whether to build cockpit-ssh
AC_ARG_ENABLE(ssh, AC_HELP_STRING([--disable-ssh], [Disable cockpit-ssh build and libssh dependency]))
AC_MSG_CHECKING([build with cockpit-ssh])
if test "$enable_ssh" != "no"; then
enable_ssh="yes"
AC_MSG_RESULT([$enable_ssh])
PKG_CHECK_MODULES(LIBSSH, [libssh >= $LIBSSH_VERSION])
COCKPIT_SSH_SESSION_CFLAGS="$COCKPIT_CFLAGS $LIBSSH_CFLAGS $KRB5_CFLAGS"
COCKPIT_SSH_SESSION_LIBS="$COCKPIT_LIBS $LIBSSH_LIBS $KRB5_LIBS"
AC_SUBST(COCKPIT_SSH_SESSION_LIBS)
AC_SUBST(COCKPIT_SSH_SESSION_CFLAGS)
else
enable_ssh="no"
key_auth="no"
AC_MSG_RESULT([$enable_ssh])
fi
AM_CONDITIONAL(WITH_COCKPIT_SSH, test "$enable_ssh" = "yes")
# pam
AC_CHECK_HEADER([security/pam_appl.h], ,
[AC_MSG_ERROR([Couldn't find PAM headers. Try installing pam-devel])]
)
AC_CHECK_LIB(pam, pam_open_session, [ true ],
[AC_MSG_ERROR([Couldn't find PAM library. Try installing pam-devel])]
)
PAM_LIBS="-lpam"
COCKPIT_SESSION_LIBS="$COCKPIT_SESSION_LIBS $PAM_LIBS"
COCKPIT_WS_LIBS="$COCKPIT_WS_LIBS $PAM_LIBS"
# pam module directory
AC_ARG_WITH([pamdir],
[AC_HELP_STRING([--with-pamdir=DIR],
[directory to install pam modules in])],
[], [with_pamdir='${libdir}/security'])
pamdir=$with_pamdir
AC_SUBST(pamdir)
# crypt
AC_CHECK_HEADER([crypt.h], ,
[AC_MSG_ERROR([Couldn't find crypt headers. Try installing glibc-headers])]
)
AC_CHECK_LIB(crypt, crypt_r, [ true ],
[AC_MSG_ERROR([Couldn't find crypt library. Try installing glibc-devel])]
)
COCKPIT_WS_LIBS="$COCKPIT_WS_LIBS -lcrypt"
# pcp
AC_MSG_CHECKING([whether to build with PCP])
AC_ARG_ENABLE(pcp, AC_HELP_STRING([--disable-pcp], [Disable usage of PCP]))
if test "$enable_pcp" = "no"; then
AC_MSG_RESULT($enable_pcp)
else
if test "$enable_pcp" = ""; then
disable_msg="(perhaps --disable-pcp)"
fi
enable_pcp="yes"
AC_MSG_RESULT($enable_pcp)
AC_CHECK_HEADER([pcp/pmapi.h], ,
[AC_MSG_ERROR([Couldn't find pcp headers $disable_msg])]
)
AC_CHECK_HEADERS([pcp/import.h pcp/pmda.h], ,
[AC_MSG_ERROR([Couldn't find pcp headers $disable_msg])],
[#include <pcp/pmapi.h>]
)
AC_CHECK_LIB(pcp, pmNewContext, [ true ],
[AC_MSG_ERROR([Couldn't find pcp library $disable_msg])]
)
AC_CHECK_LIB(pcp_pmda, pmdaCacheLookup, [ true ],
[AC_MSG_ERROR([Couldn't find pcp_pmda library $disable_msg])]
)
AC_CHECK_LIB(pcp_import, pmiStart, [ true ],
[AC_MSG_ERROR([Couldn't find pcp_import library $disable_msg])]
)
COCKPIT_PCP_LIBS="$COCKPIT_PCP_LIBS -lpcp -lm"
fi
AM_CONDITIONAL([ENABLE_PCP], [test "$enable_pcp" = "yes"])
# gssapi
AC_CHECK_LIB(gssapi_krb5, gss_store_cred, [ true ],
[AC_MSG_ERROR([Couldn't find GSSAPI KRB5 library. Try installing krb5-devel])]
)
# systemd
AC_ARG_WITH([systemdunitdir], [AC_HELP_STRING([--with-systemdunitdir=DIR],
[directory to install systemd unit files in])])
if test ! -z "$with_systemdunitdir"; then
systemdunitdir=$with_systemdunitdir
elif test "$enable_prefix_only" = "yes"; then
systemdunitdir='${prefix}/lib/systemd/system'
else
PKG_CHECK_MODULES(SYSTEMD, [systemd])
AC_MSG_CHECKING(for systemd unit dir)
systemdunitdir=$($PKG_CONFIG systemd --variable=systemdsystemunitdir)
if test "$systemdunitdir" = ""; then
AC_MSG_ERROR([systemd's pkg-config file doesn't contain 'systemdsystemunitdir' variable])
fi
AC_MSG_RESULT($systemdunitdir)
fi
AC_SUBST([systemdunitdir], [$systemdunitdir])
# Internationalization
GETTEXT_PACKAGE=cockpit
AC_SUBST([GETTEXT_PACKAGE])
AM_GLIB_GNU_GETTEXT
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
AC_PATH_PROG(MSGCAT, msgcat)
AC_PATH_PROG(MSGFMT, msgfmt)
AC_PATH_PROG(MSGGREP, msggrep)
AC_PATH_PROG(MSGMERGE, msgmerge)
AC_PATH_PROG(XGETTEXT, xgettext)
AC_MSG_CHECKING(for gettext binaries)
if test -x "$MSGCAT" -a -x "$MSGFMT" -a -x "$MSGMERGE" -a -x "$MSGGREP" -a -x "$XGETTEXT"; then
AC_SUBST(MSGCAT)
AC_SUBST(MSGFMT)
AC_SUBST(MSGGREP)
AC_SUBST(MSGMERGE)
AC_SUBST(XGETTEXT)
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR([no. Please install gettext tools])
fi
# go
AC_PATH_PROG([GOLANG], [go])
AM_CONDITIONAL([WITH_GOLANG], [test -n "$GOLANG"])
# usermod
#
# usermod might not be world-executable, so AC_PATH_PROG might not
# find it. In that case, we fall back to /usr/sbin/usermod.
AC_PATH_PROG([USERMOD], [usermod], [/usr/sbin/usermod], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
AC_DEFINE_UNQUOTED([PATH_USERMOD],["$USERMOD"],[Location of usermod binary])
# newusers
AC_PATH_PROG([NEWUSERS], [newusers], [/usr/sbin/newusers], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
AC_DEFINE_UNQUOTED([PATH_NEWUSERS],["$NEWUSERS"],[Location of newusers binary])
AC_MSG_CHECKING(whether $NEWUSERS understands --crypt-method)
if newusers --help | grep -q -e --crypt-method; then
AC_DEFINE_UNQUOTED([HAVE_NEWUSERS_CRYPT_METHOD],[1],[whether newusers understands --crypt-method])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# chpasswd
AC_PATH_PROG([CHPASSWD], [chpasswd], [/usr/sbin/chpasswd], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
AC_DEFINE_UNQUOTED([PATH_CHPASSWD],["$CHPASSWD"],[Location of chpasswd binary])
# pkexec
AC_PATH_PROG([PKEXEC], [pkexec], [/usr/bin/pkexec], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
AC_SUBST(PKEXEC)
# sudo
AC_PATH_PROG([SUDO], [sudo], [/usr/bin/sudo], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
AC_SUBST(SUDO)
# ssh-add
AC_PATH_PROG([SSH_ADD], [ssh-add], [/usr/bin/ssh-add], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
AC_DEFINE_UNQUOTED([PATH_SSH_ADD], ["$SSH_ADD"], [Location of ssh-add binary])
# ssh-agent
AC_PATH_PROG([SSH_AGENT], [ssh-agent], [/usr/bin/ssh-agent], [$PATH:/usr/local/bin:/usr/bin:/bin])
AC_DEFINE_UNQUOTED([PATH_SSH_AGENT], ["$SSH_AGENT"], [Location of ssh-agent binary])
# chcon
AC_PATH_PROG([CHCON], [chcon], [/usr/bin/chcon], [$PATH:/usr/local/bin:/usr/bin:/bin])
AC_DEFINE_UNQUOTED([PATH_CHCON], ["$CHCON"], [Location of chcon binary])
changequote(,)dnl
if test "x$GCC" = "xyes"; then
CFLAGS="-Wall \
-Werror=strict-prototypes -Werror=missing-prototypes \
-Werror=implicit-function-declaration \
-Werror=pointer-arith -Werror=init-self \
-Werror=format=2 \
-Werror=return-type \
-Werror=missing-include-dirs $CFLAGS"
fi
changequote([,])dnl
# System functions
AC_CHECK_FUNCS(fdwalk)
# Package specific settings
# HACK - Storaged before 2.5.3 doesn't tell us when it supports
# sessions, so we allow it to be switched off explicitly.
#
# https://github.com/storaged-project/storaged/pull/68
AC_ARG_WITH(storaged-iscsi-sessions,
AC_HELP_STRING([--with-storaged-iscsi-sessions=yes/no],
[Whether storaged supports listing iSCSI sessions]),
[],
[with_storaged_iscsi_sessions=yes])
AC_SUBST(with_storaged_iscsi_sessions)
# HACK - Debian has a broken policy for NetworkManager where it
# only allows local sessions or root to perform actions.
#
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808162
AC_ARG_WITH(networkmanager-needs-root,
AC_HELP_STRING([--with-networkmanager-needs-root=yes/no],
[Whether NetworkManager requires root access]),
[],
[with_networkmanager_needs_root=yes])
AC_SUBST(with_networkmanager_needs_root)
AC_ARG_WITH(appstream-config-packages,
AC_HELP_STRING([--with-appstream-config-packages=JSON],
[List of packages that configure the system to retrieve AppStream collection metadata]),
[],
[with_appstream_config_packages='[[]]'])
AC_SUBST(with_appstream_config_packages)
AC_ARG_WITH(appstream-data-packages,
AC_HELP_STRING([--with-appstream-data-packages=JSON],
[List of packages that contain AppStream collection metadata]),
[],
[with_appstream_data_packages='[[]]'])
AC_SUBST(with_appstream_data_packages)
AC_ARG_WITH(nfs-client-package,
AC_HELP_STRING([--with-nfs-client-package=JSON],
[Package that is necessary for NFS clients, or 'false']),
[],
[with_nfs_client_package='false'])
AC_SUBST(with_nfs_client_package)
AC_ARG_WITH(vdo-package,
AC_HELP_STRING([--with-vdo-package=JSON],
[Package that is necessary to use VDO, or 'false']),
[],
[with_vdo_package='false'])
AC_SUBST(with_vdo_package)
# Address sanitizer
AC_MSG_CHECKING([for asan flags])
AC_ARG_ENABLE(asan,
AC_HELP_STRING([--enable-asan=no/yes],
[Turn the Address Sanitizer on or off])
)
if test "$enable_asan" = "yes"; then
CFLAGS="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
asan_status="yes"
else
asan_status="no"
fi
AM_CONDITIONAL(WITH_ASAN, test "$enable_asan" = "yes")
AC_MSG_RESULT($asan_status)
# User and group for running cockpit web server (cockpit-tls or -ws in customized setups)
AC_ARG_WITH(cockpit_user,
AS_HELP_STRING([--with-cockpit-user=<user>],
[User for running cockpit (root)]
)
)
AC_ARG_WITH(cockpit_group,
AS_HELP_STRING([--with-cockpit-group=<group>],
[Group for running cockpit]
)
)
if test -z "$with_cockpit_user"; then
COCKPIT_USER=root
COCKPIT_GROUP=
else
COCKPIT_USER=$with_cockpit_user
if test -z "$with_cockpit_group"; then
COCKPIT_GROUP=$with_cockpit_user
else
COCKPIT_GROUP=$with_cockpit_group
fi
fi
AC_SUBST(COCKPIT_USER)
AC_SUBST(COCKPIT_GROUP)
# User for running cockpit-ws instances from cockpit-tls
AC_ARG_WITH(cockpit_ws_instance_user,
AS_HELP_STRING([--with-cockpit-ws-instance-user=<user>],
[User for running cockpit-ws instances from cockpit-tls (root)]
)
)
AC_ARG_WITH(cockpit_ws_instance_group,
AS_HELP_STRING([--with-cockpit-ws-instance-group=<group>],
[Group for running cockpit-ws instances from cockpit-tls]
)
)
if test -z "$with_cockpit_ws_instance_user"; then
if test "$COCKPIT_USER" != "root"; then
AC_MSG_ERROR([--with-cockpit-ws-instance-user is required when setting --with-cockpit-user])
fi
COCKPIT_WSINSTANCE_USER=root
else
COCKPIT_WSINSTANCE_USER=$with_cockpit_ws_instance_user
if test -z "$with_cockpit_ws_instance_group"; then
COCKPIT_WSINSTANCE_GROUP=$with_cockpit_ws_instance_user
else
COCKPIT_WSINSTANCE_GROUP=$with_cockpit_ws_instance_group
fi
fi
AC_SUBST(COCKPIT_WSINSTANCE_USER)
AC_SUBST(COCKPIT_WSINSTANCE_GROUP)
AC_ARG_WITH(selinux_config_type,
AS_HELP_STRING([--with-selinux-config-type=<type>],
[SELinux context type for cockpit config files]
)
)
COCKPIT_SELINUX_CONFIG_TYPE=$with_selinux_config_type
AC_SUBST(COCKPIT_SELINUX_CONFIG_TYPE)
# Documentation
AC_MSG_CHECKING([whether to build documentation])
AC_ARG_ENABLE(doc,
AC_HELP_STRING([--disable-doc],
[Disable building documentation])
)
if test "$enable_doc" = "no"; then
AC_MSG_RESULT($enable_doc)
else
if test "$enable_doc" = ""; then
disable_msg="(perhaps --disable-doc)"
fi
enable_doc="yes"
AC_MSG_RESULT($enable_doc)
AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
if test "$XSLTPROC" = "no"; then
AC_MSG_ERROR([the xsltproc command was not found $disable_msg])
fi
AC_PATH_PROG([XMLTO], [xmlto], [no])
if test "$XMLTO" = "no"; then
AC_MSG_ERROR([the xmlto command was not found $disable_msg])
fi
AC_SUBST(XSLTPROC)
AC_SUBST(XMLTO)
fi
AM_CONDITIONAL([ENABLE_DOC], [test "$enable_doc" = "yes"])
# Debug
AC_MSG_CHECKING([for debug mode])
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug=no/default/yes],
[Turn on or off debugging])
)
if test "$enable_debug" != "no"; then
AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
CFLAGS="$CFLAGS -g"
fi
debugdir=${prefix}/src/debug
if test "$enable_debug" = "yes"; then
debug_status="yes"
debugdir=
CFLAGS="$CFLAGS -O0"
NODE_ENV="development"
elif test "$enable_debug" = "no"; then
debug_status="no"
CFLAGS="$CFLAGS -O2"
NODE_ENV="production"
else
debug_status="default"
NODE_ENV="${NODE_ENV:-production}"
fi
AM_CONDITIONAL(WITH_DEBUG, test "$enable_debug" = "yes")
AC_MSG_RESULT($debug_status)
AC_SUBST(NODE_ENV)
AC_SUBST(debugdir)
# Coverage
AC_MSG_CHECKING([whether to build with coverage])
AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage], [Whether to enable coverage testing])],
[],
[enable_coverage=no])
if test "$enable_coverage" = "yes"; then
if test "$GCC" != "yes"; then
AC_MSG_ERROR(Coverage testing requires GCC)
fi
CFLAGS="$CFLAGS -O0 -g --coverage"
LDFLAGS="$LDFLAGS --coverage"
fi
AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
AC_MSG_RESULT([$enable_coverage])
# Strict
AC_ARG_ENABLE(strict, [
AS_HELP_STRING([--enable-strict], [Strict code compilation])
])
AC_MSG_CHECKING([build strict])
if test "$enable_strict" = "yes"; then
CFLAGS="$CFLAGS -Werror"
else
enable_strict="no"
fi
AC_MSG_RESULT($enable_strict)
# Python version; prefer python3
m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python3 python2 python])
AM_PATH_PYTHON([2.7])
# Generate
#
AC_SUBST(PAM_LIBS)
AC_OUTPUT([
Makefile
doc/guide/version
])
dnl ==========================================================================
echo "
Cockpit $VERSION
================
prefix: ${prefix}
exec_prefix: ${exec_prefix}
libdir: ${libdir}
libexecdir: ${libexecdir}
bindir: ${bindir}
sbindir: ${sbindir}
datarootdir: ${datarootdir}
datadir: ${datadir}
sysconfdir: ${sysconfdir}
localstatedir: ${localstatedir}
pamdir: ${pamdir}
systemd unit dir: ${systemdunitdir}
compiler: ${CC}
cflags: ${CFLAGS}
cppflags: ${CPPFLAGS}
cockpit-ws user: ${COCKPIT_USER}
cockpit-ws group: ${COCKPIT_GROUP}
cockpit-ws instance user: ${COCKPIT_WSINSTANCE_USER}
cockpit-ws instance group: ${COCKPIT_WSINSTANCE_GROUP}
selinux config type: ${COCKPIT_SELINUX_CONFIG_TYPE}
Maintainer mode: ${USE_MAINTAINER_MODE}
Building docs: ${enable_doc}
Debug mode: ${debug_status}
Node environment: ${NODE_ENV}
With coverage: ${enable_coverage}
With address sanitizer: ${asan_status}
With PCP: ${enable_pcp}
Branding: ${BRAND}
cockpit-ssh: ${enable_ssh}
Supports key auth: ${key_auth}
pkexec: ${PKEXEC}
ssh-add: ${SSH_ADD}
ssh-agent: ${SSH_AGENT}
sudo: ${SUDO}
usermod: ${USERMOD}
chcon: ${CHCON}
"