Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.1j
  6. PKG_RELEASE:= 2
  7. PKG_HASH:= 1b60ca8789ba6f03e8ef20da2293b8dc131c39d83814e775069f02d26354edf3
  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/host.mk
  24. include ${ADK_TOPDIR}/mk/package.mk
  25. $(eval $(call HOST_template,OPENSSL,openssl,${PKG_VERSION}-${PKG_RELEASE}))
  26. $(eval $(call PKG_template,LIBOPENSSL,libopenssl,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},$(PKG_OPTS)))
  27. $(eval $(call PKG_template,OPENSSL_UTIL,openssl-util,${PKG_VERSION}-${PKG_RELEASE},${PKGSS_OPENSSL_UTIL},${PKGSD_OPENSSL_UTIL},${PKGSC_OPENSSL_UTIL}))
  28. 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-cast
  29. HOST_STYLE:= manual
  30. CONFIG_STYLE:= manual
  31. BUILD_STYLE:= manual
  32. INSTALL_TARGET:= install_sw
  33. FAKE_FLAGS+= INSTALL_PREFIX=${WRKINST}
  34. ifneq ($(ADK_PACKAGE_LIBOPENSSL_WITH_CRYPTODEV),)
  35. OPENSSL_OPTIONS+= -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
  36. endif
  37. ifeq ($(ADK_TARGET_ARCH_MICROBLAZE),y)
  38. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  39. endif
  40. ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
  41. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  42. endif
  43. ifeq ($(ADK_TARGET_ARCH_PPC),y)
  44. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  45. endif
  46. ifeq ($(ADK_TARGET_ARCH_X86_64),y)
  47. CONFIG:= linux-embedded-x86_64
  48. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  49. else
  50. CONFIG:= linux-embedded
  51. endif
  52. host-configure:
  53. (cd $(WRKBUILD); ./config --prefix='$(STAGING_HOST_DIR)/usr' -fPIC)
  54. host-build:
  55. (cd $(WRKBUILD); make)
  56. openssl-hostinstall:
  57. (cd $(WRKBUILD); make install)
  58. post-extract:
  59. -mkdir -p $(STAGING_TARGET_DIR)/usr/include/crypto
  60. $(CP) ./files/cryptodev.h $(STAGING_TARGET_DIR)/usr/include/crypto/
  61. do-configure:
  62. (cd $(WRKBUILD); \
  63. PATH='$(TARGET_PATH)' \
  64. OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
  65. ./Configure $(CONFIG) \
  66. --prefix=/usr \
  67. --openssldir=/etc/ssl \
  68. -I$(STAGING_TARGET_DIR)/usr/include \
  69. -L$(STAGING_TARGET_DIR)/usr/lib \
  70. -DOPENSSL_SMALL_FOOTPRINT \
  71. $(OPENSSL_OPTIONS) \
  72. );
  73. do-build:
  74. $(MAKE) -C $(WRKBUILD) \
  75. CC="$(TARGET_CC)" \
  76. AR="$(TARGET_CROSS)ar r" \
  77. RANLIB="$(TARGET_CROSS)ranlib" \
  78. OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
  79. all build-shared
  80. libopenssl-install:
  81. ${INSTALL_DIR} ${IDIR_LIBOPENSSL}/usr/lib
  82. ${CP} ${WRKINST}/usr/lib*/lib*.so* ${IDIR_LIBOPENSSL}/usr/lib
  83. chmod 644 ${IDIR_LIBOPENSSL}/usr/lib/lib*.so*
  84. openssl-util-install:
  85. ${INSTALL_DIR} ${IDIR_OPENSSL_UTIL}/usr/bin
  86. ${CP} ${WRKINST}/usr/bin/openssl ${IDIR_OPENSSL_UTIL}/usr/bin
  87. ${INSTALL_DIR} ${IDIR_OPENSSL_UTIL}/etc/ssl/{,certs,private}
  88. ${CP} ${WRKSRC}/apps/openssl.cnf ${IDIR_OPENSSL_UTIL}/etc/ssl/
  89. chmod 0700 ${IDIR_OPENSSL_UTIL}/etc/ssl/private
  90. include ${ADK_TOPDIR}/mk/host-bottom.mk
  91. include ${ADK_TOPDIR}/mk/pkg-bottom.mk