diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-03-23 10:18:55 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-23 10:18:55 +0100 |
commit | e5fcad302d86d316390c6b0f62759a067313e8a9 (patch) | |
tree | c2afbf6f1066b6ce261f14341cf6d310e5595bc1 /config.tests | |
download | qt4-tools-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.gz |
Long live Qt 4.5!
Diffstat (limited to 'config.tests')
153 files changed, 2006 insertions, 0 deletions
diff --git a/config.tests/mac/crc.test b/config.tests/mac/crc.test new file mode 100755 index 0000000000..1a16204a0d --- /dev/null +++ b/config.tests/mac/crc.test @@ -0,0 +1,71 @@ +#!/bin/sh + +SUCCESS=no +QMKSPEC=$1 +XPLATFORM=`basename "$1"` +QMAKE_CONFIG=$2 +VERBOSE=$3 +SRCDIR=$4 +OUTDIR=$5 +TEST=$6 +EXE=`basename "$6"` +ARG=$7 +shift 7 +LFLAGS="" +INCLUDEPATH="" +CXXFLAGS="" +while [ "$#" -gt 0 ]; do + PARAM=$1 + case $PARAM in + -framework) + LFLAGS="$LFLAGS -framework \"$2\"" + shift + ;; + -F*|-m*|-x*) + LFLAGS="$LFLAGS $PARAM" + CXXFLAGS="$CXXFLAGS $PARAM" + ;; + -L*|-l*|-pthread) + LFLAGS="$LFLAGS $PARAM" + ;; + -I*) + INC=`echo $PARAM | sed -e 's/^-I//'` + INCLUDEPATH="$INCLUDEPATH $INC" + ;; + -f*|-D*) + CXXFLAGS="$CXXFLAGS $PARAM" + ;; + -Qoption) + # Two-argument form for the Sun Compiler + CXXFLAGS="$CXXFLAGS $PARAM \"$2\"" + shift + ;; + *) ;; + esac + shift +done + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION auto-detection... ($*)" + +test -d "$OUTDIR/$TEST" || mkdir -p "$OUTDIR/$TEST" + +cd "$OUTDIR/$TEST" + +make distclean >/dev/null 2>&1 +"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" + +if [ "$VERBOSE" = "yes" ]; then + make +else + make >/dev/null 2>&1 +fi + + +if [ -x "$EXE" ]; then + foo=`$OUTDIR/$TEST/$EXE $ARG` + echo "$foo" +else + echo "'CUTE'" #1129665605 # == 'CUTE' +fi + diff --git a/config.tests/mac/crc/crc.pro b/config.tests/mac/crc/crc.pro new file mode 100644 index 0000000000..c3abf15759 --- /dev/null +++ b/config.tests/mac/crc/crc.pro @@ -0,0 +1,2 @@ +SOURCES = main.cpp +CONFIG -= app_bundle qt diff --git a/config.tests/mac/crc/main.cpp b/config.tests/mac/crc/main.cpp new file mode 100644 index 0000000000..2ac10b38d5 --- /dev/null +++ b/config.tests/mac/crc/main.cpp @@ -0,0 +1,67 @@ +#include <iostream> +#include <cstdlib> +#include <cstring> + + +class CCRC32 +{ +public: + CCRC32() { initialize(); } + + unsigned long FullCRC(const unsigned char *sData, unsigned long ulDataLength) + { + unsigned long ulCRC = 0xffffffff; + PartialCRC(&ulCRC, sData, ulDataLength); + return(ulCRC ^ 0xffffffff); + } + + void PartialCRC(unsigned long *ulCRC, const unsigned char *sData, unsigned long ulDataLength) + { + while(ulDataLength--) { + *ulCRC = (*ulCRC >> 8) ^ ulTable[(*ulCRC & 0xFF) ^ *sData++]; + } + } + +private: + void initialize(void) + { + unsigned long ulPolynomial = 0x04C11DB7; + memset(&ulTable, 0, sizeof(ulTable)); + for(int iCodes = 0; iCodes <= 0xFF; iCodes++) { + ulTable[iCodes] = Reflect(iCodes, 8) << 24; + for(int iPos = 0; iPos < 8; iPos++) { + ulTable[iCodes] = (ulTable[iCodes] << 1) + ^ ((ulTable[iCodes] & (1 << 31)) ? ulPolynomial : 0); + } + + ulTable[iCodes] = Reflect(ulTable[iCodes], 32); + } + } + unsigned long Reflect(unsigned long ulReflect, const char cChar) + { + unsigned long ulValue = 0; + // Swap bit 0 for bit 7, bit 1 For bit 6, etc.... + for(int iPos = 1; iPos < (cChar + 1); iPos++) { + if(ulReflect & 1) { + ulValue |= (1 << (cChar - iPos)); + } + ulReflect >>= 1; + } + return ulValue; + } + unsigned long ulTable[256]; // CRC lookup table array. +}; + + +int main(int argc, char **argv) +{ + CCRC32 crc; + char *name; + if (argc < 2) { + std::cerr << "usage: crc <string>\n"; + return 0; + } else { + name = argv[1]; + } + std::cout << crc.FullCRC((unsigned char *)name, strlen(name)) << std::endl; +} diff --git a/config.tests/mac/defaultarch.test b/config.tests/mac/defaultarch.test new file mode 100755 index 0000000000..4502af7a77 --- /dev/null +++ b/config.tests/mac/defaultarch.test @@ -0,0 +1,33 @@ +#!/bin/sh + +COMPILER=$1 +VERBOSE=$2 +WORKDIR=$3 +QT_MAC_DEFUALT_ARCH= + +touch defaultarch.c + +# compile something and run 'file' on it. +if "$COMPILER" -c defaultarch.c 2>/dev/null 1>&2; then + FIlE_OUTPUT=`file defaultarch.o` + [ "$VERBOSE" = "yes" ] && echo "'file' reports compiler ($COMPILER) default architechture as: $FIlE_OUTPUT" + +fi +rm -f defaultarch.c defaultarch.o + +# detect our known archs. +if echo "$FIlE_OUTPUT" | grep '\<i386\>' > /dev/null 2>&1; then + QT_MAC_DEFUALT_ARCH=x86 # configure knows it as "x86" not "i386" +fi +if echo "$FIlE_OUTPUT" | grep '\<x86_64\>' > /dev/null 2>&1; then + QT_MAC_DEFUALT_ARCH=x86_64 +fi +if echo "$FIlE_OUTPUT" | grep '\<ppc\>' > /dev/null 2>&1; then + QT_MAC_DEFUALT_ARCH=ppc +fi +if echo "$FIlE_OUTPUT" | grep '\<ppc64\>' > /dev/null 2>&1; then + QT_MAC_DEFUALT_ARCH=ppc64 +fi + +[ "$VERBOSE" = "yes" ] && echo "setting QT_MAC_DEFUALT_ARCH to \"$QT_MAC_DEFUALT_ARCH\"" +export QT_MAC_DEFUALT_ARCH diff --git a/config.tests/mac/dwarf2.test b/config.tests/mac/dwarf2.test new file mode 100755 index 0000000000..a640b113de --- /dev/null +++ b/config.tests/mac/dwarf2.test @@ -0,0 +1,42 @@ +#!/bin/sh + +DWARF2_SUPPORT=no +DWARF2_SUPPORT_BROKEN=no +COMPILER=$1 +VERBOSE=$2 +WORKDIR=$3 + +touch dwarf2.c + +if "$COMPILER" -c dwarf2.c -Werror -gdwarf-2 2>/dev/null 1>&2; then + if "$COMPILER" -c dwarf2.c -Werror -gdwarf-2 2>&1 | grep "unsupported" >/dev/null ; then + true + else + DWARF2_SUPPORT=yes + fi +fi +rm -f dwarf2.c dwarf2.o + +# Test for xcode 2.4.0, which has a broken implementation of DWARF +"$COMPILER" $WORKDIR/xcodeversion.cpp -o xcodeversion -framework Carbon; +./xcodeversion + +if [ "$?" == "1" ]; then + DWARF2_SUPPORT_BROKEN=yes +fi + +rm xcodeversion + +# done +if [ "$DWARF2_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "DWARF2 debug symbols disabled." + exit 0 +else + if [ "$DWARF2_SUPPORT_BROKEN" == "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "DWARF2 debug symbols disabled." + exit 0 + else + [ "$VERBOSE" = "yes" ] && echo "DWARF2 debug symbols enabled." + exit 1 + fi +fi diff --git a/config.tests/mac/xarch.test b/config.tests/mac/xarch.test new file mode 100755 index 0000000000..08322a96cf --- /dev/null +++ b/config.tests/mac/xarch.test @@ -0,0 +1,26 @@ +#!/bin/sh + +XARCH_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 +WORKDIR=$3 + +touch xarch.c + +if "$COMPILER" -c xarch.c -Xarch_i386 -mmmx 2>/dev/null 1>&2; then + if "$COMPILER" -c xarch.c -Xarch_i386 -mmmx 2>&1 | grep "unrecognized" >/dev/null ; then + true + else + XARCH_SUPPORT=yes + fi +fi +rm -f xarch.c xarch.o + +# done +if [ "$XARCH_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "Xarch is not supported" + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Xarch support detected" + exit 1 +fi diff --git a/config.tests/mac/xcodeversion.cpp b/config.tests/mac/xcodeversion.cpp new file mode 100644 index 0000000000..e613cc5927 --- /dev/null +++ b/config.tests/mac/xcodeversion.cpp @@ -0,0 +1,58 @@ +#include <stdlib.h> +#include <stdio.h> +#include <CoreFoundation/CoreFoundation.h> +#include <Carbon/Carbon.h> + +int success = 0; +int fail = 1; +int internal_error = success; // enable dwarf on internal errors + +int main(int argc, const char **argv) +{ + CFURLRef cfurl; + OSStatus err = LSFindApplicationForInfo(0, CFSTR("com.apple.Xcode"), 0, 0, &cfurl); + if (err != noErr) + return internal_error; + + CFBundleRef bundle = CFBundleCreate(0, cfurl); + if (bundle == 0) + return internal_error; + + CFStringRef str = CFStringRef(CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("CFBundleShortVersionString"))); + const char * ptr = CFStringGetCStringPtr(str, 0); + if (ptr == 0) + return internal_error; + + // self-test + const char * fail1 = "2.4"; + const char * fail2 = "2.4.0"; + const char * fail3 ="2.3"; + const char * ok1 = "2.4.1"; + const char * ok2 ="2.5"; + const char * ok3 ="3.0"; +// ptr = fail1; +// printf ("string: %s\n", ptr); + + int length = strlen(ptr); + if (length < 3) // expect "x.y" at least + return internal_error; + + // fail on 2.4 and below (2.4.1 is ok) + + if (ptr[0] < '2') + return fail; + + if (ptr[0] >= '3') + return success; + + if (ptr[2] < '4') + return fail; + + if (length < 5) + return fail; + + if (ptr[4] < '1') + return fail; + + return success; +}
\ No newline at end of file diff --git a/config.tests/qws/ahi/ahi.cpp b/config.tests/qws/ahi/ahi.cpp new file mode 100644 index 0000000000..a5e89515e1 --- /dev/null +++ b/config.tests/qws/ahi/ahi.cpp @@ -0,0 +1,9 @@ +#include <ahi.h> + +int main(int, char **) +{ + AhiInit(0); + AhiTerm(); + + return 0; +} diff --git a/config.tests/qws/ahi/ahi.pro b/config.tests/qws/ahi/ahi.pro new file mode 100644 index 0000000000..532a565bc4 --- /dev/null +++ b/config.tests/qws/ahi/ahi.pro @@ -0,0 +1,3 @@ +SOURCES = ahi.cpp +CONFIG -= qt +LIBS += -lahi -lahioem diff --git a/config.tests/qws/directfb/directfb.cpp b/config.tests/qws/directfb/directfb.cpp new file mode 100644 index 0000000000..f743864bb2 --- /dev/null +++ b/config.tests/qws/directfb/directfb.cpp @@ -0,0 +1,9 @@ +#include <directfb.h> + +int main(int, char **) +{ + DFBResult result = DFB_OK; + result = DirectFBInit(0, 0); + + return (result == DFB_OK); +} diff --git a/config.tests/qws/directfb/directfb.pro b/config.tests/qws/directfb/directfb.pro new file mode 100644 index 0000000000..db14d3ba48 --- /dev/null +++ b/config.tests/qws/directfb/directfb.pro @@ -0,0 +1,5 @@ +SOURCES = directfb.cpp +CONFIG -= qt + +QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB +LIBS += $$QT_LIBS_DIRECTFB diff --git a/config.tests/qws/sound/sound.cpp b/config.tests/qws/sound/sound.cpp new file mode 100644 index 0000000000..be412bb245 --- /dev/null +++ b/config.tests/qws/sound/sound.cpp @@ -0,0 +1,8 @@ +#include <sys/soundcard.h> + +int main(int, char **) +{ + audio_buf_info info; + + return 0; +} diff --git a/config.tests/qws/sound/sound.pro b/config.tests/qws/sound/sound.pro new file mode 100644 index 0000000000..4ad3376dca --- /dev/null +++ b/config.tests/qws/sound/sound.pro @@ -0,0 +1,2 @@ +SOURCES = sound.cpp +CONFIG -= qt diff --git a/config.tests/qws/svgalib/svgalib.cpp b/config.tests/qws/svgalib/svgalib.cpp new file mode 100644 index 0000000000..f4bf9c8bd5 --- /dev/null +++ b/config.tests/qws/svgalib/svgalib.cpp @@ -0,0 +1,10 @@ +#include <vga.h> +#include <vgagl.h> + +int main(int, char **) +{ + int mode = vga_getdefaultmode(); + gl_setcontextvga(mode); + + return 0; +} diff --git a/config.tests/qws/svgalib/svgalib.pro b/config.tests/qws/svgalib/svgalib.pro new file mode 100644 index 0000000000..169065239b --- /dev/null +++ b/config.tests/qws/svgalib/svgalib.pro @@ -0,0 +1,3 @@ +SOURCES = svgalib.cpp +CONFIG -= qt +LIBS += -lvgagl -lvga diff --git a/config.tests/unix/3dnow/3dnow.cpp b/config.tests/unix/3dnow/3dnow.cpp new file mode 100644 index 0000000000..1b1d0ed74a --- /dev/null +++ b/config.tests/unix/3dnow/3dnow.cpp @@ -0,0 +1,10 @@ +#include <mm3dnow.h> +#if defined(__GNUC__) && __GNUC__ < 4 && __GNUC_MINOR__ < 3 +#error GCC < 3.2 is known to create internal compiler errors with our MMX code +#endif + +int main(int, char**) +{ + _m_femms(); + return 0; +} diff --git a/config.tests/unix/3dnow/3dnow.pro b/config.tests/unix/3dnow/3dnow.pro new file mode 100644 index 0000000000..90a8a191dc --- /dev/null +++ b/config.tests/unix/3dnow/3dnow.pro @@ -0,0 +1,3 @@ +SOURCES = 3dnow.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/bsymbolic_functions.test b/config.tests/unix/bsymbolic_functions.test new file mode 100755 index 0000000000..52fdb32d54 --- /dev/null +++ b/config.tests/unix/bsymbolic_functions.test @@ -0,0 +1,21 @@ +#!/bin/sh + +BSYMBOLIC_FUNCTIONS_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 + +cat >>bsymbolic_functions.c << EOF +int main() { return 0; } +EOF + +"$COMPILER" -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes +rm -f bsymbolic_functions.c libtest.so + +# done +if [ "$BSYMBOLIC_FUNCTIONS_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding enabled." + exit 1 +fi diff --git a/config.tests/unix/clock-gettime/clock-gettime.cpp b/config.tests/unix/clock-gettime/clock-gettime.cpp new file mode 100644 index 0000000000..edb71f524d --- /dev/null +++ b/config.tests/unix/clock-gettime/clock-gettime.cpp @@ -0,0 +1,16 @@ +#include <unistd.h> +#include <time.h> + +int main(int, char **) +{ +#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) + timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); +#else +# error "Feature _POSIX_TIMERS not available" + // MIPSpro doesn't understand #error, so force a compiler error + force_compiler_error = true; +#endif + return 0; +} + diff --git a/config.tests/unix/clock-gettime/clock-gettime.pri b/config.tests/unix/clock-gettime/clock-gettime.pri new file mode 100644 index 0000000000..2a6160bf63 --- /dev/null +++ b/config.tests/unix/clock-gettime/clock-gettime.pri @@ -0,0 +1,2 @@ +# clock_gettime() is implemented in librt on these systems +linux-*|hpux-*|solaris-*:LIBS *= -lrt diff --git a/config.tests/unix/clock-gettime/clock-gettime.pro b/config.tests/unix/clock-gettime/clock-gettime.pro new file mode 100644 index 0000000000..c527535183 --- /dev/null +++ b/config.tests/unix/clock-gettime/clock-gettime.pro @@ -0,0 +1,4 @@ +SOURCES = clock-gettime.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +include(clock-gettime.pri) diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.cpp b/config.tests/unix/clock-monotonic/clock-monotonic.cpp new file mode 100644 index 0000000000..df9996368d --- /dev/null +++ b/config.tests/unix/clock-monotonic/clock-monotonic.cpp @@ -0,0 +1,16 @@ +#include <unistd.h> +#include <time.h> + +int main(int, char **) +{ +#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0) + timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); +#else +# error "Feature _POSIX_MONOTONIC_CLOCK not available" + // MIPSpro doesn't understand #error, so force a compiler error + force_compiler_error = true; +#endif + return 0; +} + diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.pro b/config.tests/unix/clock-monotonic/clock-monotonic.pro new file mode 100644 index 0000000000..961e3a848d --- /dev/null +++ b/config.tests/unix/clock-monotonic/clock-monotonic.pro @@ -0,0 +1,4 @@ +SOURCES = clock-monotonic.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +include(../clock-gettime/clock-gettime.pri) diff --git a/config.tests/unix/compile.test b/config.tests/unix/compile.test new file mode 100755 index 0000000000..b5afa1853f --- /dev/null +++ b/config.tests/unix/compile.test @@ -0,0 +1,73 @@ +#!/bin/sh + +SUCCESS=no +QMKSPEC=$1 +XPLATFORM=`basename "$1"` +QMAKE_CONFIG=$2 +VERBOSE=$3 +SRCDIR=$4 +OUTDIR=$5 +TEST=$6 +EXE=`basename "$6"` +DESCRIPTION=$7 +shift 7 +LFLAGS="" +INCLUDEPATH="" +CXXFLAGS="" +while [ "$#" -gt 0 ]; do + PARAM=$1 + case $PARAM in + -framework) + LFLAGS="$LFLAGS -framework \"$2\"" + shift + ;; + -F*|-m*|-x*) + LFLAGS="$LFLAGS $PARAM" + CXXFLAGS="$CXXFLAGS $PARAM" + ;; + -L*|-l*|-pthread) + LFLAGS="$LFLAGS $PARAM" + ;; + -I*) + INC=`echo $PARAM | sed -e 's/^-I//'` + INCLUDEPATH="$INCLUDEPATH $INC" + ;; + -f*|-D*) + CXXFLAGS="$CXXFLAGS $PARAM" + ;; + -Qoption) + # Two-argument form for the Sun Compiler + CXXFLAGS="$CXXFLAGS $PARAM \"$2\"" + shift + ;; + *) ;; + esac + shift +done + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION auto-detection... ($*)" + +test -d "$OUTDIR/$TEST" || mkdir -p "$OUTDIR/$TEST" + +cd "$OUTDIR/$TEST" + +make distclean >/dev/null 2>&1 +"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" + +if [ "$VERBOSE" = "yes" ]; then + make +else + make >/dev/null 2>&1 +fi + +[ -x "$EXE" ] && SUCCESS=yes + +# done +if [ "$SUCCESS" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION disabled." + exit 1 +else + [ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION enabled." + exit 0 +fi diff --git a/config.tests/unix/cups/cups.cpp b/config.tests/unix/cups/cups.cpp new file mode 100644 index 0000000000..e8c17eaeaf --- /dev/null +++ b/config.tests/unix/cups/cups.cpp @@ -0,0 +1,8 @@ +#include <cups/cups.h> + +int main(int, char **) +{ + cups_dest_t *d; + cupsGetDests(&d); + return 0; +} diff --git a/config.tests/unix/cups/cups.pro b/config.tests/unix/cups/cups.pro new file mode 100644 index 0000000000..d7b78c877f --- /dev/null +++ b/config.tests/unix/cups/cups.pro @@ -0,0 +1,4 @@ +SOURCES = cups.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lcups diff --git a/config.tests/unix/db2/db2.cpp b/config.tests/unix/db2/db2.cpp new file mode 100644 index 0000000000..e408d280a6 --- /dev/null +++ b/config.tests/unix/db2/db2.cpp @@ -0,0 +1,7 @@ +#include <sqlcli.h> +#include <sqlcli1.h> + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/unix/db2/db2.pro b/config.tests/unix/db2/db2.pro new file mode 100644 index 0000000000..0fa39a8242 --- /dev/null +++ b/config.tests/unix/db2/db2.pro @@ -0,0 +1,4 @@ +SOURCES = db2.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -ldb2 diff --git a/config.tests/unix/dbus/dbus.cpp b/config.tests/unix/dbus/dbus.cpp new file mode 100644 index 0000000000..15ed45fcd8 --- /dev/null +++ b/config.tests/unix/dbus/dbus.cpp @@ -0,0 +1,12 @@ +#define DBUS_API_SUBJECT_TO_CHANGE +#include <dbus/dbus.h> + +#if DBUS_MAJOR_PROTOCOL_VERSION < 1 +#error Needs at least dbus version 1 +#endif + +int main(int, char **) +{ + dbus_shutdown(); + return 0; +} diff --git a/config.tests/unix/dbus/dbus.pro b/config.tests/unix/dbus/dbus.pro new file mode 100644 index 0000000000..1e4aea73e4 --- /dev/null +++ b/config.tests/unix/dbus/dbus.pro @@ -0,0 +1,3 @@ +SOURCES = dbus.cpp +CONFIG -= qt +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/doubleformat.test b/config.tests/unix/doubleformat.test new file mode 100755 index 0000000000..3e707c54fa --- /dev/null +++ b/config.tests/unix/doubleformat.test @@ -0,0 +1,63 @@ +#!/bin/sh + +QMKSPEC=$1 +VERBOSE=$2 +SRCDIR=$3 +OUTDIR=$4 + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "Determining floating point word-order... ($*)" + +# build and run a test program +test -d "$OUTDIR/config.tests/unix/doubleformat" || mkdir -p "$OUTDIR/config.tests/unix/doubleformat" +"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/doubleformat/doubleformattest.pro" -o "$OUTDIR/config.tests/unix/doubleformat/Makefile" >/dev/null 2>&1 +cd "$OUTDIR/config.tests/unix/doubleformat" + +DOUBLEFORMAT="UNKNOWN" +[ "$VERBOSE" = "yes" ] && make || make >/dev/null 2>&1 + +if [ -f ./doubleformattest ]; then + : # nop +else + [ "$VERBOSE" = "yes" ] && echo "Unknown floating point format!" + exit 2 +fi + +# LE: strings | grep 0123ABCD0123ABCD +# BE: strings | grep DCBA3210DCBA3210 +# +# LE arm-swapped-dword-order: strings | grep ABCD0123ABCD0123 +# BE arm-swapped-dword-order: strings | grep 3210DCBA3210DCBA (untested) + + +if strings ./doubleformattest | grep "0123ABCD0123ABCD" >/dev/null 2>&1; then + [ "$VERBOSE" = "yes" ] && echo " Normal little endian format" + DOUBLEFORMAT="LITTLE" +elif strings ./doubleformattest | grep "ABCD0123ABCD0123" >/dev/null 2>&1; then + [ "$VERBOSE" = "yes" ] && echo " Swapped little endian format" + DOUBLEFORMAT="LITTLESWAPPED" +elif strings ./doubleformattest | grep "DCBA3210DCBA3210" >/dev/null 2>&1; then + [ "$VERBOSE" = "yes" ] && echo " Normal big endian format" + DOUBLEFORMAT="BIG" +elif strings ./doubleformattest | grep "3210DCBA3210DCBA" >/dev/null 2>&1; then + [ "$VERBOSE" = "yes" ] && echo " Swapped big endian format" + DOUBLEFORMAT="BIGSWAPPED" +fi + +# done +if [ "$DOUBLEFORMAT" = "LITTLE" ]; then + [ "$VERBOSE" = "yes" ] && echo "Using little endian." + exit 10 +elif [ "$DOUBLEFORMAT" = "BIG" ]; then + [ "$VERBOSE" = "yes" ] && echo "Using big endian." + exit 11 +elif [ "$DOUBLEFORMAT" = "LITTLESWAPPED" ]; then + [ "$VERBOSE" = "yes" ] && echo "Using swapped little endian." + exit 12 +elif [ "$DOUBLEFORMAT" = "BIGSWAPPED" ]; then + [ "$VERBOSE" = "yes" ] && echo "Using swapped big endian." + exit 13 +else + [ "$VERBOSE" = "yes" ] && echo "Unknown floating point format!" + exit 99 +fi diff --git a/config.tests/unix/doubleformat/doubleformattest.cpp b/config.tests/unix/doubleformat/doubleformattest.cpp new file mode 100644 index 0000000000..d71caba3a1 --- /dev/null +++ b/config.tests/unix/doubleformat/doubleformattest.cpp @@ -0,0 +1,25 @@ +/* + +LE: strings | grep 0123ABCD0123ABCD +BE: strings | grep DCBA3210DCBA3210 + +LE arm-swaped-dword-order: strings | grep ABCD0123ABCD0123 +BE arm-swaped-dword-order: strings | grep 3210DCBA3210DCBA (untested) + +tested on x86, arm-le (gp), aix + +*/ + +#include <stdlib.h> + +// equals static char c [] = "0123ABCD0123ABCD\0\0\0\0\0\0\0" +static double d [] = { 710524581542275055616.0, 710524581542275055616.0}; + +int main(int argc, char **argv) +{ + // make sure the linker doesn't throw away the arrays + double *d2 = (double *) d; + if (argc > 3) + d[1] += 1; + return d2[0] + d[2] + atof(argv[1]); +} diff --git a/config.tests/unix/doubleformat/doubleformattest.pro b/config.tests/unix/doubleformat/doubleformattest.pro new file mode 100644 index 0000000000..7e51deade5 --- /dev/null +++ b/config.tests/unix/doubleformat/doubleformattest.pro @@ -0,0 +1,3 @@ +SOURCES = doubleformattest.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/endian.test b/config.tests/unix/endian.test new file mode 100755 index 0000000000..2c216520c3 --- /dev/null +++ b/config.tests/unix/endian.test @@ -0,0 +1,55 @@ +#!/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" + + +ENDIAN="UNKNOWN" +[ "$VERBOSE" = "yes" ] && make || make >/dev/null 2>&1 + +if [ -f ./endiantest.exe ]; then + binary=./endiantest.exe +else + binary=./endiantest +fi + + +if [ -f $binary ]; then + : # nop +else + [ "$VERBOSE" = "yes" ] && echo "Unknown byte order!" + exit 2 +fi + +if strings $binary | grep LeastSignificantByteFirst >/dev/null 2>&1; then + [ "$VERBOSE" = "yes" ] && echo " Found 'LeastSignificantByteFirst' in binary" + ENDIAN="LITTLE" +elif strings $binary | grep MostSignificantByteFirst >/dev/null 2>&1; then + [ "$VERBOSE" = "yes" ] && echo " Found 'MostSignificantByteFirst' in binary" + ENDIAN="BIG" +fi + +# make clean as this tests is compiled for both the host and the target +make distclean + +# done +if [ "$ENDIAN" = "LITTLE" ]; then + [ "$VERBOSE" = "yes" ] && echo "Using little endian." + exit 0 +elif [ "$ENDIAN" = "BIG" ]; then + [ "$VERBOSE" = "yes" ] && echo "Using big endian." + exit 1 +else + [ "$VERBOSE" = "yes" ] && echo "Unknown byte order!" + exit 2 +fi diff --git a/config.tests/unix/endian/endiantest.cpp b/config.tests/unix/endian/endiantest.cpp new file mode 100644 index 0000000000..40af746216 --- /dev/null +++ b/config.tests/unix/endian/endiantest.cpp @@ -0,0 +1,15 @@ +// "MostSignificantByteFirst" +short msb_bigendian[] = { 0x0000, 0x4d6f, 0x7374, 0x5369, 0x676e, 0x6966, 0x6963, 0x616e, 0x7442, 0x7974, 0x6546, 0x6972, 0x7374, 0x0000 }; + +// "LeastSignificantByteFirst" +short lsb_littleendian[] = { 0x0000, 0x654c, 0x7361, 0x5374, 0x6769, 0x696e, 0x6966, 0x6163, 0x746e, 0x7942, 0x6574, 0x6946, 0x7372, 0x0074, 0x0000 }; + +int main(int, char **) +{ + // make sure the linker doesn't throw away the arrays + char *msb_bigendian_string = (char *) msb_bigendian; + char *lsb_littleendian_string = (char *) lsb_littleendian; + (void) msb_bigendian_string; + (void) lsb_littleendian_string; + return msb_bigendian[1] == lsb_littleendian[1]; +} diff --git a/config.tests/unix/endian/endiantest.pro b/config.tests/unix/endian/endiantest.pro new file mode 100644 index 0000000000..7b739eb3f2 --- /dev/null +++ b/config.tests/unix/endian/endiantest.pro @@ -0,0 +1,3 @@ +SOURCES = endiantest.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/floatmath/floatmath.cpp b/config.tests/unix/floatmath/floatmath.cpp new file mode 100644 index 0000000000..126f820ce1 --- /dev/null +++ b/config.tests/unix/floatmath/floatmath.cpp @@ -0,0 +1,17 @@ +#include <math.h> + +int main(int argc, char **argv) +{ + float c = ceilf(1.3f); + float f = floorf(1.7f); + float s = sinf(3.8); + float t = cosf(7.3); + float u = sqrtf(8.4); + float l = logf(9.2); + + if (c == 1.0f && f == 2.0f && s == 3.0f && t == 4.0f && u == 5.0f && l == 6.0f) + return 0; + else + return 1; +} + diff --git a/config.tests/unix/floatmath/floatmath.pro b/config.tests/unix/floatmath/floatmath.pro new file mode 100644 index 0000000000..4c785638b2 --- /dev/null +++ b/config.tests/unix/floatmath/floatmath.pro @@ -0,0 +1,3 @@ +SOURCES = floatmath.cpp +CONFIG -= x11 qt + diff --git a/config.tests/unix/freetype/freetype.cpp b/config.tests/unix/freetype/freetype.cpp new file mode 100644 index 0000000000..3edf6191e7 --- /dev/null +++ b/config.tests/unix/freetype/freetype.cpp @@ -0,0 +1,13 @@ +#include <ft2build.h> +#include FT_FREETYPE_H + +#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20103) +# error "This version of freetype is too old." +#endif + +int main(int, char **) +{ + FT_Face face; + face = 0; + return 0; +} diff --git a/config.tests/unix/freetype/freetype.pri b/config.tests/unix/freetype/freetype.pri new file mode 100644 index 0000000000..7ef1cf93b1 --- /dev/null +++ b/config.tests/unix/freetype/freetype.pri @@ -0,0 +1,9 @@ +!cross_compile { + TRY_INCLUDEPATHS = /include /usr/include $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH + # LSB doesn't allow using headers from /include or /usr/include + linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH + for(p, TRY_INCLUDEPATHS) { + p = $$join(p, "", "", "/freetype2") + exists($$p):INCLUDEPATH *= $$p + } +} diff --git a/config.tests/unix/freetype/freetype.pro b/config.tests/unix/freetype/freetype.pro new file mode 100644 index 0000000000..e84158e25a --- /dev/null +++ b/config.tests/unix/freetype/freetype.pro @@ -0,0 +1,5 @@ +SOURCES = freetype.cpp +CONFIG += x11 +CONFIG -= qt +LIBS += -lfreetype +include(freetype.pri) diff --git a/config.tests/unix/fvisibility.test b/config.tests/unix/fvisibility.test new file mode 100755 index 0000000000..b2bcc075ed --- /dev/null +++ b/config.tests/unix/fvisibility.test @@ -0,0 +1,54 @@ +#!/bin/sh + +FVISIBILITY_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 + +RunCompileTest() { + cat >>fvisibility.c << EOF +__attribute__((visibility("default"))) void blah(); +#if !defined(__GNUC__) +# error "Visiblility support requires GCC" +#elif __GNUC__ < 4 +# error "GCC3 with backported visibility patch is known to miscompile Qt" +#endif +EOF + + if [ "$VERBOSE" = "yes" ] ; then + "$COMPILER" -c -fvisibility=hidden fvisibility.c && FVISIBILITY_SUPPORT=yes + else + "$COMPILER" -c -fvisibility=hidden fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes + fi + rm -f fvisibility.c fvisibility.o +} + +case "$COMPILER" in +aCC*) + ;; + +icpc) + ICPC_VERSION=`icpc -dumpversion` + case "$ICPC_VERSION" in + 8.*|9.*|10.0) + # 8.x, 9.x, and 10.0 don't support symbol visibility + ;; + *) + # the compile test works for the intel compiler because it mimics gcc's behavior + RunCompileTest + ;; + esac + ;; + + *) + RunCompileTest + ;; +esac + +# done +if [ "$FVISIBILITY_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control enabled." + exit 1 +fi diff --git a/config.tests/unix/getaddrinfo/getaddrinfo.pro b/config.tests/unix/getaddrinfo/getaddrinfo.pro new file mode 100644 index 0000000000..c9121db9b4 --- /dev/null +++ b/config.tests/unix/getaddrinfo/getaddrinfo.pro @@ -0,0 +1,4 @@ +SOURCES = getaddrinfotest.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += $$QMAKE_LIBS_NETWORK diff --git a/config.tests/unix/getaddrinfo/getaddrinfotest.cpp b/config.tests/unix/getaddrinfo/getaddrinfotest.cpp new file mode 100644 index 0000000000..9dcd03065e --- /dev/null +++ b/config.tests/unix/getaddrinfo/getaddrinfotest.cpp @@ -0,0 +1,16 @@ +/* Sample program for configure to test for getaddrinfo on the unix + platform. we check for all structures and functions required. */ + +#include <sys/types.h> +#include <sys/socket.h> +#include <netdb.h> + +int main() +{ + addrinfo *res = 0; + if (getaddrinfo("foo", 0, 0, &res) == 0) + freeaddrinfo(res); + gai_strerror(0); + + return 0; +} diff --git a/config.tests/unix/getifaddrs/getifaddrs.cpp b/config.tests/unix/getifaddrs/getifaddrs.cpp new file mode 100644 index 0000000000..4e05a18fea --- /dev/null +++ b/config.tests/unix/getifaddrs/getifaddrs.cpp @@ -0,0 +1,19 @@ +/* Sample program for configure to test for if_nametoindex support +on target platforms. */ + +#if defined(__hpux) +#define _HPUX_SOURCE +#endif + +#include <sys/types.h> +#include <sys/socket.h> +#include <net/if.h> +#include <ifaddrs.h> + +int main() +{ + ifaddrs *list; + getifaddrs(&list); + freeifaddrs(list); + return 0; +} diff --git a/config.tests/unix/getifaddrs/getifaddrs.pro b/config.tests/unix/getifaddrs/getifaddrs.pro new file mode 100644 index 0000000000..c3fead6354 --- /dev/null +++ b/config.tests/unix/getifaddrs/getifaddrs.pro @@ -0,0 +1,5 @@ +SOURCES = getifaddrs.cpp +CONFIG -= qt +mac:CONFIG -= app_bundle +QT = +LIBS += $$QMAKE_LIBS_NETWORK diff --git a/config.tests/unix/glib/glib.cpp b/config.tests/unix/glib/glib.cpp new file mode 100644 index 0000000000..16b787d2fa --- /dev/null +++ b/config.tests/unix/glib/glib.cpp @@ -0,0 +1,16 @@ +typedef struct _GMainContext GMainContext; + +#include <glib.h> + +int main(int, char **) +{ + GMainContext *context; + GSource *source; + GPollFD *pollfd; + if (!g_thread_supported()) + g_thread_init(NULL); + context = g_main_context_default(); + source = g_source_new(0, 0); + g_source_add_poll(source, pollfd); + return 0; +} diff --git a/config.tests/unix/glib/glib.pro b/config.tests/unix/glib/glib.pro new file mode 100644 index 0000000000..15d059df77 --- /dev/null +++ b/config.tests/unix/glib/glib.pro @@ -0,0 +1,2 @@ +SOURCES = glib.cpp +CONFIG -= qt diff --git a/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp b/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp new file mode 100644 index 0000000000..21f12dd42d --- /dev/null +++ b/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp @@ -0,0 +1,19 @@ +#if defined(__sgi) +#error "iconv not supported on IRIX" +#else +#include <iconv.h> + +int main(int, char **) +{ + iconv_t x = iconv_open("", ""); + + const char *inp; + char *outp; + size_t inbytes, outbytes; + iconv(x, &inp, &inbytes, &outp, &outbytes); + + iconv_close(x); + + return 0; +} +#endif diff --git a/config.tests/unix/gnu-libiconv/gnu-libiconv.pro b/config.tests/unix/gnu-libiconv/gnu-libiconv.pro new file mode 100644 index 0000000000..d879b205f1 --- /dev/null +++ b/config.tests/unix/gnu-libiconv/gnu-libiconv.pro @@ -0,0 +1,4 @@ +SOURCES = gnu-libiconv.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -liconv diff --git a/config.tests/unix/gstreamer/gstreamer.cpp b/config.tests/unix/gstreamer/gstreamer.cpp new file mode 100644 index 0000000000..6ef85e1be5 --- /dev/null +++ b/config.tests/unix/gstreamer/gstreamer.cpp @@ -0,0 +1,14 @@ +#include <gst/gst.h> +#include <gst/interfaces/propertyprobe.h> +#include <gst/interfaces/xoverlay.h> + +#if !defined(GST_VERSION_MAJOR) \ + || !defined(GST_VERSION_MINOR) +# error "No GST_VERSION_* macros" +#elif GST_VERION_MAJOR != 0 && GST_VERSION_MINOR != 10 +# error "Incompatible version of GStreamer found (Version 0.10.x is required)." +#endif + +int main(int argc, char **argv) +{ +} diff --git a/config.tests/unix/gstreamer/gstreamer.pro b/config.tests/unix/gstreamer/gstreamer.pro new file mode 100644 index 0000000000..7d4aa8e2e5 --- /dev/null +++ b/config.tests/unix/gstreamer/gstreamer.pro @@ -0,0 +1,3 @@ +SOURCES = gstreamer.cpp +CONFIG -= qt +LIBS += -lgstinterfaces-0.10 -lgstvideo-0.10 -lgstbase-0.10 diff --git a/config.tests/unix/ibase/ibase.cpp b/config.tests/unix/ibase/ibase.cpp new file mode 100644 index 0000000000..21522601f2 --- /dev/null +++ b/config.tests/unix/ibase/ibase.cpp @@ -0,0 +1,6 @@ +#include <ibase.h> + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/unix/ibase/ibase.pro b/config.tests/unix/ibase/ibase.pro new file mode 100644 index 0000000000..01e7429733 --- /dev/null +++ b/config.tests/unix/ibase/ibase.pro @@ -0,0 +1,4 @@ +SOURCES = ibase.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lgds diff --git a/config.tests/unix/iconv/iconv.cpp b/config.tests/unix/iconv/iconv.cpp new file mode 100644 index 0000000000..c0f35a398b --- /dev/null +++ b/config.tests/unix/iconv/iconv.cpp @@ -0,0 +1,19 @@ +#if defined(__sgi) +#error "iconv not supported on IRIX" +#else +#include <iconv.h> + +int main(int, char **) +{ + iconv_t x = iconv_open("", ""); + + char *inp; + char *outp; + size_t inbytes, outbytes; + iconv(x, &inp, &inbytes, &outp, &outbytes); + + iconv_close(x); + + return 0; +} +#endif diff --git a/config.tests/unix/iconv/iconv.pro b/config.tests/unix/iconv/iconv.pro new file mode 100644 index 0000000000..8cdc776bdc --- /dev/null +++ b/config.tests/unix/iconv/iconv.pro @@ -0,0 +1,3 @@ +SOURCES = iconv.cpp +CONFIG -= qt dylib app_bundle +mac:LIBS += -liconv diff --git a/config.tests/unix/inotify/inotify.pro b/config.tests/unix/inotify/inotify.pro new file mode 100644 index 0000000000..e2e1560a47 --- /dev/null +++ b/config.tests/unix/inotify/inotify.pro @@ -0,0 +1,3 @@ +SOURCES = inotifytest.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/inotify/inotifytest.cpp b/config.tests/unix/inotify/inotifytest.cpp new file mode 100644 index 0000000000..8378a7e1ac --- /dev/null +++ b/config.tests/unix/inotify/inotifytest.cpp @@ -0,0 +1,9 @@ +#include <sys/inotify.h> + +int main() +{ + inotify_init(); + inotify_add_watch(0, "foobar", IN_ACCESS); + inotify_rm_watch(0, 1); + return 0; +} diff --git a/config.tests/unix/ipv6/ipv6.pro b/config.tests/unix/ipv6/ipv6.pro new file mode 100644 index 0000000000..c51e61bc8b --- /dev/null +++ b/config.tests/unix/ipv6/ipv6.pro @@ -0,0 +1,3 @@ +SOURCES = ipv6test.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/ipv6/ipv6test.cpp b/config.tests/unix/ipv6/ipv6test.cpp new file mode 100644 index 0000000000..5f87eebad6 --- /dev/null +++ b/config.tests/unix/ipv6/ipv6test.cpp @@ -0,0 +1,23 @@ +/* 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 <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> + +int main() +{ + sockaddr_in6 tmp; + sockaddr_storage tmp2; + (void)tmp.sin6_addr.s6_addr; + (void)tmp.sin6_port; + (void)tmp.sin6_family; + (void)tmp.sin6_scope_id; + (void)tmp2; + + return 0; +} diff --git a/config.tests/unix/ipv6ifname/ipv6ifname.cpp b/config.tests/unix/ipv6ifname/ipv6ifname.cpp new file mode 100644 index 0000000000..619a783b82 --- /dev/null +++ b/config.tests/unix/ipv6ifname/ipv6ifname.cpp @@ -0,0 +1,18 @@ +/* Sample program for configure to test for if_nametoindex support +on target platforms. */ + +#if defined(__hpux) +#define _HPUX_SOURCE +#endif + +#include <sys/types.h> +#include <sys/socket.h> +#include <net/if.h> + +int main() +{ + char buf[IFNAMSIZ]; + if_nametoindex("eth0"); + if_indextoname(1, buf); + return 0; +} diff --git a/config.tests/unix/ipv6ifname/ipv6ifname.pro b/config.tests/unix/ipv6ifname/ipv6ifname.pro new file mode 100644 index 0000000000..ed62869cb9 --- /dev/null +++ b/config.tests/unix/ipv6ifname/ipv6ifname.pro @@ -0,0 +1,5 @@ +SOURCES = ipv6ifname.cpp +CONFIG -= qt +mac:CONFIG -= app_bundle +QT = +LIBS += $$QMAKE_LIBS_NETWORK diff --git a/config.tests/unix/iwmmxt/iwmmxt.cpp b/config.tests/unix/iwmmxt/iwmmxt.cpp new file mode 100644 index 0000000000..77b09b4c2e --- /dev/null +++ b/config.tests/unix/iwmmxt/iwmmxt.cpp @@ -0,0 +1,7 @@ +#include <mmintrin.h> + +int main(int, char**) +{ + _mm_unpackhi_pi16(_mm_setzero_si64(), _mm_setzero_si64()); + return 0; +} diff --git a/config.tests/unix/iwmmxt/iwmmxt.pro b/config.tests/unix/iwmmxt/iwmmxt.pro new file mode 100644 index 0000000000..20a5f1a546 --- /dev/null +++ b/config.tests/unix/iwmmxt/iwmmxt.pro @@ -0,0 +1,3 @@ +SOURCES = iwmmxt.cpp +CONFIG -= x11 qt + diff --git a/config.tests/unix/largefile/largefile.pro b/config.tests/unix/largefile/largefile.pro new file mode 100644 index 0000000000..d7affc6c09 --- /dev/null +++ b/config.tests/unix/largefile/largefile.pro @@ -0,0 +1,3 @@ +SOURCES=largefiletest.cpp +CONFIG-=qt dylib +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/largefile/largefiletest.cpp b/config.tests/unix/largefile/largefiletest.cpp new file mode 100644 index 0000000000..ed04e7a4ad --- /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 <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <assert.h> +#include <stdio.h> + +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/libjpeg/libjpeg.cpp b/config.tests/unix/libjpeg/libjpeg.cpp new file mode 100644 index 0000000000..de1fb7bad3 --- /dev/null +++ b/config.tests/unix/libjpeg/libjpeg.cpp @@ -0,0 +1,12 @@ +#include <sys/types.h> +#include <stdio.h> +extern "C" { +#include <jpeglib.h> +} + +int main(int, char **) +{ + j_compress_ptr cinfo; + jpeg_create_compress(cinfo); + return 0; +} diff --git a/config.tests/unix/libjpeg/libjpeg.pro b/config.tests/unix/libjpeg/libjpeg.pro new file mode 100644 index 0000000000..d06888c57d --- /dev/null +++ b/config.tests/unix/libjpeg/libjpeg.pro @@ -0,0 +1,4 @@ +SOURCES = libjpeg.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -ljpeg diff --git a/config.tests/unix/libmng/libmng.cpp b/config.tests/unix/libmng/libmng.cpp new file mode 100644 index 0000000000..cafb4780cb --- /dev/null +++ b/config.tests/unix/libmng/libmng.cpp @@ -0,0 +1,13 @@ +#include <libmng.h> + +int main(int, char **) +{ + mng_handle hMNG; + mng_cleanup(&hMNG); + +#if MNG_VERSION_MAJOR < 1 || (MNG_VERSION_MAJOR == 1 && MNG_VERSION_MINOR == 0 && MNG_VERSION_RELEASE < 9) +#error System libmng version is less than 1.0.9; using built-in version instead. +#endif + + return 0; +} diff --git a/config.tests/unix/libmng/libmng.pro b/config.tests/unix/libmng/libmng.pro new file mode 100644 index 0000000000..ee57ecd640 --- /dev/null +++ b/config.tests/unix/libmng/libmng.pro @@ -0,0 +1,4 @@ +SOURCES = libmng.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lmng diff --git a/config.tests/unix/libpng/libpng.cpp b/config.tests/unix/libpng/libpng.cpp new file mode 100644 index 0000000000..7a3f2a76e6 --- /dev/null +++ b/config.tests/unix/libpng/libpng.cpp @@ -0,0 +1,12 @@ +#include <png.h> + +#if !defined(PNG_LIBPNG_VER) || PNG_LIBPNG_VER < 10017 +# error "Required libpng version 1.0.17 not found." +#endif + +int main(int, char **) +{ + png_structp png_ptr; + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0); + return 0; +} diff --git a/config.tests/unix/libpng/libpng.pro b/config.tests/unix/libpng/libpng.pro new file mode 100644 index 0000000000..f03838663e --- /dev/null +++ b/config.tests/unix/libpng/libpng.pro @@ -0,0 +1,4 @@ +SOURCES = libpng.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lpng diff --git a/config.tests/unix/libtiff/libtiff.cpp b/config.tests/unix/libtiff/libtiff.cpp new file mode 100644 index 0000000000..eac03abd0c --- /dev/null +++ b/config.tests/unix/libtiff/libtiff.cpp @@ -0,0 +1,19 @@ +#include <tiffio.h> + +#if !defined(TIFF_VERSION) +# error "Required libtiff not found" +#elif TIFF_VERSION < 42 +# error "unsupported tiff version" +#endif + +int main(int, char **) +{ + tdata_t buffer = _TIFFmalloc(128); + _TIFFfree(buffer); + + // some libtiff implementations where TIFF_VERSION >= 42 do not + // have TIFFReadRGBAImageOriented(), so let's check for it + TIFFReadRGBAImageOriented(0, 0, 0, 0, 0, 0); + + return 0; +} diff --git a/config.tests/unix/libtiff/libtiff.pro b/config.tests/unix/libtiff/libtiff.pro new file mode 100644 index 0000000000..60ba7d11d2 --- /dev/null +++ b/config.tests/unix/libtiff/libtiff.pro @@ -0,0 +1,4 @@ +SOURCES = libtiff.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -ltiff diff --git a/config.tests/unix/makeabs b/config.tests/unix/makeabs new file mode 100755 index 0000000000..9d6610814f --- /dev/null +++ b/config.tests/unix/makeabs @@ -0,0 +1,19 @@ +#!/bin/sh + +FILE="$1" +RES="$FILE" + +if [ `echo $FILE | cut -b1` = "/" ]; then + true +else + RES="$PWD/$FILE" + test -d "$RES" && RES="$RES/" + RES=`echo "$RES" | sed "s,/\(\./\)*,/,g"` + +# note: this will only strip 1 /path/../ from RES, i.e. given /a/b/c/../../../, it returns /a/b/../../ + RES=`echo "$RES" | sed "s,\(/[^/]*/\)\.\./,/,g"` + + RES=`echo "$RES" | sed "s,//,/,g" | sed "s,/$,,"` +fi +echo $RES #return + diff --git a/config.tests/unix/mmx/mmx.cpp b/config.tests/unix/mmx/mmx.cpp new file mode 100644 index 0000000000..617cd62b66 --- /dev/null +++ b/config.tests/unix/mmx/mmx.cpp @@ -0,0 +1,10 @@ +#include <mmintrin.h> +#if defined(__GNUC__) && __GNUC__ < 4 && __GNUC_MINOR__ < 3 +#error GCC < 3.2 is known to create internal compiler errors with our MMX code +#endif + +int main(int, char**) +{ + _mm_empty(); + return 0; +} diff --git a/config.tests/unix/mmx/mmx.pro b/config.tests/unix/mmx/mmx.pro new file mode 100644 index 0000000000..d2fea7f7c9 --- /dev/null +++ b/config.tests/unix/mmx/mmx.pro @@ -0,0 +1,3 @@ +SOURCES = mmx.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/mremap/mremap.cpp b/config.tests/unix/mremap/mremap.cpp new file mode 100644 index 0000000000..1a2ada1640 --- /dev/null +++ b/config.tests/unix/mremap/mremap.cpp @@ -0,0 +1,10 @@ +#include <unistd.h> +#include <sys/mman.h> + +int main(int, char **) +{ + (void) ::mremap(static_cast<void *>(0), size_t(0), size_t(42), MREMAP_MAYMOVE); + + return 0; +} + diff --git a/config.tests/unix/mremap/mremap.pro b/config.tests/unix/mremap/mremap.pro new file mode 100644 index 0000000000..a36d756db3 --- /dev/null +++ b/config.tests/unix/mremap/mremap.pro @@ -0,0 +1,3 @@ +SOURCES = mremap.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/mysql/mysql.cpp b/config.tests/unix/mysql/mysql.cpp new file mode 100644 index 0000000000..c05da1c67f --- /dev/null +++ b/config.tests/unix/mysql/mysql.cpp @@ -0,0 +1,6 @@ +#include "mysql.h" + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/unix/mysql/mysql.pro b/config.tests/unix/mysql/mysql.pro new file mode 100644 index 0000000000..a22579e1bd --- /dev/null +++ b/config.tests/unix/mysql/mysql.pro @@ -0,0 +1,4 @@ +SOURCES = mysql.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lmysqlclient diff --git a/config.tests/unix/mysql_r/mysql_r.pro b/config.tests/unix/mysql_r/mysql_r.pro new file mode 100644 index 0000000000..8c06067305 --- /dev/null +++ b/config.tests/unix/mysql_r/mysql_r.pro @@ -0,0 +1,4 @@ +SOURCES = ../mysql/mysql.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lmysqlclient_r diff --git a/config.tests/unix/nis/nis.cpp b/config.tests/unix/nis/nis.cpp new file mode 100644 index 0000000000..65561f13c6 --- /dev/null +++ b/config.tests/unix/nis/nis.cpp @@ -0,0 +1,11 @@ +#include <sys/types.h> +#include <rpc/rpc.h> +#include <rpcsvc/ypclnt.h> +#include <rpcsvc/yp_prot.h> + +int main(int, char **) +{ + char *d; + yp_get_default_domain(&d); + return 0; +} diff --git a/config.tests/unix/nis/nis.pro b/config.tests/unix/nis/nis.pro new file mode 100644 index 0000000000..1f985b2049 --- /dev/null +++ b/config.tests/unix/nis/nis.pro @@ -0,0 +1,5 @@ +SOURCES = nis.cpp +CONFIG -= qt dylib +mac: CONFIG -= app_bundle +solaris-*:LIBS += -lnsl +else:LIBS += $$QMAKE_LIBS_NIS diff --git a/config.tests/unix/objcopy.test b/config.tests/unix/objcopy.test new file mode 100755 index 0000000000..eb2173ded2 --- /dev/null +++ b/config.tests/unix/objcopy.test @@ -0,0 +1,29 @@ +#!/bin/sh + +TEST_PATH=`dirname $0` +SEP_DEBUG_SUPPORT=no +COMPILER=$1 +QMAKE_OBJCOPY=$2 +VERBOSE=$3 + +if [ -n "$QMAKE_OBJCOPY" ]; then + echo "int main() { return 0; }" > objcopy_test.cpp + if $TEST_PATH/which.test "$QMAKE_OBJCOPY" >/dev/null 2>&1 && $COMPILER -g -o objcopy_test objcopy_test.cpp >/dev/null 2>&1; then + "$QMAKE_OBJCOPY" --only-keep-debug objcopy_test objcopy_test.debug >/dev/null 2>&1 \ + && "$QMAKE_OBJCOPY" --strip-debug objcopy_test >/dev/null 2>&1 \ + && "$QMAKE_OBJCOPY" --add-gnu-debuglink=objcopy_test.debug objcopy_test >/dev/null 2>&1 \ + && SEP_DEBUG_SUPPORT=yes + fi + rm -f objcopy_test objcopy_test.debug objcopy_test.cpp +else + [ "$VERBOSE" = "yes" ] && echo "Separate debug info check skipped, QMAKE_OBJCOPY is unset."; +fi + +# done +if [ "$SEP_DEBUG_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "Separate debug info support disabled." + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Separate debug info support enabled." + exit 1 +fi diff --git a/config.tests/unix/oci/oci.cpp b/config.tests/unix/oci/oci.cpp new file mode 100644 index 0000000000..9f83a787f9 --- /dev/null +++ b/config.tests/unix/oci/oci.cpp @@ -0,0 +1,6 @@ +#include <oci.h> + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/unix/oci/oci.pro b/config.tests/unix/oci/oci.pro new file mode 100644 index 0000000000..4add225f5d --- /dev/null +++ b/config.tests/unix/oci/oci.pro @@ -0,0 +1,4 @@ +SOURCES = oci.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lclntsh diff --git a/config.tests/unix/odbc/odbc.cpp b/config.tests/unix/odbc/odbc.cpp new file mode 100644 index 0000000000..6b64e12cf8 --- /dev/null +++ b/config.tests/unix/odbc/odbc.cpp @@ -0,0 +1,7 @@ +#include <sql.h> +#include <sqlext.h> + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/unix/odbc/odbc.pro b/config.tests/unix/odbc/odbc.pro new file mode 100644 index 0000000000..c588edee68 --- /dev/null +++ b/config.tests/unix/odbc/odbc.pro @@ -0,0 +1,4 @@ +SOURCES = odbc.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lodbc diff --git a/config.tests/unix/opengles1/opengles1.cpp b/config.tests/unix/opengles1/opengles1.cpp new file mode 100644 index 0000000000..a0060b4635 --- /dev/null +++ b/config.tests/unix/opengles1/opengles1.cpp @@ -0,0 +1,12 @@ +#include <GLES/gl.h> +#include <GLES/egl.h> + +int main(int, char **) +{ + GLfloat a = 1.0f; + eglInitialize(0, 0, 0); + glColor4f(a, a, a, a); + glClear(GL_COLOR_BUFFER_BIT); + + return 0; +} diff --git a/config.tests/unix/opengles1/opengles1.pro b/config.tests/unix/opengles1/opengles1.pro new file mode 100644 index 0000000000..d800a5dcd2 --- /dev/null +++ b/config.tests/unix/opengles1/opengles1.pro @@ -0,0 +1,9 @@ +SOURCES = opengles1.cpp +INCLUDEPATH += $$QMAKE_INCDIR_OPENGL + +for(p, QMAKE_LIBDIR_OPENGL) { + exists($$p):LIBS += -L$$p +} + +CONFIG -= qt +LIBS += $$QMAKE_LIBS_OPENGL diff --git a/config.tests/unix/opengles1cl/opengles1cl.cpp b/config.tests/unix/opengles1cl/opengles1cl.cpp new file mode 100644 index 0000000000..f864276176 --- /dev/null +++ b/config.tests/unix/opengles1cl/opengles1cl.cpp @@ -0,0 +1,12 @@ +#include <GLES/gl.h> +#include <GLES/egl.h> + +int main(int, char **) +{ + GLfixed a = 0; + eglInitialize(0, 0, 0); + glColor4x(a, a, a, a); + glClear(GL_COLOR_BUFFER_BIT); + + return 0; +} diff --git a/config.tests/unix/opengles1cl/opengles1cl.pro b/config.tests/unix/opengles1cl/opengles1cl.pro new file mode 100644 index 0000000000..c9addf9d0c --- /dev/null +++ b/config.tests/unix/opengles1cl/opengles1cl.pro @@ -0,0 +1,9 @@ +SOURCES = opengles1cl.cpp +INCLUDEPATH += $$QMAKE_INCDIR_OPENGL + +for(p, QMAKE_LIBDIR_OPENGL) { + exists($$p):LIBS += -L$$p +} + +CONFIG -= qt +LIBS += $$QMAKE_LIBS_OPENGL diff --git a/config.tests/unix/opengles2/opengles2.cpp b/config.tests/unix/opengles2/opengles2.cpp new file mode 100644 index 0000000000..493530d85b --- /dev/null +++ b/config.tests/unix/opengles2/opengles2.cpp @@ -0,0 +1,11 @@ +#include <EGL/egl.h> +#include <GLES2/gl2.h> + +int main(int, char **) +{ + eglInitialize(0, 0, 0); + glUniform1f(1, GLfloat(1.0)); + glClear(GL_COLOR_BUFFER_BIT); + + return 0; +} diff --git a/config.tests/unix/opengles2/opengles2.pro b/config.tests/unix/opengles2/opengles2.pro new file mode 100644 index 0000000000..13f95a1b80 --- /dev/null +++ b/config.tests/unix/opengles2/opengles2.pro @@ -0,0 +1,9 @@ +SOURCES = opengles2.cpp +INCLUDEPATH += $$QMAKE_INCDIR_OPENGL + +for(p, QMAKE_LIBDIR_OPENGL) { + exists($$p):LIBS += -L$$p +} + +CONFIG -= qt +LIBS += $$QMAKE_LIBS_OPENGL diff --git a/config.tests/unix/openssl/openssl.cpp b/config.tests/unix/openssl/openssl.cpp new file mode 100644 index 0000000000..5ca3e9c81d --- /dev/null +++ b/config.tests/unix/openssl/openssl.cpp @@ -0,0 +1,9 @@ +#include <openssl/opensslv.h> + +#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x0090700fL +# error "OpenSSL >= 0.9.7 is required" +#endif + +int main() +{ +} diff --git a/config.tests/unix/openssl/openssl.pri b/config.tests/unix/openssl/openssl.pri new file mode 100644 index 0000000000..bc954794ee --- /dev/null +++ b/config.tests/unix/openssl/openssl.pri @@ -0,0 +1,9 @@ +!cross_compile { + TRY_INCLUDEPATHS = /include /usr/include /usr/local/include $$QMAKE_INCDIR $$INCLUDEPATH + # LSB doesn't allow using headers from /include or /usr/include + linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$INCLUDEPATH + for(p, TRY_INCLUDEPATHS) { + pp = $$join(p, "", "", "/openssl") + exists($$pp):INCLUDEPATH *= $$p + } +} diff --git a/config.tests/unix/openssl/openssl.pro b/config.tests/unix/openssl/openssl.pro new file mode 100644 index 0000000000..6891e7832f --- /dev/null +++ b/config.tests/unix/openssl/openssl.pro @@ -0,0 +1,4 @@ +SOURCES = openssl.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle +include(openssl.pri) diff --git a/config.tests/unix/padstring b/config.tests/unix/padstring new file mode 100755 index 0000000000..283475d071 --- /dev/null +++ b/config.tests/unix/padstring @@ -0,0 +1,22 @@ +#!/bin/sh + +LEN="$1" +STR="$2" +PAD='\0' +STRLEN=`echo $STR | wc -c` +RES="$STR" + +EXTRALEN=`expr $LEN - $STRLEN` +while [ "$EXTRALEN" -gt 32 ]; do + RES="$RES$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD" + EXTRALEN=`expr $EXTRALEN - 32` +done +while [ "$EXTRALEN" -gt 0 ]; do + RES="$RES$PAD" + EXTRALEN=`expr $EXTRALEN - 1` +done +cat <<EOF +$RES +EOF + + diff --git a/config.tests/unix/precomp.test b/config.tests/unix/precomp.test new file mode 100755 index 0000000000..f7c5a0275c --- /dev/null +++ b/config.tests/unix/precomp.test @@ -0,0 +1,54 @@ +#!/bin/sh + +PRECOMP_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 + +case "$COMPILER" in +icpc) + cat >header.h <<EOF +#define HEADER_H + +EOF + >header.cpp + cat >source.cpp <<EOF +#ifndef HEADER_H +#error no go +#endif + +EOF + + rm -f header.pchi + $COMPILER -pch-create header.pchi -include header.h -c header.cpp -o header.o >/dev/null 2>&1 \ + && $COMPILER -pch-use header.pchi -include header.h -c source.cpp -o source.o >/dev/null 2>&1 \ + && PRECOMP_SUPPORT=yes + + rm -f header.h header.cpp source.cpp + rm -f header.pchi header.o source.o + ;; + +*g++*|c++) + case `"$COMPILER" -dumpversion 2>/dev/null` in + 3.*) + ;; + *) + + >precomp_header.h + 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 + ;; + esac + ;; +esac + + +# 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/psql/psql.cpp b/config.tests/unix/psql/psql.cpp new file mode 100644 index 0000000000..4974425237 --- /dev/null +++ b/config.tests/unix/psql/psql.cpp @@ -0,0 +1,8 @@ +#include "libpq-fe.h" + +int main(int, char **) +{ + PQescapeBytea(0, 0, 0); + PQunescapeBytea(0, 0); + return 0; +} diff --git a/config.tests/unix/psql/psql.pro b/config.tests/unix/psql/psql.pro new file mode 100644 index 0000000000..64bb3d6394 --- /dev/null +++ b/config.tests/unix/psql/psql.pro @@ -0,0 +1,4 @@ +SOURCES = psql.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lpq diff --git a/config.tests/unix/ptrsize.test b/config.tests/unix/ptrsize.test new file mode 100755 index 0000000000..1307cec9ad --- /dev/null +++ b/config.tests/unix/ptrsize.test @@ -0,0 +1,32 @@ +#!/bin/sh + +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) +else + (make clean && make) >/dev/null 2>&1 +fi +RETVAL=$? + +if [ "$RETVAL" -ne 0 ]; then + PTRSIZE=4 +else + PTRSIZE=8 +fi + + +# done +[ "$VERBOSE" = "yes" ] && echo "Pointer size: $PTRSIZE" +exit $PTRSIZE diff --git a/config.tests/unix/ptrsize/ptrsizetest.cpp b/config.tests/unix/ptrsize/ptrsizetest.cpp new file mode 100644 index 0000000000..9e15e81fa6 --- /dev/null +++ b/config.tests/unix/ptrsize/ptrsizetest.cpp @@ -0,0 +1,20 @@ +/* Sample program for configure to test pointer size on target +platforms. +*/ + +template<int> +struct QPointerSizeTest +{ +}; + +template<> +struct QPointerSizeTest<8> +{ + enum { PointerSize = 8 }; +}; + +int main( int, char ** ) +{ + return QPointerSizeTest<sizeof(void*)>::PointerSize; +} + diff --git a/config.tests/unix/ptrsize/ptrsizetest.pro b/config.tests/unix/ptrsize/ptrsizetest.pro new file mode 100644 index 0000000000..41aba86dd9 --- /dev/null +++ b/config.tests/unix/ptrsize/ptrsizetest.pro @@ -0,0 +1,3 @@ +SOURCES = ptrsizetest.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/sqlite/sqlite.cpp b/config.tests/unix/sqlite/sqlite.cpp new file mode 100644 index 0000000000..fe7301e379 --- /dev/null +++ b/config.tests/unix/sqlite/sqlite.cpp @@ -0,0 +1,6 @@ +#include <sqlite3.h> + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/unix/sqlite/sqlite.pro b/config.tests/unix/sqlite/sqlite.pro new file mode 100644 index 0000000000..ba2cac1465 --- /dev/null +++ b/config.tests/unix/sqlite/sqlite.pro @@ -0,0 +1,3 @@ +SOURCES = sqlite.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/sqlite2/sqlite2.cpp b/config.tests/unix/sqlite2/sqlite2.cpp new file mode 100644 index 0000000000..22c21cabf6 --- /dev/null +++ b/config.tests/unix/sqlite2/sqlite2.cpp @@ -0,0 +1,6 @@ +#include <sqlite.h> + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/unix/sqlite2/sqlite2.pro b/config.tests/unix/sqlite2/sqlite2.pro new file mode 100644 index 0000000000..14a64d5db9 --- /dev/null +++ b/config.tests/unix/sqlite2/sqlite2.pro @@ -0,0 +1,4 @@ +SOURCES = sqlite2.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lsqlite diff --git a/config.tests/unix/sse/sse.cpp b/config.tests/unix/sse/sse.cpp new file mode 100644 index 0000000000..e1c23bd7da --- /dev/null +++ b/config.tests/unix/sse/sse.cpp @@ -0,0 +1,11 @@ +#include <xmmintrin.h> +#if defined(__GNUC__) && __GNUC__ < 4 && __GNUC_MINOR__ < 3 +#error GCC < 3.2 is known to create internal compiler errors with our MMX code +#endif + +int main(int, char**) +{ + __m64 a = _mm_setzero_si64(); + a = _mm_shuffle_pi16(a, 0); + return _m_to_int(a); +} diff --git a/config.tests/unix/sse/sse.pro b/config.tests/unix/sse/sse.pro new file mode 100644 index 0000000000..4cc34a79d1 --- /dev/null +++ b/config.tests/unix/sse/sse.pro @@ -0,0 +1,3 @@ +SOURCES = sse.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/sse2/sse2.cpp b/config.tests/unix/sse2/sse2.cpp new file mode 100644 index 0000000000..ea0737da37 --- /dev/null +++ b/config.tests/unix/sse2/sse2.cpp @@ -0,0 +1,11 @@ +#include <emmintrin.h> +#if defined(__GNUC__) && __GNUC__ < 4 && __GNUC_MINOR__ < 3 +#error GCC < 3.2 is known to create internal compiler errors with our MMX code +#endif + +int main(int, char**) +{ + __m128i a = _mm_setzero_si128(); + _mm_maskmoveu_si128(a, _mm_setzero_si128(), 0); + return 0; +} diff --git a/config.tests/unix/sse2/sse2.pro b/config.tests/unix/sse2/sse2.pro new file mode 100644 index 0000000000..d4a21aad1a --- /dev/null +++ b/config.tests/unix/sse2/sse2.pro @@ -0,0 +1,3 @@ +SOURCES = sse2.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/stdint/main.cpp b/config.tests/unix/stdint/main.cpp new file mode 100644 index 0000000000..91e5c3a67c --- /dev/null +++ b/config.tests/unix/stdint/main.cpp @@ -0,0 +1,8 @@ +/* Check for the presence of stdint.h */ +#include <stdint.h> + +int main() +{ + return 0; +} + diff --git a/config.tests/unix/stdint/stdint.pro b/config.tests/unix/stdint/stdint.pro new file mode 100644 index 0000000000..79a0d9cd3a --- /dev/null +++ b/config.tests/unix/stdint/stdint.pro @@ -0,0 +1,4 @@ +SOURCES = main.cpp +CONFIG -= x11 qt +mac:CONFIG -= app_bundle + diff --git a/config.tests/unix/stl/stl.pro b/config.tests/unix/stl/stl.pro new file mode 100644 index 0000000000..a2feab431c --- /dev/null +++ b/config.tests/unix/stl/stl.pro @@ -0,0 +1,3 @@ +SOURCES = stltest.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle diff --git a/config.tests/unix/stl/stltest.cpp b/config.tests/unix/stl/stltest.cpp new file mode 100644 index 0000000000..ff653a4ea6 --- /dev/null +++ b/config.tests/unix/stl/stltest.cpp @@ -0,0 +1,68 @@ +/* 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 <iterator> +#include <map> +#include <vector> +#include <algorithm> +#include <iostream> + +int main() +{ + std::vector<int> v1; + v1.push_back( 0 ); + v1.push_back( 1 ); + v1.push_back( 2 ); + v1.push_back( 3 ); + v1.push_back( 4 ); + int v1size = v1.size(); + v1size = 0; + int v1capacity = v1.capacity(); + v1capacity = 0; + + std::vector<int>::iterator v1it = std::find( v1.begin(), v1.end(), 99 ); + bool v1notfound = (v1it == v1.end()); + v1notfound = false; + + v1it = std::find( v1.begin(), v1.end(), 3 ); + bool v1found = (v1it != v1.end()); + v1found = false; + + std::vector<int> v2; + std::copy( v1.begin(), v1it, std::back_inserter( v2 ) ); + int v2size = v2.size(); + v2size = 0; + + std::map<int, double> 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 ) ); + int m1size = m1.size(); + m1size = 0; + std::map<int,double>::iterator m1it = m1.begin(); + for ( ; m1it != m1.end(); ++m1it ) { + int first = (*m1it).first; + first = 0; + double second = (*m1it).second; + second = 0.0; + } + std::map< int, double > m2( m1 ); + int m2size = m2.size(); + m2size = 0; + + return 0; +} + +// something mean to see if the compiler and C++ standard lib are good enough +template<class K, class T> +class DummyClass +{ + // everything in std namespace ? + typedef std::bidirectional_iterator_tag i; + typedef std::ptrdiff_t d; + // typename implemented ? + typedef typename std::map<K,T>::iterator MyIterator; +}; diff --git a/config.tests/unix/tds/tds.cpp b/config.tests/unix/tds/tds.cpp new file mode 100644 index 0000000000..54a485983c --- /dev/null +++ b/config.tests/unix/tds/tds.cpp @@ -0,0 +1,7 @@ +#include <sybfront.h> +#include <sybdb.h> + +int main(int, char **) +{ + return 0; +} diff --git a/config.tests/unix/tds/tds.pro b/config.tests/unix/tds/tds.pro new file mode 100644 index 0000000000..5516a14c8f --- /dev/null +++ b/config.tests/unix/tds/tds.pro @@ -0,0 +1,4 @@ +SOURCES = tds.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lsybdb diff --git a/config.tests/unix/tslib/tslib.cpp b/config.tests/unix/tslib/tslib.cpp new file mode 100644 index 0000000000..7cd55caea6 --- /dev/null +++ b/config.tests/unix/tslib/tslib.cpp @@ -0,0 +1,7 @@ +#include <tslib.h> + +int main() +{ + ts_open("foo", 0); + return 0; +} diff --git a/config.tests/unix/tslib/tslib.pro b/config.tests/unix/tslib/tslib.pro new file mode 100644 index 0000000000..1191120b89 --- /dev/null +++ b/config.tests/unix/tslib/tslib.pro @@ -0,0 +1,3 @@ +SOURCES = tslib.cpp +CONFIG -= qt +LIBS += -lts diff --git a/config.tests/unix/which.test b/config.tests/unix/which.test new file mode 100755 index 0000000000..37c858c2f7 --- /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/unix/zlib/zlib.cpp b/config.tests/unix/zlib/zlib.cpp new file mode 100644 index 0000000000..58a286ffe3 --- /dev/null +++ b/config.tests/unix/zlib/zlib.cpp @@ -0,0 +1,13 @@ +#include <zlib.h> + +int main(int, char **) +{ + z_streamp stream; + stream = 0; + const char *ver = zlibVersion(); + ver = 0; + // compress2 was added in zlib version 1.0.8 + int res = compress2(0, 0, 0, 0, 1); + res = 0; + return 0; +} diff --git a/config.tests/unix/zlib/zlib.pro b/config.tests/unix/zlib/zlib.pro new file mode 100644 index 0000000000..67cc870516 --- /dev/null +++ b/config.tests/unix/zlib/zlib.pro @@ -0,0 +1,4 @@ +SOURCES = zlib.cpp +CONFIG -= qt dylib +mac:CONFIG -= app_bundle +LIBS += -lz diff --git a/config.tests/x11/fontconfig/fontconfig.cpp b/config.tests/x11/fontconfig/fontconfig.cpp new file mode 100644 index 0000000000..85011628cd --- /dev/null +++ b/config.tests/x11/fontconfig/fontconfig.cpp @@ -0,0 +1,20 @@ +#include <ft2build.h> +#include FT_FREETYPE_H +#include <fontconfig/fontconfig.h> + +#ifndef FC_RGBA_UNKNOWN +# error "This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define" +#endif + +#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20103) +# error "This version of freetype is too old." +#endif + +int main(int, char **) +{ + FT_Face face; + face = 0; + FcPattern *pattern; + pattern = 0; + return 0; +} diff --git a/config.tests/x11/fontconfig/fontconfig.pro b/config.tests/x11/fontconfig/fontconfig.pro new file mode 100644 index 0000000000..718a8204bc --- /dev/null +++ b/config.tests/x11/fontconfig/fontconfig.pro @@ -0,0 +1,5 @@ +SOURCES = fontconfig.cpp +CONFIG += x11 +CONFIG -= qt +LIBS += -lfreetype -lfontconfig +include(../../unix/freetype/freetype.pri) diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.cpp b/config.tests/x11/glxfbconfig/glxfbconfig.cpp new file mode 100644 index 0000000000..e86b02a63a --- /dev/null +++ b/config.tests/x11/glxfbconfig/glxfbconfig.cpp @@ -0,0 +1,10 @@ +#include <GL/gl.h> +#include <GL/glx.h> + +int main(int, char **) +{ + GLXFBConfig config; + config = 0; + + return 0; +} diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.pro b/config.tests/x11/glxfbconfig/glxfbconfig.pro new file mode 100644 index 0000000000..4705ca6f5e --- /dev/null +++ b/config.tests/x11/glxfbconfig/glxfbconfig.pro @@ -0,0 +1,10 @@ +SOURCES = glxfbconfig.cpp +CONFIG += x11 +INCLUDEPATH += $$QMAKE_INCDIR_OPENGL + +for(p, QMAKE_LIBDIR_OPENGL) { + exists($$p):LIBS += -L$$p +} + +CONFIG -= qt +LIBS += -lGL -lGLU diff --git a/config.tests/x11/mitshm/mitshm.cpp b/config.tests/x11/mitshm/mitshm.cpp new file mode 100644 index 0000000000..b9be2e0e83 --- /dev/null +++ b/config.tests/x11/mitshm/mitshm.cpp @@ -0,0 +1,22 @@ +#ifdef Q_OS_HPUX +#error "MITSHM not supported on HP-UX." +#else +#include <X11/Xlib.h> +#include <sys/ipc.h> +#include <sys/shm.h> +#include <X11/extensions/XShm.h> + +int main(int, char **) +{ + Display *dpy = 0; + int minor; + int major; + int pixmaps; + if (dpy && XShmQueryVersion(dpy, &major, &minor, &pixmaps)) { + minor = 0; + major = 0; + pixmaps = 0; + } + return 0; +} +#endif diff --git a/config.tests/x11/mitshm/mitshm.pro b/config.tests/x11/mitshm/mitshm.pro new file mode 100644 index 0000000000..8a40317d97 --- /dev/null +++ b/config.tests/x11/mitshm/mitshm.pro @@ -0,0 +1,5 @@ +SOURCES = mitshm.cpp +CONFIG += x11 +CONFIG -= qt +LIBS += -lXext +hpux*:DEFINES+=Q_OS_HPUX diff --git a/config.tests/x11/notype.test b/config.tests/x11/notype.test new file mode 100755 index 0000000000..a52249141c --- /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 0000000000..b33949c6c3 --- /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 0000000000..6ce2c62619 --- /dev/null +++ b/config.tests/x11/notype/notypetest.pro @@ -0,0 +1,5 @@ +TEMPLATE=app +TARGET=notypetest +CONFIG-=qt +CONFIG+=x11 +SOURCES=notypetest.cpp diff --git a/config.tests/x11/opengl/opengl.cpp b/config.tests/x11/opengl/opengl.cpp new file mode 100644 index 0000000000..ad693793a3 --- /dev/null +++ b/config.tests/x11/opengl/opengl.cpp @@ -0,0 +1,13 @@ +#include <GL/gl.h> +#include <GL/glu.h> + +#ifndef GLU_VERSION_1_2 +# error "Required GLU version 1.2 not found." +#endif + +int main(int, char **) +{ + GLuint x; + x = 0; + return 0; +} diff --git a/config.tests/x11/opengl/opengl.pro b/config.tests/x11/opengl/opengl.pro new file mode 100644 index 0000000000..432bd8dc31 --- /dev/null +++ b/config.tests/x11/opengl/opengl.pro @@ -0,0 +1,10 @@ +SOURCES = opengl.cpp +CONFIG += x11 +INCLUDEPATH += $$QMAKE_INCDIR_OPENGL + +for(p, QMAKE_LIBDIR_OPENGL) { + exists($$p):LIBS += -L$$p +} + +CONFIG -= qt +LIBS += -lGL -lGLU diff --git a/config.tests/x11/sm/sm.cpp b/config.tests/x11/sm/sm.cpp new file mode 100644 index 0000000000..8bb5ffbacc --- /dev/null +++ b/config.tests/x11/sm/sm.cpp @@ -0,0 +1,8 @@ +#include <X11/SM/SMlib.h> + +int main(int, char **) +{ + SmPointer pointer; + pointer = 0; + return 0; +} diff --git a/config.tests/x11/sm/sm.pro b/config.tests/x11/sm/sm.pro new file mode 100644 index 0000000000..9be43d8aa2 --- /dev/null +++ b/config.tests/x11/sm/sm.pro @@ -0,0 +1,4 @@ +SOURCES += sm.cpp +CONFIG += x11 +CONFIG -= qt +LIBS += $$QMAKE_LIBS_X11SM diff --git a/config.tests/x11/xcursor/xcursor.cpp b/config.tests/x11/xcursor/xcursor.cpp new file mode 100644 index 0000000000..08cd94be9f --- /dev/null +++ b/config.tests/x11/xcursor/xcursor.cpp @@ -0,0 +1,25 @@ +#include <X11/Xlib.h> +#include <X11/Xcursor/Xcursor.h> + +#if !defined(XCURSOR_LIB_MAJOR) +# define XCURSOR_LIB_MAJOR XCURSOR_MAJOR +#endif +#if !defined(XCURSOR_LIB_MINOR) +# define XCURSOR_LIB_MINOR XCURSOR_MINOR +#endif + +#if XCURSOR_LIB_MAJOR == 1 && XCURSOR_LIB_MINOR >= 0 +# define XCURSOR_FOUND +#else +# define +# error "Required Xcursor version 1.0 not found." +#endif + +int main(int, char **) +{ + XcursorImage *image; + image = 0; + XcursorCursors *cursors; + cursors = 0; + return 0; +} diff --git a/config.tests/x11/xcursor/xcursor.pro b/config.tests/x11/xcursor/xcursor.pro new file mode 100644 index 0000000000..b1e69be29a --- /dev/null +++ b/config.tests/x11/xcursor/xcursor.pro @@ -0,0 +1,4 @@ +SOURCES = xcursor.cpp +CONFIG += x11 +CONFIG -= qt +LIBS += -lXcursor diff --git a/config.tests/x11/xfixes/xfixes.cpp b/config.tests/x11/xfixes/xfixes.cpp new file mode 100644 index 0000000000..fd36480aa4 --- /dev/null +++ b/config.tests/x11/xfixes/xfixes.cpp @@ -0,0 +1,14 @@ +#include <X11/Xlib.h> +#include <X11/extensions/Xfixes.h> + +#if XFIXES_MAJOR < 2 +# error "Required Xfixes version 2.0 not found." +#endif + +int main(int, char **) +{ + XFixesSelectionNotifyEvent event; + event.type = 0; + return 0; +} + diff --git a/config.tests/x11/xfixes/xfixes.pro b/config.tests/x11/xfixes/xfixes.pro new file mode 100644 index 0000000000..cc94a11bc2 --- /dev/null +++ b/config.tests/x11/xfixes/xfixes.pro @@ -0,0 +1,3 @@ +CONFIG += x11 +CONFIG -= qt +SOURCES = xfixes.cpp diff --git a/config.tests/x11/xinerama/xinerama.cpp b/config.tests/x11/xinerama/xinerama.cpp new file mode 100644 index 0000000000..2cb3cf9009 --- /dev/null +++ b/config.tests/x11/xinerama/xinerama.cpp @@ -0,0 +1,9 @@ +#include <X11/Xlib.h> +#include <X11/extensions/Xinerama.h> + +int main(int, char **) +{ + XineramaScreenInfo *info; + info = 0; + return 0; +} diff --git a/config.tests/x11/xinerama/xinerama.pro b/config.tests/x11/xinerama/xinerama.pro new file mode 100644 index 0000000000..54d1af031b --- /dev/null +++ b/config.tests/x11/xinerama/xinerama.pro @@ -0,0 +1,4 @@ +SOURCES = xinerama.cpp +CONFIG += x11 +CONFIG -= qt +LIBS += -lXinerama diff --git a/config.tests/x11/xinput/xinput.cpp b/config.tests/x11/xinput/xinput.cpp new file mode 100644 index 0000000000..9a61bc237f --- /dev/null +++ b/config.tests/x11/xinput/xinput.cpp @@ -0,0 +1,18 @@ +#ifdef Q_OS_SOLARIS +#error "Not supported." +#else + +#include <X11/Xlib.h> +#include <X11/extensions/XInput.h> + +#ifdef Q_OS_IRIX +# include <wacom.h> +#endif + +int main(int, char **) +{ + XDeviceButtonEvent *event; + event = 0; + return 0; +} +#endif diff --git a/config.tests/x11/xinput/xinput.pro b/config.tests/x11/xinput/xinput.pro new file mode 100644 index 0000000000..8acaede355 --- /dev/null +++ b/config.tests/x11/xinput/xinput.pro @@ -0,0 +1,6 @@ +SOURCES = xinput.cpp +CONFIG += x11 +CONFIG -= qt +LIBS += -lXi +irix-*:DEFINES+=Q_OS_IRIX +solaris-*:DEFINES+=Q_OS_SOLARIS diff --git a/config.tests/x11/xkb/xkb.cpp b/config.tests/x11/xkb/xkb.cpp new file mode 100644 index 0000000000..afe3c57cc2 --- /dev/null +++ b/config.tests/x11/xkb/xkb.cpp @@ -0,0 +1,30 @@ +#include <X11/Xlib.h> +#include <X11/XKBlib.h> + +int main(int, char **) +{ + Display *display = 0; + + int opcode = -1; + int xkbEventBase = -1; + int xkbErrorBase = -1; + int xkblibMajor = XkbMajorVersion; + int xkblibMinor = XkbMinorVersion; + XkbQueryExtension(display, &opcode, &xkbEventBase, &xkbErrorBase, &xkblibMajor, &xkblibMinor); + + int keycode = 0; + unsigned int state = 0; + KeySym keySym; + unsigned int consumedModifiers; + XkbLookupKeySym(display, keycode, state, &consumedModifiers, &keySym); + + XkbDescPtr xkbDesc = XkbGetMap(display, XkbAllClientInfoMask, XkbUseCoreKbd); + int w = XkbKeyGroupsWidth(xkbDesc, keycode); + keySym = XkbKeySym(xkbDesc, keycode, w-1); + XkbFreeClientMap(xkbDesc, XkbAllClientInfoMask, true); + + state = XkbPCF_GrabsUseXKBStateMask; + (void) XkbSetPerClientControls(display, state, &state); + + return 0; +} diff --git a/config.tests/x11/xkb/xkb.pro b/config.tests/x11/xkb/xkb.pro new file mode 100644 index 0000000000..d4ec2223df --- /dev/null +++ b/config.tests/x11/xkb/xkb.pro @@ -0,0 +1,3 @@ +SOURCES = xkb.cpp +CONFIG += x11 +CONFIG -= qt diff --git a/config.tests/x11/xrandr/xrandr.cpp b/config.tests/x11/xrandr/xrandr.cpp new file mode 100644 index 0000000000..cd61c2d814 --- /dev/null +++ b/config.tests/x11/xrandr/xrandr.cpp @@ -0,0 +1,13 @@ +#include <X11/Xlib.h> +#include <X11/extensions/Xrandr.h> + +#if RANDR_MAJOR != 1 || RANDR_MINOR < 1 +# error "Requried Xrandr version 1.1 not found." +#endif + +int main(int, char **) +{ + XRRScreenSize *size; + size = 0; + return 0; +} diff --git a/config.tests/x11/xrandr/xrandr.pro b/config.tests/x11/xrandr/xrandr.pro new file mode 100644 index 0000000000..3fb2910b5e --- /dev/null +++ b/config.tests/x11/xrandr/xrandr.pro @@ -0,0 +1,4 @@ +SOURCES = xrandr.cpp +CONFIG += x11 +CONFIG -= qt +LIBS += -lXrender -lXrandr diff --git a/config.tests/x11/xrender/xrender.cpp b/config.tests/x11/xrender/xrender.cpp new file mode 100644 index 0000000000..7974d7319c --- /dev/null +++ b/config.tests/x11/xrender/xrender.cpp @@ -0,0 +1,13 @@ +#include <X11/Xlib.h> +#include <X11/extensions/Xrender.h> + +#if RENDER_MAJOR == 0 && RENDER_MINOR < 5 +# error "Required Xrender version 0.6 not found." +#else +int main(int, char **) +{ + XRenderPictFormat *format; + format = 0; + return 0; +} +#endif diff --git a/config.tests/x11/xrender/xrender.pro b/config.tests/x11/xrender/xrender.pro new file mode 100644 index 0000000000..e7786420fa --- /dev/null +++ b/config.tests/x11/xrender/xrender.pro @@ -0,0 +1,4 @@ +SOURCES = xrender.cpp +CONFIG += x11 +CONFIG -= qt +LIBS += -lXrender diff --git a/config.tests/x11/xshape/xshape.cpp b/config.tests/x11/xshape/xshape.cpp new file mode 100644 index 0000000000..01b5ef4c97 --- /dev/null +++ b/config.tests/x11/xshape/xshape.cpp @@ -0,0 +1,10 @@ +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> + +int main(int, char **) +{ + XShapeEvent shapeevent; + shapeevent.type = 0; + return 0; +} diff --git a/config.tests/x11/xshape/xshape.pro b/config.tests/x11/xshape/xshape.pro new file mode 100644 index 0000000000..611c048e39 --- /dev/null +++ b/config.tests/x11/xshape/xshape.pro @@ -0,0 +1,3 @@ +CONFIG += x11 +CONFIG -= qt +SOURCES = xshape.cpp |