diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:17:53 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:17:53 -0500 |
commit | dda8474928bd7276e1fad8fb7a601e7c83ff2bc2 (patch) | |
tree | 7f83910598b33b12730035f086df20b5a53ab99c /tqtinterface/qt4/config.tests/unix/nis.test | |
parent | 6260b6178868c03aab1644bf93b0ef043654bdb0 (diff) | |
download | experimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.tar.gz experimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.zip |
Added TQt4 HEAD
Diffstat (limited to 'tqtinterface/qt4/config.tests/unix/nis.test')
-rwxr-xr-x | tqtinterface/qt4/config.tests/unix/nis.test | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/tqtinterface/qt4/config.tests/unix/nis.test b/tqtinterface/qt4/config.tests/unix/nis.test new file mode 100755 index 0000000..835a187 --- /dev/null +++ b/tqtinterface/qt4/config.tests/unix/nis.test @@ -0,0 +1,87 @@ +#!/bin/sh + +NIS=yes +XPLATFORM=`basename $1` +XCONFIG=$1/qmake.conf +VERBOSE=$2 +shift 2 +IN_INCDIRS="" +PARAMS=$@ +for PARAM in $PARAMS; do + PREFIX=`echo $PARAM | sed 's/^\(..\).*/\1/'` + case $PREFIX in + -L) + CLIBDIR=`echo $PARAM | sed -e 's/^-L//'` + IN_LIBDIRS="$IN_LIBDIRS $CLIBDIR" + ;; + -I) + CINCDIR=`echo $PARAM | sed -e 's/^-I//'` + IN_INCDIRS="$IN_INCDIRS $CINCDIR" + ;; + *) ;; + esac +done + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "NIS auto-detection... ($*)" + +# check for the NIS library +if echo $XPLATFORM | grep '^solaris-' >/dev/null; then + # on Solaris it's -lnsl, it's not specified because X11 already links it + LIBS=nsl +else + LIBS=`sed -n -e '/^QMAKE_LIBS_NIS[ ]*=/ { s/[^=]*=[ ]*//; s/-l/ /g; p; }' $XCONFIG` +fi +LIBDIRS="$IN_LIBDIRS /usr/shlib /usr/lib /lib" +if [ -z "$LIBS" ]; then + NIS=no + [ "$VERBOSE" = "yes" ] && echo " No NIS libraries specified." +else + for L in $LIBS; do + FOUND_LIB= + F= + for LIBDIR in $LIBDIRS; do + FOUND_LIB=`ls $LIBDIR/lib$L.* 2>/dev/null` + if [ ! -z "$FOUND_LIB" ]; then + F=yes + [ "$VERBOSE" = "yes" ] && echo " Found $L lib in $LIBDIR" + break + fi + done + if [ -z "$F" ]; then + NIS=no + [ "VERBOSE" = "yes" ] && echo " Could not tqfind NIS lib anywhere in $LIBDIRS" + fi + done +fi + +# check for rpcsvc/ypclnt.h and rpcsvc/yp_prot.h +if [ "$NIS" = "yes" ] +then + INCS="rpcsvc/ypclnt.h rpcsvc/yp_prot.h" + INCDIRS="$IN_INCDIRS /usr/include /include" + + for I in $INCS; do + F= + for INCDIR in $INCDIRS; do + if [ -f $INCDIR/$I ]; then + F=yes + [ "$VERBOSE" = "yes" ] && echo " Found $I in $INCDIR" + break + fi + done + if [ -z "$F" ]; then + NIS=no + [ "$VERBOSE" = "yes" ] && echo " Could not tqfind $I anywhere in $INCDIRS" + fi + done +fi + +# done +if [ "$NIS" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "NIS disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "NIS enabled." + exit 1 +fi |