package-defaults.mk 3.8 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. 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. [ ! -d ./src/ ] || $(CP) ./src/* $(PKG_BUILD_DIR)
  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_CXXFLAGS)" \
  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