pcre: import from packages feeds
[openwrt/staging/jow.git] / package / libs / pcre / Makefile
1 #
2 # Copyright (C) 2006-2015 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.44
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
16 PKG_HASH:=19108658b23b3ec5058edc9f66ac545ea19f9537234be1ec62b714c84399366d
17
18 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=LICENCE
21 PKG_CPE_ID:=cpe:/a:pcre:pcre
22
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 PKG_CONFIG_DEPENDS:=\
27 CONFIG_PACKAGE_libpcrecpp \
28 CONFIG_PCRE_JIT_ENABLED
29
30 include $(INCLUDE_DIR)/uclibc++.mk
31 include $(INCLUDE_DIR)/package.mk
32
33 define Package/libpcre/default
34 SECTION:=libs
35 CATEGORY:=Libraries
36 URL:=https://www.pcre.org/
37 endef
38
39 define Package/libpcre/config
40 source "$(SOURCE)/Config.in"
41 endef
42
43 define Package/libpcre
44 $(call Package/libpcre/default)
45 TITLE:=A Perl Compatible Regular Expression library
46 endef
47
48 define Package/libpcre16
49 $(call Package/libpcre/default)
50 TITLE:=A Perl Compatible Regular Expression library (16bit support)
51 endef
52
53 define Package/libpcre32
54 $(call Package/libpcre/default)
55 TITLE:=A Perl Compatible Regular Expression library (32bit support)
56 endef
57
58 define Package/libpcrecpp
59 $(call Package/libpcre/default)
60 TITLE:=C++ wrapper for Perl Compatible Regular Expression library
61 DEPENDS:=+libpcre $(CXX_DEPENDS)
62 endef
63
64 TARGET_CFLAGS += $(FPIC)
65
66 CONFIGURE_ARGS += \
67 --enable-utf8 \
68 --enable-unicode-properties \
69 --enable-pcre16 \
70 --enable-pcre32 \
71 $(if $(CONFIG_PCRE_JIT_ENABLED),--enable-jit,--disable-jit) \
72 --with-match-limit-recursion=16000 \
73 $(if $(CONFIG_PACKAGE_libpcrecpp),--enable,--disable)-cpp
74
75 MAKE_FLAGS += \
76 CFLAGS="$(TARGET_CFLAGS)"
77
78 define Build/InstallDev
79 $(INSTALL_DIR) $(1)/usr/bin
80 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pcre-config $(1)/usr/bin/
81
82 $(INSTALL_DIR) $(2)/bin
83 $(LN) $(STAGING_DIR)/usr/bin/pcre-config $(2)/bin
84
85 $(INSTALL_DIR) $(1)/usr/include
86 $(CP) $(PKG_INSTALL_DIR)/usr/include/pcre*.h $(1)/usr/include/
87
88 $(INSTALL_DIR) $(1)/usr/lib
89 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre*.{a,so*} $(1)/usr/lib/
90
91 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
92 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcre*.pc $(1)/usr/lib/pkgconfig/
93 endef
94
95 define Package/libpcre/install
96 $(INSTALL_DIR) $(1)/usr/lib
97 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre{,posix}.so.* $(1)/usr/lib/
98 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre.so $(1)/usr/lib/
99 endef
100
101 define Package/libpcre16/install
102 $(INSTALL_DIR) $(1)/usr/lib
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre16.so* $(1)/usr/lib/
104 endef
105
106 define Package/libpcre32/install
107 $(INSTALL_DIR) $(1)/usr/lib
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre32.so* $(1)/usr/lib/
109 endef
110
111 define Package/libpcrecpp/install
112 $(INSTALL_DIR) $(1)/usr/lib
113 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcrecpp.so.* $(1)/usr/lib/
114 endef
115
116 $(eval $(call BuildPackage,libpcre))
117 $(eval $(call BuildPackage,libpcre16))
118 $(eval $(call BuildPackage,libpcre32))
119 $(eval $(call BuildPackage,libpcrecpp))