summaryrefslogtreecommitdiffstats
path: root/experimental/tqtinterface/qt4/config.tests/x11/sm.test
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/tqtinterface/qt4/config.tests/x11/sm.test')
-rwxr-xr-xexperimental/tqtinterface/qt4/config.tests/x11/sm.test49
1 files changed, 49 insertions, 0 deletions
diff --git a/experimental/tqtinterface/qt4/config.tests/x11/sm.test b/experimental/tqtinterface/qt4/config.tests/x11/sm.test
new file mode 100755
index 000000000..a1ad33bbe
--- /dev/null
+++ b/experimental/tqtinterface/qt4/config.tests/x11/sm.test
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+SM=yes
+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
+ -I)
+ CINCDIR=`echo $PARAM | sed -e 's/^-I//'`
+ IN_INCDIRS="$IN_INCDIRS $CINCDIR"
+ ;;
+ *) ;;
+ esac
+done
+
+# debuggery
+[ "$VERBOSE" = "yes" ] && echo "Session Management auto-detection... ($*)"
+
+# check for headers
+if [ "$SM" = "yes" ]; then
+ INC="X11/SM/SM.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
+ SM=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not tqfind $INC anywhere in $INCDIRS"
+ fi
+fi
+
+# done
+if [ "$SM" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "Session Management disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "Session Management enabled."
+ exit 1
+fi