zlib.mk 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #############################################################
  2. #
  3. # zlib
  4. #
  5. #############################################################
  6. ZLIB_VERSION = 1.2.6
  7. ZLIB_SOURCE =zlib-$(ZLIB_VERSION).tar.bz2
  8. ZLIB_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
  9. ZLIB_INSTALL_STAGING = YES
  10. ifeq ($(BR2_PREFER_STATIC_LIB),y)
  11. ZLIB_PIC :=
  12. ZLIB_SHARED := --static
  13. else
  14. ZLIB_PIC := -fPIC
  15. ZLIB_SHARED := --shared
  16. endif
  17. define ZLIB_CONFIGURE_CMDS
  18. (cd $(@D); rm -rf config.cache; \
  19. $(TARGET_CONFIGURE_ARGS) \
  20. $(TARGET_CONFIGURE_OPTS) \
  21. CFLAGS="$(TARGET_CFLAGS) $(ZLIB_PIC)" \
  22. ./configure \
  23. $(ZLIB_SHARED) \
  24. --prefix=/usr \
  25. )
  26. endef
  27. define HOST_ZLIB_CONFIGURE_CMDS
  28. (cd $(@D); rm -rf config.cache; \
  29. $(HOST_CONFIGURE_ARGS) \
  30. $(HOST_CONFIGURE_OPTS) \
  31. ./configure \
  32. --prefix="$(HOST_DIR)/usr" \
  33. --sysconfdir="$(HOST_DIR)/etc" \
  34. )
  35. endef
  36. define ZLIB_BUILD_CMDS
  37. $(MAKE1) -C $(@D)
  38. endef
  39. define HOST_ZLIB_BUILD_CMDS
  40. $(MAKE1) -C $(@D)
  41. endef
  42. define ZLIB_INSTALL_STAGING_CMDS
  43. $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) LDCONFIG=true install
  44. endef
  45. define ZLIB_INSTALL_TARGET_CMDS
  46. $(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) LDCONFIG=true install
  47. endef
  48. define HOST_ZLIB_INSTALL_CMDS
  49. $(MAKE1) -C $(@D) LDCONFIG=true install
  50. endef
  51. define ZLIB_CLEAN_CMDS
  52. -$(MAKE1) -C $(@D) clean
  53. endef
  54. define ZLIB_UNINSTALL_STAGING_CMDS
  55. $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) uninstall
  56. endef
  57. define ZLIB_UNINSTALL_TARGET_CMDS
  58. $(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) uninstall
  59. endef
  60. define HOST_ZLIB_UNINSTALL_TARGET_CMDS
  61. $(MAKE1) -C $(@D) uninstall
  62. endef
  63. $(eval $(call GENTARGETS))
  64. $(eval $(call GENTARGETS,host))