when compiling mysql, don't grep for linuxthreads in /usr/include
[openwrt.git] / package / pcre / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=pcre
6 PKG_VERSION:=5.0
7 PKG_RELEASE:=3
8 PKG_MD5SUM:=53976b62032fd5c76678274e5fd196b4
9
10 PKG_SOURCE_URL:=\
11 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ \
12 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_CAT:=zcat
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17
18 IPKG_LIBPCRE:=$(PACKAGE_DIR)/lib$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
19 IDIR_LIBPCRE:=$(PKG_BUILD_DIR)/ipkg/lib$(PKG_NAME)
20 INFO_LIBPCRE:=$(IPKG_STATE_DIR)/info/lib$(PKG_NAME).list
21
22 $(DL_DIR)/$(PKG_SOURCE):
23 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
24
25 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
26 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
27 # $(PATCH) $(PKG_BUILD_DIR) ./patches
28 touch $(PKG_BUILD_DIR)/.prepared
29
30 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
31 (cd $(PKG_BUILD_DIR); rm -rf config.cache config.status; \
32 $(TARGET_CONFIGURE_OPTS) \
33 CFLAGS="$(TARGET_CFLAGS)" \
34 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
35 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
36 ./configure \
37 --target=$(GNU_TARGET_NAME) \
38 --host=$(GNU_TARGET_NAME) \
39 --build=$(GNU_HOST_NAME) \
40 --program-prefix="" \
41 --program-suffix="" \
42 --prefix=/usr \
43 --exec-prefix=/usr \
44 --bindir=/usr/bin \
45 --datadir=/usr/share \
46 --includedir=/usr/include \
47 --infodir=/usr/share/info \
48 --libdir=/usr/lib \
49 --libexecdir=/usr/lib \
50 --localstatedir=/var \
51 --mandir=/usr/share/man \
52 --sbindir=/usr/sbin \
53 --sysconfdir=/etc \
54 $(DISABLE_NLS) \
55 $(DISABLE_LARGEFILE) \
56 --enable-shared \
57 --enable-static \
58 --enable-utf8 \
59 );
60 touch $(PKG_BUILD_DIR)/.configured
61
62 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
63 $(MAKE) -C "$(PKG_BUILD_DIR)" \
64 CC_FOR_BUILD="$(HOSTCC)" \
65 LINK_FOR_BUILD="$(HOSTCC)" \
66 CFLAGS_FOR_BUILD="" \
67 dftables
68 $(MAKE) \
69 $(TARGET_CONFIGURE_OPTS) \
70 CFLAGS="$(TARGET_CFLAGS)" \
71
72 touch $(PKG_BUILD_DIR)/.built
73
74 $(STAGING_DIR)/usr/lib/libpcre.so: $(PKG_BUILD_DIR)/.built
75 $(MAKE) -C "$(PKG_BUILD_DIR)" \
76 DESTDIR="$(STAGING_DIR)" \
77 install
78 rm -f $(STAGING_DIR)/usr/lib/libpcre*.la
79
80 $(IPKG_LIBPCRE): $(STAGING_DIR)/usr/lib/libpcre.so
81 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBPCRE) lib$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
82 mkdir -p $(IDIR_LIBPCRE)/usr/lib
83 cp -fp $(STAGING_DIR)/usr/lib/libpcre*.so.* $(IDIR_LIBPCRE)/usr/lib/
84 $(STRIP) $(IDIR_LIBPCRE)/usr/lib/lib*.so*
85 mkdir -p $(PACKAGE_DIR)
86 $(IPKG_BUILD) $(IDIR_LIBPCRE) $(PACKAGE_DIR)
87
88 $(INFO_LIBPCRE): $(IPKG_LIBPCRE)
89 $(IPKG) install $(IPKG_LIBPCRE)
90
91 source: $(DL_DIR)/$(PKG_SOURCE)
92 prepare: $(PKG_BUILD_DIR)/.prepared
93 compile: $(IPKG_LIBPCRE)
94 install: $(INFO_LIBPCRE)
95
96 clean:
97 rm -rf \
98 $(STAGING_DIR)/usr/bin/pcre-config \
99 $(STAGING_DIR)/usr/include/pcre* \
100 $(STAGING_DIR)/usr/lib/libpcre* \
101 $(STAGING_DIR)/usr/lib/pkgconfig/libpcre.pc \
102 $(STAGING_DIR)/usr/share/man/man*/pcre* \
103 $(PKG_BUILD_DIR) $(IPKG_LIBPCRE)
This page took 0.088266 seconds and 5 git commands to generate.