. "$GRIMOIRE/FUNCTIONS" &&

depends pkgconfig &&
depends libffi  &&
depends gettext &&
depends xz-utils &&

if [[ $GLIB_VER == devel ]];then
  optional_depends elfutils '' '' 'manipulate ELF files'
fi &&

if  !  spell_installed  pkgconfig;  then
  force_depends  pkgconfig
fi  &&

depends perl      &&
# It used to be optional, but cannot be until we figure out what to do
# about gdbus-codegen. INSTALL fails without python and leaves us
# without glib2, which can break other serious stuff.
#optional_depends PYTHON                       \
#                 "--enable-modular-tests"     \
#                 "--disable-modular-tests"    \
#                 "Perform post-build testing" &&
depends PYTHON    &&

if spell_ok $SPELL; then
  optional_depends FAM                                \
                   "--enable-fam"                     \
                   "--disable-fam"                    \
                   "Build with file system monitoring"
else
  message "${MESSAGE_COLOR}NOTE: spell $SPELL isn't installed yet, FAM provider unavailable.${DEFAULT_COLOR}" &&

  optional_depends fam                                \
                   "--enable-fam"                     \
                   "--disable-fam"                    \
                   "Build with file system monitoring"
fi &&

optional_depends -sub UTFPROP pcre                  \
                 "--with-pcre=system"               \
                 "--with-pcre=internal"             \
                 "Use system supplied PCRE. Otherwise, the internal PCRE library will be used" &&

if is_depends_enabled $SPELL pcre; then
  if spell_ok pcre && is_version_less $(installed_version pcre) 8.11; then
    force_depends pcre
  fi
fi &&

optional_depends libselinux                         \
                 "--enable-selinux"                 \
                 "--disable-selinux"                \
                 "Build with selinux support"       &&

optional_depends gtk-doc                            \
                 "--enable-gtk-doc"                 \
                 "--disable-gtk-doc"                \
                 "Build documentation with gtk-doc" &&

depends zlib
