Makefile 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 ${ADK_TOPDIR}/rules.mk
  4. PKG_NAME:= perl
  5. PKG_VERSION:= 5.18.1
  6. PKG_RELEASE:= 3
  7. PKG_HASH:= 655e11a8ffba8853efcdce568a142c232600ed120ac24aaebb4e6efe74e85b2b
  8. PKG_DESCR:= perl interpreter
  9. PKG_SECTION:= dev/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. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
  15. include ${ADK_TOPDIR}/mk/host.mk
  16. include ${ADK_TOPDIR}/mk/package.mk
  17. $(eval $(call HOST_template,PERL,perl,${PKG_VERSION}-${PKG_RELEASE}))
  18. $(eval $(call PKG_template,PERL,perl,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  19. HOST_STYLE:= manual
  20. CONFIG_STYLE:= manual
  21. BUILD_STYLE:= manual
  22. INSTALL_STYLE:= manual
  23. # ld memory exhausted problem
  24. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  25. host-configure:
  26. $(SED) "s#@@STAGING_HOST_DIR@@/perl-host#./perl#" ${WRKBUILD}/Makefile.SH
  27. $(SED) "s#@@LIB@@#-Ilib#" ${WRKBUILD}/Makefile.SH
  28. # darwin workaround
  29. $(CP) ${WRKBUILD}/hints/darwin.sh ${WRKBUILD}/hints/darwin.sh.bak
  30. $(SED) "s#^usedl.*##" ${WRKBUILD}/hints/darwin.sh
  31. (cd ${WRKBUILD}; ${BASH} ./Configure -des -Uusedl -Uusethreads -Duseperlio -Uuseshrplib -Dprefix=${STAGING_HOST_DIR}/usr)
  32. host-build:
  33. cd ${WRKBUILD} && env CC_FOR_BUILD="gcc" ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  34. ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
  35. perl-hostinstall:
  36. cd ${WRKBUILD} && env CC_FOR_BUILD="gcc" ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  37. ${HOST_MAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  38. mv ${STAGING_HOST_DIR}/usr/bin/perl ${STAGING_HOST_DIR}/usr/bin/perl-static
  39. cp ${WRKBUILD}/miniperl ${STAGING_HOST_DIR}/usr/bin
  40. # now build perl a second time for perl modules (dynamic)
  41. $(CP) ${WRKBUILD}/hints/darwin.sh.bak ${WRKBUILD}/hints/darwin.sh
  42. (cd ${WRKBUILD}; rm config.sh; ${BASH} ./Configure -des -Uuseshrplib -Dprefix=${STAGING_HOST_DIR}/usr)
  43. cd ${WRKBUILD} && env CC_FOR_BUILD="gcc" ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  44. ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
  45. cd ${WRKBUILD} && env CC_FOR_BUILD="gcc" ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  46. ${HOST_MAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  47. mv ${STAGING_HOST_DIR}/usr/bin/perl ${STAGING_HOST_DIR}/usr/bin/perl-host
  48. do-configure:
  49. sed \
  50. -e 's!%%CC%%!$(TARGET_CC)!g' \
  51. -e 's!%%CFLAGS%%!$(TARGET_CFLAGS) -DUSE_CROSS_COMPILE $(TARGET_CPPFLAGS)!g' \
  52. -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
  53. -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
  54. -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \
  55. -e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \
  56. -e 's!%%CPPFLAGS%%!$(TARGET_CPPFLAGS)!g' \
  57. -e 's!%%LIBDIRS%%!$(STAGING_TARGET_DIR)/lib $(STAGING_TARGET_DIR)/usr/lib!g' \
  58. -e 's!%%INCDIRS%%!$(STAGING_TARGET_DIR)/include $(STAGING_TARGET_DIR)/usr/include!g' \
  59. ./files/config.sh.$(ADK_TARGET_CPU_ARCH).$(ADK_TARGET_LIBC) > ${WRKBUILD}/config.sh
  60. $(SED) "s#@@STAGING_HOST_DIR@@#${STAGING_HOST_DIR}/usr/bin#" ${WRKBUILD}/Makefile.SH
  61. $(SED) "s#@@LIB@@##" ${WRKBUILD}/Makefile.SH
  62. (cd ${WRKBUILD}; ./Configure -S)
  63. do-build:
  64. (cd ${WRKBUILD}; $(CP) config.h xconfig.h; $(MAKE) miniperl)
  65. (cd ${WRKBUILD}; $(CP) miniperl miniperl.target)
  66. $(CP) $(STAGING_HOST_DIR)/usr/bin/miniperl ${WRKBUILD}/
  67. touch ${WRKBUILD}/miniperl
  68. (cd ${WRKBUILD}; $(MAKE))
  69. do-install:
  70. (cd ${WRKBUILD}; $(STAGING_HOST_DIR)/usr/bin/perl-static installperl --destdir=${WRKINST})
  71. perl-install:
  72. ${INSTALL_DIR} ${IDIR_PERL}/usr/bin
  73. ${INSTALL_DIR} ${IDIR_PERL}/usr/lib/perl5/${PKG_VERSION}
  74. ${CP} ${WRKINST}/usr/lib/perl5/${PKG_VERSION}/* \
  75. ${IDIR_PERL}/usr/lib/perl5/${PKG_VERSION}
  76. ${INSTALL_BIN} ${WRKINST}/usr/bin/perl ${IDIR_PERL}/usr/bin/
  77. touch $(IDIR_PERL)/usr/lib/perl5/$(PKG_VERSION)/$(ADK_TARGET_CPU_ARCH)-linux/CORE/patchlevel-debian.h
  78. include ${ADK_TOPDIR}/mk/host-bottom.mk
  79. include ${ADK_TOPDIR}/mk/pkg-bottom.mk