Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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:= 1
  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/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-cast
  31. ifneq ($(ADK_PACKAGE_LIBOPENSSL_WITH_CRYPTODEV),)
  32. OPENSSL_OPTIONS+= -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
  33. endif
  34. ifeq ($(ADK_TARGET_ARCH_MICROBLAZE),y)
  35. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  36. endif
  37. ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
  38. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  39. endif
  40. ifeq ($(ADK_TARGET_ARCH_PPC),y)
  41. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  42. endif
  43. ifeq ($(ADK_TARGET_ARCH_X86_64),y)
  44. CONFIG:= linux-embedded-x86_64
  45. TARGET_CFLAGS:= $(subst g3,g,$(TARGET_CFLAGS))
  46. else
  47. CONFIG:= linux-embedded
  48. endif
  49. post-extract:
  50. -mkdir -p $(STAGING_TARGET_DIR)/usr/include/crypto
  51. $(CP) ./files/cryptodev.h $(STAGING_TARGET_DIR)/usr/include/crypto/
  52. do-configure:
  53. (cd $(WRKBUILD); \
  54. PATH='$(TARGET_PATH)' \
  55. OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
  56. ./Configure $(CONFIG) \
  57. --prefix=/usr \
  58. --openssldir=/etc/ssl \
  59. -I$(STAGING_TARGET_DIR)/usr/include \
  60. -L$(STAGING_TARGET_DIR)/usr/lib \
  61. -DOPENSSL_SMALL_FOOTPRINT \
  62. $(OPENSSL_OPTIONS) \
  63. );
  64. do-build:
  65. $(MAKE) -C $(WRKBUILD) \
  66. CC="$(TARGET_CC)" \
  67. AR="$(TARGET_CROSS)ar r" \
  68. RANLIB="$(TARGET_CROSS)ranlib" \
  69. OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
  70. all build-shared
  71. libopenssl-install:
  72. ${INSTALL_DIR} ${IDIR_LIBOPENSSL}/usr/lib
  73. ${CP} ${WRKINST}/usr/lib*/lib*.so* ${IDIR_LIBOPENSSL}/usr/lib
  74. chmod 644 ${IDIR_LIBOPENSSL}/usr/lib/lib*.so*
  75. openssl-util-install:
  76. ${INSTALL_DIR} ${IDIR_OPENSSL_UTIL}/usr/bin
  77. ${CP} ${WRKINST}/usr/bin/openssl ${IDIR_OPENSSL_UTIL}/usr/bin
  78. ${INSTALL_DIR} ${IDIR_OPENSSL_UTIL}/etc/ssl/{,certs,private}
  79. ${CP} ${WRKSRC}/apps/openssl.cnf ${IDIR_OPENSSL_UTIL}/etc/ssl/
  80. chmod 0700 ${IDIR_OPENSSL_UTIL}/etc/ssl/private
  81. include ${ADK_TOPDIR}/mk/pkg-bottom.mk