Fresh pull from upstream (stable) package feed
[librecmc/package-feed.git] / 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.41
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
16 PKG_MD5SUM:=c160d22723b1670447341b08c58981c1
17 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
18
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=LICENCE
21
22 PKG_FIXUP:=autoreconf
23
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/libpcre/default
29   SECTION:=libs
30   CATEGORY:=Libraries
31   URL:=http://www.pcre.org/
32 endef
33
34 define Package/libpcre
35   $(call Package/libpcre/default)
36   TITLE:=A Perl Compatible Regular Expression library
37 endef
38
39 define Package/libpcre16
40   $(call Package/libpcre/default)
41   TITLE:=A Perl Compatible Regular Expression library (16bit support)
42 endef
43
44 define Package/libpcrecpp
45   $(call Package/libpcre/default)
46   TITLE:=C++ wrapper for Perl Compatible Regular Expression library
47   DEPENDS:=+libpcre +libstdcpp
48 endef
49
50 TARGET_CFLAGS += $(FPIC)
51
52 CONFIGURE_ARGS += \
53         --enable-utf8 \
54         --enable-unicode-properties \
55         --enable-pcre16 \
56         --with-match-limit-recursion=16000 \
57
58 ifneq ($(CONFIG_PACKAGE_libpcrecpp),)
59   CONFIGURE_ARGS+= --enable-cpp
60 else
61   CONFIGURE_ARGS+= --disable-cpp
62 endif
63
64 MAKE_FLAGS += \
65         CFLAGS="$(TARGET_CFLAGS)"
66
67 define Build/InstallDev
68         $(INSTALL_DIR) $(1)/usr/bin
69         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pcre-config $(1)/usr/bin/
70
71         $(INSTALL_DIR) $(2)/bin
72         $(LN) $(STAGING_DIR)/usr/bin/pcre-config $(2)/bin
73
74         $(INSTALL_DIR) $(1)/usr/include
75         $(CP) $(PKG_INSTALL_DIR)/usr/include/pcre*.h $(1)/usr/include/
76
77         $(INSTALL_DIR) $(1)/usr/lib
78         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre*.{a,so*} $(1)/usr/lib/
79
80         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
81         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcre*.pc $(1)/usr/lib/pkgconfig/
82 endef
83
84 define Package/libpcre/install
85         $(INSTALL_DIR) $(1)/usr/lib
86         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre{,posix}.so.* $(1)/usr/lib/
87         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre.so $(1)/usr/lib/
88 endef
89
90 define Package/libpcre16/install
91         $(INSTALL_DIR) $(1)/usr/lib
92         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre16.so* $(1)/usr/lib/
93 endef
94
95 define Package/libpcrecpp/install
96         $(INSTALL_DIR) $(1)/usr/lib
97         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcrecpp.so.* $(1)/usr/lib/
98 endef
99
100 $(eval $(call BuildPackage,libpcre))
101 $(eval $(call BuildPackage,libpcre16))
102 $(eval $(call BuildPackage,libpcrecpp))