forked from abhikalitra/qttrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·82 lines (76 loc) · 2.35 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
#!/bin/sh
echo -n "Determining Qt version ..."
qtVersionMajorRequired="4"
qtVersionMinorRequired="5"
qtMessage="This version of Qttrader requires Qt$qtVersionMajorRequired.$qtVersionMinorRequired or better"
qmakeCmd=`command -v qmake-qt4`
qtVersionOk="false"
if [ -z "$qmakeCmd" ] ; then
qmakeOk="false"
echo " not found"
echo "ERROR: Qt is not properly installed - cannot find 'qmake'"
else
qmakeOk="true"
qtVersionOk="true"
qtVersion=`"$qmakeCmd" --version 2>&1 | sed -n '/[0-9]\.[0-9]\.[0-9]/s/^.*\([0-9]\.[0-9]\.[0-9]\).*$/\1/p'`
echo -n " $qtVersion ..."
qtVersionMajor=`echo $qtVersion | sed 's/^\([0-9]\)\..*$/\1/'`
qtVersionMinor=`echo $qtVersion | sed 's/^[0-9]\.\([0-9]\)\..*$/\1/'`
if [ $qtVersionMajor -ne $qtVersionMajorRequired ]; then
qtVersionOk="false"
elif [ $qtVersionMinor -lt $qtVersionMinorRequired ]; then
qtVersionOk="false"
fi
if [ "$qtVersionOk" != "true" ]; then
echo " not okay"
echo "ERROR: $qtMessage"
else
echo " okay"
fi
fi
echo -n "Determining TA-Lib version ..."
talibCmd=`command -v ta-lib-config`
if [ -z "$talibCmd" ] ; then
talibOk="false"
echo " not found"
echo "ERROR: TA-Lib is not properly installed - cannot find 'ta-lib-config'"
else
talibOk="true"
talibVersion=`"$talibCmd" --version`
echo -n " $talibVersion ..."
echo " okay"
fi
if [ "$qmakeOk" != "true" ] || [ "$qtVersionOk" != "true" ] || [ "$talibOk" != "true" ]; then
echo "ERROR: There were configuration issues."
exit 1
fi
echo
echo "Building Makefile ..."
if [ -z $1 ] ; then
echo "No parameter given, defaulting to debug mode"
qmake-qt4 "DEFINES += QT_NO_COMPAT" "CONFIG += qt debug" -o Makefile qttrader.pro
else
if [ $1 != "release" ] ; then
echo "Parameter given, generating debug"
qmake-qt4 "DEFINES += QT_NO_COMPAT" "CONFIG += qt debug" -o Makefile qttrader.pro
else
echo "Parameter given, generating release"
qmake-qt4 "DEFINES += QT_NO_COMPAT" "CONFIG += qt release" -o Makefile qttrader.pro
fi
fi
if [ "$?" -ne "0" ]; then
echo "ERROR: See configuration messages above."
exit 1
else
echo "Done"
fi
echo
echo "Creating national language files in i18n ..."
qmake-qt4 -project -r -o qttrader_single.pro .
lupdate-qt4 qttrader_single.pro
echo "Done"
echo "Compiling existing translations ..."
lrelease-qt4 i18n/qttrader_??.ts
echo "Done"
echo
echo "You may now 'make && sudo make install'"