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


LIKELY_X11_ROOT_DIRS=`getKnownX11Roots`

POSSIBLE_DIRS=
POSSIBLE_DIRS="$POSSIBLE_DIRS $LIKELY_X11_ROOT_DIRS"
POSSIBLE_DIRS="$POSSIBLE_DIRS /usr"
POSSIBLE_DIRS="$POSSIBLE_DIRS /usr/dt"
POSSIBLE_DIRS="$POSSIBLE_DIRS /opt/dt"
POSSIBLE_DIRS="$POSSIBLE_DIRS /opt/SUNWmotif"
POSSIBLE_DIRS="$POSSIBLE_DIRS /usr/openwin"
POSSIBLE_DIRS="$POSSIBLE_DIRS /usr/local"
POSSIBLE_DIRS="$POSSIBLE_DIRS /usr/local/LessTif/Motif1.2"

# Lesstif is sometimes in /usr/local

DYN_LIB_SUFFIX=`getDynamicLibSuffix`

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

done


echo "Failed to find the motif lib directory!!!" >> $SCRIPT_LOG
echo "Add the path to the list in getMotifLibPath" >> $SCRIPT_LOG

abortScript


