Makefile 2.3 KB

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