package-defaults.mk 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #
  2. # Copyright (C) 2006 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. PKG_DEFAULT_DEPENDS = +libc +USE_EGLIBC:librt +USE_EGLIBC:libpthread
  8. ifneq ($(PKG_NAME),toolchain)
  9. PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))
  10. else
  11. PKG_FIXUP_DEPENDS = $(2)
  12. endif
  13. define Package/Default
  14. CONFIGFILE:=
  15. SECTION:=opt
  16. CATEGORY:=Extra packages
  17. DEPENDS:=
  18. MDEPENDS:=
  19. PROVIDES:=
  20. EXTRA_DEPENDS:=
  21. MAINTAINER:=$(PKG_MAINTAINER)
  22. SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
  23. ifneq ($(PKG_VERSION),)
  24. ifneq ($(PKG_RELEASE),)
  25. VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
  26. else
  27. VERSION:=$(PKG_VERSION)
  28. endif
  29. else
  30. VERSION:=$(PKG_RELEASE)
  31. endif
  32. ABI_VERSION:=
  33. ifneq ($(PKG_FLAGS),)
  34. PKGFLAGS:=$(PKG_FLAGS)
  35. else
  36. PKGFLAGS:=
  37. endif
  38. ifneq ($(ARCH_PACKAGES),)
  39. PKGARCH:=$(ARCH_PACKAGES)
  40. else
  41. PKGARCH:=$(BOARD)
  42. endif
  43. DEFAULT:=
  44. MENU:=
  45. SUBMENU:=
  46. SUBMENUDEP:=
  47. TITLE:=
  48. KCONFIG:=
  49. BUILDONLY:=
  50. HIDDEN:=
  51. URL:=
  52. VARIANT:=
  53. endef
  54. Build/Patch:=$(Build/Patch/Default)
  55. ifneq ($(strip $(PKG_UNPACK)),)
  56. define Build/Prepare/Default
  57. $(PKG_UNPACK)
  58. $(Build/Patch)
  59. endef
  60. endif
  61. EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)
  62. CONFIGURE_PREFIX:=/usr
  63. CONFIGURE_ARGS = \
  64. --target=$(GNU_TARGET_NAME) \
  65. --host=$(GNU_TARGET_NAME) \
  66. --build=$(GNU_HOST_NAME) \
  67. --program-prefix="" \
  68. --program-suffix="" \
  69. --prefix=$(CONFIGURE_PREFIX) \
  70. --exec-prefix=$(CONFIGURE_PREFIX) \
  71. --bindir=$(CONFIGURE_PREFIX)/bin \
  72. --sbindir=$(CONFIGURE_PREFIX)/sbin \
  73. --libexecdir=$(CONFIGURE_PREFIX)/lib \
  74. --sysconfdir=/etc \
  75. --datadir=$(CONFIGURE_PREFIX)/share \
  76. --localstatedir=/var \
  77. --mandir=$(CONFIGURE_PREFIX)/man \
  78. --infodir=$(CONFIGURE_PREFIX)/info \
  79. $(DISABLE_NLS) \
  80. $(DISABLE_LARGEFILE) \
  81. $(DISABLE_IPV6)
  82. CONFIGURE_VARS = \
  83. $(TARGET_CONFIGURE_OPTS) \
  84. CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
  85. CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CFLAGS)" \
  86. CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
  87. LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
  88. CONFIGURE_PATH = .
  89. CONFIGURE_CMD = ./configure
  90. replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp $(SCRIPT_DIR)/$(2);
  91. define Build/Configure/Default
  92. (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
  93. if [ -x $(CONFIGURE_CMD) ]; then \
  94. $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
  95. $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
  96. $(CONFIGURE_VARS) \
  97. $(2) \
  98. $(CONFIGURE_CMD) \
  99. $(CONFIGURE_ARGS) \
  100. $(1); \
  101. fi; \
  102. )
  103. endef
  104. MAKE_VARS = \
  105. CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
  106. CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
  107. LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
  108. MAKE_FLAGS = \
  109. $(TARGET_CONFIGURE_OPTS) \
  110. CROSS="$(TARGET_CROSS)" \
  111. ARCH="$(ARCH)"
  112. MAKE_INSTALL_FLAGS = \
  113. $(MAKE_FLAGS) \
  114. DESTDIR="$(PKG_INSTALL_DIR)"
  115. MAKE_PATH = .
  116. define Build/Compile/Default
  117. +$(MAKE_VARS) \
  118. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
  119. $(MAKE_FLAGS) \
  120. $(1);
  121. endef
  122. define Build/Install/Default
  123. $(MAKE_VARS) \
  124. $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
  125. $(MAKE_INSTALL_FLAGS) \
  126. $(if $(1), $(1), install);
  127. endef
  128. define Build/Dist/Default
  129. $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
  130. endef
  131. define Build/DistCheck/Default
  132. $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)
  133. endef