list_remove XORG_SERVER_OPTS "--enable-multibuffer" "--disable-multibuffer"

. $GRIMOIRE/config_query_multi.function
config_query XORG_XINITRC_XSESSION                                          \
                  "install a .desktop file that calls the user's .xinitrc?" \
                  n                                                         &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build documentation?"                                  \
                    n                                                       \
                    "--enable-builddocs"                                    \
                    "--disable-builddocs"                                   &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Install libxf86config?"                                \
                    n                                                       \
                    "--enable-install-libxf86config"                        \
                    "--disable-install-libxf86config"                       &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build XRes extension?"                                 \
                    y                                                       \
                    "--enable-xres"                                         \
                    "--disable-xres"                                        &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build DPMS extension?"                                 \
                    y                                                       \
                    "--enable-dpms"                                         \
                    "--disable-dpms"                                        &&


config_query_option XORG_SERVER_OPTS                                        \
                    "Build Record extension?"                               \
                    y                                                       \
                    "--enable-record"                                       \
                    "--disable-record"                                      &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build XDMCP extension?"                                \
                    y                                                       \
                    "--enable-xdmcp"                                        \
                    "--disable-xdmcp"                                       &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build XDM_Auth_1 extension?"                           \
                    y                                                       \
                    "--enable-xdm-auth-1"                                   \
                    "--disable-xdm-auth-1"                                  &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build GLX extension?"                                  \
                    y                                                       \
                    "--enable-glx"                                          \
                    "--disable-glx"                                         &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build accelerated indirect GLX?"                       \
                    y                                                       \
                    "--enable-aiglx"                                        \
                    "--disable-aiglx"                                       &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build GLX with Thread Local Storage support?"          \
                    n                                                       \
                    "--enable-glx-tls"                                      \
                    "--disable-glx-tls"                                     &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build DRI extension?"                                  \
                    y                                                       \
                    "--enable-dri"                                          \
                    "--disable-dri"                                         &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build Security extension?"                             \
                    y                                                       \
                    "--enable-xcsecurity"                                   \
                    "--disable-xcsecurity"                                  &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build X-ACE extension?"                                \
                    y                                                       \
                    "--enable-xace"                                         \
                    "--disable-xace"                                        &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build XCalibrate extension?"                           \
                    n                                                       \
                    "--enable-xcalibrate"                                   \
                    "--disable-xcalibrate"                                  &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build Xorg server?"                                    \
                    y                                                       \
                    "--enable-xorg"                                         \
                    "--disable-xorg"                                        &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build Xvfb server?"                                    \
                    y                                                       \
                    "--enable-xvfb"                                         \
                    "--disable-xvfb"                                        &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build Xnest server?"                                   \
                    n                                                       \
                    "--enable-xnest"                                        \
                    "--disable-xnest"                                       &&

message "${SPELL_COLOR}$SPELL${DEFAULT_COLOR} provides some advanced"       \
        "${PROBLEM_COLOR}EXPERIMENTAL${DEFAULT_COLOR} options that may"     \
        "${PROBLEM_COLOR}BREAK${DEFAULT_COLOR} the build or the final"      \
        "executing of the server. So answer the following carefully"        &&

config_query XORG_SERVER_ADVANCED "Do you wish the advanced options?" n     &&

if [[ $XORG_SERVER_ADVANCED == y ]] ; then
config_query_option XORG_SERVER_OPTS                                        \
                    "Build kdrive servers (EXPERIMENTAL)?"                  \
                    n                                                       \
                    "--enable-kdrive"                                       \
                    "--disable-kdrive"                                      &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build the kdrive Xephyr server (EXPERIMENTAL)?"        \
                    n                                                       \
                    "--enable-xephyr"                                       \
                    "--disable-xephyr"                                      &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build the kdrive Xsdl server (EXPERIMENTAL)?"          \
                    n                                                       \
                    "--enable-xsdl"                                         \
                    "--disable-xsdl"                                        &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build the kdrive Xfbdev server (EXPERIMENTAL)?"        \
                    n                                                       \
                    "--enable-xfbdev"                                       \
                    "--disable-xfbdev"                                      &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build the kdrive Xfake server (EXPERIMENTAL)?"         \
                    n                                                       \
                    "--enable-xfake"                                        \
                    "--disable-xfake"                                       &&
# this tends to break stuff badly
config_query_option XORG_SERVER_OPTS                                        \
                    "Install Xorg server as owned by root with setuid bit (EXPERIMENTAL)?" \
                    y                                                       \
                    "--enable-install-setuid"                               \
                    "--disable-install-setuid"                              &&

message "${QUERY_COLOR}Advanced options end here${DEFAULT_COLOR}"
fi
config_query_option XORG_SERVER_OPTS                                        \
                    "Enable Secure RPC?"                                    \
                    y                                                       \
                    "--enable-secure-rpc"                                   \
                    "--disable-secure-rpc"                                  &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build the xfree86 DDX utils?"                          \
                    n                                                       \
                    "--enable-xfree86-utils"                                \
                    "--disable-xfree86-utils"                               &&

config_query_option XORG_SERVER_OPTS                                        \
                    "Build string registry module?"                         \
                    y                                                       \
                    "--enable-registry"                                     \
                    "--disable-registry"                                    &&

message "${MESSAGE_COLOR}Note:"                                             &&
message "Default font search prefix is now /usr/share/fonts/X11 ."          && 
message "You might want to make sure you got no old font installs left in"  &&
message "/usr/lib/X11/fonts or instead have those paths set in xorg.conf ." &&
message "$DEFAULT_COLOR"                                                    &&

config_query_multi  XORG_SERVER_FONT_100DPI                                 \
                    "Which 100dpi fonts do you want?"                       \
                    all                                                     \
                    none                                                    \
                    font-bh-100dpi                                          \
                    font-adobe-100dpi                                       \
                    font-bitstream-100dpi                                   \
                    font-adobe-utopia-100dpi                                \
                    font-bh-lucidatypewriter-100dpi                         &&

config_query_multi  XORG_SERVER_FONT_75DPI                                  \
                    "Which 75dpi fonts do you want?"                        \
                    all                                                     \
                    none                                                    \
                    font-bh-75dpi                                           \
                    font-adobe-75dpi                                        \
                    font-bitstream-75dpi                                    \
                    font-adobe-utopia-75dpi                                 \
                    font-bh-lucidatypewriter-75dpi                          &&

config_query_multi  XORG_SERVER_FONT_SPEEDO                                 \
                    "Which Speedo fonts do you want?"                       \
                    all                                                     \
                    none                                                    \
                    font-bitstream-speedo                                   &&

config_query_multi  XORG_SERVER_FONT_TYPE1                                  \
                    "Which Type1 fonts do you want?"                        \
                    all                                                     \
                    none                                                    \
                    font-bh-type1                                           \
                    font-ibm-type1                                          \
                    font-xfree86-type1                                      \
                    font-bitstream-type1                                    \
                    font-adobe-utopia-type1                                 &&

config_query_multi  XORG_SERVER_FONT_TTFOTF                                 \
                    "Which TTF/OTF fonts do you want?"                      \
                    all                                                     \
                    none                                                    \
                    font-bh-ttf                                             \
                    font-misc-meltho                                        \
                    font-misc-ethiopic                                      &&

config_query_multi  XORG_SERVER_FONT_MISC                                   \
                    "Which misc fonts do you want?"                         \
                    all                                                     \
                    none                                                    \
                    font-dec-misc                                           \
                    font-sun-misc                                           \
                    font-jis-misc                                           \
                    font-mutt-misc                                          \
                    font-sony-misc                                          \
                    font-isas-misc                                          \
                    font-micro-misc                                         \
                    font-arabic-misc                                        \
                    font-daewoo-misc                                        \
                    font-misc-cyrillic                                      \
                    font-cronyx-cyrillic                                    \
                    font-schumacher-misc                                    \
                    font-screen-cyrillic                                    \
                    font-winitzki-cyrillic

config_query_multi  XORG_SERVER_INPUT_DRIVER                                \
                    "What input drivers do you want"                        \
                    sane                                                    \
                    none                                                    \
                    all                                                     \
                    xf86-input-mouse                                        \
                    xf86-input-evdev                                        \
                    xf86-input-keyboard                                     \
                    xf86-input-joystick                                     \
                    xf86-input-synaptics                                    \
                    xf86-input-aiptek                                       \
                    linuxwacom                                              &&

config_query_multi  XORG_SERVER_INPUT_OBSCURE                               \
                    "What special input drivers do you want"                \
                    none                                                    \
                    all                                                     \
                    xf86-input-dmc                                          \
                    xf86-input-fpit                                         \
                    xf86-input-ur98                                         \
                    xf86-input-void                                         \
                    xf86-input-summa                                        \
                    xf86-input-palmax                                       \
                    xf86-input-acecad                                       \
                    xf86-input-citron                                       \
                    xf86-input-dynapro                                      \
                    xf86-input-diamondtouch                                 \
                    xf86-input-elo2300                                      \
                    xf86-input-tek4957                                      \
                    xf86-input-calcomp                                      \
                    xf86-input-mutouch                                      \
                    xf86-input-penmount                                     \
                    xf86-input-spaceorb                                     \
                    xf86-input-hyperpen                                     \
                    xf86-input-magellan                                     \
                    xf86-input-jamstudio                                    \
                    xf86-input-magictouch                                   \
                    xf86-input-microtouch                                   \
                    xf86-input-digitaledge                                  \
                    xf86-input-elographics                                  &&

config_query_multi  XORG_SERVER_VIDEO_DRIVER_COMMON                         \
                    "What common video drivers do you want"                 \
                    sane                                                    \
                    none                                                    \
                    all                                                     \
                    xf86-video-ati                                          \
                    xf86-video-nouveau                                      \
                    xf86-video-nv                                           \
                    xf86-video-intel                                        \
                    xf86-video-i810                                         \
                    xf86-video-i740                                         \
                    xf86-video-i128                                         \
                    xf86-video-mga                                          \
                    xf86-video-via                                          \
                    xf86-video-savage                                       \
                    xf86-video-s3                                           \
                    xf86-video-s3virge                                      \
                    xf86-video-sis                                          \
                    xf86-video-vesa                                         \
                    xf86-video-fbdev                                        \
                    xf86-video-neomagic                                     \
                    ati-fglrx                                               \
                    NVIDIA                                                  &&

config_query_multi  XORG_SERVER_VIDEO_DRIVER_UNCOMMON                       \
                    "What uncommon video drivers do you want"               \
                    none                                                    \
                    all                                                     \
                    xf86-video-tga                                          \
                    xf86-video-v4l                                          \
                    xf86-video-tdfx                                         \
                    xf86-video-chips                                        \
                    xf86-video-cyrix                                        \
                    xf86-video-dummy                                        \
                    xf86-video-glint                                        \
                    xf86-video-tseng                                        \
                    xf86-video-sisusb                                       \
                    xf86-video-cirrus                                       \
                    xf86-video-vmware                                       \
                    xf86-video-voodoo                                       \
                    xf86-video-trident                                      \
                    xf86-video-vga                                          &&

config_query_multi  XORG_SERVER_VIDEO_DRIVER_OBSCURE                        \
                    "What obscure video drivers do you want"                \
                    none                                                    \
                    all                                                     \
                    xf86-video-nsc                                          \
                    xf86-video-apm                                          \
                    xf86-video-ark                                          \
                    xf86-video-geode                                        \
                    xf86-video-imstt                                        \
                    xf86-video-sunbw2                                       \
                    xf86-video-suncg3                                       \
                    xf86-video-suncg6                                       \
                    xf86-video-sunffb                                       \
                    xf86-video-sunleo                                       \
                    xf86-video-suntcx                                       \
                    xf86-video-suncg14                                      \
                    xf86-video-newport                                      \
                    xf86-video-rendition                                    \
                    xf86-video-siliconmotion

