Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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:= python2
  5. PKG_VERSION:= 2.7.1
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 15ed56733655e3fab785e49a7278d2fb
  8. PKG_DESCR:= Python scripting language (Version 2)
  9. PKG_SECTION:= lang
  10. PKG_DEPENDS:= libpthread zlib libffi libopenssl
  11. PKG_BUILDDEP:= zlib libffi openssl
  12. PKG_URL:= http://www.python.org/
  13. PKG_SITES:= http://www.python.org/ftp/python/${PKG_VERSION}/
  14. PKG_OPTS:= noscripts
  15. PKG_HOST_DEPENDS:= !netbsd !openbsd !cygwin
  16. DISTFILES= Python-${PKG_VERSION}.tgz
  17. WRKDIST= ${WRKDIR}/Python-${PKG_VERSION}
  18. include ${TOPDIR}/mk/package.mk
  19. $(eval $(call PKG_template,PYTHON2,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  20. MAKE_ENV+= OPT="$(TARGET_CFLAGS)" \
  21. RANLIB="${TARGET_CROSS}ranlib" \
  22. HOSTPYTHON=./hostpython \
  23. HOSTPGEN=./Parser/hostpgen
  24. CONFIGURE_ENV+= OPT="$(TARGET_CFLAGS)" \
  25. ac_cv_have_long_long_format=yes
  26. CONFIGURE_ARGS:= --with-threads \
  27. --disable-toolbox-glue \
  28. --with-system-ffi \
  29. --without-cxx-main
  30. post-extract:
  31. $(CP) ./files/python-config.in ${WRKBUILD}/Misc/python-config.in
  32. (cd ${WRKBUILD}; rm -rf config.{cache,status} ; \
  33. OPT="$(CFLAGS_FOR_BUILD)" \
  34. ./configure --without-cxx-main --without-threads \
  35. --prefix=$(STAGING_HOST_DIR)/usr \
  36. );
  37. $(MAKE) -C ${WRKBUILD} python Parser/pgen
  38. $(MAKE) -C ${WRKBUILD} install
  39. ${CP} ${WRKBUILD}/Parser/pgen ${STAGING_HOST_DIR}/usr/bin/pgen
  40. ${CP} ${WRKBUILD}/python ${STAGING_HOST_DIR}/usr/bin/hostpython
  41. ${CP} ${WRKBUILD}/Parser/pgen ${WRKBUILD}/Parser/hostpgen
  42. ${CP} ${WRKBUILD}/python ${WRKBUILD}/hostpython
  43. $(MAKE) -C ${WRKBUILD} clean
  44. pre-configure:
  45. $(SED) "s#@@CPU_ARCH@@#$(CPU_ARCH)#" ${WRKBUILD}/configure
  46. post-install:
  47. ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/bin ${IDIR_PYTHON2}/usr/lib
  48. ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/lib/python2.7
  49. ${INSTALL_DIR} ${IDIR_PYTHON2}/usr/include/python2.7
  50. ${INSTALL_BIN} ${WRKINST}/usr/bin/python ${IDIR_PYTHON2}/usr/bin
  51. ${CP} ${WRKINST}/usr/lib/libpython*.so* ${IDIR_PYTHON2}/usr/lib
  52. ${CP} ${WRKINST}/usr/lib/python2.7/* ${IDIR_PYTHON2}/usr/lib/python2.7
  53. ${CP} ${WRKINST}/usr/include/python2.7/* ${IDIR_PYTHON2}/usr/include/python2.7
  54. -find ${IDIR_PYTHON2} -name "\*.pyc" -o -name "*\.pyo" -exec rm {} \;
  55. # workaround, copy host python-config to target scripts directory
  56. ${CP} ${STAGING_HOST_DIR}/usr/bin/python*-config ${STAGING_TARGET_DIR}/scripts
  57. ${CP} ${STAGING_HOST_DIR}/usr/bin/python*-config ${STAGING_TARGET_DIR}/usr/bin
  58. include ${TOPDIR}/mk/pkg-bottom.mk