[packages] libpcre: enable unicode property support (required by php) (#9360)
[openwrt/svn-archive/archive.git] / libs / pcre / Makefile
1 #
2 # Copyright (C) 2006-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=pcre
11 PKG_VERSION:=8.11
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/pcre
16 PKG_MD5SUM:=ef907b8792ec7f90f0dcd773848f0b3b
17
18 PKG_FIXUP:=autoreconf
19
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libpcre/default
25 SECTION:=libs
26 CATEGORY:=Libraries
27 URL:=http://www.pcre.org/
28 endef
29
30 define Package/libpcre
31 $(call Package/libpcre/default)
32 TITLE:=A Perl Compatible Regular Expression library
33 endef
34
35 define Package/libpcrecpp
36 $(call Package/libpcre/default)
37 TITLE:=C++ wrapper for Perl Compatible Regular Expression library
38 DEPENDS:=+libpcre
39 endef
40
41
42 TARGET_CFLAGS += $(FPIC)
43
44 CONFIGURE_ARGS += \
45 --enable-utf8 \
46 --enable-unicode-properties \
47
48 ifneq ($(CONFIG_PACKAGE_libpcrecpp),)
49 CONFIGURE_ARGS+= --enable-cpp
50 else
51 CONFIGURE_ARGS+= --disable-cpp
52 endif
53
54 MAKE_FLAGS += \
55 CFLAGS="$(TARGET_CFLAGS)"
56
57 define Build/InstallDev
58 $(INSTALL_DIR) $(1)/usr/bin
59 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pcre-config $(1)/usr/bin/
60
61 $(INSTALL_DIR) $(2)/bin
62 $(LN) $(STAGING_DIR)/usr/bin/pcre-config $(2)/bin
63
64 $(INSTALL_DIR) $(1)/usr/include
65 $(CP) $(PKG_INSTALL_DIR)/usr/include/pcre*.h $(1)/usr/include/
66
67 $(INSTALL_DIR) $(1)/usr/lib
68 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre*.{a,so*} $(1)/usr/lib//
69
70 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcre*.pc $(1)/usr/lib/pkgconfig/
72
73 endef
74
75 define Package/libpcre/install
76 $(INSTALL_DIR) $(1)/usr/lib
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre{,posix}.so.* $(1)/usr/lib/
78 endef
79
80 define Package/libpcrecpp/install
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcrecpp.so.* $(1)/usr/lib/
83 endef
84
85 $(eval $(call BuildPackage,libpcre))
86 $(eval $(call BuildPackage,libpcrecpp))