Makefile 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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:= openssl
  5. PKG_VERSION:= 1.0.1h
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 8d6d684a9430d5cc98a62a5d8fbda8cf
  8. PKG_DESCR:= secure socket layer libraries
  9. PKG_SECTION:= libs/crypto
  10. PKG_DEPENDS:= zlib
  11. PKG_BUILDDEP:= zlib
  12. PKG_URL:= http://www.openssl.org/
  13. PKG_SITES:= http://www.openssl.org/source/
  14. PKG_LIBNAME:= libopenssl
  15. PKG_OPTS:= dev
  16. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
  17. PKG_SUBPKGS:= LIBOPENSSL OPENSSL_UTIL
  18. PKGSD_OPENSSL_UTIL:= openssl command line tool
  19. PKGSC_OPENSSL_UTIL:= app/crypto
  20. PKGSS_OPENSSL_UTIL:= libopenssl
  21. PKG_FLAVOURS_LIBOPENSSL:= WITH_CRYPTODEV
  22. PKGFD_WITH_CRYPTODEV:= enable support for cryptodev-linux
  23. include ${ADK_TOPDIR}/mk/package.mk
  24. $(eval $(call PKG_template,LIBOPENSSL,libopenssl,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},$(PKG_OPTS)))
  25. $(eval $(call PKG_template,OPENSSL_UTIL,openssl-util,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_OPENSSL_UTIL},${PKGSD_OPENSSL_UTIL},${PKGSC_OPENSSL_UTIL}))
  26. CONFIG_STYLE:= manual
  27. BUILD_STYLE:= manual
  28. INSTALL_TARGET:= install_sw
  29. FAKE_FLAGS+= INSTALL_PREFIX=${WRKINST}
  30. OPENSSL_OPTIONS:= shared threads no-err no-krb5 zlib-dynamic no-engines no-camellia no-idea no-rc5 no-mdc2 no-sha0 no-smime no-aes192 no-ripemd no-cast
  31. ifneq ($(ADK_PACKAGE_LIBOPENSSL_WITH_CRYPTODEV),)
  32. OPENSSL_OPTIONS+= -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
  33. endif
  34. ifeq ($(ADK_LINUX_MICROBLAZE),y)
  35. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  36. endif
  37. ifeq ($(ADK_LINUX_XTENSA),y)
  38. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  39. endif
  40. ifeq ($(ADK_LINUX_X86_64),y)
  41. CONFIG:= linux-embedded-x86_64
  42. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  43. else
  44. CONFIG:= linux-embedded
  45. endif
  46. post-extract:
  47. -mkdir -p $(STAGING_TARGET_DIR)/usr/include/crypto
  48. cp ./files/cryptodev.h $(STAGING_TARGET_DIR)/usr/include/crypto/
  49. do-configure:
  50. (cd $(WRKBUILD); \
  51. PATH='$(TARGET_PATH)' \
  52. OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
  53. ./Configure $(CONFIG) \
  54. --prefix=/usr \
  55. --openssldir=/etc/ssl \
  56. -I$(STAGING_TARGET_DIR)/usr/include \
  57. -L$(STAGING_TARGET_DIR)/usr/lib -ldl \
  58. -DOPENSSL_SMALL_FOOTPRINT \
  59. $(OPENSSL_OPTIONS) \
  60. );
  61. do-build:
  62. $(MAKE) -C $(WRKBUILD) \
  63. CC="$(TARGET_CC)" \
  64. AR="$(TARGET_CROSS)ar r" \
  65. RANLIB="$(TARGET_CROSS)ranlib" \
  66. OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
  67. all build-shared
  68. libopenssl-install:
  69. ${INSTALL_DIR} ${IDIR_LIBOPENSSL}/usr/lib
  70. ${CP} ${WRKINST}/usr/lib*/lib*.so* ${IDIR_LIBOPENSSL}/usr/lib
  71. chmod 644 ${IDIR_LIBOPENSSL}/usr/lib/lib*.so*
  72. openssl-util-install:
  73. ${INSTALL_DIR} ${IDIR_OPENSSL_UTIL}/usr/bin
  74. ${CP} ${WRKINST}/usr/bin/openssl ${IDIR_OPENSSL_UTIL}/usr/bin
  75. ${INSTALL_DIR} ${IDIR_OPENSSL_UTIL}/etc/ssl/{,certs,private}
  76. ${CP} ${WRKSRC}/apps/openssl.cnf ${IDIR_OPENSSL_UTIL}/etc/ssl/
  77. chmod 0700 ${IDIR_OPENSSL_UTIL}/etc/ssl/private
  78. include ${ADK_TOPDIR}/mk/pkg-bottom.mk