package-defaults.mk 3.7 KB

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