2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
11 CATEGORY
:=Extra packages
16 MAINTAINER
:=OpenWrt Developers Team
<openwrt-devel@openwrt.org
>
17 SOURCE
:=$(patsubst $(TOPDIR
)/%,%,$(CURDIR
))
18 ifneq ($(PKG_VERSION
),)
19 ifneq ($(PKG_RELEASE
),)
20 VERSION
:=$(PKG_VERSION
)-$(PKG_RELEASE
)
22 VERSION
:=$(PKG_VERSION
)
25 VERSION
:=$(PKG_RELEASE
)
28 PKGFLAGS
:=$(PKG_FLAGS
)
32 ifneq ($(ARCH_PACKAGES
),)
33 PKGARCH
:=$(ARCH_PACKAGES
)
50 Build
/Patch
:=$(Build
/Patch
/Default
)
51 ifneq ($(strip $(PKG_UNPACK
)),)
52 define Build
/Prepare
/Default
53 $(SH_FUNC
) $(PKG_UNPACK
)
58 EXTRA_CXXFLAGS
= $(EXTRA_CFLAGS
)
60 CONFIGURE_PREFIX
:=/usr
62 --target
=$(GNU_TARGET_NAME
) \
63 --host
=$(GNU_TARGET_NAME
) \
64 --build
=$(GNU_HOST_NAME
) \
67 --prefix=$(CONFIGURE_PREFIX
) \
68 --exec-prefix
=$(CONFIGURE_PREFIX
) \
69 --bindir=$(CONFIGURE_PREFIX
)/bin \
70 --sbindir
=$(CONFIGURE_PREFIX
)/sbin \
71 --libexecdir
=$(CONFIGURE_PREFIX
)/lib \
73 --datadir=$(CONFIGURE_PREFIX
)/share \
74 --localstatedir
=/var \
75 --mandir=$(CONFIGURE_PREFIX
)/man \
76 --infodir=$(CONFIGURE_PREFIX
)/info \
78 $(DISABLE_LARGEFILE
) \
82 $(TARGET_CONFIGURE_OPTS
) \
83 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
84 CXXFLAGS
="$(TARGET_CXXFLAGS) $(EXTRA_CFLAGS)" \
85 CPPFLAGS
="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
86 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
89 CONFIGURE_CMD
= .
/configure
91 replace_script
=$(FIND
) $(1) -name
$(2) |
$(XARGS
) chmod u
+w
; $(FIND
) $(1) -name
$(2) |
$(XARGS
) -n1 cp
$(SCRIPT_DIR
)/$(2);
93 define Build
/Configure
/Default
94 (cd
$(PKG_BUILD_DIR
)/$(CONFIGURE_PATH
)/$(strip $(3)); \
95 if
[ -x
$(CONFIGURE_CMD
) ]; then \
96 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.guess
) \
97 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.sub
) \
108 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
109 CXXFLAGS
="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
110 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
113 $(TARGET_CONFIGURE_OPTS
) \
114 CROSS
="$(TARGET_CROSS)" \
117 MAKE_INSTALL_FLAGS
= \
119 DESTDIR
="$(PKG_INSTALL_DIR)"
123 define Build
/Compile
/Default
125 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
130 define Build
/Install
/Default
132 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
133 $(MAKE_INSTALL_FLAGS
) \
134 $(if
$(1), $(1), install);
137 define Build
/Dist
/Default
138 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" dist)
141 define Build
/DistCheck
/Default
142 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" distcheck
)