From bd0f3345a938b35ce6a12f6150373b0955b8dd12 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:24:15 -0500 Subject: Add Qt3 development HEAD version --- config.tests/mac/mac_version.test | 44 +++++++ config.tests/unix/checkavail | 124 ++++++++++++++++++ config.tests/unix/cups.test | 82 ++++++++++++ config.tests/unix/endian.test | 30 +++++ config.tests/unix/endian/endiantest.cpp | 8 ++ config.tests/unix/endian/endiantest.pro | 5 + config.tests/unix/ipv6.test | 31 +++++ config.tests/unix/ipv6/ipv6test.cpp | 20 +++ config.tests/unix/ipv6/ipv6test.pro | 5 + config.tests/unix/largefile.test | 31 +++++ config.tests/unix/largefile/largefiletest.cpp | 32 +++++ config.tests/unix/largefile/largefiletest.pro | 5 + config.tests/unix/nis.test | 87 +++++++++++++ config.tests/unix/precomp.test | 22 ++++ config.tests/unix/ptrsize.test | 26 ++++ config.tests/unix/ptrsize/ptrsizetest.cpp | 9 ++ config.tests/unix/ptrsize/ptrsizetest.pro | 5 + config.tests/unix/stl.test | 31 +++++ config.tests/unix/stl/stltest.cpp | 83 ++++++++++++ config.tests/unix/stl/stltest.pro | 5 + config.tests/unix/which.test | 39 ++++++ config.tests/x11/notype.test | 49 +++++++ config.tests/x11/notype/notypetest.cpp | 11 ++ config.tests/x11/notype/notypetest.pro | 5 + config.tests/x11/opengl.test | 103 +++++++++++++++ config.tests/x11/sm.test | 49 +++++++ config.tests/x11/xcursor.test | 92 +++++++++++++ config.tests/x11/xfreetype.test | 180 ++++++++++++++++++++++++++ config.tests/x11/xinerama.test | 75 +++++++++++ config.tests/x11/xinput.test | 74 +++++++++++ config.tests/x11/xkb.test | 100 ++++++++++++++ config.tests/x11/xrandr.test | 95 ++++++++++++++ config.tests/x11/xrender.test | 72 +++++++++++ config.tests/x11/xshape.test | 54 ++++++++ 34 files changed, 1683 insertions(+) create mode 100755 config.tests/mac/mac_version.test create mode 100755 config.tests/unix/checkavail create mode 100755 config.tests/unix/cups.test create mode 100755 config.tests/unix/endian.test create mode 100644 config.tests/unix/endian/endiantest.cpp create mode 100644 config.tests/unix/endian/endiantest.pro create mode 100755 config.tests/unix/ipv6.test create mode 100644 config.tests/unix/ipv6/ipv6test.cpp create mode 100644 config.tests/unix/ipv6/ipv6test.pro create mode 100755 config.tests/unix/largefile.test create mode 100644 config.tests/unix/largefile/largefiletest.cpp create mode 100644 config.tests/unix/largefile/largefiletest.pro create mode 100755 config.tests/unix/nis.test create mode 100755 config.tests/unix/precomp.test create mode 100755 config.tests/unix/ptrsize.test create mode 100644 config.tests/unix/ptrsize/ptrsizetest.cpp create mode 100644 config.tests/unix/ptrsize/ptrsizetest.pro create mode 100755 config.tests/unix/stl.test create mode 100644 config.tests/unix/stl/stltest.cpp create mode 100644 config.tests/unix/stl/stltest.pro create mode 100755 config.tests/unix/which.test create mode 100755 config.tests/x11/notype.test create mode 100644 config.tests/x11/notype/notypetest.cpp create mode 100644 config.tests/x11/notype/notypetest.pro create mode 100755 config.tests/x11/opengl.test create mode 100755 config.tests/x11/sm.test create mode 100755 config.tests/x11/xcursor.test create mode 100755 config.tests/x11/xfreetype.test create mode 100755 config.tests/x11/xinerama.test create mode 100755 config.tests/x11/xinput.test create mode 100755 config.tests/x11/xkb.test create mode 100755 config.tests/x11/xrandr.test create mode 100755 config.tests/x11/xrender.test create mode 100755 config.tests/x11/xshape.test (limited to 'config.tests') diff --git a/config.tests/mac/mac_version.test b/config.tests/mac/mac_version.test new file mode 100755 index 0000000..ae9e707 --- /dev/null +++ b/config.tests/mac/mac_version.test @@ -0,0 +1,44 @@ +#!/bin/sh + +HOME=/dev/null +export HOME + +VERBOSE=$1 +SRCDIR=$2 +OUTDIR=$3 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Testing Mac version..." >&2 + +# build a test program +test -d $OUTDIR/config.tests/mac/ || mkdir -p $OUTDIR/config.tests/mac/ +cd $OUTDIR/config.tests/mac +#TSTFILE=$OUTDIR/config.tests/mac/mac_version.cpp +TSTFILE=mac_version.cpp + +rm -f $TSTFILE +echo "#include " >$TSTFILE +echo "#include " >>$TSTFILE +echo "int main() {" >>$TSTFILE +echo " long gestalt_version;" >>$TSTFILE +echo " fprintf(stdout, \"%d\\n\", (Gestalt(gestaltSystemVersion, &gestalt_version) == noErr) ? gestalt_version : 0);" >>$TSTFILE +echo " return 1;" >>$TSTFILE +echo "}" >>$TSTFILE + +COMPILE_ERROR=yes +if [ "$VERBOSE" = "yes" ]; then + c++ $TSTFILE -o tst_mac_version -framework Carbon >&2 && COMPILE_ERROR=no +else + c++ $TSTFILE -o tst_mac_version -framework Carbon >/dev/null 2>&1 && COMPILE_ERROR=no +fi + +# done +if [ "$COMPILE_ERROR" = "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "Mac version cannot be detected!" >&2 + exit 1 +else + MAC_VERSION=`./tst_mac_version` + [ "$VERBOSE" = "yes" ] && echo "Mac version set to: $MAC_VERSION." >&2 + echo $MAC_VERSION + exit 0 +fi diff --git a/config.tests/unix/checkavail b/config.tests/unix/checkavail new file mode 100755 index 0000000..43cec94 --- /dev/null +++ b/config.tests/unix/checkavail @@ -0,0 +1,124 @@ +#!/bin/sh +# +# usage: $1 is featurename, $2 verbose +# $3..$n librarynames like '-llibmysqlclient.*' or (optional) extra library paths like '-L/usr/local/lib' +# or filenames like "mysql.h" and (optional) extra include paths like '-I/usr/local/include' +# returns 0 on success + +SUCCESS= +MODULE_NAME=$1 +VERBOSE=$2 +shift 2 +LIBDIRS="/lib /usr/lib" +LIBNAMES="" +INCLUDEDIRS="/usr/include" +INCLUDES="" + +PARAMS=$@ +for PARAM in $PARAMS +do + PREFIX=`echo $PARAM | sed 's/^\(..\).*/\1/'` + case $PREFIX in + -L) + CLIBDIR=`echo $PARAM | sed -e 's/^-L//'` + LIBDIRS="$LIBDIRS $CLIBDIR" + ;; + -l) + CLIBNAME=`echo $PARAM | sed -e 's/^-l//'` + LIBNAMES="$LIBNAMES lib${CLIBNAME}.*" + ;; + -I) + CINCDIR=`echo $PARAM | sed -e 's/^-I//'` + INCLUDEDIRS="$INCLUDEDIRS $CINCDIR" + ;; + *) + INCLUDES="$PARAM $INCLUDES" + ;; + esac +done + +# debuggery + +if [ "$VERBOSE" = "yes" ] +then + echo "$MODULE_NAME auto-detection..." +# echo "searching for $LIBNAMES in $LIBDIRS" +# echo "and $INCLUDES in $INCLUDEDIRS" +fi + + +# check for lib +for LIBNAME in $LIBNAMES +do + SUCCESS="" + for LIBDIR in $LIBDIRS + do + FOUND_LIB=`ls $LIBDIR/$LIBNAME 2>/dev/null` + if [ ! -z "$FOUND_LIB" ] + then + SUCCESS=yes + if [ "$VERBOSE" = "yes" ] + then + echo " Found $LIBNAME in $LIBDIR" + fi + break + fi + done + if [ -z "$SUCCESS" ] + then + SUCCESS=no + if [ "$VERBOSE" = "yes" ] + then + echo " Could not find $LIBNAME anywhere in $LIBDIRS" + fi + break + fi +done + +# check for includes +if [ "$SUCCESS" = "yes" ] +then + for INCLUDE in $INCLUDES + do + SUCCESS="" + for INCLUDEDIR in $INCLUDEDIRS + do + FOUND_INC=`ls $INCLUDEDIR/$INCLUDE 2>/dev/null` + if [ ! -z "$FOUND_INC" ] + then + SUCCESS=yes + if [ "$VERBOSE" = "yes" ] + then + echo " Found $INCLUDE in $INCLUDEDIR" + fi + break + fi + done + if [ -z "$SUCCESS" ] + then + SUCCESS=no + if [ "$VERBOSE" = "yes" ] + then + echo " Could not find $INCLUDE anywhere in $INCLUDEDIRS" + fi + break + fi + done +fi + +if [ "$SUCCESS" != "yes" ] +then + if [ "$VERBOSE" = "yes" ] + then + echo "$MODULE_NAME disabled." + fi + exit 1 +else + if [ "$VERBOSE" = "yes" ] + then + echo "$MODULE_NAME enabled." + fi + exit 0 +fi +exit 1 + diff --git a/config.tests/unix/cups.test b/config.tests/unix/cups.test new file mode 100755 index 0000000..0b97e2b --- /dev/null +++ b/config.tests/unix/cups.test @@ -0,0 +1,82 @@ +#!/bin/sh + +CUPS=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 "CUPS auto-detection... ($*)" + +# check for the CUPS library +LIBS=cups +LIBDIRS="$IN_LIBDIRS /usr/shlib /usr/lib /lib" +if [ -z "$LIBS" ]; then + CUPS=no + [ "$VERBOSE" = "yes" ] && echo " No CUPS 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 + CUPS=no + [ "VERBOSE" = "yes" ] && echo " Could not find CUPS lib anywhere in $LIBDIRS" + fi + done +fi + +# check for cups/cups.h +if [ "$CUPS" = "yes" ] +then + INCS="cups/cups.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 + CUPS=no + [ "$VERBOSE" = "yes" ] && echo " Could not find $I anywhere in $INCDIRS" + fi + done +fi + +# done +if [ "$CUPS" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "CUPS disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "CUPS enabled." + exit 1 +fi diff --git a/config.tests/unix/endian.test b/config.tests/unix/endian.test new file mode 100755 index 0000000..9f5c566 --- /dev/null +++ b/config.tests/unix/endian.test @@ -0,0 +1,30 @@ +#!/bin/sh + +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Determining machine byte-order... ($*)" + +# build and run a test program +test -d $OUTDIR/config.tests/unix/endian || mkdir -p $OUTDIR/config.tests/unix/endian +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/endian/endiantest.pro -o $OUTDIR/config.tests/unix/endian/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/endian + +if [ "$VERBOSE" = "yes" ]; then + (make && ./endiantest) +else + (make && ./endiantest) >/dev/null 2>&1 +fi +ENDIAN=$? + +# done +if [ "$ENDIAN" -eq 0 ]; then + [ "$VERBOSE" = "yes" ] && echo "Using big endian." + exit 1 +else + [ "$VERBOSE" = "yes" ] && echo "Using little endian." + exit 0 +fi diff --git a/config.tests/unix/endian/endiantest.cpp b/config.tests/unix/endian/endiantest.cpp new file mode 100644 index 0000000..d4133cd --- /dev/null +++ b/config.tests/unix/endian/endiantest.cpp @@ -0,0 +1,8 @@ +int main(int, char **) +{ + unsigned char bytes[] = { 0x01, 0x02, 0x03, 0x04 }; + unsigned int *integer = (unsigned int *) bytes; + return (*integer == 0x01020304 ? + 0 : // big endian + 1); // little endian +} diff --git a/config.tests/unix/endian/endiantest.pro b/config.tests/unix/endian/endiantest.pro new file mode 100644 index 0000000..ab8c008 --- /dev/null +++ b/config.tests/unix/endian/endiantest.pro @@ -0,0 +1,5 @@ +TARGET=endiantest +CONFIG-=qt opengl x11sm dylib +CONFIG+=console +TEMPLATE=app +SOURCES=endiantest.cpp diff --git a/config.tests/unix/ipv6.test b/config.tests/unix/ipv6.test new file mode 100755 index 0000000..5df87d6 --- /dev/null +++ b/config.tests/unix/ipv6.test @@ -0,0 +1,31 @@ +#!/bin/sh + +IPV6=0 +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Testing IPv6 support..." + +# build a test program +test -d $OUTDIR/config.tests/unix/ipv6 || mkdir -p $OUTDIR/config.tests/unix/ipv6 +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/ipv6/ipv6test.pro -o $OUTDIR/config.tests/unix/ipv6/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/ipv6 + +if [ "$VERBOSE" = "yes" ]; then + (make && ./ipv6test) +else + (make && ./ipv6test) >/dev/null 2>&1 +fi +IPV6=$? + +# done +if [ "$IPV6" -ne 0 ]; then + [ "$VERBOSE" = "yes" ] && echo "IPv6 support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "IPv6 support enabled." + exit 1 +fi diff --git a/config.tests/unix/ipv6/ipv6test.cpp b/config.tests/unix/ipv6/ipv6test.cpp new file mode 100644 index 0000000..4700ae6 --- /dev/null +++ b/config.tests/unix/ipv6/ipv6test.cpp @@ -0,0 +1,20 @@ +/* Sample program for configure to test IPv6 support on target +platforms. We check for the required IPv6 data structures. */ + +#if defined(__hpux) +#define _HPUX_SOURCE +#endif + +#include +#include +#include + +int main() +{ + sockaddr_in6 tmp; + sockaddr_storage tmp2; + (void)tmp; + (void)tmp2; + + return 0; +} diff --git a/config.tests/unix/ipv6/ipv6test.pro b/config.tests/unix/ipv6/ipv6test.pro new file mode 100644 index 0000000..ec4e875 --- /dev/null +++ b/config.tests/unix/ipv6/ipv6test.pro @@ -0,0 +1,5 @@ +TARGET=ipv6test +CONFIG += console +CONFIG-=qt opengl x11sm dylib +TEMPLATE=app +SOURCES=ipv6test.cpp diff --git a/config.tests/unix/largefile.test b/config.tests/unix/largefile.test new file mode 100755 index 0000000..f8cde73 --- /dev/null +++ b/config.tests/unix/largefile.test @@ -0,0 +1,31 @@ +#!/bin/sh + +LARGEFILE=0 +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Testing Large File support... ($*)" + +# build and run a test program +test -d $OUTDIR/config.tests/unix/largefile || mkdir -p $OUTDIR/config.tests/unix/largefile +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/largefile/largefiletest.pro -o $OUTDIR/config.tests/unix/largefile/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/largefile + +if [ "$VERBOSE" = "yes" ]; then + (make && ./largefiletest) +else + (make && ./largefiletest) >/dev/null 2>&1 +fi +LARGEFILE=$? + +# done +if [ "$LARGEFILE" -ne 0 ]; then + [ "$VERBOSE" = "yes" ] && echo "Large File support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Large File support enabled." + exit 1 +fi diff --git a/config.tests/unix/largefile/largefiletest.cpp b/config.tests/unix/largefile/largefiletest.cpp new file mode 100644 index 0000000..ed04e7a --- /dev/null +++ b/config.tests/unix/largefile/largefiletest.cpp @@ -0,0 +1,32 @@ +/* Sample program for configure to test Large File support on target +platforms. +*/ + +#define _LARGEFILE_SOURCE +#define _LARGE_FILES +#define _FILE_OFFSET_BITS 64 +#include +#include +#include +#include +#include + +int main( int, char **argv ) +{ +// check that off_t can hold 2^63 - 1 and perform basic operations... +#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + if (OFF_T_64 % 2147483647 != 1) + return 1; + + // stat breaks on SCO OpenServer + struct stat buf; + stat( argv[0], &buf ); + if (!S_ISREG(buf.st_mode)) + return 2; + + FILE *file = fopen( argv[0], "r" ); + off_t offset = ftello( file ); + fseek( file, offset, SEEK_CUR ); + fclose( file ); + return 0; +} diff --git a/config.tests/unix/largefile/largefiletest.pro b/config.tests/unix/largefile/largefiletest.pro new file mode 100644 index 0000000..918e8cc --- /dev/null +++ b/config.tests/unix/largefile/largefiletest.pro @@ -0,0 +1,5 @@ +TARGET=largefiletest +CONFIG-=qt opengl x11sm dylib +CONFIG+=console +TEMPLATE=app +SOURCES=largefiletest.cpp diff --git a/config.tests/unix/nis.test b/config.tests/unix/nis.test new file mode 100755 index 0000000..2dc4c5a --- /dev/null +++ b/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 find 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 find $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 diff --git a/config.tests/unix/precomp.test b/config.tests/unix/precomp.test new file mode 100755 index 0000000..1a553d3 --- /dev/null +++ b/config.tests/unix/precomp.test @@ -0,0 +1,22 @@ +#!/bin/sh + +PRECOMP_SUPPORT=no +XPLATFORM=`basename $1` +XCONFIG=$1/qmake.conf +VERBOSE=$2 + +>precomp_header.h +COMPILER=`grep QMAKE_CC $XCONFIG | sed "s,.*= *,,"` +if $COMPILER -x c-header precomp_header.h >/dev/null 2>&1; then + $COMPILER -x c++-header precomp_header.h && PRECOMP_SUPPORT=yes +fi +rm -f precomp_header.h precomp_header.h.gch + +# done +if [ "$PRECOMP_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support enabled." + exit 1 +fi diff --git a/config.tests/unix/ptrsize.test b/config.tests/unix/ptrsize.test new file mode 100755 index 0000000..0d0337d --- /dev/null +++ b/config.tests/unix/ptrsize.test @@ -0,0 +1,26 @@ +#/bin/sh + +LARGEFILE=0 +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Testing size of pointers ... ($*)" + +# build and run a test program +test -d $OUTDIR/config.tests/unix/ptrsize || mkdir -p $OUTDIR/config.tests/unix/ptrsize +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/ptrsize/ptrsizetest.pro -o $OUTDIR/config.tests/unix/ptrsize/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/ptrsize + +if [ "$VERBOSE" = "yes" ]; then + (make clean && make && ./ptrsizetest) +else + (make clean && make && ./ptrsizetest) >/dev/null 2>&1 +fi +PTRSIZE=$? + +# done +[ "$VERBOSE" = "yes" ] && echo "Pointersize: $PTRSIZE" +exit $PTRSIZE diff --git a/config.tests/unix/ptrsize/ptrsizetest.cpp b/config.tests/unix/ptrsize/ptrsizetest.cpp new file mode 100644 index 0000000..f2de943 --- /dev/null +++ b/config.tests/unix/ptrsize/ptrsizetest.cpp @@ -0,0 +1,9 @@ +/* Sample program for configure to test pointer size on target +platforms. +*/ + +int main( int, char ** ) +{ + return sizeof(void *); +} + diff --git a/config.tests/unix/ptrsize/ptrsizetest.pro b/config.tests/unix/ptrsize/ptrsizetest.pro new file mode 100644 index 0000000..dfff44f --- /dev/null +++ b/config.tests/unix/ptrsize/ptrsizetest.pro @@ -0,0 +1,5 @@ +TARGET=ptrsizetest +CONFIG-=qt opengl x11sm dylib +CONFIG+=console +TEMPLATE=app +SOURCES=ptrsizetest.cpp diff --git a/config.tests/unix/stl.test b/config.tests/unix/stl.test new file mode 100755 index 0000000..90c1925 --- /dev/null +++ b/config.tests/unix/stl.test @@ -0,0 +1,31 @@ +#!/bin/sh + +STL=0 +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Testing STL support..." + +# build a test program +test -d $OUTDIR/config.tests/unix/stl || mkdir -p $OUTDIR/config.tests/unix/stl +$OUTDIR/bin/qmake -nocache -spec "$QMKSPEC" $SRCDIR/config.tests/unix/stl/stltest.pro -o $OUTDIR/config.tests/unix/stl/Makefile >/dev/null 2>&1 +cd $OUTDIR/config.tests/unix/stl + +if [ "$VERBOSE" = "yes" ]; then + (make && ./stltest) +else + (make && ./stltest) >/dev/null 2>&1 +fi +STL=$? + +# done +if [ "$STL" -ne 0 ]; then + [ "$VERBOSE" = "yes" ] && echo "STL support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "STL support enabled." + exit 1 +fi diff --git a/config.tests/unix/stl/stltest.cpp b/config.tests/unix/stl/stltest.cpp new file mode 100644 index 0000000..979d5c4 --- /dev/null +++ b/config.tests/unix/stl/stltest.cpp @@ -0,0 +1,83 @@ +/* Sample program for configure to test STL support on target +platforms. We are mainly concerned with being able to instantiate +templates for common STL container classes. +*/ + +#include +#include +#include +#include +#include + +int main() +{ + int rval = 0; + + std::vector v1; + v1.push_back( 0 ); + v1.push_back( 1 ); + v1.push_back( 2 ); + v1.push_back( 3 ); + v1.push_back( 4 ); + if ( v1.size() != 5 ) { + std::cout << "stltest: vector failed size check, expected 5, got " << v1.size(); + ++rval; + } + if ( v1.capacity() < 5 ) { + std::cout << "stltest: vector failed capacity check, expected >= 5, got " << v1.capacity(); + ++rval; + } + std::vector::iterator v1it = std::find( v1.begin(), v1.end(), 99 ); + if ( v1it != v1.end() ) { + std::cout << "stltest: find failed, expected end(), got " << *v1it; + ++rval; + } + v1it = std::find( v1.begin(), v1.end(), 3 ); + if ( v1it == v1.end() ) { + std::cout << "stltest: find failed, expected to find element, got end()"; + ++rval; + } + std::vector v2; + std::copy( v1.begin(), v1it, std::back_inserter( v2 ) ); + if ( v2.size() != 3 ) { + std::cout << "stltest: copy failed, expected 3 elements, got " << v2.size(); + ++rval; + } + + std::map m1; + m1.insert( std::make_pair( 1, 2.0 ) ); + m1.insert( std::make_pair( 3, 2.0 ) ); + m1.insert( std::make_pair( 5, 2.0 ) ); + m1.insert( std::make_pair( 7, 2.0 ) ); + if ( m1.size() != 4 ) { + std::cout << "stltest: map failed size check, expected 4, got " << m1.size(); + ++rval; + } + std::map::iterator m1it = m1.begin(); + for ( ; m1it != m1.end(); ++m1it ) { + if ( (*m1it).second != 2 ) { + std::cout << "stltest: iterator failed, expected 2, got " << (*m1it).second; + ++rval; + } + } + std::map< int, double > m2( m1 ); + if ( m2.size() != m1.size() ) { + std::cout << "stltest: map copy failed, expected " << m1.size() << " elements, got " << m2.size(); + ++rval; + } + + return rval; +} + + +// something mean to see if the compiler and C++ standard lib are good enough +template +class DummyClass +{ + // everything in std namespace ? + typedef std::bidirectional_iterator_tag i; + typedef std::ptrdiff_t d; + // typename implemented ? + typedef typename std::map::iterator MyIterator; +}; + diff --git a/config.tests/unix/stl/stltest.pro b/config.tests/unix/stl/stltest.pro new file mode 100644 index 0000000..e40708a --- /dev/null +++ b/config.tests/unix/stl/stltest.pro @@ -0,0 +1,5 @@ +TARGET=stltest +CONFIG+=console +CONFIG-=qt opengl x11sm dylib +TEMPLATE=app +SOURCES=stltest.cpp diff --git a/config.tests/unix/which.test b/config.tests/unix/which.test new file mode 100755 index 0000000..37c858c --- /dev/null +++ b/config.tests/unix/which.test @@ -0,0 +1,39 @@ +#!/bin/sh + +HOME=/dev/null +export HOME + +unset which + +WHICH=`which which 2>/dev/null` +if echo $WHICH | grep 'shell built-in command' >/dev/null 2>&1; then + WHICH=which +elif [ -z "$WHICH" ]; then + if which which >/dev/null 2>&1; then + WHICH=which + else + for a in /usr/ucb /usr/bin /bin /usr/local/bin; do + if [ -x $a/which ]; then + WHICH=$a/which + break; + fi + done + fi +fi + +if [ -z "$WHICH" ]; then + IFS=: + for a in $PATH; do + if [ -x $a/$1 ]; then + echo "$a/$1" + exit 0 + fi + done +else + a=`"$WHICH" "$1" 2>/dev/null` + if [ ! -z "$a" -a -x "$a" ]; then + echo "$a" + exit 0 + fi +fi +exit 1 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 +#include + +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 -- cgit v1.2.1