Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #
  2. # Copyright (C) 2006-2009 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=fuse
  10. PKG_VERSION:=2.7.4
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=@SF/$(PKG_NAME)
  14. PKG_MD5SUM:=4879f06570d2225667534c37fea04213
  15. include $(INCLUDE_DIR)/package.mk
  16. define Package/fuse/Default
  17. TITLE:=FUSE
  18. URL:=http://fuse.sourceforge.net/
  19. endef
  20. define Package/fuse/Default/description
  21. FUSE (Filesystem in UserSpacE)
  22. endef
  23. define Package/fuse-utils
  24. $(call Package/fuse/Default)
  25. SECTION:=utils
  26. CATEGORY:=Utilities
  27. DEPENDS:=+libfuse
  28. TITLE+= (utilities)
  29. SUBMENU:=filesystem
  30. endef
  31. define Package/fuse-utils/description
  32. $(call Package/fuse/Default/description)
  33. This package contains the FUSE utility 'fusermount'.
  34. endef
  35. define KernelPackage/fuse
  36. $(call Package/fuse/Default)
  37. SUBMENU:=Filesystems
  38. DEPENDS:=@LINUX_2_6
  39. TITLE+= (kernel module)
  40. KCONFIG:= CONFIG_FUSE_FS
  41. FILES:=$(LINUX_DIR)/fs/fuse/fuse.$(LINUX_KMOD_SUFFIX)
  42. AUTOLOAD:=$(call AutoLoad,80,fuse)
  43. VERSION:=$(LINUX_VERSION)
  44. endef
  45. define KernelPackage/fuse/description
  46. $(call Package/fuse/Default/description)
  47. This package contains the FUSE kernel module.
  48. endef
  49. define Package/libfuse
  50. $(call Package/fuse/Default)
  51. SECTION:=libs
  52. CATEGORY:=Libraries
  53. TITLE+= (library)
  54. DEPENDS:=+LINUX_2_4:kmod-fuse24 +LINUX_2_6:kmod-fuse
  55. SUBMENU:=filesystem
  56. endef
  57. define Package/libfuse/description
  58. $(call Package/fuse/Default/description)
  59. This package contains the FUSE shared library, needed by other programs.
  60. endef
  61. CONFIGURE_VARS += \
  62. kernsrcver="$(LINUX_VERSION)"
  63. CONFIGURE_ARGS += \
  64. --enable-shared \
  65. --enable-static \
  66. --disable-rpath \
  67. --enable-lib \
  68. --enable-util \
  69. --disable-example \
  70. --disable-auto-modprobe \
  71. --with-kernel="$(LINUX_DIR)" \
  72. --disable-mtab
  73. # This section is disabled; since kernel 2.6.14 the fuse module is officially
  74. # part of the kernel. The following enables this fuse packages kernel module
  75. # instead of the kernel's, if the kernel is younger than 2.6.25.
  76. # Generally it is better to use the kernel's module. Because it is DCACHE BUG
  77. # patched and from fuse 2.8.0 on it will be removed from the fuse package
  78. # anyway.
  79. #
  80. #ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),lt,2.6.25)),1)
  81. # define KernelPackage/fuse/2.6
  82. # KCONFIG:=
  83. # FILES:=$(PKG_INSTALL_DIR)/lib/modules/$(LINUX_VERSION)/kernel/fs/fuse/fuse.$(LINUX_KMOD_SUFFIX)
  84. # endef
  85. #
  86. # CONFIGURE_ARGS += --enable-kernel-module
  87. #else
  88. # CONFIGURE_ARGS += --disable-kernel-module
  89. #endif
  90. define Build/Configure
  91. (cd $(PKG_BUILD_DIR); rm -f config.cache; \
  92. touch configure.in ; \
  93. touch aclocal.m4 ; \
  94. touch Makefile.in ; \
  95. touch include/config.h.in ; \
  96. touch configure ; \
  97. )
  98. $(call Build/Configure/Default)
  99. endef
  100. define Build/Compile
  101. $(MAKE) -C $(PKG_BUILD_DIR) \
  102. ARCH="$(LINUX_KARCH)" \
  103. CROSS_COMPILE="$(TARGET_CROSS)" \
  104. DESTDIR="$(PKG_INSTALL_DIR)" \
  105. AM_CFLAGS="$(TARGET_CFLAGS) -DDISABLE_COMPAT=1" \
  106. EXTRA_DIST="" \
  107. all install
  108. endef
  109. define Build/InstallDev
  110. mkdir -p $(1)/usr/include
  111. $(CP) $(PKG_INSTALL_DIR)/usr/include/fuse{,.h} $(1)/usr/include/
  112. mkdir -p $(1)/usr/lib
  113. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfuse.{a,so*} $(1)/usr/lib/
  114. mkdir -p $(1)/usr/lib/pkgconfig
  115. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fuse.pc $(1)/usr/lib/pkgconfig/
  116. $(SED) 's,-I$$$${includedir}/fuse,,g' $(1)/usr/lib/pkgconfig/fuse.pc
  117. $(SED) 's,-L$$$${libdir},,g' $(1)/usr/lib/pkgconfig/fuse.pc
  118. endef
  119. define Package/fuse-utils/install
  120. $(INSTALL_DIR) $(1)/usr/bin
  121. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fusermount $(1)/usr/bin/
  122. endef
  123. define Package/libfuse/install
  124. $(INSTALL_DIR) $(1)/usr/lib
  125. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfuse.so.* $(1)/usr/lib/
  126. endef
  127. $(eval $(call BuildPackage,fuse-utils))
  128. $(eval $(call BuildPackage,libfuse))
  129. $(eval $(call KernelPackage,fuse))