4d5378ab67a0e0f355c50814ebb5b6a01b97018e
[packages.git] / libs / pcre / Makefile
1 #
2 # Copyright (C) 2006-2010 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:=1
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
47 ifneq ($(CONFIG_PACKAGE_libpcrecpp),)
48   CONFIGURE_ARGS+= --enable-cpp
49 else
50   CONFIGURE_ARGS+= --disable-cpp
51 endif
52
53 MAKE_FLAGS += \
54         CFLAGS="$(TARGET_CFLAGS)"
55
56 define Build/InstallDev
57         $(INSTALL_DIR) $(1)/usr/bin
58         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pcre-config $(1)/usr/bin/
59
60         $(INSTALL_DIR) $(2)/bin
61         $(LN) $(STAGING_DIR)/usr/bin/pcre-config $(2)/bin
62
63         $(INSTALL_DIR) $(1)/usr/include
64         $(CP) $(PKG_INSTALL_DIR)/usr/include/pcre*.h $(1)/usr/include/
65
66         $(INSTALL_DIR) $(1)/usr/lib
67         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre*.{a,so*} $(1)/usr/lib//
68
69         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
70         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcre*.pc $(1)/usr/lib/pkgconfig/
71
72 endef
73
74 define Package/libpcre/install
75         $(INSTALL_DIR) $(1)/usr/lib
76         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre{,posix}.so.* $(1)/usr/lib/
77 endef
78
79 define Package/libpcrecpp/install
80         $(INSTALL_DIR) $(1)/usr/lib
81         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcrecpp.so.* $(1)/usr/lib/
82 endef
83
84 $(eval $(call BuildPackage,libpcre))
85 $(eval $(call BuildPackage,libpcrecpp))