Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
[qt-netbsd.git] / config.tests / unix / ptrsize.test
blobc1d80eea9d499869e780884e7956d40b904eb489
1 #!/bin/sh
3 QMKSPEC=$1
4 VERBOSE=$2
5 SRCDIR=$3
6 OUTDIR=$4
8 # debuggery
9 [ "$VERBOSE" = "yes" ] && echo "Testing size of pointers ... ($*)"
11 # build and run a test program
12 test -d "$OUTDIR/config.tests/unix/ptrsize" || mkdir -p "$OUTDIR/config.tests/unix/ptrsize"
13 "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/ptrsize/ptrsizetest.pro" -o "$OUTDIR/config.tests/unix/ptrsize/Makefile" >/dev/null 2>&1
14 cd "$OUTDIR/config.tests/unix/ptrsize"
16 if [ "$VERBOSE" = "yes" ]; then
17 ($MAKE clean && $MAKE)
18 else
19 ($MAKE clean && $MAKE) >/dev/null 2>&1
21 RETVAL=$?
23 if [ "$RETVAL" -ne 0 ]; then
24 PTRSIZE=4
25 else
26 PTRSIZE=8
30 # done
31 [ "$VERBOSE" = "yes" ] && echo "Pointer size: $PTRSIZE"
32 exit $PTRSIZE