forked from wxFormBuilder/wxFormBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_build_files5.sh
executable file
·83 lines (74 loc) · 2.7 KB
/
create_build_files5.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
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
#!/bin/sh
# Parse command line options
shared=""
arch=""
wxroot=""
wxpath=`wx-config --prefix`
# These works only on wxWidgets 2.8.10+
#wxcharset=`wx-config --query-chartype`
#wxversion=`wx-config --query-version`
for args in "$@"
do
haveroot=`expr "${args}" : '--wx-root=.*'`
havearch=`expr "${args}" : '--architecture=.*'`
haverpath=`expr "${args}" : '--rpath=.*'`
if ( [ ${args} = "--help" ] || [ ${args} = "-h" ] ); then
echo "Available options:"
echo
echo "--disable-mediactrl Disable wxMediaCtrl / wxMedia library."
echo
echo "--disable-shared Use static wxWidgets build instead of shared libraries."
echo
echo "--wx-root Specify the wxWidgets build path,"
echo " useful for wxWidgets builds not installed"
echo " in your system (alternate/custom builds)"
echo " Example: --wx-root=/home/devel/wx/3.0/buildgtk"
echo " Current: $wxpath"
echo
echo "--architecture Specify build architecture (e.g. --architecture=i386)."
echo "--rpath Specify a rpath (e.g. --rpath=/usr/lib/wxformbuilder)."
echo
exit
elif [ ${args} = "--disable-mediactrl" ]; then
mediactrl="--disable-mediactrl"
continue
elif [ ${args} = "--disable-shared" ]; then
shared="--disable-shared"
continue
elif ( [ "$haveroot" -gt "0" ] ); then
wxroot=${args}
continue
elif ( [ "$havearch" -gt "0" ] ); then
arch=${args}
continue
elif ( [ "$haverpath" -gt "0" ] ); then
rpath=${args}
continue
fi
done
# Autodetect wxWidgets version
if [ "$wxroot" = "" ]; then
wxver=`wx-config --release`
else
wxpath=${wxroot#-*=}
wxver=`$wxpath/wx-config --release`
fi
wxversion="--wx-version="$wxver
# Autodetect OS
isbsd=`expr "$unamestr" : '.*BSD'`
platform="unknown"
unamestr=$(uname)
if ( [ "$isbsd" -gt "0" ] ); then
platform="bsd"
elif [ "$unamestr" = "Linux" ]; then
platform="unix"
elif [ "$unamestr" = "Darwin" ]; then
platform="macosx"
fi
# Build premake
make config=release -C ./build/premake/5.0/build/gmake.$platform
./build/premake/5.0/bin/release/premake5 --file=./build/premake/solution.lua $wxroot $wxversion $mediactrl $shared $arch $rpath codelite
./build/premake/5.0/bin/release/premake5 --file=./build/premake/solution.lua $wxroot $wxversion $mediactrl $shared $arch $rpath gmake2
if [ "$platform" = "macosx" ]; then
./build/premake/5.0/bin/release/premake5 --file=./build/premake/solution.lua $wxroot $wxversion $mediactrl $shared $arch xcode4
fi