No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

191 líneas
5.5 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${MSYSTEM}" = 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" >&2
  64. false
  65. fi
  66. LDFLAGS="$LDFLAGS -L$PWD/contrib/glew-1.7.0/lib/i686-w64-mingw32"
  67. LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-1.2.14/lib/i686-w64-mingw32"
  68. ;;
  69. windows-amd64)
  70. if test "x${MSYSTEM}" = xMINGW64; then
  71. :
  72. elif x86_64-w64-mingw32-g++ --version >/dev/null 2>&1; then
  73. HOSTFLAGS=--host=x86_64-w64-mingw32
  74. BUILDFLAGS=--build=none
  75. else
  76. echo "Error: could not find win64 compiler" >&2
  77. false
  78. fi
  79. LDFLAGS="$LDFLAGS -L$PWD/contrib/glew-1.7.0/lib/x86_64-w64-mingw32"
  80. LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-1.2.14/lib/x86_64-w64-mingw32"
  81. ;;
  82. esac
  83. case "$platform" in
  84. ios-arm)
  85. # No configuration needed
  86. ;;
  87. android-arm)
  88. cd monsterz/android
  89. android update project --path .
  90. ;;
  91. ps3-ppu)
  92. ./configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=none
  93. ;;
  94. windows-i386|windows-amd64)
  95. PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PWD/contrib/gtkglarea-2.0.1/lib/pkgconfig"
  96. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/sdl-1.2.14/include"
  97. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/sdl-image-1.2.10/include"
  98. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/sdl-mixer-1.2.11/include"
  99. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/glew-1.7.0/include -DGLEW_STATIC"
  100. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/lib/glib-2.0/include"
  101. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/lib/gtk-2.0/include"
  102. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/glib-2.0"
  103. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/gtk-2.0"
  104. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/cairo"
  105. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/pango-1.0"
  106. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/gdk-pixbuf-2.0"
  107. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/atk-1.0"
  108. CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtkglarea-2.0.1/include"
  109. LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-image-1.2.10/lib"
  110. LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-mixer-1.2.11/lib"
  111. LDFLAGS="$LDFLAGS -L$PWD/contrib/gtk-2.22.1/lib"
  112. LDFLAGS="$LDFLAGS -L$PWD/contrib/gtk-2.22.1/bin"
  113. LDFLAGS="$LDFLAGS -L$PWD/contrib/gtkglarea-2.0.1/lib"
  114. CPPFLAGS="$CPPFLAGS -mms-bitfields"
  115. LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
  116. GTK_LIBS="$GTK_LIBS -lgtkgl-2.0 -lopengl32 -lglew32 -lgdi32"
  117. GTK_LIBS="$GTK_LIBS -lgtk-win32-2.0 -lgdk-win32-2.0"
  118. GTK_LIBS="$GTK_LIBS -lglib-2.0 -lgthread-2.0 -lgobject-2.0"
  119. LOL_LIBS="$LOL_LIBS -lSDL_image -lSDL_mixer -lSDLmain -lSDL -lopengl32 -lglew32"
  120. PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS" LOL_LIBS="$LOL_LIBS"
  121. ;;
  122. *)
  123. ./configure
  124. ;;
  125. esac
  126. }
  127. build()
  128. {
  129. cd $top_srcdir
  130. case "$platform" in
  131. ios-arm)
  132. cd monsterz/ios
  133. xcodebuild -configuration Release -sdk iphonesimulator4.3
  134. ;;
  135. android-arm)
  136. cd monsterz/android
  137. ndk-build
  138. ant compile
  139. ;;
  140. *)
  141. make -j6
  142. ;;
  143. esac
  144. }
  145. check()
  146. {
  147. cd $top_srcdir
  148. case "$platform" in
  149. ios-arm)
  150. ;;
  151. android-arm)
  152. ;;
  153. ps3-ppu)
  154. ;;
  155. *)
  156. make check
  157. ;;
  158. esac
  159. }
  160. clean()
  161. {
  162. cd $top_srcdir
  163. case "$platform" in
  164. ios-arm)
  165. cd monsterz/ios
  166. xcodebuild -configuration Release -sdk iphonesimulator4.3 clean
  167. ;;
  168. android-arm)
  169. cd monsterz/android
  170. ndk-build distclean
  171. ant clean
  172. ;;
  173. *)
  174. make distclean
  175. ;;
  176. esac
  177. }
  178. echo "lol-build: executing action '$action' on platform '$platform'" >&2
  179. eval "$action"