#!/bin/sh
#
# getXAppLibPath - Return the path to the X application lib dir, i.e. 
#		  the one where app-defaults is.
#

LIKELY_X11_ROOT_DIRS=`getKnownX11Roots`

POSSIBLE_DIRS=
POSSIBLE_DIRS="$POSSIBLE_DIRS $LIKELY_X11_ROOT_DIRS"

for i in $POSSIBLE_DIRS
do
    if [ -d "$i/lib/X11/app-defaults" ]
    then
        echo `deReference $i/lib/X11`
	exit 0
    fi

    if [ -d "$i/lib/app-defaults" ]
    then
        echo `deReference $i/lib`
	exit 0
    fi
done

# Could do a deep search of the whole file system.

echo "Failed to find the app-defaults directory!!!" >> $SCRIPT_LOG
echo "Add the path to the list in getXAppLibPath, or override it" >> $SCRIPT_LOG

abortScript


