summaryrefslogtreecommitdiffstats
path: root/config.tests/x11
diff options
context:
space:
mode:
Diffstat (limited to 'config.tests/x11')
-rwxr-xr-xconfig.tests/x11/notype.test49
-rw-r--r--config.tests/x11/notype/notypetest.cpp11
-rw-r--r--config.tests/x11/notype/notypetest.pro5
-rwxr-xr-xconfig.tests/x11/opengl.test103
-rwxr-xr-xconfig.tests/x11/sm.test49
-rwxr-xr-xconfig.tests/x11/xcursor.test92
-rwxr-xr-xconfig.tests/x11/xfreetype.test180
-rwxr-xr-xconfig.tests/x11/xinerama.test75
-rwxr-xr-xconfig.tests/x11/xinput.test74
-rwxr-xr-xconfig.tests/x11/xkb.test100
-rwxr-xr-xconfig.tests/x11/xrandr.test95
-rwxr-xr-xconfig.tests/x11/xrender.test72
-rwxr-xr-xconfig.tests/x11/xshape.test54
13 files changed, 959 insertions, 0 deletions
diff --git a/config.tests/x11/notype.test b/config.tests/x11/notype.test
new file mode 100755
index 0000000..4c429be
--- /dev/null
+++ b/config.tests/x11/notype.test
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+QMKSPEC=$1
+XPLATFORM=`basename $1`
+VERBOSE=$2
+SRCDIR=$3
+OUTDIR=$4
+
+# debuggery
+[ "$VERBOSE" = "yes" ] && echo "Detecting broken X11 headers... ($*)"
+
+# Detect broken X11 headers when using GCC 2.95 or later
+# Xsun on Solaris 2.5.1:
+# Patches are available for Solaris 2.6, 7, and 8 but
+# not for Solaris 2.5.1.
+# HP-UX:
+# Patches are available for HP-UX 10.20, 11.00, and 11.11.
+# AIX 4.3.3 and AIX 5.1:
+# Headers are clearly broken on all AIX versions, and we
+# don't know of any patches. The strange thing is that we
+# did not get any reports about this issue until very
+# recently, long after gcc 3.0.x was released. It seems to
+# work for us with gcc 2.95.2.
+NOTYPE=no
+
+if [ $XPLATFORM = "solaris-g++" -o $XPLATFORM = "hpux-g++" -o $XPLATFORM = "aix-g++" -o $XPLATFORM = "aix-g++-64" ]; then
+ NOTYPE=yes
+
+ test -d $OUTDIR/config.tests/x11/notype || mkdir -p $OUTDIR/config.tests/x11/notype
+ $OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/x11/notype/notypetest.pro -o $OUTDIR/config.tests/x11/notype/Makefile >/dev/null 2>&1
+ cd $OUTDIR/config.tests/x11/notype
+
+ if [ "$VERBOSE" = "yes" ]; then
+ make
+ else
+ make >/dev/null 2>&1
+ fi
+
+ [ -x notypetest ] && NOTYPE=no
+fi
+
+# done
+if [ "$NOTYPE" = "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "Broken X11 headers detected."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "X11 headers look good."
+ exit 1
+fi
diff --git a/config.tests/x11/notype/notypetest.cpp b/config.tests/x11/notype/notypetest.cpp
new file mode 100644
index 0000000..b33949c
--- /dev/null
+++ b/config.tests/x11/notype/notypetest.cpp
@@ -0,0 +1,11 @@
+/* Sample program for configure to test for broken X11 headers that
+confuse gcc 2.95 and better on target platforms such as Solaris.
+*/
+
+#include <X11/Xlib.h>
+#include <X11/ICE/ICElib.h>
+
+int main()
+{
+ return 0;
+}
diff --git a/config.tests/x11/notype/notypetest.pro b/config.tests/x11/notype/notypetest.pro
new file mode 100644
index 0000000..fce2251
--- /dev/null
+++ b/config.tests/x11/notype/notypetest.pro
@@ -0,0 +1,5 @@
+TEMPLATE=app
+TARGET=notypetest
+CONFIG-=qt opengl
+CONFIG+=x11
+SOURCES=notypetest.cpp
diff --git a/config.tests/x11/opengl.test b/config.tests/x11/opengl.test
new file mode 100755
index 0000000..328a7a8
--- /dev/null
+++ b/config.tests/x11/opengl.test
@@ -0,0 +1,103 @@
+#!/bin/sh
+
+OPENGL=yes
+XCONFIG=$1/qmake.conf
+THREAD=$2
+VERBOSE=$3
+shift 3
+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 "OpenGL auto-detection... ($*)"
+
+# check for lib
+LIBS=`sed -n -e '/^QMAKE_LIBS_OPENGL[ ]*=/ { s/[^=]*=[ ]*//; s/-l/ /g; p; }' $XCONFIG`
+GLDIRS=`sed -n -e '/^QMAKE_LIBDIR_OPENGL[ ]*=/ { s/[^=]*=[ ]*//; p; }' $XCONFIG`
+XDIRS=`sed -n -e '/^QMAKE_LIBDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; p; }' $XCONFIG`
+LIBDIRS="$IN_LIBDIRS $GLDIRS $XDIRS /usr/shlib /usr/lib /lib"
+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 "$FOUND_LIB" -a ! "x$THREAD" = "xyes" -a ! -z "$F" ]; then
+ LDD_P=`which ldd 2>/dev/null`
+ if [ ! -z "$LDD_P" ]; then
+ for a in $FOUND_LIB; do
+ if $LDD_P $a 2>/dev/null | grep -i thread >/dev/null 2>&1; then
+ FOUND_LIB=$a
+ F_REASON="threads"
+ F=
+ break
+ fi
+ done
+ fi
+ fi
+ if [ -z "$F" ]; then
+ OPENGL=no
+ if [ "x$F_REASON" = "xthreads" ]; then
+ echo
+ echo "WARNING: $FOUND_LIB is threaded!"
+ echo "The Qt OpenGL module requires Qt to be configured with -thread."
+ echo
+ else
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $L lib anywhere in $LIBDIRS"
+ fi
+ break
+ fi
+done
+
+# check for headers
+if [ "$OPENGL" = "yes" ]; then
+ INCS="GL/gl.h GL/glu.h"
+ GLDIRS=`sed -n -e '/^QMAKE_INCDIR_OPENGL[ ]*=/ { s/[^=]*=[ ]*//; p; }' $XCONFIG`
+ XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; p; }' $XCONFIG`
+ INCDIRS="$IN_INCDIRS $GLDIRS $XDIRS /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
+ OPENGL=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $I anywhere in $INCDIRS"
+ break
+ fi
+ done
+fi
+
+# done
+if [ "$OPENGL" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "OpenGL disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "OpenGL enabled."
+ exit 1
+fi
diff --git a/config.tests/x11/sm.test b/config.tests/x11/sm.test
new file mode 100755
index 0000000..ad99d0e
--- /dev/null
+++ b/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 find $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
diff --git a/config.tests/x11/xcursor.test b/config.tests/x11/xcursor.test
new file mode 100755
index 0000000..514e33c
--- /dev/null
+++ b/config.tests/x11/xcursor.test
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+XCURSOR=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 "Xcursor auto-detection... ($*)"
+
+# check for the Xcursor library
+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/libXcursor.* 2>/dev/null`
+ if [ ! -z "$FOUND_LIB" ]; then
+ F=yes
+ [ "$VERBOSE" = "yes" ] && echo " Found Xcursor lib in $LIBDIR"
+ break
+ fi
+done
+if [ -z "$F" ]; then
+ XCURSOR=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find Xcursor lib anywhere in $LIBDIRS"
+fi
+
+# check for Xcursor.h
+XCURSOR_H=
+if [ "$XCURSOR" = "yes" ]; then
+ INC="X11/Xcursor/Xcursor.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
+ XCURSOR_H=$INCDIR/$INC
+ [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR"
+ break
+ fi
+ done
+ if [ -z "$F" ]
+ then
+ XCURSOR=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS"
+ fi
+fi
+
+# verify that we are using Xcursor 1.x
+if [ "$XCURSOR" = "yes" ]; then
+ XCURSOR_MAJOR=`egrep 'XCURSOR(_LIB)?_MAJOR' $XCURSOR_H | head -n 1 | awk '{ print \$3 }'`
+ XCURSOR_MINOR=`egrep 'XCURSOR(_LIB)?_MINOR' $XCURSOR_H | head -n 1 | awk '{ print \$3 }'`
+ if [ -z "$XCURSOR_MAJOR" -o -z "$XCURSOR_MINOR" ]; then
+ XCURSOR=no
+ [ "$VERBOSE" = "yes" ] && \
+ echo " Could not find Xcursor version."
+ elif [ "$XCURSOR_MAJOR" != "1" ]; then
+ XCURSOR=no
+ [ "$VERBOSE" = "yes" ] && \
+ echo " Found Xcursor version $XCURSOR_MAJOR.$XCURSOR_MINOR, version 1.0 or higher required."
+ else
+ [ "$VERBOSE" = "yes" ] && \
+ echo " Found Xcursor version $XCURSOR_MAJOR.$XCURSOR_MINOR"
+ fi
+fi
+
+# done
+if [ "$XCURSOR" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "Xcursor disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "Xcursor enabled."
+ exit 1
+fi
diff --git a/config.tests/x11/xfreetype.test b/config.tests/x11/xfreetype.test
new file mode 100755
index 0000000..5cabc32
--- /dev/null
+++ b/config.tests/x11/xfreetype.test
@@ -0,0 +1,180 @@
+#!/bin/sh
+
+XFT=yes
+XFT2=no
+XFT2_HEADER=no
+XCONFIG=$1/qmake.conf
+VERBOSE=$2
+SRCDIR=$3
+OUTDIR=$4
+shift 4
+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 "Xft auto-detection... ($*)"
+
+# cleanup...
+rm -f $OUTDIR/config.tests/x11/xft.cfg
+rm -f $OUTDIR/config.tests/x11/xft.inc
+rm -f $OUTDIR/config.tests/x11/xft.lib
+
+# check for the Xft library
+XDIRS=`sed -n -e '/^QMAKE_LIBDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-L/ /g; p; }' $XCONFIG`
+LIBDIRS="$IN_LIBDIRS $XDIRS /usr/shlib /usr/lib /lib"
+F=
+LIBS="Xft2 Xft"
+for LIB in $LIBS; do
+ for LIBDIR in $LIBDIRS; do
+ EXTENSIONS="a so sl"
+ for E in $EXTENSIONS; do
+ if [ -f "$LIBDIR/lib$LIB.$E" ]; then
+ F="$LIB"
+ [ "$VERBOSE" = "yes" ] && echo " Found lib$LIB.$E in $LIBDIR"
+ break
+ fi
+ done
+ done
+ [ -n "$F" ] && break
+done
+if [ -z "$F" ]; then
+ XFT=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find Xft lib anywhere in $LIBDIRS"
+fi
+LIBXFT="-l$F -lfreetype"
+
+# check for X11/Xft/Xft.h
+XFT_H=
+if [ "$XFT" = "yes" ]; then
+ 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
+ INCS="X11/Xft/Xft2.h X11/Xft/Xft.h"
+ for INC in $INCS; do
+ if [ -f $INCDIR/$INC ]; then
+ F=yes
+ [ "$INC" = "X11/Xft/Xft2.h" ] && XFT2_HEADER=yes
+ XFT_H=$INCDIR/$INC
+ [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR"
+ break
+ fi
+ done
+ done
+ if [ -z "$F" ]; then
+ XFT=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS"
+ fi
+fi
+
+# detect major version of Xft
+if [ "$XFT" = "yes" ]; then
+ XFT_MAJOR=`grep XFT_MAJOR $XFT_H | head -n 1 | awk '{ print \$3 }'`
+ XFT_MINOR=`grep XFT_MINOR $XFT_H | head -n 1 | awk '{ print \$3 }'`
+ XFT_REVISION=`grep XFT_REVISION $XFT_H | head -n 1 | awk '{ print \$3 }'`
+ [ "$VERBOSE" = "yes" ] && echo " Found Xft version $XFT_MAJOR.$XFT_MINOR.$XFT_REVISION"
+ if [ "$XFT_MAJOR" = "2" ]; then
+ XFT2=yes
+ LIBXFT="$LIBXFT -lfontconfig"
+ fi
+fi
+
+# find XftFreetype.h if using Xft1
+if [ "$XFT" = "yes" ] && [ "$XFT2" = "no" ]; then
+ INC="X11/Xft/XftFreetype.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
+ XFT=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS"
+ fi
+fi
+
+# check for freetype2 headers
+FREETYPE2_INCDIR=
+if [ "$XFT" = "yes" ]; then
+ INC="freetype2/freetype/freetype.h"
+ XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
+ LDIRS=`sed -n -e '/^QMAKE_INCDIR[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
+ INCDIRS="$IN_INCDIRS $XDIRS $LDIRS /usr/include /include"
+ F=
+ for INCDIR in $INCDIRS; do
+ if [ -f $INCDIR/$INC ]; then
+ # detect major version of freetype2
+ FREETYPE_MAJOR=`grep "#define FREETYPE_MAJOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`
+ FREETYPE_MINOR=`grep "#define FREETYPE_MINOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`
+ FREETYPE_PATCH=`grep "#define FREETYPE_PATCH" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`
+ test -z "$FREETYPE_PATCH" && FREETYPE_PATCH="0"
+ [ "$VERBOSE" = "yes" ] && \
+ echo " Found Freetype version $FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH"
+ if [ "$FREETYPE_MAJOR" -eq "2" ] \
+ && [ "$FREETYPE_MINOR" -ge "0" -a "$FREETYPE_PATCH" -ge "9" ] \
+ || [ "$FREETYPE_MINOR" -ge "1" ]; then
+ F=yes
+ FREETYPE2_INCDIR=$INCDIR/freetype2
+ [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR"
+ break
+ fi
+ fi
+ done
+ if [ -z "$F" ]; then
+ XFT=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS"
+ fi
+fi
+
+# check for fontconfig headers when using Xft2
+if [ "$XFT" = "yes" ] && [ "$XFT2" = "yes" ]; then
+ INC="fontconfig/fontconfig.h"
+ XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
+ LDIRS=`sed -n -e '/^QMAKE_INCDIR[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
+ INCDIRS="$IN_INCDIRS $XDIRS $LDIRS /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
+ XFT=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS"
+ fi
+fi
+
+# done
+if [ "$XFT" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "Xft disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "Xft enabled."
+ [ "$XFT2_HEADER" = "yes" ] && \
+ echo "xft2header" > $OUTDIR/config.tests/x11/xft.cfg
+ echo "$FREETYPE2_INCDIR" > $OUTDIR/config.tests/x11/xft.inc
+ echo "$LIBXFT" > $OUTDIR/config.tests/x11/xft.lib
+ exit 1
+fi
diff --git a/config.tests/x11/xinerama.test b/config.tests/x11/xinerama.test
new file mode 100755
index 0000000..dc01558
--- /dev/null
+++ b/config.tests/x11/xinerama.test
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+XINERAMA=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 "Xinerama 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/libXinerama.* 2>/dev/null`
+ if [ ! -z "$FOUND_LIB" ]; then
+ F=yes
+ [ "$VERBOSE" = "yes" ] && echo " Found Xinerama lib in $LIBDIR"
+ break
+ fi
+done
+if [ -z "$F" ]; then
+ XINERAMA=no
+ if [ "$VERBOSE" = "yes" ]; then
+ echo " Could not find Xinerama lib anywhere in $LIBDIRS"
+ fi
+fi
+
+# check for headers
+if [ "$XINERAMA" = "yes" ]; then
+ INC="X11/extensions/Xinerama.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
+ XINERAMA=no
+ if [ "$VERBOSE" = "yes" ]; then
+ echo " Could not find $INC anywhere in $INCDIRS"
+ fi
+ fi
+fi
+
+# done
+if [ "$XINERAMA" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "Xinerama disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "Xinerama enabled."
+ exit 1
+fi
diff --git a/config.tests/x11/xinput.test b/config.tests/x11/xinput.test
new file mode 100755
index 0000000..c8b3e08
--- /dev/null
+++ b/config.tests/x11/xinput.test
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+XINPUT=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 "XInput auto-detection... ($*)"
+
+# check for the XInput library
+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/libXi.* 2>/dev/null`
+ if [ ! -z "$FOUND_LIB" ]; then
+ F=yes
+ [ "$VERBOSE" = "yes" ] && echo " Found XInput lib in $LIBDIR"
+ break
+ fi
+done
+if [ -z "$F" ]; then
+ XINPUT=no
+ [ "VERBOSE" = "yes" ] && echo " Could not find XInput lib anywhere in $LIBDIRS"
+fi
+
+# check for XInput.h and the IRIX wacom.h
+if [ "$XINPUT" = "yes" ]; then
+ INCS="X11/extensions/XInput.h wacom.h"
+ XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
+ INCDIRS="$IN_INCDIRS $XDIRS /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
+ XINPUT=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $I anywhere in $INCDIRS"
+ fi
+ done
+fi
+
+# done
+if [ "$XINPUT" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "XInput disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "XInput enabled."
+ exit 1
+fi
diff --git a/config.tests/x11/xkb.test b/config.tests/x11/xkb.test
new file mode 100755
index 0000000..5560b08
--- /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
diff --git a/config.tests/x11/xrandr.test b/config.tests/x11/xrandr.test
new file mode 100755
index 0000000..66a05c5
--- /dev/null
+++ b/config.tests/x11/xrandr.test
@@ -0,0 +1,95 @@
+#!/bin/sh
+
+XRANDR=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 "XRandR auto-detection... ($*)"
+
+# check for the Xrandr library
+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/libXrandr.* 2>/dev/null`
+ if [ ! -z "$FOUND_LIB" ]; then
+ F=yes
+ [ "$VERBOSE" = "yes" ] && echo " Found XRandR lib in $LIBDIR"
+ break
+ fi
+done
+if [ -z "$F" ]; then
+ XRANDR=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find XRandR lib anywhere in $LIBDIRS"
+fi
+
+# check for Xrandr.h and randr.h
+XRANDR_H=
+RANDR_H=
+if [ "$XRANDR" = "yes" ]; then
+ INC="X11/extensions/Xrandr.h"
+ INC2="X11/extensions/randr.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 -a -f $INCDIR/$INC2 ]; then
+ F=yes
+ XRANDR_H=$INCDIR/$INC
+ RANDR_H=$INCDIR/$INC2
+ [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR"
+ break
+ fi
+ done
+ if [ -z "$F" ]
+ then
+ XRANDR=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS"
+ fi
+fi
+
+# verify that we are using XRandR 1.x >= 1.1
+if [ "$XRANDR" = "yes" ]; then
+ XRANDR_MAJOR=`grep RANDR_MAJOR $RANDR_H | awk '{ print \$3 }'`
+ XRANDR_MINOR=`grep RANDR_MINOR $RANDR_H | awk '{ print \$3 }'`
+ if [ -z "$XRANDR_MAJOR" -o -z "$XRANDR_MINOR" ]; then
+ XRANDR=no
+ [ "$VERBOSE" = "yes" ] && \
+ echo " Could not find XRandR version."
+ elif [ "$XRANDR_MAJOR" != "1" -o "$XRANDR_MINOR" -lt "1" ]; then
+ XRANDR=no
+ [ "$VERBOSE" = "yes" ] && \
+ echo " Found XRandR version $XRANDR_MAJOR.$XRANDR_MINOR, version 1.1 or higher required."
+ else
+ [ "$VERBOSE" = "yes" ] && \
+ echo " Found XRandR version $XRANDR_MAJOR.$XRANDR_MINOR"
+ fi
+fi
+
+# done
+if [ "$XRANDR" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "XRandR disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "XRandR enabled."
+ exit 1
+fi
diff --git a/config.tests/x11/xrender.test b/config.tests/x11/xrender.test
new file mode 100755
index 0000000..64ccc20
--- /dev/null
+++ b/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 find 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 find $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
diff --git a/config.tests/x11/xshape.test b/config.tests/x11/xshape.test
new file mode 100755
index 0000000..4fae606
--- /dev/null
+++ b/config.tests/x11/xshape.test
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+XSHAPE=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 "XShape auto-detection... ($*)"
+
+# NOTE: we assume that libXext is always available...
+INCS="X11/extensions/shape.h"
+XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG`
+INCDIRS="$IN_INCDIRS $XDIRS /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
+ XSHAPE=no
+ [ "$VERBOSE" = "yes" ] && echo " Could not find $I anywhere in $INCDIRS"
+ fi
+done
+
+# done
+if [ "$XSHAPE" != "yes" ]; then
+ [ "$VERBOSE" = "yes" ] && echo "XShape disabled."
+ exit 0
+else
+ [ "$VERBOSE" = "yes" ] && echo "XShape enabled."
+ exit 1
+fi