@@ -7,88 +7,88 @@ LUA_PATCH=1
77ME=$PWD /` basename $0 `
88
99usage () {
10- echo " Usage: $0 [options] {DF_OSX_PATH}"
11- echo -e " \told\t- use on pre-Snow Leopard OSX installations"
12- echo -e " \tbrew\t- if GCC 4.5 was installed with homebrew"
13- echo -e " \tport\t- if GCC 4.5 was insalled with macports"
14- echo -e " \tclean\t- delete ../build-osx before compiling"
15- echo " Example:"
16- echo -e " \t$0 old brew ../../../personal/df_osx"
17- echo -e " \t$0 port clean /Users/dfplayer/df_osx"
18- exit $1
10+ echo " Usage: $0 [options] {DF_OSX_PATH}"
11+ echo -e " \told\t- use on pre-Snow Leopard OSX installations"
12+ echo -e " \tbrew\t- if GCC 4.5 was installed with homebrew"
13+ echo -e " \tport\t- if GCC 4.5 was insalled with macports"
14+ echo -e " \tclean\t- delete ../build-osx before compiling"
15+ echo " Example:"
16+ echo -e " \t$0 old brew ../../../personal/df_osx"
17+ echo -e " \t$0 port clean /Users/dfplayer/df_osx"
18+ exit $1
1919}
2020
2121options () {
22- case $1 in
23- brew)
24- echo " Using homebrew gcc."
25- export CC=/usr/local/bin/gcc-4.5
26- export CXX=/usr/local/bin/g++-4.5
27- targetted=1
28- ;;
29- port)
30- echo " Using macports gcc."
31- export CC=/opt/local/bin/gcc-mp-4.5
32- export CXX=/opt/local/bin/g++-mp-4.5
33- targetted=1
34- ;;
35- old)
36- LUA_PATCH=0
37- ;;
38- clean)
39- echo " Deleting ../build-osx"
40- rm -rf ../build-osx
41- ;;
42- * )
43- ;;
44- esac
22+ case $1 in
23+ brew)
24+ echo " Using homebrew gcc."
25+ export CC=/usr/local/bin/gcc-4.5
26+ export CXX=/usr/local/bin/g++-4.5
27+ targetted=1
28+ ;;
29+ port)
30+ echo " Using macports gcc."
31+ export CC=/opt/local/bin/gcc-mp-4.5
32+ export CXX=/opt/local/bin/g++-mp-4.5
33+ targetted=1
34+ ;;
35+ old)
36+ LUA_PATCH=0
37+ ;;
38+ clean)
39+ echo " Deleting ../build-osx"
40+ rm -rf ../build-osx
41+ ;;
42+ * )
43+ ;;
44+ esac
4545}
4646
4747# sanity checks
4848if [[ $# -lt 1 ]]
4949then
50- echo " Not enough arguments."
51- usage 0
50+ echo " Not enough arguments."
51+ usage 0
5252fi
5353if [[ $# -gt 4 ]]
5454then
55- echo " Too many arguments."
56- usage 1
55+ echo " Too many arguments."
56+ usage 1
5757fi
5858
5959# run through the arguments
6060for last
6161do
62- options $last
62+ options $last
6363done
6464# last keeps the last argument
6565
6666if [[ $targetted -eq 0 ]]
6767then
68- echo " You did not specify whether you intalled GCC 4.5 from brew or ports."
69- echo " If you continue, your default compiler will be used."
70- read -p " Are you sure you want to continue? [y/N] " -n 1 -r
71- echo # (optional) move to a new line
72- if [[ ! $REPLY =~ ^[Yy]$ ]]
73- then
74- exit 0
75- fi
68+ echo " You did not specify whether you intalled GCC 4.5 from brew or ports."
69+ echo " If you continue, your default compiler will be used."
70+ read -p " Are you sure you want to continue? [y/N] " -n 1 -r
71+ echo # (optional) move to a new line
72+ if [[ ! $REPLY =~ ^[Yy]$ ]]
73+ then
74+ exit 0
75+ fi
7676fi
7777
7878# check for build folder and start working there
7979if [[ ! -d ../build-osx ]]
8080then
81- mkdir ../build-osx
81+ mkdir ../build-osx
8282fi
8383cd ../build-osx
8484
8585# patch if necessary
8686if [[ $LUA_PATCH -ne 0 ]]
8787then
88- cd ..
89- echo " $PWD "
90- sed -e ' 1,/' " PATCH" " CODE" ' /d' " $ME " | patch -p0
91- cd -
88+ cd ..
89+ echo " $PWD "
90+ sed -e ' 1,/' " PATCH" " CODE" ' /d' " $ME " | patch -p0
91+ cd -
9292fi
9393
9494echo " Generate"
@@ -101,17 +101,17 @@ make install
101101# unpatch if /libarary/luaTypes.cpp was patched
102102if [[ $LUA_PATCH -ne 0 ]]
103103then
104- cd ..
105- echo -n " un"
106- sed -e ' 1,/' " PATCH" " CODE" ' /d' " $ME " | patch -p0 -R
107- cd -
104+ cd ..
105+ echo -n " un"
106+ sed -e ' 1,/' " PATCH" " CODE" ' /d' " $ME " | patch -p0 -R
107+ cd -
108108fi
109109
110110exit 0
111111
112112# PATCHCODE - everything below this line is fed into patch
113- --- library/LuaTypes.cpp 2014-08-20 00:13:17.000000000 -0700
114- +++ library/LuaTypes.cpp 2014-08-31 23:31:00.000000000 -0700
113+ --- library/LuaTypes.cpp 2014-08-20 00:13:17.000000000 -0700
114+ +++ library/LuaTypes.cpp 2014-08-31 23:31:00.000000000 -0700
115115@@ -464,7 +464,7 @@
116116 {
117117 case struct_field_info::STATIC_STRING:
0 commit comments