optional_depends afterstep                                   \
                 "--with-afterbase"                          \
                 "--without-afterbase"                       \
                 "Use afterstep's libafterbase?"             &&

optional_depends freetype2                                   \
                 "--with-ttf"                                \
                 "--without-ttf"                             \
                 "Use freetype2 for True Type font support?" &&

optional_depends jpeg                                        \
                 "--with-jpeg"                               \
                 "--without-jpeg"                            \
                 "Support jpeg image format?"                &&

optional_depends libpng                                      \
                 "--with-png"                                \
                 "--without-png"                             \
                 "Support png image format?"                 &&

optional_depends tiff                                        \
                 "--with-tiff"                               \
                 "--without-tiff"                            \
                 "Support tiff image format?"                &&

if [ "${LIBAFTERSTEP_GIF}" == "y" ] ; then
  optional_depends LIBGIF                                    \
                   "--without-builtin-ungif"                 \
                   "--with-builtin-ungif"                    \
                   "Use external gif library?"               &&

  #
  ## Remove this after is_depends_enabled is integrated to stable sorcery.
  #
  source  "$GRIMOIRE/is_depends_enabled.function"  &&

  # test for which LIBGIF is picked go here.
  if is_depends_enabled ${SPELL} giflib
    then depends giflib '--with-gif'
  elif is_depends_enabled ${SPELL} libungif
    then depends libungif '--with-ungif'
  fi
else OPTS="${OPTS} --without-gif --without-builtin-ungif"
fi
