-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·44 lines (30 loc) · 1.01 KB
/
build.sh
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
#!/bin/bash
# this script compiles Qt for development use
if [ -n "$1" ]
then
DEST_DIR=$1
else
DEST_DIR=/opt/qt
fi
mkdir -p "$DEST_DIR"
if [ $? -ne 0 ];
then
echo "Cannot create $DEST_DIR"
exit $?;
fi
touch ${DEST_DIR}/.foo && rm -f ${DEST_DIR}/.foo
if [ $? -ne 0 ];
then
echo "$DEST_DIR is not writable";
exit $?;
fi
./configure -opensource -framework -arch x86 -sdk /Developer/SDKs/MacOSX10.5.sdk -release -prefix $DEST_DIR -qt-sql-odbc -qt-sql-sqlite -buildkey Cedrus-Qt-4.7.1 -no-sql-mysql -no-sql-odbc -no-qt3support -nomake demos -nomake examples
MAKE_FLAGS="-j`sysctl hw.ncpu | awk '// {print $2*1.5}'`"
make $MAKE_FLAGS
make install
defaults write ~/.MacOSX/environment QTDIR "$DEST_DIR"
echo "---------------------------------------------------"
echo "If you do not already have a QTDIR environment variable, you will need to"
echo "log out of Mac OS X and log back in again. This variable has been set"
echo "in ~/.MacOSX/environment.plist"
echo "---------------------------------------------------"