-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·116 lines (98 loc) · 2.26 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#! /bin/sh
prefix=/usr/local
config=release
QMAKE=
usage="Usage: configure [-prefix DIR] [-qmake PATH] [-debug]
Options:
-prefix DIR Set the instalation directory to DIR (default: /usr/local)
-qmake PATH Full path to the 'qmake' program (default: autodetect)
-debug Build with debugging symbols
"
while test $# -gt 0; do
case $1 in
-prefix )
prefix=$2
shift ; shift
;;
-qmake )
QMAKE=$2
shift; shift
;;
-debug )
config=debug
shift
;;
-help | --help )
echo "$usage"
exit
;;
* )
echo "*** ERROR: Unrecognized option '$1'" >&2
echo "$usage"
exit 1
;;
esac
done
echo "Testing for qmake..."
paths=
if test -n "$QMAKE"; then
if test -x "$QMAKE"; then
paths=$QMAKE
else
echo "*** ERROR: '$QMAKE' is not an executable program." >&2
exit 1
fi
else
for i in qmake qmake-qt4; do
if which $i >/dev/null 2>/dev/null; then
paths="$paths `which $i`"
fi
if test -n "$QTDIR"; then
if test -x "$QTDIR/bin/$i"; then
paths="$paths $QTDIR/bin/$i"
fi
fi
done
fi
if test -z "$paths"; then
echo "*** ERROR: Cannot find 'qmake' in your PATH." >&2
exit 1
fi
QMAKE=
for i in $paths; do
version=`$i -query QT_VERSION`
if test "$version" != "**Unknown**"; then
major=`echo $version | sed -e "s/\([0-9][0-9]*\).*/\1/"`
minor=`echo $version | sed -e "s/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/"`
if test $major -eq 4 -a $minor -ge 7; then
QMAKE=$i
break
fi
fi
done
if test -z "$QMAKE"; then
echo "*** ERROR: Cannot find 'qmake' from Qt 4.7 or newer." >&2
exit 1
fi
echo "Using $QMAKE (Qt $version)"
if test -f descend.pro; then
PROJECT=descend.pro
elif test -f ../descend.pro; then
PROJECT=../descend.pro
else
echo "*** ERROR: Cannot find 'descend.pro' in current or parent directory." >&2
exit 1
fi
echo "Writing configuration file..."
echo "# this file was generated by configure" >config.pri
echo "CONFIG += $config" >>config.pri
echo "PREFIX = $prefix" >>config.pri
echo "Generating Makefiles..."
if $QMAKE -recursive $PROJECT; then
echo
echo "Configure finished. Run 'make' now."
echo
else
echo "*** ERROR: Running 'qmake' failed." >&2
exit 1
fi