0
|
1 |
#!/bin/sh
|
|
2 |
|
|
3 |
QMKSPEC=$1
|
|
4 |
VERBOSE=$2
|
|
5 |
SRCDIR=$3
|
|
6 |
OUTDIR=$4
|
|
7 |
|
|
8 |
# debuggery
|
|
9 |
[ "$VERBOSE" = "yes" ] && echo "Testing size of pointers ... ($*)"
|
|
10 |
|
|
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"
|
|
15 |
|
|
16 |
if [ "$VERBOSE" = "yes" ]; then
|
|
17 |
($MAKE clean && $MAKE)
|
|
18 |
else
|
|
19 |
($MAKE clean && $MAKE) >/dev/null 2>&1
|
|
20 |
fi
|
|
21 |
RETVAL=$?
|
|
22 |
|
|
23 |
if [ "$RETVAL" -ne 0 ]; then
|
|
24 |
PTRSIZE=4
|
|
25 |
else
|
|
26 |
PTRSIZE=8
|
|
27 |
fi
|
|
28 |
|
|
29 |
|
|
30 |
# done
|
|
31 |
[ "$VERBOSE" = "yes" ] && echo "Pointer size: $PTRSIZE"
|
|
32 |
exit $PTRSIZE
|