Makefile 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include ${TOPDIR}/rules.mk
  4. PKG_NAME:= perl
  5. PKG_VERSION:= 5.18.1
  6. PKG_RELEASE:= 2
  7. PKG_MD5SUM:= 304cb5bd18e48c44edd6053337d3386d
  8. PKG_DESCR:= Perl interpreter
  9. PKG_SECTION:= lang
  10. PKG_BUILDDEP:= perl-host
  11. PKG_URL:= http://www.perl.org/
  12. PKG_SITES:= http://www.cpan.org/src/
  13. PKG_NOPARALLEL:= 1
  14. include ${TOPDIR}/mk/host.mk
  15. include ${TOPDIR}/mk/package.mk
  16. $(eval $(call HOST_template,PERL,perl,${PKG_VERSION}-${PKG_RELEASE}))
  17. $(eval $(call PKG_template,PERL,perl,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  18. HOST_STYLE:= manual
  19. CONFIG_STYLE:= manual
  20. BUILD_STYLE:= manual
  21. INSTALL_STYLE:= manual
  22. # ld memory exhausted problem
  23. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  24. host-configure:
  25. $(SED) "s#@@STAGING_HOST_DIR@@/perl-host#./perl#" ${WRKBUILD}/Makefile.SH
  26. $(SED) "s#@@LIB@@#-Ilib#" ${WRKBUILD}/Makefile.SH
  27. # darwin workaround
  28. $(SED) "s#^usedl.*##" ${WRKBUILD}/hints/darwin.sh
  29. (cd ${WRKBUILD}; ${BASH} ./Configure -des -Duseperlio -Uusedl -Uusethreads -Uuseshrplib -Dprefix=${STAGING_HOST_DIR}/usr)
  30. host-build:
  31. cd ${WRKBUILD} && env CC_FOR_BUILD="gcc" ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  32. ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
  33. perl-hostinstall:
  34. cd ${WRKBUILD} && env CC_FOR_BUILD="gcc" ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  35. ${HOST_MAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  36. mv ${STAGING_HOST_DIR}/usr/bin/perl ${STAGING_HOST_DIR}/usr/bin/perl-host
  37. cp ${WRKBUILD}/miniperl ${STAGING_HOST_DIR}/usr/bin
  38. do-configure:
  39. sed \
  40. -e 's!%%CC%%!$(TARGET_CC)!g' \
  41. -e 's!%%CFLAGS%%!$(TARGET_CFLAGS) -DUSE_CROSS_COMPILE $(TARGET_CPPFLAGS)!g' \
  42. -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
  43. -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
  44. -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \
  45. -e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \
  46. -e 's!%%CPPFLAGS%%!$(TARGET_CPPFLAGS)!g' \
  47. -e 's!%%LIBDIRS%%!$(STAGING_TARGET_DIR)/lib $(STAGING_TARGET_DIR)/usr/lib!g' \
  48. -e 's!%%INCDIRS%%!$(STAGING_TARGET_DIR)/include $(STAGING_TARGET_DIR)/usr/include!g' \
  49. ./files/config.sh.$(CPU_ARCH).$(ADK_TARGET_LIBC) > ${WRKBUILD}/config.sh
  50. $(SED) "s#@@STAGING_HOST_DIR@@#${STAGING_HOST_DIR}/usr/bin#" ${WRKBUILD}/Makefile.SH
  51. $(SED) "s#@@LIB@@##" ${WRKBUILD}/Makefile.SH
  52. (cd ${WRKBUILD}; ./Configure -S)
  53. do-build:
  54. (cd ${WRKBUILD}; $(CP) config.h xconfig.h; $(MAKE) miniperl)
  55. (cd ${WRKBUILD}; $(CP) miniperl miniperl.target)
  56. $(CP) $(STAGING_HOST_DIR)/usr/bin/miniperl ${WRKBUILD}/
  57. touch ${WRKBUILD}/miniperl
  58. (cd ${WRKBUILD}; $(MAKE))
  59. do-install:
  60. (cd ${WRKBUILD}; $(STAGING_HOST_DIR)/usr/bin/perl-host installperl --destdir=${WRKINST})
  61. perl-install:
  62. ${INSTALL_DIR} ${IDIR_PERL}/usr/bin
  63. ${INSTALL_DIR} ${IDIR_PERL}/usr/lib/perl5/${PKG_VERSION}
  64. ${CP} ${WRKINST}/usr/lib/perl5/${PKG_VERSION}/* \
  65. ${IDIR_PERL}/usr/lib/perl5/${PKG_VERSION}
  66. ${INSTALL_BIN} ${WRKINST}/usr/bin/perl ${IDIR_PERL}/usr/bin/
  67. include ${TOPDIR}/mk/host-bottom.mk
  68. include ${TOPDIR}/mk/pkg-bottom.mk