Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

72 rindas
2.3 KiB

  1. #! /bin/sh
  2. ## Win32 cross-compilation for libpipi -- Sam Hocevar <sam@zoy.org>
  3. ## $Id$
  4. set -x
  5. set -e
  6. # Clean up our working directory
  7. PROJECT="ThePimp"
  8. SRCDIR="`pwd`"
  9. VERSION="`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
  10. if [ -f .git/svn/trunk/unhandled.log ]; then
  11. VERSION="${VERSION}-`grep '^r' .git/svn/trunk/unhandled.log | tail -n 1`"
  12. elif [ -f .svn/entries ]; then
  13. VERSION="${VERSION}-r`head -n 4 .svn/entries | tail -n 1`"
  14. fi
  15. DIRNAME="${PROJECT}-${VERSION}"
  16. INSTALLDIR="`pwd`/${DIRNAME}"
  17. BUILDDIR="${INSTALLDIR}/build"
  18. rm -Rf "${INSTALLDIR}"
  19. rm -f "${INSTALLDIR}.zip"
  20. mkdir "${INSTALLDIR}"
  21. mkdir "${BUILDDIR}"
  22. make distclean || true
  23. cd "${BUILDDIR}"
  24. # Build for win32
  25. "${SRCDIR}/configure" --host=i686-w64-mingw32 --prefix=/ --bindir=/bin --libdir=/lib CPPFLAGS="-I${SRCDIR}/win32/gdiplus/include" LIBS="-L${SRCDIR}/win32/gdiplus/lib" "$@"
  26. make pkglibdir=/lib pkgdatadir=/data bindir=/bin
  27. # Install into our private directory
  28. make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
  29. # Clean up
  30. cd "${SRCDIR}"
  31. rm -Rf "${BUILDDIR}"
  32. #i686-w64-mingw32-strip "${INSTALLDIR}/bin/"*.exe || true
  33. #i686-w64-mingw32-strip "${INSTALLDIR}/lib/"*.dll || true
  34. # Install pipi.exe
  35. echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\pipi.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
  36. i686-w64-mingw32-gcc run.c -mwindows -o "${INSTALLDIR}/pipi.exe"
  37. i686-w64-mingw32-strip "${INSTALLDIR}/pipi.exe"
  38. # Install gtk-sharp
  39. cp -r "win32/gtksharp/"* "${INSTALLDIR}/"
  40. find "${INSTALLDIR}/" -name .svn -prune -exec rm -rf '{}' ';'
  41. # Install pipi-sharp
  42. mv "${INSTALLDIR}/lib/mono/gac/pipi-sharp/"*/* "${INSTALLDIR}/bin/"
  43. rm -Rf "${INSTALLDIR}/lib/mono"
  44. # Install The Pimp
  45. mv "${INSTALLDIR}/lib/ThePimp.exe" "${INSTALLDIR}/bin/"
  46. echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
  47. i686-w64-mingw32-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe"
  48. i686-w64-mingw32-strip "${INSTALLDIR}/ThePimp.exe"
  49. # Install documentation
  50. mkdir "${INSTALLDIR}/doc"
  51. for f in COPYING NOTES; do
  52. sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
  53. done
  54. rm -f "${INSTALLDIR}/lib/"*.a
  55. rm -f "${INSTALLDIR}/lib/"*.la
  56. # Pack the directory
  57. zip "${DIRNAME}.zip" `find "${DIRNAME}"`
  58. rm -Rf "${INSTALLDIR}"