# @configure_input@
#
# Configure-time variable definitions and any other common definition that can
# be safely included by all makefiles.
#
# Note: Do not define any targets on this file, as that could potentially end
# up overriding the includer's intended default target (which by default is the
# first target encountered).
MAKEFLAGS += -r

NAME=@PACKAGE_NAME@
TARNAME=@PACKAGE_TARNAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@ # needed by docdir
VERSION=@PACKAGE_VERSION@

prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
libdir=@libdir@
datarootdir=@datarootdir@
docdir=@docdir@
mandir=@mandir@
localstatedir=@localstatedir@
sysconfdir=@sysconfdir@

# Misc flags
BUSYBOX_WORKAROUND=@BUSYBOX_WORKAROUND@
HAVE_CONTRIB_INSTALL=@HAVE_CONTRIB_INSTALL@
HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
HAVE_GCOV=@HAVE_GCOV@

# MANFLAGS
HAVE_APPARMOR=@HAVE_APPARMOR@
HAVE_CHROOT=@HAVE_CHROOT@
HAVE_DBUSPROXY=@HAVE_DBUSPROXY@
HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
HAVE_FORCE_NONEWPRIVS=@HAVE_FORCE_NONEWPRIVS@
HAVE_LANDLOCK=@HAVE_LANDLOCK@
HAVE_NETWORK=@HAVE_NETWORK@
HAVE_ONLY_SYSCFG_PROFILES=@HAVE_ONLY_SYSCFG_PROFILES@
HAVE_OUTPUT=@HAVE_OUTPUT@
HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
HAVE_PRIVATE_LIB=@HAVE_PRIVATE_LIB@
HAVE_SANDBOX_CHECK=@HAVE_SANDBOX_CHECK@
HAVE_SELINUX=@HAVE_SELINUX@
HAVE_SUID=@HAVE_SUID@
HAVE_USERNS=@HAVE_USERNS@
HAVE_X11=@HAVE_X11@

MANFLAGS = \
	$(HAVE_APPARMOR) \
	$(HAVE_CHROOT) \
	$(HAVE_DBUSPROXY) \
	$(HAVE_FILE_TRANSFER) \
	$(HAVE_FORCE_NONEWPRIVS) \
	$(HAVE_LANDLOCK) \
	$(HAVE_NETWORK) \
	$(HAVE_ONLY_SYSCFG_PROFILES) \
	$(HAVE_OUTPUT) \
	$(HAVE_PRIVATE_HOME) \
	$(HAVE_PRIVATE_LIB) \
	$(HAVE_SANDBOX_CHECK) \
	$(HAVE_SELINUX) \
	$(HAVE_SUID) \
	$(HAVE_USERNS) \
	$(HAVE_X11)

# User variables - should not be modified in the code (as they are reserved for
# the user building the package); see the following for details:
# https://www.gnu.org/software/automake/manual/1.16.5/html_node/User-Variables.html
CC=@CC@
CODESPELL=@CODESPELL@
CPPCHECK=@CPPCHECK@
GAWK=@GAWK@
GZIP=@GZIP@
SCAN_BUILD=@SCAN_BUILD@
STRIP=@STRIP@
TAR=@TAR@

CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@

# Project variables
EXTRA_CFLAGS  =@EXTRA_CFLAGS@
DEPS_CFLAGS   =@DEPS_CFLAGS@
COMMON_CFLAGS = \
	-ggdb -O2 -DVERSION='"$(VERSION)"' \
	-Wall -Wextra $(HAVE_FATAL_WARNINGS) \
	-Wformat -Wformat-security \
	-fstack-protector-all \
	-DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/$(TARNAME)"' \
	-DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' \
	-DVARDIR='"$(localstatedir)/lib/$(TARNAME)"'

PROG_CFLAGS = \
	$(COMMON_CFLAGS) \
	$(HAVE_GCOV) $(MANFLAGS) \
	$(EXTRA_CFLAGS) \
	$(DEPS_CFLAGS) \
	-fPIE

SO_CFLAGS = \
	$(COMMON_CFLAGS) \
	$(DEPS_CFLAGS) \
	-fPIC

EXTRA_LDFLAGS =@EXTRA_LDFLAGS@
PROG_LDFLAGS  = -Wl,-z,relro -Wl,-z,now -fPIE -pie $(EXTRA_LDFLAGS)
SO_LDFLAGS    = -Wl,-z,relro -Wl,-z,now -fPIC
LIBS =@LIBS@

CLEANFILES = *.d *.o *.gcov *.gcda *.gcno *.plist
