summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/config.tests/x11/xrender.test
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
commitdda8474928bd7276e1fad8fb7a601e7c83ff2bc2 (patch)
tree7f83910598b33b12730035f086df20b5a53ab99c /tqtinterface/qt4/config.tests/x11/xrender.test
parent6260b6178868c03aab1644bf93b0ef043654bdb0 (diff)
downloadexperimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.tar.gz
experimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.zip
Added TQt4 HEAD
Diffstat (limited to 'tqtinterface/qt4/config.tests/x11/xrender.test')
-rwxr-xr-xtqtinterface/qt4/config.tests/x11/xrender.test72
1 files changed, 72 insertions, 0 deletions
diff --git a/tqtinterface/qt4/config.tests/x11/xrender.test b/tqtinterface/qt4/config.tests/x11/xrender.test
new file mode 100755
index 0000000..5655299
--- /dev/null
+++ b/tqtinterface/qt4/config.tests/x11/xrender.test
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+XRENDER=yes
+XCONFIG=$1/qmake.conf
+VERBOSE=$2
+shift 2
+IN_LIBDIRS=""
+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 "XRender auto-detection... ($*)"
+
+# check for lib
+XDIRS=`sed -n -e '/^QMAKE_LIBDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-L/ /g; p; }' $XCONFIG`
+LIBDIRS="$IN_LIBDIRS $XDIRS /usr/shlib /usr/lib /lib"
+F=
+for LIBDIR in $LIBDIRS; do
+ FOUND_LIB=`ls $LIBDIR/libXrender.* 2>/dev/null`
+ if [ ! -z "$FOUND_LIB" ]; then
+ F=yes
+ [ "$VERBOSE" = "yes" ] && echo " Found XRender lib in $LIBDIR"
+ break
+ fi
+done
+if [ -z "$F" ]; then
+ XRENDER=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not tqfind XRender lib anywhere in $LIBDIRS"
+fi
+
+# check for headers
+if [ "$XRENDER" = "yes" ]; then
+ INC="X11/extensions/Xrender.h"
+ XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
+ INCDIRS="$IN_INCDIRS $XDIRS /usr/include /include"
+ F=
+ for INCDIR in $INCDIRS; do
+ if [ -f $INCDIR/$INC ]; then
+ F=yes
+ [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR"
+ break
+ fi
+ done
+ if [ -z "$F" ]
+ then
+ XRENDER=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not tqfind $INC anywhere in $INCDIRS"
+ fi
+fi
+
+# done
+if [ "$XRENDER" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "XRender disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "XRender enabled."
+ exit 1
+fi