#!/bin/sh
#
# getXLibPath - Return the location of the directory which contains the
# X11 libraries for linking with.
#

LIKELY_X11_ROOT_DIRS=`getKnownX11Roots`

POSSIBLE_DIRS=
POSSIBLE_DIRS="$POSSIBLE_DIRS $LIKELY_X11_ROOT_DIRS"
POSSIBLE_DIRS="$POSSIBLE_DIRS /usr/dt"
POSSIBLE_DIRS="$POSSIBLE_DIRS /opt/SUNWx11"
POSSIBLE_DIRS="$POSSIBLE_DIRS /opt/SUNWx11R6"
POSSIBLE_DIRS="$POSSIBLE_DIRS /usr/openwin"
POSSIBLE_DIRS="$POSSIBLE_DIRS /usr"

DYN_LIB_SUFFIX=`getDynamicLibSuffix`

for i in $POSSIBLE_DIRS
do
    if [ -f "$i/lib/libX11.a" -o -f "$i/lib/libX11.$DYN_LIB_SUFFIX" ]
    then
        echo `deReference $i/lib`
	exit 0
    fi

done

echo "Failed to find the X lib directory!!!" >> $SCRIPT_LOG
echo "Add the path to the list in getKnownX11Roots or getXLibPath" >> $SCRIPT_LOG

abortScript


