case "$EMACS_XTOOLKIT" in
  lucid)
    optional_depends xaw3d                \
                     "--with-xaw3d"       \
                     "--without-xaw3d"    \
                     "for fancy 3D-style scroll bars" &&
    if ! is_depends_enabled ${SPELL} xaw3d; then
      depends libxaw
    fi
    ;;
  gtk)
    depends gtk+2
    ;;
  gtk3)
    depends gtk+3 &&
    optional_depends "webkitgtk3"           \
                     "--with-xwidgets"      \
                     "--without-xwidgets"   \
                     "for XWidgets support"
    ;;
  motif)
    depends MOTIF
    ;;
esac &&

if [[ "$EMACS_XTOOLKIT" != "no" ]]; then
  depends libxrandr   &&
  depends libxinerama &&
  depends libxfixes   &&
  depends desktop-file-utils &&

  optional_depends "harfbuzz"                            \
                   "--with-harfbuzz"                     \
                   "--without-harfbuzz"                  \
                   "for text-shaping support"            &&
  
  optional_depends "libpng"                              \
                   "--with-png"                          \
                   "--without-png"                       \
                   "for PNG format support"              &&

  optional_depends "lcms2"                               \
                   "--with-lcms2"                        \
                   "--without-lcms2"                     \
                   "for Little CMS support"              &&
  
  optional_depends "JPEG"                                \
                   "--with-jpeg"                         \
                   "--without-jpeg"                      \
                   "for JPEG format support"             &&
  
  optional_depends "tiff"                                \
                   "--with-tiff"                         \
                   "--without-tiff"                      \
                   "for TIFF format support"             &&
  
  optional_depends "GIFLIB"                              \
                   "--with-gif"                          \
                   "--without-gif"                       \
                   "for GIF format support"              &&
  
  optional_depends "libxpm"                              \
                   "--with-xpm"                          \
                   "--without-xpm"                       \
                   "for XPM (X pixmap) suport"           &&
  
  optional_depends "librsvg2"                            \
                   "--with-rsvg"                         \
                   "--without-rsvg"                      \
                   "for SVG (Scalable Vector Graphics) support" &&
  
  optional_depends "imagemagick"                         \
                   "--with-imagemagick"                  \
                   "--without-imagemagick"               \
                   "for ImageMagick image support"       &&

  optional_depends "libxft"                              \
                   "--with-xft"                          \
                   "--without-xft"                       \
                   "for XFT anti-aliased font support"   &&
  
  optional_depends libotf                                \
                   --with-libotf                         \
                   --without-libotf                      \
                   "for OpenType font support"           &&

  optional_depends m17n-lib                              \
                   --with-m17n-flt                       \
                   --without-m17n-flt                    \
                   "use m17n-flt for text shaping"       &&

  optional_depends "cairo"                               \
                   "--with-cairo"                        \
                   "--without-cairo"                     \
                   "use cairo for drawing"
fi

optional_depends "alsa-lib"                            \
                 "--with-sound=alsa"                   \
                 "--without-sound"                     \
                 "for sound support"                   &&

optional_depends "gmp"                                 \
                 "--with-gmp"                          \
                 "--without-gmp"                       \
                 "for GMP support"                     &&

optional_depends "jansson"                             \
                 "--with-json"                         \
                 "--without-json"                      \
                 "for json support"                    &&

optional_depends "gpm"                                 \
                 "--with-gpm"                          \
                 "--without-gpm"                       \
                 "for mouse support on a GNU/Linux console"  &&

optional_depends "libxml2"                             \
                 "--with-xml2"                         \
                 "--without-xml2"                      \
                 "for XML parsing support"             &&

optional_depends "dbus"                                \
                 "--with-dbus"                         \
                 "--without-dbus"                      \
                 "for D-Bus support"                   &&

optional_depends "gconf2"                              \
                 "--with-gconf"                        \
                 "--without-gconf"                     \
                 "for GConf support"                   &&

optional_depends "libselinux"                          \
                 "--with-selinux"                      \
                 "--without-selinux"                   \
                 "for SELinux support"                 &&

optional_depends "systemd"                             \
                 "--with-libsystemd"                   \
                 "--without-libsystemd"                \
                 "for systemd support"                 &&

optional_depends "gnutls"                              \
                 "--with-gnutls"                       \
                 "--without-gnutls"                    \
                 "for SSL/TLS support"                 &&

optional_depends "texinfo"                             \
                 "--with-makeinfo"                     \
                 "--without-makeinfo"                  \
                 "for building manuals"                &&

optional_depends "zlib"                                \
                 "--with-zlib"                         \
                 "--without-zlib"                      \
                 "for zlib decompression support"      &&

optional_depends "libseccomp"                          \
                 ""                                    \
                 ""                                    \
                 "for seccomp support"                 &&

optional_depends -sub JIT gcc \
                 "--with-native-compilation" \
                 "--without-native-compilation" \
                 "for native-compilation support" &&

if [[ "$EMACS_BRANCH" == "scm" ]]; then
  depends git
fi
