Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

189 Zeilen
5.4 KiB

  1. #!/bin/sh
  2. #
  3. # Lol Engine build script
  4. # Usage:
  5. # lol-build <action> [<platform>]
  6. #
  7. # Where <action> is one of:
  8. # - bootstrap
  9. # - configure
  10. # - build
  11. # - check
  12. # - clean
  13. #
  14. # And <platform> is one of:
  15. # - linux-i386
  16. # - linux-amd64
  17. # - ios-arm
  18. # - android-arm
  19. # - ps3-ppu
  20. # - windows-i386
  21. # - windows-amd64
  22. #
  23. set -e
  24. action="$1"
  25. platform="$2"
  26. top_srcdir=$(dirname "$0")/..
  27. cd $top_srcdir
  28. top_srcdir="`pwd`"
  29. bootstrap()
  30. {
  31. cd $top_srcdir
  32. case "$platform" in
  33. ios-arm)
  34. # No bootstrapping needed
  35. ;;
  36. android-arm)
  37. # No bootstrapping needed
  38. ;;
  39. windows-i386|windows-amd64)
  40. PATH="$PATH:./contrib/gtk-2.22.1/bin"
  41. M4PATH="$M4PATH:./contrib/gtk-2.22.1/share/aclocal"
  42. PATH="$PATH" M4PATH="$M4PATH" ./bootstrap
  43. ;;
  44. *)
  45. ./bootstrap
  46. ;;
  47. esac
  48. }
  49. configure()
  50. {
  51. cd $top_srcdir
  52. case "$platform" in
  53. windows-i386)
  54. if test "x${SYSTEM}" = xMINGW32; then
  55. :
  56. elif i586-mingw32msvc-g++ --version >/dev/null 2>&1; then
  57. HOSTFLAGS=--host=i586-mingw32msvc
  58. BUILDFLAGS=--build=none
  59. elif i686-w64-mingw32-g++ --version >/dev/null 2>&1; then
  60. HOSTFLAGS=--host=i686-w64-mingw32
  61. BUILDFLAGS=--build=none
  62. else
  63. echo "Error: could not find win32 compiler"
  64. false
  65. fi
  66. LDFLAGS="$LDFLAGS -L$PWD/contrib/glew-1.7.0/lib/i686-w64-mingw32"
  67. ;;
  68. windows-amd64)
  69. if test "x${SYSTEM}" = xMINGW64; then
  70. :
  71. elif x86_64-w64-mingw32-g++ --version >/dev/null 2>&1; then
  72. HOSTFLAGS=--host=x86_64-w64-mingw32
  73. BUILDFLAGS=--build=none
  74. else
  75. echo "Error: could not find win64 compiler"
  76. false
  77. fi
  78. LDFLAGS="$LDFLAGS -L$PWD/contrib/glew-1.7.0/lib/x86_64-w64-mingw32"
  79. ;;
  80. esac
  81. case "$platform" in
  82. ios-arm)
  83. # No configuration needed
  84. ;;
  85. android-arm)
  86. cd monsterz/android
  87. android update project --path .
  88. ;;
  89. ps3-ppu)
  90. ./configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=none
  91. ;;
  92. windows-i386|windows-amd64)
  93. PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PWD/contrib/gtkglarea-2.0.1/lib/pkgconfig"
  94. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/sdl-1.2.14/include"
  95. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/sdl-image-1.2.10/include"
  96. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/sdl-mixer-1.2.11/include"
  97. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/glew-1.7.0/include -DGLEW_STATIC"
  98. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/lib/glib-2.0/include"
  99. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/lib/gtk-2.0/include"
  100. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/glib-2.0"
  101. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/gtk-2.0"
  102. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/cairo"
  103. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/pango-1.0"
  104. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/gdk-pixbuf-2.0"
  105. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/atk-1.0"
  106. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtkglarea-2.0.1/include"
  107. LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-1.2.14/lib"
  108. LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-image-1.2.10/lib"
  109. LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-mixer-1.2.11/lib"
  110. LDFLAGS="$LDFLAGS -L$PWD/contrib/gtk-2.22.1/lib"
  111. LDFLAGS="$LDFLAGS -L$PWD/contrib/gtk-2.22.1/bin"
  112. LDFLAGS="$LDFLAGS -L$PWD/contrib/gtkglarea-2.0.1/lib"
  113. CPPFLAGS="$CPPFLAGS -mms-bitfields"
  114. LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
  115. GTK_LIBS="$GTK_LIBS -lgtkgl-2.0 -lopengl32 -lglew32 -lgdi32"
  116. GTK_LIBS="$GTK_LIBS -lgtk-win32-2.0 -lgdk-win32-2.0"
  117. GTK_LIBS="$GTK_LIBS -lglib-2.0 -lgthread-2.0 -lgobject-2.0"
  118. LOL_LIBS="$LOL_LIBS -lSDL_image -lSDL_mixer -lSDLmain -lSDL -lopengl32 -lglew32"
  119. PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS" LOL_LIBS="$LOL_LIBS"
  120. ;;
  121. *)
  122. ./configure
  123. ;;
  124. esac
  125. }
  126. build()
  127. {
  128. cd $top_srcdir
  129. case "$platform" in
  130. ios-arm)
  131. cd monsterz/ios
  132. xcodebuild -configuration Release -sdk iphonesimulator4.3
  133. ;;
  134. android-arm)
  135. cd monsterz/android
  136. ndk-build
  137. ant compile
  138. ;;
  139. *)
  140. make -j6
  141. ;;
  142. esac
  143. }
  144. check()
  145. {
  146. cd $top_srcdir
  147. case "$platform" in
  148. ios-arm)
  149. ;;
  150. android-arm)
  151. ;;
  152. ps3-ppu)
  153. ;;
  154. *)
  155. make check
  156. ;;
  157. esac
  158. }
  159. clean()
  160. {
  161. cd $top_srcdir
  162. case "$platform" in
  163. ios-arm)
  164. cd monsterz/ios
  165. xcodebuild -configuration Release -sdk iphonesimulator4.3 clean
  166. ;;
  167. android-arm)
  168. cd monsterz/android
  169. ndk-build distclean
  170. ant clean
  171. ;;
  172. *)
  173. make distclean
  174. ;;
  175. esac
  176. }
  177. eval "$action"