1
0

Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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:= 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 ${TOPDIR}/mk/host.mk
  16. include ${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. $(SED) "s#^usedl.*##" ${WRKBUILD}/hints/darwin.sh
  30. (cd ${WRKBUILD}; ${BASH} ./Configure -des -Duseperlio -Uusedl -Uusethreads -Uuseshrplib -Dprefix=${STAGING_HOST_DIR}/usr)
  31. host-build:
  32. cd ${WRKBUILD} && env CC_FOR_BUILD="gcc" ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  33. ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
  34. perl-hostinstall:
  35. cd ${WRKBUILD} && env CC_FOR_BUILD="gcc" ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  36. ${HOST_MAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  37. mv ${STAGING_HOST_DIR}/usr/bin/perl ${STAGING_HOST_DIR}/usr/bin/perl-host
  38. cp ${WRKBUILD}/miniperl ${STAGING_HOST_DIR}/usr/bin
  39. do-configure:
  40. sed \
  41. -e 's!%%CC%%!$(TARGET_CC)!g' \
  42. -e 's!%%CFLAGS%%!$(TARGET_CFLAGS) -DUSE_CROSS_COMPILE $(TARGET_CPPFLAGS)!g' \
  43. -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
  44. -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
  45. -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \
  46. -e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \
  47. -e 's!%%CPPFLAGS%%!$(TARGET_CPPFLAGS)!g' \
  48. -e 's!%%LIBDIRS%%!$(STAGING_TARGET_DIR)/lib $(STAGING_TARGET_DIR)/usr/lib!g' \
  49. -e 's!%%INCDIRS%%!$(STAGING_TARGET_DIR)/include $(STAGING_TARGET_DIR)/usr/include!g' \
  50. ./files/config.sh.$(ADK_TARGET_CPU_ARCH).$(ADK_TARGET_LIBC) > ${WRKBUILD}/config.sh
  51. $(SED) "s#@@STAGING_HOST_DIR@@#${STAGING_HOST_DIR}/usr/bin#" ${WRKBUILD}/Makefile.SH
  52. $(SED) "s#@@LIB@@##" ${WRKBUILD}/Makefile.SH
  53. (cd ${WRKBUILD}; ./Configure -S)
  54. do-build:
  55. (cd ${WRKBUILD}; $(CP) config.h xconfig.h; $(MAKE) miniperl)
  56. (cd ${WRKBUILD}; $(CP) miniperl miniperl.target)
  57. $(CP) $(STAGING_HOST_DIR)/usr/bin/miniperl ${WRKBUILD}/
  58. touch ${WRKBUILD}/miniperl
  59. (cd ${WRKBUILD}; $(MAKE))
  60. do-install:
  61. (cd ${WRKBUILD}; $(STAGING_HOST_DIR)/usr/bin/perl-host installperl --destdir=${WRKINST})
  62. perl-install:
  63. ${INSTALL_DIR} ${IDIR_PERL}/usr/bin
  64. ${INSTALL_DIR} ${IDIR_PERL}/usr/lib/perl5/${PKG_VERSION}
  65. ${CP} ${WRKINST}/usr/lib/perl5/${PKG_VERSION}/* \
  66. ${IDIR_PERL}/usr/lib/perl5/${PKG_VERSION}
  67. ${INSTALL_BIN} ${WRKINST}/usr/bin/perl ${IDIR_PERL}/usr/bin/
  68. include ${TOPDIR}/mk/host-bottom.mk
  69. include ${TOPDIR}/mk/pkg-bottom.mk