summaryrefslogtreecommitdiffstats
path: root/config.tests/unix
diff options
context:
space:
mode:
Diffstat (limited to 'config.tests/unix')
-rw-r--r--config.tests/unix/3dnow/3dnow.cpp10
-rw-r--r--config.tests/unix/3dnow/3dnow.pro3
-rwxr-xr-xconfig.tests/unix/bsymbolic_functions.test21
-rw-r--r--config.tests/unix/clock-gettime/clock-gettime.cpp16
-rw-r--r--config.tests/unix/clock-gettime/clock-gettime.pri2
-rw-r--r--config.tests/unix/clock-gettime/clock-gettime.pro4
-rw-r--r--config.tests/unix/clock-monotonic/clock-monotonic.cpp16
-rw-r--r--config.tests/unix/clock-monotonic/clock-monotonic.pro4
-rwxr-xr-xconfig.tests/unix/compile.test73
-rw-r--r--config.tests/unix/cups/cups.cpp8
-rw-r--r--config.tests/unix/cups/cups.pro4
-rw-r--r--config.tests/unix/db2/db2.cpp7
-rw-r--r--config.tests/unix/db2/db2.pro4
-rw-r--r--config.tests/unix/dbus/dbus.cpp12
-rw-r--r--config.tests/unix/dbus/dbus.pro3
-rwxr-xr-xconfig.tests/unix/doubleformat.test63
-rw-r--r--config.tests/unix/doubleformat/doubleformattest.cpp25
-rw-r--r--config.tests/unix/doubleformat/doubleformattest.pro3
-rwxr-xr-xconfig.tests/unix/endian.test55
-rw-r--r--config.tests/unix/endian/endiantest.cpp15
-rw-r--r--config.tests/unix/endian/endiantest.pro3
-rw-r--r--config.tests/unix/floatmath/floatmath.cpp17
-rw-r--r--config.tests/unix/floatmath/floatmath.pro3
-rw-r--r--config.tests/unix/freetype/freetype.cpp13
-rw-r--r--config.tests/unix/freetype/freetype.pri9
-rw-r--r--config.tests/unix/freetype/freetype.pro5
-rwxr-xr-xconfig.tests/unix/fvisibility.test54
-rw-r--r--config.tests/unix/getaddrinfo/getaddrinfo.pro4
-rw-r--r--config.tests/unix/getaddrinfo/getaddrinfotest.cpp16
-rw-r--r--config.tests/unix/getifaddrs/getifaddrs.cpp19
-rw-r--r--config.tests/unix/getifaddrs/getifaddrs.pro5
-rw-r--r--config.tests/unix/glib/glib.cpp16
-rw-r--r--config.tests/unix/glib/glib.pro2
-rw-r--r--config.tests/unix/gnu-libiconv/gnu-libiconv.cpp19
-rw-r--r--config.tests/unix/gnu-libiconv/gnu-libiconv.pro4
-rw-r--r--config.tests/unix/gstreamer/gstreamer.cpp14
-rw-r--r--config.tests/unix/gstreamer/gstreamer.pro3
-rw-r--r--config.tests/unix/ibase/ibase.cpp6
-rw-r--r--config.tests/unix/ibase/ibase.pro4
-rw-r--r--config.tests/unix/iconv/iconv.cpp19
-rw-r--r--config.tests/unix/iconv/iconv.pro3
-rw-r--r--config.tests/unix/inotify/inotify.pro3
-rw-r--r--config.tests/unix/inotify/inotifytest.cpp9
-rw-r--r--config.tests/unix/ipv6/ipv6.pro3
-rw-r--r--config.tests/unix/ipv6/ipv6test.cpp23
-rw-r--r--config.tests/unix/ipv6ifname/ipv6ifname.cpp18
-rw-r--r--config.tests/unix/ipv6ifname/ipv6ifname.pro5
-rw-r--r--config.tests/unix/iwmmxt/iwmmxt.cpp7
-rw-r--r--config.tests/unix/iwmmxt/iwmmxt.pro3
-rw-r--r--config.tests/unix/largefile/largefile.pro3
-rw-r--r--config.tests/unix/largefile/largefiletest.cpp32
-rw-r--r--config.tests/unix/libjpeg/libjpeg.cpp12
-rw-r--r--config.tests/unix/libjpeg/libjpeg.pro4
-rw-r--r--config.tests/unix/libmng/libmng.cpp13
-rw-r--r--config.tests/unix/libmng/libmng.pro4
-rw-r--r--config.tests/unix/libpng/libpng.cpp12
-rw-r--r--config.tests/unix/libpng/libpng.pro4
-rw-r--r--config.tests/unix/libtiff/libtiff.cpp19
-rw-r--r--config.tests/unix/libtiff/libtiff.pro4
-rwxr-xr-xconfig.tests/unix/makeabs19
-rw-r--r--config.tests/unix/mmx/mmx.cpp10
-rw-r--r--config.tests/unix/mmx/mmx.pro3
-rw-r--r--config.tests/unix/mremap/mremap.cpp10
-rw-r--r--config.tests/unix/mremap/mremap.pro3
-rw-r--r--config.tests/unix/mysql/mysql.cpp6
-rw-r--r--config.tests/unix/mysql/mysql.pro4
-rw-r--r--config.tests/unix/mysql_r/mysql_r.pro4
-rw-r--r--config.tests/unix/nis/nis.cpp11
-rw-r--r--config.tests/unix/nis/nis.pro5
-rwxr-xr-xconfig.tests/unix/objcopy.test29
-rw-r--r--config.tests/unix/oci/oci.cpp6
-rw-r--r--config.tests/unix/oci/oci.pro4
-rw-r--r--config.tests/unix/odbc/odbc.cpp7
-rw-r--r--config.tests/unix/odbc/odbc.pro4
-rw-r--r--config.tests/unix/opengles1/opengles1.cpp12
-rw-r--r--config.tests/unix/opengles1/opengles1.pro9
-rw-r--r--config.tests/unix/opengles1cl/opengles1cl.cpp12
-rw-r--r--config.tests/unix/opengles1cl/opengles1cl.pro9
-rw-r--r--config.tests/unix/opengles2/opengles2.cpp11
-rw-r--r--config.tests/unix/opengles2/opengles2.pro9
-rw-r--r--config.tests/unix/openssl/openssl.cpp9
-rw-r--r--config.tests/unix/openssl/openssl.pri17
-rw-r--r--config.tests/unix/openssl/openssl.pro4
-rwxr-xr-xconfig.tests/unix/padstring22
-rwxr-xr-xconfig.tests/unix/precomp.test54
-rw-r--r--config.tests/unix/psql/psql.cpp8
-rw-r--r--config.tests/unix/psql/psql.pro4
-rwxr-xr-xconfig.tests/unix/ptrsize.test32
-rw-r--r--config.tests/unix/ptrsize/ptrsizetest.cpp20
-rw-r--r--config.tests/unix/ptrsize/ptrsizetest.pro3
-rw-r--r--config.tests/unix/sqlite/sqlite.cpp6
-rw-r--r--config.tests/unix/sqlite/sqlite.pro3
-rw-r--r--config.tests/unix/sqlite2/sqlite2.cpp6
-rw-r--r--config.tests/unix/sqlite2/sqlite2.pro4
-rw-r--r--config.tests/unix/sse/sse.cpp11
-rw-r--r--config.tests/unix/sse/sse.pro3
-rw-r--r--config.tests/unix/sse2/sse2.cpp11
-rw-r--r--config.tests/unix/sse2/sse2.pro3
-rw-r--r--config.tests/unix/stdint/main.cpp8
-rw-r--r--config.tests/unix/stdint/stdint.pro4
-rw-r--r--config.tests/unix/stl/stl.pro3
-rw-r--r--config.tests/unix/stl/stltest.cpp68
-rw-r--r--config.tests/unix/tds/tds.cpp7
-rw-r--r--config.tests/unix/tds/tds.pro4
-rw-r--r--config.tests/unix/tslib/tslib.cpp7
-rw-r--r--config.tests/unix/tslib/tslib.pro3
-rwxr-xr-xconfig.tests/unix/which.test39
-rw-r--r--config.tests/unix/zlib/zlib.cpp13
-rw-r--r--config.tests/unix/zlib/zlib.pro4
109 files changed, 1331 insertions, 0 deletions
diff --git a/config.tests/unix/3dnow/3dnow.cpp b/config.tests/unix/3dnow/3dnow.cpp
new file mode 100644
index 0000000..1b1d0ed
--- /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 0000000..90a8a19
--- /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 0000000..52fdb32
--- /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 0000000..edb71f5
--- /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 0000000..2a6160b
--- /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 0000000..c527535
--- /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 0000000..df99963
--- /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 0000000..961e3a8
--- /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 0000000..b5afa18
--- /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 0000000..e8c17ea
--- /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 0000000..d7b78c8
--- /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 0000000..e408d28
--- /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 0000000..0fa39a8
--- /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 0000000..15ed45f
--- /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 0000000..1e4aea7
--- /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 0000000..3e707c5
--- /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 0000000..d71caba
--- /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 0000000..7e51dea
--- /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 0000000..2c21652
--- /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 0000000..40af746
--- /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 0000000..7b739eb
--- /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 0000000..126f820
--- /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 0000000..4c78563
--- /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 0000000..3edf619
--- /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 0000000..7ef1cf9
--- /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 0000000..e84158e
--- /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 0000000..b2bcc07
--- /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 0000000..c9121db
--- /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 0000000..9dcd030
--- /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 0000000..4e05a18
--- /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 0000000..c3fead6
--- /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 0000000..16b787d
--- /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 0000000..15d059d
--- /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 0000000..21f12dd
--- /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 0000000..d879b20
--- /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 0000000..6ef85e1
--- /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 0000000..7d4aa8e
--- /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 0000000..2152260
--- /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 0000000..01e7429
--- /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 0000000..c0f35a3
--- /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 0000000..8cdc776
--- /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 0000000..e2e1560
--- /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 0000000..8378a7e
--- /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 0000000..c51e61b
--- /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 0000000..5f87eeb
--- /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 0000000..619a783
--- /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 0000000..ed62869
--- /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 0000000..77b09b4
--- /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 0000000..20a5f1a
--- /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 0000000..d7affc6
--- /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 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 <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 0000000..de1fb7b
--- /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 0000000..d06888c
--- /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 0000000..cafb478
--- /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 0000000..ee57ecd
--- /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 0000000..7a3f2a7
--- /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 0000000..f038386
--- /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 0000000..eac03ab
--- /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 0000000..60ba7d1
--- /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 0000000..9d66108
--- /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 0000000..617cd62
--- /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 0000000..d2fea7f
--- /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 0000000..1a2ada1
--- /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 0000000..a36d756
--- /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 0000000..c05da1c
--- /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 0000000..a22579e
--- /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 0000000..8c06067
--- /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 0000000..65561f1
--- /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 0000000..1f985b2
--- /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 0000000..eb2173d
--- /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 0000000..9f83a78
--- /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 0000000..4add225
--- /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 0000000..6b64e12
--- /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 0000000..c588ede
--- /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 0000000..a0060b4
--- /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 0000000..d800a5d
--- /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 0000000..f864276
--- /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 0000000..c9addf9
--- /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 0000000..493530d
--- /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 0000000..13f95a1
--- /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 0000000..5ca3e9c
--- /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 0000000..c8703c2
--- /dev/null
+++ b/config.tests/unix/openssl/openssl.pri
@@ -0,0 +1,17 @@
+!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
+ }
+}
+
+symbian{
+ TRY_INCLUDEPATHS = $${EPOCROOT}epoc32 $${EPOCROOT}epoc32/include $${EPOCROOT}epoc32/include/stdapis $${EPOCROOT}epoc32/include/stdapis/sys $$OS_LAYER_LIBC_SYSTEMINCLUDE $$QMAKE_INCDIR $$INCLUDEPATH
+ for(p, TRY_INCLUDEPATHS) {
+ pp = $$join(p, "", "", "/openssl")
+ exists($$pp):INCLUDEPATH *= $$pp
+ }
+}
diff --git a/config.tests/unix/openssl/openssl.pro b/config.tests/unix/openssl/openssl.pro
new file mode 100644
index 0000000..6891e78
--- /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 0000000..283475d
--- /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 0000000..f7c5a02
--- /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 0000000..4974425
--- /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 0000000..64bb3d6
--- /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 0000000..1307cec
--- /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 0000000..9e15e81
--- /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 0000000..41aba86
--- /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 0000000..fe7301e
--- /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 0000000..ba2cac1
--- /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 0000000..22c21ca
--- /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 0000000..14a64d5
--- /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 0000000..e1c23bd
--- /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 0000000..4cc34a7
--- /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 0000000..ea0737d
--- /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 0000000..d4a21aa
--- /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 0000000..91e5c3a
--- /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 0000000..79a0d9c
--- /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 0000000..a2feab4
--- /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 0000000..ff653a4
--- /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 0000000..54a4859
--- /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 0000000..5516a14
--- /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 0000000..7cd55ca
--- /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 0000000..1191120
--- /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 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/unix/zlib/zlib.cpp b/config.tests/unix/zlib/zlib.cpp
new file mode 100644
index 0000000..58a286f
--- /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 0000000..67cc870
--- /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