# This script sets Xserver module options for the specified driver
# using the X_MODULE_01 .. X_MODULE_10 lts.conf vars
#

if [ -n "$(env|awk -F = '/^X_MODULE_(0[1-9]|10)=/{print $2}')" ]; then
    module_hacks="$module_hacks set_xmodules"
    CONFIGURE_X="True"

    set_xmodules() {
        for i in 01 02 03 04 05 06 07 08 09 10; do
            eval X_MODULE="\$X_MODULE_$i"
            if [ -n "${X_MODULE}" ]; then
		if [ -z `echo ${X_MODULE} | grep "-"` ]; then
            	    echo "        Load \"${X_MODULE}\""
            	else
		    X_MODULE=`echo ${X_MODULE} | sed s/-//g`
            	    echo "        Disable \"${X_MODULE}\""
		fi
            fi
            [ ${X_MODULE} = "vnc" ] && VNC_MODULE_LOADED=1
        done
    }
fi