2013-11-01 09:42:29 -08:00
|
|
|
# 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/>.
|
2014-04-15 03:31:19 -08:00
|
|
|
|
|
|
|
|
AC_INIT([Cockpit],
|
2020-04-01 07:13:14 -08:00
|
|
|
[m4_esyscmd_s([if [ -f .tarball ]; then cat .tarball; else echo $(git describe | tr - . ); fi])],
|
2014-04-15 03:31:19 -08:00
|
|
|
[devel@lists.cockpit-project.org],
|
|
|
|
|
[cockpit],
|
2018-05-14 07:35:41 -08:00
|
|
|
[https://cockpit-project.org/])
|
2013-11-01 09:42:29 -08:00
|
|
|
|
2020-03-23 00:47:46 -08:00
|
|
|
# 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
|
2016-10-03 04:51:07 -08:00
|
|
|
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
|
|
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
AC_CONFIG_SRCDIR([src])
|
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
AC_CONFIG_AUX_DIR([tools])
|
|
|
|
|
AC_CONFIG_MACRO_DIR([tools])
|
|
|
|
|
|
2021-12-16 06:02:50 -09:00
|
|
|
AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip subdir-objects])
|
|
|
|
|
am__tar='tools/tar-create "$$tardir"'
|
2013-11-01 09:42:29 -08:00
|
|
|
|
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2014-03-04 03:48:51 -09:00
|
|
|
AC_PROG_RANLIB
|
2013-11-01 09:42:29 -08:00
|
|
|
|
2021-12-12 23:39:51 -09:00
|
|
|
AM_SILENT_RULES([yes])
|
2013-11-01 09:42:29 -08:00
|
|
|
|
2014-10-14 07:47:22 -08:00
|
|
|
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)
|
|
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
# Initialization
|
|
|
|
|
#
|
|
|
|
|
|
2020-09-04 01:35:33 -08:00
|
|
|
GLIB_VERSION="2.50"
|
2020-04-27 06:49:39 -08:00
|
|
|
LIBSSH_VERSION="0.8.5"
|
2014-03-12 05:00:36 -08:00
|
|
|
|
2020-09-04 01:35:33 -08:00
|
|
|
GIO_REQUIREMENT="gio-unix-2.0 >= $GLIB_VERSION gio-2.0 >= $GLIB_VERSION"
|
2019-09-10 11:20:40 -08:00
|
|
|
LIBSYSTEMD_REQUIREMENT="libsystemd >= 235"
|
2020-09-08 02:24:43 -08:00
|
|
|
JSON_GLIB_REQUIREMENT="json-glib-1.0 >= 1.4"
|
2014-04-30 04:59:42 -08:00
|
|
|
POLKIT_REQUIREMENT="polkit-agent-1 >= 0.105"
|
2021-03-25 01:11:41 -08:00
|
|
|
GNUTLS_REQUIREMENT="gnutls >= 3.6.0"
|
2019-09-06 22:37:49 -08:00
|
|
|
KRB5_REQUIREMENT="krb5-gssapi >= 1.11 krb5 >= 1.11"
|
2014-03-12 05:00:36 -08:00
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(GIO, [$GIO_REQUIREMENT])
|
|
|
|
|
GLIB_VERSION_DEF="GLIB_VERSION_$(echo $GLIB_VERSION | tr '.' '_')"
|
2020-09-04 01:35:33 -08:00
|
|
|
GIO_CFLAGS="$GIO_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_44" # GSimpleAsyncResult
|
2014-03-12 05:00:36 -08:00
|
|
|
GIO_CFLAGS="$GIO_CFLAGS -DGLIB_VERSION_MAX_ALLOWED=$GLIB_VERSION_DEF"
|
|
|
|
|
|
2019-09-10 11:20:40 -08:00
|
|
|
PKG_CHECK_MODULES(LIBSYSTEMD, [$LIBSYSTEMD_REQUIREMENT])
|
2014-03-12 05:00:36 -08:00
|
|
|
PKG_CHECK_MODULES(JSON_GLIB, [$JSON_GLIB_REQUIREMENT])
|
2019-04-15 02:30:56 -08:00
|
|
|
PKG_CHECK_MODULES(GNUTLS, [$GNUTLS_REQUIREMENT])
|
2019-09-06 22:37:49 -08:00
|
|
|
PKG_CHECK_MODULES(KRB5, [$KRB5_REQUIREMENT])
|
2014-08-12 03:43:05 -08:00
|
|
|
|
2016-08-01 15:32:42 -08:00
|
|
|
COCKPIT_CFLAGS="$GIO_CFLAGS $JSON_GLIB_CFLAGS $LIBSYSTEMD_CFLAGS"
|
|
|
|
|
COCKPIT_LIBS="$GIO_LIBS $JSON_GLIB_LIBS $LIBSYSTEMD_LIBS -lutil -lm"
|
2014-03-12 05:00:36 -08:00
|
|
|
AC_SUBST(COCKPIT_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_LIBS)
|
|
|
|
|
|
2020-04-27 05:19:14 -08:00
|
|
|
# bridge with optional polkit
|
2021-08-03 06:04:36 -08:00
|
|
|
AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [Disable usage of polkit]),,enable_polkit=yes)
|
2021-03-23 08:11:44 -08:00
|
|
|
|
2020-04-27 05:19:14 -08:00
|
|
|
if test "$enable_polkit" = "yes"; then
|
2021-03-23 08:11:44 -08:00
|
|
|
PKG_CHECK_MODULES(POLKIT, [$POLKIT_REQUIREMENT])
|
2020-04-27 05:19:14 -08:00
|
|
|
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")
|
2014-10-15 04:53:14 -08:00
|
|
|
AC_SUBST(COCKPIT_BRIDGE_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_BRIDGE_LIBS)
|
2014-03-12 05:00:36 -08:00
|
|
|
|
2015-02-25 21:30:19 -09:00
|
|
|
COCKPIT_PCP_CFLAGS="$COCKPIT_CFLAGS"
|
|
|
|
|
COCKPIT_PCP_LIBS="$COCKPIT_LIBS"
|
|
|
|
|
AC_SUBST(COCKPIT_PCP_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_PCP_LIBS)
|
|
|
|
|
|
2021-06-25 04:53:19 -08:00
|
|
|
COCKPIT_SESSION_CFLAGS="$KRB5_CFLAGS $LIBSYSTEMD_CFLAGS"
|
|
|
|
|
COCKPIT_SESSION_LIBS="$KRB5_LIBS $LIBSYSTEMD_LIBS"
|
2014-08-12 03:43:05 -08:00
|
|
|
AC_SUBST(COCKPIT_SESSION_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_SESSION_LIBS)
|
|
|
|
|
|
2021-06-25 04:53:19 -08:00
|
|
|
PAM_COCKPIT_CERT_CFLAGS="$COCKPIT_CFLAGS"
|
|
|
|
|
PAM_COCKPIT_CERT_LIBS=""
|
2019-03-14 08:40:49 -08:00
|
|
|
AC_SUBST(PAM_COCKPIT_CERT_CFLAGS)
|
|
|
|
|
AC_SUBST(PAM_COCKPIT_CERT_LIBS)
|
|
|
|
|
|
2018-12-14 01:08:03 -09:00
|
|
|
COCKPIT_WS_CFLAGS="$COCKPIT_CFLAGS"
|
|
|
|
|
COCKPIT_WS_LIBS="$COCKPIT_LIBS"
|
2017-01-16 00:43:40 -09:00
|
|
|
AC_SUBST(COCKPIT_WS_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_WS_LIBS)
|
|
|
|
|
|
2019-04-15 02:30:56 -08:00
|
|
|
COCKPIT_TLS_CFLAGS="$GNUTLS_CFLAGS"
|
|
|
|
|
COCKPIT_TLS_LIBS="$GNUTLS_LIBS"
|
|
|
|
|
AC_SUBST(COCKPIT_TLS_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_TLS_LIBS)
|
|
|
|
|
|
2017-01-16 00:43:40 -09:00
|
|
|
# whether to build cockpit-ssh
|
2021-08-03 06:04:36 -08:00
|
|
|
AC_ARG_ENABLE(ssh, AS_HELP_STRING([--disable-ssh], [Disable cockpit-ssh build and libssh dependency]))
|
2017-01-16 00:43:40 -09:00
|
|
|
AC_MSG_CHECKING([build with cockpit-ssh])
|
|
|
|
|
if test "$enable_ssh" != "no"; then
|
|
|
|
|
enable_ssh="yes"
|
|
|
|
|
AC_MSG_RESULT([$enable_ssh])
|
2018-08-14 05:31:08 -08:00
|
|
|
PKG_CHECK_MODULES(LIBSSH, [libssh >= $LIBSSH_VERSION])
|
2016-09-23 07:48:02 -08:00
|
|
|
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)
|
2014-12-12 06:06:56 -09:00
|
|
|
else
|
2017-01-16 00:43:40 -09:00
|
|
|
enable_ssh="no"
|
|
|
|
|
key_auth="no"
|
|
|
|
|
AC_MSG_RESULT([$enable_ssh])
|
2014-12-12 06:06:56 -09:00
|
|
|
fi
|
|
|
|
|
|
2017-01-16 00:43:40 -09:00
|
|
|
AM_CONDITIONAL(WITH_COCKPIT_SSH, test "$enable_ssh" = "yes")
|
2014-12-12 06:06:56 -09:00
|
|
|
|
2013-11-04 08:27:26 -09:00
|
|
|
# pam
|
2014-11-05 02:58:57 -09:00
|
|
|
AC_CHECK_HEADER([security/pam_appl.h], ,
|
2013-11-04 08:27:26 -09:00
|
|
|
[AC_MSG_ERROR([Couldn't find PAM headers. Try installing pam-devel])]
|
|
|
|
|
)
|
2015-08-24 14:43:54 -08:00
|
|
|
PAM_LIBS="-lpam"
|
|
|
|
|
COCKPIT_SESSION_LIBS="$COCKPIT_SESSION_LIBS $PAM_LIBS"
|
2014-04-29 23:45:20 -08:00
|
|
|
|
|
|
|
|
# pam module directory
|
|
|
|
|
AC_ARG_WITH([pamdir],
|
2021-08-03 06:04:36 -08:00
|
|
|
[AS_HELP_STRING([--with-pamdir=DIR],
|
2014-04-29 23:45:20 -08:00
|
|
|
[directory to install pam modules in])],
|
|
|
|
|
[], [with_pamdir='${libdir}/security'])
|
|
|
|
|
pamdir=$with_pamdir
|
|
|
|
|
AC_SUBST(pamdir)
|
|
|
|
|
|
|
|
|
|
# crypt
|
2014-11-05 02:58:57 -09:00
|
|
|
AC_CHECK_HEADER([crypt.h], ,
|
2014-04-29 23:45:20 -08:00
|
|
|
[AC_MSG_ERROR([Couldn't find crypt headers. Try installing glibc-headers])]
|
|
|
|
|
)
|
2014-12-04 21:29:11 -09:00
|
|
|
AC_CHECK_LIB(crypt, crypt_r, [ true ],
|
2014-04-29 23:45:20 -08:00
|
|
|
[AC_MSG_ERROR([Couldn't find crypt library. Try installing glibc-devel])]
|
|
|
|
|
)
|
|
|
|
|
COCKPIT_WS_LIBS="$COCKPIT_WS_LIBS -lcrypt"
|
2013-11-04 08:27:26 -09:00
|
|
|
|
2014-12-16 00:01:28 -09:00
|
|
|
# pcp
|
2015-08-24 01:21:14 -08:00
|
|
|
AC_MSG_CHECKING([whether to build with PCP])
|
2021-08-03 06:04:36 -08:00
|
|
|
AC_ARG_ENABLE(pcp, AS_HELP_STRING([--disable-pcp], [Disable usage of PCP]))
|
2015-08-24 01:21:14 -08:00
|
|
|
|
|
|
|
|
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])]
|
|
|
|
|
)
|
2016-02-29 02:14:03 -09:00
|
|
|
AC_CHECK_HEADERS([pcp/import.h pcp/pmda.h], ,
|
|
|
|
|
[AC_MSG_ERROR([Couldn't find pcp headers $disable_msg])],
|
|
|
|
|
[#include <pcp/pmapi.h>]
|
|
|
|
|
)
|
2015-08-24 01:21:14 -08:00
|
|
|
AC_CHECK_LIB(pcp, pmNewContext, [ true ],
|
|
|
|
|
[AC_MSG_ERROR([Couldn't find pcp library $disable_msg])]
|
|
|
|
|
)
|
2016-02-29 02:14:03 -09:00
|
|
|
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])]
|
|
|
|
|
)
|
2015-08-24 01:21:14 -08:00
|
|
|
COCKPIT_PCP_LIBS="$COCKPIT_PCP_LIBS -lpcp -lm"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ENABLE_PCP], [test "$enable_pcp" = "yes"])
|
2014-12-16 00:01:28 -09:00
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
# systemd
|
2021-08-03 06:04:36 -08:00
|
|
|
AC_ARG_WITH([systemdunitdir], [AS_HELP_STRING([--with-systemdunitdir=DIR],
|
2016-08-01 15:32:42 -08:00
|
|
|
[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'
|
2014-10-14 07:47:22 -08:00
|
|
|
else
|
2016-08-01 15:32:42 -08:00
|
|
|
PKG_CHECK_MODULES(SYSTEMD, [systemd])
|
|
|
|
|
AC_MSG_CHECKING(for systemd unit dir)
|
2014-10-14 07:47:22 -08:00
|
|
|
systemdunitdir=$($PKG_CONFIG systemd --variable=systemdsystemunitdir)
|
|
|
|
|
if test "$systemdunitdir" = ""; then
|
2016-08-01 15:32:42 -08:00
|
|
|
AC_MSG_ERROR([systemd's pkg-config file doesn't contain 'systemdsystemunitdir' variable])
|
2014-10-14 07:47:22 -08:00
|
|
|
fi
|
2016-08-01 15:32:42 -08:00
|
|
|
AC_MSG_RESULT($systemdunitdir)
|
2013-11-01 09:42:29 -08:00
|
|
|
fi
|
2014-10-14 07:47:22 -08:00
|
|
|
AC_SUBST([systemdunitdir], [$systemdunitdir])
|
2013-11-01 09:42:29 -08:00
|
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
|
|
|
|
|
|
GETTEXT_PACKAGE=cockpit
|
|
|
|
|
AC_SUBST([GETTEXT_PACKAGE])
|
|
|
|
|
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
|
|
|
|
|
|
2021-07-10 02:28:58 -08:00
|
|
|
# We need msgcat, msgfmt, msggrep, msgmerge, but they're all in the same
|
|
|
|
|
# package as xgettext, and we find them by PATH, so just check for the one.
|
|
|
|
|
AC_PATH_PROG([XGETTEXT], [xsltproc], [no])
|
|
|
|
|
if test "$XGETTEXT" = "no"; then
|
|
|
|
|
AC_MSG_ERROR([Please install gettext tools])
|
2016-11-14 06:25:40 -09:00
|
|
|
fi
|
|
|
|
|
|
2015-08-24 03:52:11 -08:00
|
|
|
# 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])
|
2013-11-01 09:42:29 -08:00
|
|
|
|
|
|
|
|
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 \
|
2017-03-23 02:20:01 -08:00
|
|
|
-Werror=format=2 \
|
|
|
|
|
-Werror=return-type \
|
2015-01-30 02:10:22 -09:00
|
|
|
-Werror=missing-include-dirs $CFLAGS"
|
2013-11-01 09:42:29 -08:00
|
|
|
fi
|
|
|
|
|
changequote([,])dnl
|
|
|
|
|
|
2014-06-03 01:22:55 -08:00
|
|
|
# Address sanitizer
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for asan flags])
|
|
|
|
|
AC_ARG_ENABLE(asan,
|
2021-08-03 06:04:36 -08:00
|
|
|
AS_HELP_STRING([--enable-asan=no/yes],
|
2014-06-03 01:22:55 -08:00
|
|
|
[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)
|
|
|
|
|
|
2019-09-27 04:10:56 -08:00
|
|
|
# User and group for running cockpit web server (cockpit-tls or -ws in customized setups)
|
2014-07-07 02:05:36 -08:00
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
2019-09-27 04:10:56 -08:00
|
|
|
# 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)
|
|
|
|
|
|
2020-11-03 00:32:26 -09:00
|
|
|
# admin users group
|
|
|
|
|
AC_ARG_WITH([admin-group],
|
2021-08-03 06:04:36 -08:00
|
|
|
[AS_HELP_STRING([--with-admin-group=GROUP],
|
2020-11-03 00:32:26 -09:00
|
|
|
[system group to which admin users belong])],
|
|
|
|
|
[admin_group=$withval],
|
|
|
|
|
[
|
|
|
|
|
AC_MSG_CHECKING([for system group to which admin users belong])
|
|
|
|
|
CANDIDATE_GROUPS="wheel sudo root"
|
|
|
|
|
admin_group="$(getent group ${CANDIDATE_GROUPS} | head -n1 | cut -f1 -d:)"
|
|
|
|
|
if test -n "$admin_group"; then
|
|
|
|
|
AC_MSG_RESULT([$admin_group])
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_RESULT([unable to detect])
|
|
|
|
|
AC_MSG_ERROR([none of '${CANDIDATE_GROUPS}' exist: please specify a group with --with-admin-group=])
|
|
|
|
|
fi
|
|
|
|
|
])
|
|
|
|
|
AC_SUBST(admin_group)
|
|
|
|
|
|
|
|
|
|
|
2015-11-16 23:58:29 -09:00
|
|
|
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)
|
|
|
|
|
|
2014-09-22 05:44:55 -08:00
|
|
|
# Documentation
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to build documentation])
|
|
|
|
|
AC_ARG_ENABLE(doc,
|
2021-08-03 06:04:36 -08:00
|
|
|
AS_HELP_STRING([--disable-doc],
|
2014-09-22 05:44:55 -08:00
|
|
|
[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"])
|
|
|
|
|
|
2021-11-23 06:28:00 -09:00
|
|
|
# cockpit-client
|
|
|
|
|
AC_MSG_CHECKING([whether to install cockpit-client])
|
|
|
|
|
AC_ARG_ENABLE([cockpit-client],
|
|
|
|
|
[AS_HELP_STRING([--enable-cockpit-client], [Whether to install cockpit-client])],
|
|
|
|
|
[], [enable_cockpit_client=no])
|
|
|
|
|
AC_MSG_RESULT($enable_prefix_only)
|
|
|
|
|
AM_CONDITIONAL([ENABLE_COCKPIT_CLIENT], [test "$enable_cockpit_client" = "yes"])
|
|
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
# Debug
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for debug mode])
|
|
|
|
|
AC_ARG_ENABLE(debug,
|
2021-08-03 06:04:36 -08:00
|
|
|
AS_HELP_STRING([--enable-debug=no/default/yes],
|
2013-11-01 09:42:29 -08:00
|
|
|
[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
|
2021-02-12 01:49:21 -09:00
|
|
|
debugdir='${prefix}/src/debug'
|
2013-11-01 09:42:29 -08:00
|
|
|
if test "$enable_debug" = "yes"; then
|
|
|
|
|
debug_status="yes"
|
2015-07-28 00:23:35 -08:00
|
|
|
debugdir=
|
2013-11-01 09:42:29 -08:00
|
|
|
CFLAGS="$CFLAGS -O0"
|
2016-11-09 01:46:31 -09:00
|
|
|
NODE_ENV="development"
|
2013-11-01 09:42:29 -08:00
|
|
|
elif test "$enable_debug" = "no"; then
|
|
|
|
|
debug_status="no"
|
|
|
|
|
CFLAGS="$CFLAGS -O2"
|
2016-07-13 04:22:47 -08:00
|
|
|
NODE_ENV="production"
|
2013-11-01 09:42:29 -08:00
|
|
|
else
|
|
|
|
|
debug_status="default"
|
2018-10-15 00:57:39 -08:00
|
|
|
NODE_ENV="${NODE_ENV:-production}"
|
2013-11-01 09:42:29 -08:00
|
|
|
fi
|
2014-03-04 04:23:41 -09:00
|
|
|
AM_CONDITIONAL(WITH_DEBUG, test "$enable_debug" = "yes")
|
2013-11-01 09:42:29 -08:00
|
|
|
AC_MSG_RESULT($debug_status)
|
2016-07-13 04:22:47 -08:00
|
|
|
AC_SUBST(NODE_ENV)
|
2015-07-28 00:23:35 -08:00
|
|
|
AC_SUBST(debugdir)
|
2013-11-01 09:42:29 -08:00
|
|
|
|
|
|
|
|
# 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])
|
|
|
|
|
|
2014-04-08 04:02:35 -08:00
|
|
|
# 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)
|
|
|
|
|
|
2021-09-24 05:20:27 -08:00
|
|
|
AM_PATH_PYTHON([3.6])
|
2018-06-27 04:15:40 -08:00
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
# Generate
|
|
|
|
|
#
|
|
|
|
|
|
2015-08-24 14:43:54 -08:00
|
|
|
AC_SUBST(PAM_LIBS)
|
2013-11-04 08:27:26 -09:00
|
|
|
|
2021-09-24 05:21:15 -08:00
|
|
|
AC_CONFIG_FILES([
|
2013-11-01 09:42:29 -08:00
|
|
|
Makefile
|
2015-09-03 04:05:11 -08:00
|
|
|
doc/guide/version
|
2021-03-23 01:16:11 -08:00
|
|
|
src/tls/cockpit-certificate-helper
|
2013-11-01 09:42:29 -08:00
|
|
|
])
|
2021-09-24 05:21:15 -08:00
|
|
|
AC_OUTPUT
|
2013-11-01 09:42:29 -08:00
|
|
|
|
2016-06-25 05:06:41 -08:00
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
dnl ==========================================================================
|
|
|
|
|
echo "
|
|
|
|
|
Cockpit $VERSION
|
|
|
|
|
================
|
|
|
|
|
|
|
|
|
|
prefix: ${prefix}
|
2014-10-14 07:47:22 -08:00
|
|
|
exec_prefix: ${exec_prefix}
|
2013-11-01 09:42:29 -08:00
|
|
|
libdir: ${libdir}
|
|
|
|
|
libexecdir: ${libexecdir}
|
|
|
|
|
bindir: ${bindir}
|
|
|
|
|
sbindir: ${sbindir}
|
2014-10-14 07:47:22 -08:00
|
|
|
datarootdir: ${datarootdir}
|
2013-11-01 09:42:29 -08:00
|
|
|
datadir: ${datadir}
|
|
|
|
|
sysconfdir: ${sysconfdir}
|
|
|
|
|
localstatedir: ${localstatedir}
|
2014-04-29 23:45:20 -08:00
|
|
|
pamdir: ${pamdir}
|
2016-08-01 15:32:42 -08:00
|
|
|
systemd unit dir: ${systemdunitdir}
|
2013-11-01 09:42:29 -08:00
|
|
|
|
|
|
|
|
compiler: ${CC}
|
|
|
|
|
cflags: ${CFLAGS}
|
|
|
|
|
cppflags: ${CPPFLAGS}
|
|
|
|
|
|
2014-07-07 02:05:36 -08:00
|
|
|
cockpit-ws user: ${COCKPIT_USER}
|
|
|
|
|
cockpit-ws group: ${COCKPIT_GROUP}
|
2019-09-27 04:10:56 -08:00
|
|
|
cockpit-ws instance user: ${COCKPIT_WSINSTANCE_USER}
|
|
|
|
|
cockpit-ws instance group: ${COCKPIT_WSINSTANCE_GROUP}
|
2020-11-03 00:32:26 -09:00
|
|
|
admin group: ${admin_group}
|
2015-11-16 23:58:29 -09:00
|
|
|
selinux config type: ${COCKPIT_SELINUX_CONFIG_TYPE}
|
2014-07-07 02:05:36 -08:00
|
|
|
|
2014-09-22 05:44:55 -08:00
|
|
|
Building docs: ${enable_doc}
|
2013-11-01 09:42:29 -08:00
|
|
|
Debug mode: ${debug_status}
|
2018-10-15 00:57:39 -08:00
|
|
|
Node environment: ${NODE_ENV}
|
2013-11-01 09:42:29 -08:00
|
|
|
With coverage: ${enable_coverage}
|
2014-06-03 01:22:55 -08:00
|
|
|
With address sanitizer: ${asan_status}
|
2015-08-24 01:21:14 -08:00
|
|
|
With PCP: ${enable_pcp}
|
2021-03-23 08:11:44 -08:00
|
|
|
With polkit: ${enable_polkit}
|
2019-09-27 04:10:56 -08:00
|
|
|
Branding: ${BRAND}
|
2017-01-16 00:43:40 -09:00
|
|
|
|
2021-11-23 06:28:00 -09:00
|
|
|
cockpit-client: ${enable_cockpit_client}
|
2017-01-16 00:43:40 -09:00
|
|
|
cockpit-ssh: ${enable_ssh}
|
2015-07-06 10:09:47 -08:00
|
|
|
Supports key auth: ${key_auth}
|
2015-08-24 03:50:34 -08:00
|
|
|
|
2015-08-24 03:52:11 -08:00
|
|
|
ssh-add: ${SSH_ADD}
|
|
|
|
|
ssh-agent: ${SSH_AGENT}
|
2021-06-30 01:09:38 -08:00
|
|
|
|
|
|
|
|
Now type 'make' to compile cockpit."
|