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],
|
2015-08-19 12:09:17 -08:00
|
|
|
[m4_esyscmd([tools/git-version-gen .tarball])],
|
2014-04-15 03:31:19 -08:00
|
|
|
[devel@lists.cockpit-project.org],
|
|
|
|
|
[cockpit],
|
|
|
|
|
[http://www.cockpit-project.org/])
|
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])
|
|
|
|
|
|
2016-01-07 11:56:05 -09:00
|
|
|
AM_INIT_AUTOMAKE([1.9 foreign dist-xz no-dist-gzip subdir-objects tar-pax])
|
2013-11-01 09:42:29 -08:00
|
|
|
AM_MAINTAINER_MODE([enable])
|
|
|
|
|
|
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
|
|
2015-04-20 04:43:37 -08:00
|
|
|
AM_PROG_AR
|
2013-11-01 09:42:29 -08:00
|
|
|
AC_PROG_CC
|
|
|
|
|
AC_PROG_CC_C99
|
2014-03-04 03:48:51 -09:00
|
|
|
AC_PROG_RANLIB
|
2013-11-01 09:42:29 -08:00
|
|
|
AC_ISC_POSIX
|
|
|
|
|
AC_HEADER_STDC
|
2015-03-21 12:50:38 -08:00
|
|
|
AC_PROG_LN_S
|
2013-11-01 09:42:29 -08:00
|
|
|
|
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
|
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
|
|
|
|
|
#
|
|
|
|
|
|
2014-03-12 05:00:36 -08:00
|
|
|
GLIB_VERSION="2.34"
|
2014-12-12 06:06:56 -09:00
|
|
|
LIBSSH_VERSION="0.6.0"
|
2014-03-12 05:00:36 -08:00
|
|
|
|
|
|
|
|
GIO_REQUIREMENT="gio-unix-2.0 >= $GLIB_VERSION"
|
2015-07-14 10:28:39 -08:00
|
|
|
SYSTEMD_REQUIREMENT="libsystemd"
|
|
|
|
|
SYSTEMD_REQUIREMENT_OLD="libsystemd-journal >= 187 libsystemd-daemon"
|
2013-11-01 09:42:29 -08:00
|
|
|
JSON_GLIB_REQUIREMENT="json-glib-1.0 >= 0.14.0"
|
2014-04-30 04:59:42 -08:00
|
|
|
POLKIT_REQUIREMENT="polkit-agent-1 >= 0.105"
|
2014-03-12 05:00:36 -08:00
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
2015-07-14 10:28:39 -08:00
|
|
|
PKG_CHECK_MODULES(SYSTEMD, [$SYSTEMD_REQUIREMENT], [], [
|
|
|
|
|
PKG_CHECK_MODULES(SYSTEMD, [$SYSTEMD_REQUIREMENT_OLD])
|
|
|
|
|
])
|
2014-03-12 05:00:36 -08:00
|
|
|
PKG_CHECK_MODULES(JSON_GLIB, [$JSON_GLIB_REQUIREMENT])
|
2014-04-30 04:59:42 -08:00
|
|
|
PKG_CHECK_MODULES(POLKIT, [$POLKIT_REQUIREMENT])
|
2014-03-12 05:00:36 -08:00
|
|
|
|
2014-08-12 03:43:05 -08:00
|
|
|
# HACK: We can't yet use the new krb5 pkg-config file
|
|
|
|
|
AC_PATH_PROG(KRB5_CONFIG, krb5-config)
|
|
|
|
|
AC_MSG_CHECKING(for working krb5-config)
|
|
|
|
|
if test -x "$KRB5_CONFIG"; then
|
|
|
|
|
KRB5_CFLAGS="$($KRB5_CONFIG --cflags gssapi)"
|
|
|
|
|
KRB5_LIBS="$($KRB5_CONFIG --libs gssapi)"
|
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_ERROR(no. Please install MIT kerberos devel package)
|
|
|
|
|
fi
|
|
|
|
|
|
2014-03-12 05:00:36 -08:00
|
|
|
COCKPIT_CFLAGS="$GIO_CFLAGS $JSON_GLIB_CFLAGS $SYSTEMD_CFLAGS"
|
2016-06-19 23:20:32 -08:00
|
|
|
COCKPIT_LIBS="$GIO_LIBS $JSON_GLIB_LIBS $SYSTEMD_LIBS -lutil -lm"
|
2014-03-12 05:00:36 -08:00
|
|
|
AC_SUBST(COCKPIT_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_LIBS)
|
|
|
|
|
|
2014-11-04 23:22:57 -09:00
|
|
|
COCKPIT_BRIDGE_CFLAGS="$COCKPIT_CFLAGS $POLKIT_CFLAGS"
|
2014-10-15 04:53:14 -08:00
|
|
|
COCKPIT_BRIDGE_LIBS="$COCKPIT_LIBS $POLKIT_LIBS"
|
|
|
|
|
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)
|
|
|
|
|
|
2014-08-12 03:43:05 -08:00
|
|
|
COCKPIT_SESSION_CFLAGS="$KRB5_CFLAGS"
|
|
|
|
|
COCKPIT_SESSION_LIBS="$KRB5_LIBS"
|
|
|
|
|
AC_SUBST(COCKPIT_SESSION_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_SESSION_LIBS)
|
|
|
|
|
|
2014-05-08 02:05:38 -08:00
|
|
|
COCKPIT_POLKIT_CFLAGS="$GIO_CFLAGS $POLKIT_CFLAGS"
|
|
|
|
|
COCKPIT_POLKIT_LIBS="$GIO_LIBS $POLKIT_LIBS"
|
|
|
|
|
AC_SUBST(COCKPIT_POLKIT_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_POLKIT_LIBS)
|
|
|
|
|
|
2014-12-12 06:06:56 -09:00
|
|
|
# whether to build cockpit-ws
|
|
|
|
|
AC_ARG_ENABLE(ws, AC_HELP_STRING([--disable-ws], [Disable cockpit-ws build]))
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([build with cockpit-ws])
|
|
|
|
|
if test "$enable_ws" != "no"; then
|
|
|
|
|
enable_ws="yes"
|
|
|
|
|
AC_MSG_RESULT([$enable_ws])
|
|
|
|
|
PKG_CHECK_MODULES(GLIB_TLS, [glib-2.0 >= 2.37.4])
|
|
|
|
|
PKG_CHECK_MODULES(LIBSSH, [libssh >= $LIBSSH_VERSION libssh_threads])
|
|
|
|
|
COCKPIT_WS_CFLAGS="$COCKPIT_CFLAGS $LIBSSH_CFLAGS $KRB5_CFLAGS"
|
|
|
|
|
COCKPIT_WS_LIBS="$COCKPIT_LIBS $LIBSSH_LIBS $KRB5_LIBS"
|
|
|
|
|
AC_SUBST(COCKPIT_WS_CFLAGS)
|
|
|
|
|
AC_SUBST(COCKPIT_WS_LIBS)
|
|
|
|
|
else
|
|
|
|
|
enable_ws="no"
|
|
|
|
|
AC_MSG_RESULT([$enable_ws])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AM_CONDITIONAL(WITH_COCKPIT_WS, test "$enable_ws" = "yes")
|
|
|
|
|
|
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])]
|
|
|
|
|
)
|
2014-12-04 21:29:11 -09:00
|
|
|
AC_CHECK_LIB(pam, pam_open_session, [ true ],
|
2013-11-04 08:27:26 -09:00
|
|
|
[AC_MSG_ERROR([Couldn't find PAM library. Try installing pam-devel])]
|
|
|
|
|
)
|
2015-08-24 14:43:54 -08:00
|
|
|
PAM_LIBS="-lpam"
|
|
|
|
|
COCKPIT_SESSION_LIBS="$COCKPIT_SESSION_LIBS $PAM_LIBS"
|
|
|
|
|
COCKPIT_WS_LIBS="$COCKPIT_WS_LIBS $PAM_LIBS"
|
|
|
|
|
REAUTHORIZE_LIBS="$REAUTHORIZE_LIBS $PAM_LIBS"
|
2014-04-29 23:45:20 -08:00
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
|
|
|
|
|
# keyutils
|
2014-11-05 02:58:57 -09:00
|
|
|
AC_CHECK_HEADER([keyutils.h], ,
|
2014-04-29 23:45:20 -08:00
|
|
|
[AC_MSG_ERROR([Couldn't find keyutils headers. Try installing keyutils-libs-devel])]
|
|
|
|
|
)
|
2014-11-05 02:58:57 -09:00
|
|
|
AC_CHECK_LIB(keyutils, keyctl_join_session_keyring, [ true ],
|
2014-04-29 23:45:20 -08:00
|
|
|
[AC_MSG_ERROR([Couldn't find keyutils library. Try installing keyutils-libs-devel])]
|
|
|
|
|
)
|
|
|
|
|
COCKPIT_SESSION_LIBS="$COCKPIT_SESSION_LIBS -lkeyutils"
|
|
|
|
|
REAUTHORIZE_LIBS="$REAUTHORIZE_LIBS -lkeyutils"
|
|
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
|
REAUTHORIZE_LIBS="$REAUTHORIZE_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])
|
|
|
|
|
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])]
|
|
|
|
|
)
|
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
|
|
|
|
2014-09-23 05:10:42 -08:00
|
|
|
# gssapi
|
|
|
|
|
AC_CHECK_LIB(gssapi_krb5, gss_import_cred,
|
|
|
|
|
[AC_DEFINE_UNQUOTED(HAVE_GSS_IMPORT_CRED, 1, Whether gss_import_cred is available)])
|
2014-10-07 07:47:28 -08:00
|
|
|
AC_CHECK_LIB(ssh, ssh_gssapi_set_creds,
|
|
|
|
|
[AC_DEFINE_UNQUOTED(HAVE_SSH_GSSAPI_SET_CREDS, 1, Whether ssh_gssapi_set_creds is available)])
|
2014-09-23 05:10:42 -08:00
|
|
|
|
2015-07-06 10:09:47 -08:00
|
|
|
# key auth
|
|
|
|
|
AC_CHECK_LIB(ssh, ssh_set_agent_socket,
|
|
|
|
|
[AC_DEFINE_UNQUOTED(HAVE_SSH_SET_AGENT_SOCKET, 1, Whether ssh_set_agent_socket is available)
|
|
|
|
|
key_auth="yes"],
|
|
|
|
|
[key_auth="no"])
|
|
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
# systemd
|
2014-10-14 07:47:22 -08:00
|
|
|
AC_MSG_CHECKING(for systemd unit dir)
|
|
|
|
|
if test "$enable_prefix_only" = "yes"; then
|
|
|
|
|
systemdunitdir='${prefix}/lib/systemd/system'
|
|
|
|
|
else
|
|
|
|
|
systemdunitdir=$($PKG_CONFIG systemd --variable=systemdsystemunitdir)
|
|
|
|
|
if test "$systemdunitdir" = ""; then
|
|
|
|
|
systemdunitdir="/tmp"
|
|
|
|
|
fi
|
2013-11-01 09:42:29 -08:00
|
|
|
fi
|
2014-10-14 07:47:22 -08:00
|
|
|
AC_SUBST([systemdunitdir], [$systemdunitdir])
|
2015-12-04 00:50:39 -09:00
|
|
|
AC_MSG_RESULT($systemdunitdir)
|
2013-11-01 09:42:29 -08:00
|
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
|
|
|
|
|
|
IT_PROG_INTLTOOL([$INTLTOOL_REQUIRED])
|
|
|
|
|
|
|
|
|
|
GETTEXT_PACKAGE=cockpit
|
|
|
|
|
AC_SUBST([GETTEXT_PACKAGE])
|
|
|
|
|
AM_GLIB_GNU_GETTEXT
|
|
|
|
|
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
|
|
|
|
|
|
2014-02-26 21:54:30 -09:00
|
|
|
# phantomjs
|
|
|
|
|
|
2016-03-29 02:08:05 -08:00
|
|
|
AC_PATH_PROG([PHANTOMJS], [phantomjs], [], [$PATH$PATH_SEPARATOR$srcdir/node_modules/.bin/])
|
2014-02-26 21:54:30 -09:00
|
|
|
AM_CONDITIONAL([WITH_PHANTOMJS], [test -n "$PHANTOMJS"])
|
|
|
|
|
|
2016-02-17 17:09:39 -09:00
|
|
|
# go
|
|
|
|
|
|
|
|
|
|
AC_PATH_PROG([GOLANG], [go])
|
|
|
|
|
AM_CONDITIONAL([WITH_GOLANG], [test -n "$GOLANG"])
|
|
|
|
|
|
2014-09-25 03:03:37 -08:00
|
|
|
# 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])
|
|
|
|
|
|
2015-12-04 01:05:59 -09:00
|
|
|
# newusers
|
2015-12-09 01:16:14 -09:00
|
|
|
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)
|
2015-12-04 01:05:59 -09:00
|
|
|
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
|
|
|
|
|
|
2015-12-09 01:16:14 -09:00
|
|
|
# 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])
|
|
|
|
|
|
2014-11-18 00:24:50 -09:00
|
|
|
# pkexec
|
2015-10-13 04:42:05 -08:00
|
|
|
AC_PATH_PROG([PKEXEC], [pkexec], [/usr/bin/pkexec], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
|
2014-11-18 00:24:50 -09:00
|
|
|
AC_DEFINE_UNQUOTED([PATH_PKEXEC], ["$PKEXEC"], [Location of pkexec binary])
|
|
|
|
|
|
2015-05-21 23:52:36 -08:00
|
|
|
# sudo
|
|
|
|
|
AC_PATH_PROG([SUDO], [sudo], [/usr/bin/sudo], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
|
|
|
|
|
AC_DEFINE_UNQUOTED([PATH_SUDO], ["$SUDO"], [Location of sudo binary])
|
|
|
|
|
|
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
|
|
|
|
2015-11-16 23:58:29 -09:00
|
|
|
# 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])
|
|
|
|
|
|
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 \
|
|
|
|
|
-Werror=format-security \
|
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-04-11 07:18:31 -08:00
|
|
|
# System functions
|
|
|
|
|
|
|
|
|
|
AC_CHECK_FUNCS(fdwalk)
|
|
|
|
|
|
2016-06-23 05:36:44 -08:00
|
|
|
# Storaged
|
|
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
|
2014-06-03 01:22:55 -08:00
|
|
|
# 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)
|
|
|
|
|
|
2014-07-07 02:05:36 -08:00
|
|
|
# User and group for running cockpit-ws
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
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,
|
|
|
|
|
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"])
|
|
|
|
|
|
2015-03-13 05:45:35 -08:00
|
|
|
# Branding
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for branding directory])
|
|
|
|
|
AC_ARG_WITH(branding,
|
|
|
|
|
AC_HELP_STRING([--with-branding=default],
|
2015-05-21 03:43:20 -08:00
|
|
|
[Specify which branding to use. A value of "auto" means to detect it at run-time.])
|
2015-03-13 05:45:35 -08:00
|
|
|
)
|
2015-05-21 03:19:38 -08:00
|
|
|
BRAND=${with_branding:-default}
|
2015-03-13 05:45:35 -08:00
|
|
|
AC_MSG_RESULT($BRAND)
|
2015-05-21 03:43:20 -08:00
|
|
|
if test "$BRAND" != "auto"; then
|
|
|
|
|
AC_DEFINE_UNQUOTED([PACKAGE_BRAND], ["$BRAND"], [Which brand to show.])
|
|
|
|
|
fi
|
2015-03-13 05:45:35 -08:00
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
# 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
|
2015-07-28 00:23:35 -08: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"
|
|
|
|
|
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"
|
2016-07-13 04:22:47 -08:00
|
|
|
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)
|
|
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
# Generate
|
|
|
|
|
#
|
|
|
|
|
|
2014-04-29 23:45:20 -08:00
|
|
|
AC_SUBST(REAUTHORIZE_LIBS)
|
2015-08-24 14:43:54 -08:00
|
|
|
AC_SUBST(PAM_LIBS)
|
2013-11-04 08:27:26 -09:00
|
|
|
|
2016-07-01 15:41:25 -08:00
|
|
|
# So that we can enforce this include to be evaluated at make runtime
|
|
|
|
|
AC_SUBST([INCLUDE_WEBPACK_DEPS], ["-include Makefile-webpack.deps"])
|
|
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
AC_OUTPUT([
|
|
|
|
|
Makefile
|
2016-06-23 05:36:44 -08:00
|
|
|
pkg/storaged/override.json
|
2015-09-03 04:05:11 -08:00
|
|
|
doc/guide/version
|
2013-11-01 09:42:29 -08:00
|
|
|
po/Makefile.in
|
|
|
|
|
])
|
|
|
|
|
|
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}
|
2013-11-01 09:42:29 -08:00
|
|
|
|
|
|
|
|
compiler: ${CC}
|
|
|
|
|
cflags: ${CFLAGS}
|
|
|
|
|
cppflags: ${CPPFLAGS}
|
|
|
|
|
|
2014-12-12 06:06:56 -09:00
|
|
|
cockpit-ws: ${enable_ws}
|
2014-07-07 02:05:36 -08:00
|
|
|
cockpit-ws user: ${COCKPIT_USER}
|
|
|
|
|
cockpit-ws group: ${COCKPIT_GROUP}
|
2015-11-16 23:58:29 -09:00
|
|
|
selinux config type: ${COCKPIT_SELINUX_CONFIG_TYPE}
|
2014-07-07 02:05:36 -08:00
|
|
|
|
2013-11-01 09:42:29 -08:00
|
|
|
Maintainer mode: ${USE_MAINTAINER_MODE}
|
2014-09-22 05:44:55 -08:00
|
|
|
Building docs: ${enable_doc}
|
2013-11-01 09:42:29 -08:00
|
|
|
Debug mode: ${debug_status}
|
|
|
|
|
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}
|
2015-05-21 03:19:38 -08:00
|
|
|
Branding: ${BRAND}
|
2015-07-06 10:09:47 -08:00
|
|
|
Supports key auth: ${key_auth}
|
2015-08-24 03:50:34 -08:00
|
|
|
|
|
|
|
|
pkexec: ${PKEXEC}
|
2015-08-24 03:52:11 -08:00
|
|
|
ssh-add: ${SSH_ADD}
|
|
|
|
|
ssh-agent: ${SSH_AGENT}
|
2015-08-24 03:50:34 -08:00
|
|
|
sudo: ${SUDO}
|
|
|
|
|
usermod: ${USERMOD}
|
2015-11-16 23:58:29 -09:00
|
|
|
chcon: ${CHCON}
|
2013-11-01 09:42:29 -08:00
|
|
|
"
|