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
15 MAINTAINER
:=OpenWrt Developers Team
<openwrt-devel@openwrt.org
>
16 SOURCE
:=$(patsubst $(TOPDIR
)/%,%,$(CURDIR
))
17 ifneq ($(PKG_VERSION
),)
18 ifneq ($(PKG_RELEASE
),)
19 VERSION
:=$(PKG_VERSION
)-$(PKG_RELEASE
)
21 VERSION
:=$(PKG_VERSION
)
24 VERSION
:=$(PKG_RELEASE
)
38 Build
/Patch
:=$(Build
/Patch
/Default
)
39 ifneq ($(strip $(PKG_UNPACK
)),)
40 define Build
/Prepare
/Default
46 CONFIGURE_PREFIX
:=/usr
48 --target
=$(GNU_TARGET_NAME
) \
49 --host
=$(GNU_TARGET_NAME
) \
50 --build
=$(GNU_HOST_NAME
) \
53 --prefix=$(CONFIGURE_PREFIX
) \
54 --exec-prefix
=$(CONFIGURE_PREFIX
) \
55 --bindir=$(CONFIGURE_PREFIX
)/bin \
56 --sbindir
=$(CONFIGURE_PREFIX
)/sbin \
57 --libexecdir
=$(CONFIGURE_PREFIX
)/lib \
59 --datadir=$(CONFIGURE_PREFIX
)/share \
60 --localstatedir
=/var \
61 --mandir=$(CONFIGURE_PREFIX
)/man \
62 --infodir=$(CONFIGURE_PREFIX
)/info \
67 $(TARGET_CONFIGURE_OPTS
) \
68 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
69 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
70 CPPFLAGS
="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
71 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
74 CONFIGURE_CMD
= .
/configure
76 replace_script
=$(FIND
) $(1) -name
$(2) |
$(XARGS
) chmod u
+w
; $(FIND
) $(1) -name
$(2) |
$(XARGS
) -n1 cp
$(SCRIPT_DIR
)/$(2);
78 define Build
/Configure
/Default
79 (cd
$(PKG_BUILD_DIR
)/$(CONFIGURE_PATH
)/$(strip $(3)); \
80 if
[ -x
$(CONFIGURE_CMD
) ]; then \
81 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.guess
) \
82 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.sub
) \
94 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
95 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
96 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
99 $(TARGET_CONFIGURE_OPTS
) \
100 CROSS
="$(TARGET_CROSS)" \
103 MAKE_INSTALL_FLAGS
= \
105 DESTDIR
="$(PKG_INSTALL_DIR)"
109 define Build
/Compile
/Default
111 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
116 define Build
/Install
/Default
118 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
119 $(MAKE_INSTALL_FLAGS
) \
123 define Build
/Dist
/Default
124 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" dist)
127 define Build
/DistCheck
/Default
128 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" distcheck
)