package-defaults.mk 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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 +SSP_SUPPORT:libssp +USE_GLIBC:librt +USE_GLIBC: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. PACKAGE_SUBDIR:=$(FEED)
  18. DEPENDS:=
  19. MDEPENDS:=
  20. CONFLICTS:=
  21. PROVIDES:=
  22. EXTRA_DEPENDS:=
  23. MAINTAINER:=$(PKG_MAINTAINER)
  24. SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
  25. ifneq ($(PKG_VERSION),)
  26. ifneq ($(PKG_RELEASE),)
  27. VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
  28. else
  29. VERSION:=$(PKG_VERSION)
  30. endif
  31. else
  32. VERSION:=$(PKG_RELEASE)
  33. endif
  34. ABI_VERSION:=
  35. ifneq ($(PKG_FLAGS),)
  36. PKGFLAGS:=$(PKG_FLAGS)
  37. else
  38. PKGFLAGS:=
  39. endif
  40. ifneq ($(ARCH_PACKAGES),)
  41. PKGARCH:=$(ARCH_PACKAGES)
  42. else
  43. PKGARCH:=$(BOARD)
  44. endif
  45. DEFAULT:=
  46. MENU:=
  47. SUBMENU:=
  48. SUBMENUDEP:=
  49. TITLE:=
  50. KCONFIG:=
  51. BUILDONLY:=
  52. HIDDEN:=
  53. URL:=
  54. VARIANT:=
  55. DEFAULT_VARIANT:=
  56. USERID:=
  57. endef
  58. Build/Patch:=$(Build/Patch/Default)
  59. ifneq ($(strip $(PKG_UNPACK)),)
  60. define Build/Prepare/Default
  61. $(PKG_UNPACK)
  62. $(Build/Patch)
  63. endef
  64. endif
  65. EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)
  66. ifeq ($(CONFIG_BUILD_NLS),y)
  67. DISABLE_NLS:=
  68. else
  69. DISABLE_NLS:=--disable-nls
  70. endif
  71. CONFIGURE_PREFIX:=/usr
  72. CONFIGURE_ARGS = \
  73. --target=$(GNU_TARGET_NAME) \
  74. --host=$(GNU_TARGET_NAME) \
  75. --build=$(GNU_HOST_NAME) \
  76. --program-prefix="" \
  77. --program-suffix="" \
  78. --prefix=$(CONFIGURE_PREFIX) \
  79. --exec-prefix=$(CONFIGURE_PREFIX) \
  80. --bindir=$(CONFIGURE_PREFIX)/bin \
  81. --sbindir=$(CONFIGURE_PREFIX)/sbin \
  82. --libexecdir=$(CONFIGURE_PREFIX)/lib \
  83. --sysconfdir=/etc \
  84. --datadir=$(CONFIGURE_PREFIX)/share \
  85. --localstatedir=/var \
  86. --mandir=$(CONFIGURE_PREFIX)/man \
  87. --infodir=$(CONFIGURE_PREFIX)/info \
  88. $(DISABLE_NLS) \
  89. $(DISABLE_LARGEFILE) \
  90. $(DISABLE_IPV6)
  91. CONFIGURE_VARS = \
  92. $(TARGET_CONFIGURE_OPTS) \
  93. CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
  94. CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CFLAGS)" \
  95. CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
  96. LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
  97. CONFIGURE_PATH = .
  98. CONFIGURE_CMD = ./configure
  99. replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; \
  100. $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp --remove-destination \
  101. $(SCRIPT_DIR)/$(2);
  102. define Build/Configure/Default
  103. (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
  104. if [ -x $(CONFIGURE_CMD) ]; then \
  105. $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
  106. $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
  107. $(CONFIGURE_VARS) \
  108. $(2) \
  109. $(CONFIGURE_CMD) \
  110. $(CONFIGURE_ARGS) \
  111. $(1); \
  112. fi; \
  113. )
  114. endef
  115. MAKE_VARS = \
  116. CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
  117. CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
  118. LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
  119. MAKE_FLAGS = \
  120. $(TARGET_CONFIGURE_OPTS) \
  121. CROSS="$(TARGET_CROSS)" \
  122. ARCH="$(ARCH)"
  123. MAKE_INSTALL_FLAGS = \
  124. $(MAKE_FLAGS) \
  125. DESTDIR="$(PKG_INSTALL_DIR)"
  126. MAKE_PATH = .
  127. define Build/Compile/Default
  128. +$(MAKE_VARS) \
  129. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
  130. $(MAKE_FLAGS) \
  131. $(1);
  132. endef
  133. define Build/Install/Default
  134. $(MAKE_VARS) \
  135. $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
  136. $(MAKE_INSTALL_FLAGS) \
  137. $(if $(1), $(1), install);
  138. endef
  139. define Build/Dist/Default
  140. $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
  141. endef
  142. define Build/DistCheck/Default
  143. $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)
  144. endef