You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

52 lines
1.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. SRCDIR="`pwd`"
  8. DIRNAME="libpipi-win32-`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
  9. INSTALLDIR="`pwd`/${DIRNAME}"
  10. BUILDDIR="${INSTALLDIR}/build"
  11. rm -Rf "${INSTALLDIR}"
  12. rm -f "${INSTALLDIR}.zip"
  13. mkdir "${INSTALLDIR}"
  14. mkdir "${BUILDDIR}"
  15. make distclean || true
  16. cd "${BUILDDIR}"
  17. # Build for win32
  18. "${SRCDIR}/configure" --host=i586-mingw32msvc --prefix=/ --bindir=/bin --libdir=/lib "$@"
  19. make pkglibdir=/lib pkgdatadir=/data bindir=/bin
  20. # Install into our private directory
  21. make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
  22. cd "${SRCDIR}"
  23. rm -Rf "${BUILDDIR}"
  24. mv "${INSTALLDIR}/bin/"* "${INSTALLDIR}/"
  25. mv "${INSTALLDIR}/lib/"* "${INSTALLDIR}/"
  26. i586-mingw32msvc-strip "${INSTALLDIR}/"*.exe || true
  27. i586-mingw32msvc-strip "${INSTALLDIR}/"*.dll || true
  28. rmdir "${INSTALLDIR}/bin"
  29. rmdir "${INSTALLDIR}/lib"
  30. mkdir "${INSTALLDIR}/doc"
  31. for f in COPYING NOTES; do
  32. sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
  33. done
  34. rm -Rf "${INSTALLDIR}/share"
  35. rm -Rf "${INSTALLDIR}/man"
  36. rm -Rf "${INSTALLDIR}/include"
  37. rm -Rf "${INSTALLDIR}/pkg-config"
  38. rm -f "${INSTALLDIR}/"*.a
  39. rm -f "${INSTALLDIR}/"*.la
  40. # Pack the directory
  41. zip "${DIRNAME}.zip" `find "${DIRNAME}"`
  42. rm -Rf "${INSTALLDIR}"