summaryrefslogtreecommitdiffstats
path: root/config.tests/x11/xkb.test
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-08 12:31:36 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-08 12:31:36 -0600
commitd796c9dd933ab96ec83b9a634feedd5d32e1ba3f (patch)
tree6e3dcca4f77e20ec8966c666aac7c35bd4704053 /config.tests/x11/xkb.test
downloadtqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.tar.gz
tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.zip
Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731
Diffstat (limited to 'config.tests/x11/xkb.test')
-rwxr-xr-xconfig.tests/x11/xkb.test100
1 files changed, 100 insertions, 0 deletions
diff --git a/config.tests/x11/xkb.test b/config.tests/x11/xkb.test
new file mode 100755
index 000000000..5560b0809
--- /dev/null
+++ b/config.tests/x11/xkb.test
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+XKB=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
+ -I)
+ CINCDIR=`echo $PARAM | sed -e 's/^-I//'`
+ IN_INCDIRS="$IN_INCDIRS $CINCDIR"
+ ;;
+ *) ;;
+ esac
+done
+
+# debuggery
+[ "$VERBOSE" = "yes" ] && echo "XKB auto-detection... ($*)"
+
+# some platforms are known to be broken
+# Solaris 7 + Xsun
+# Patches 107648-01 and 107649-01 upgrade the Xsun package
+# of Solaris 7 to X Window 6.4 on SPARC and Intel platforms
+# respectively, introducing XKB support. However most headers
+# are missing and there's no patch to fix that. Our solution
+# is to disable XKB support on Solaris 7.
+# Of course XFree86 is not affected by this Xsun bug, so ideally
+# we should disable XKB support on Solaris + Xsun only, not on
+# Solaris + XFree86. But then how to detect Xsun vs. XFree86?
+# Tru64
+# Link-time problems.
+case "$XPLATFORM" in
+solaris-*)
+ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+ case "$UNAME_RELEASE" in
+ 5.7)
+ [ "x$VERBOSE" = "xyes" ] && echo "XKB extension known to be broken on this platform."
+ XKB=no
+ ;;
+ esac
+ ;;
+tru64-*)
+ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+ [ "x$VERBOSE" = "xyes" ] && echo "XKB extension not supported on this platform."
+ XKB=no
+ ;;
+esac
+
+# check for headers
+XKBLIB_H=
+if [ "$XKB" = "yes" ]; then
+ INC="X11/XKBlib.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
+ XKBLIB_H=$INCDIR/$INC
+ if [ "$VERBOSE" = "yes" ]
+ then
+ echo " Found $INC in $INCDIR"
+ fi
+ break
+ fi
+ done
+ if [ -z "$F" ]; then
+ XKB=no
+ if [ "$VERBOSE" = "yes" ]; then
+ echo " Could not find $INC anywhere in $INCDIRS"
+ fi
+ fi
+fi
+
+# check for XkbSetPerClientControls in X11/XKBlib.h
+# if it is not found, we disable xkb support
+if [ "$XKB" = "yes" ] && [ -f "$XKBLIB_H" ]; then
+ grep XkbSetPerClientControls $XKBLIB_H >/dev/null || XKB=no
+ if [ "$VERBOSE" = "yes" ]; then
+ if [ "$XKB" = "yes" ]; then
+ echo " XkbSetPerClientControls found."
+ else
+ echo " XkbSetPerClientControls not found."
+ fi
+ fi
+fi
+
+
+# done
+if [ "$XKB" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "XKB disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "XKB enabled."
+ exit 1
+fi