add uclibc++ to sdk build
[openwrt.git] / package / postgresql / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=postgresql
6 PKG_VERSION:=7.4.6
7 PKG_RELEASE:=3
8 PKG_MD5SUM:=f0ea2b372a7bdaf2613e92176ebf5e0f
9
10 PKG_SOURCE_URL:=\
11 ftp://ftp3.us.postgresql.org/pub/postgresql/source/v$(PKG_VERSION)/ \
12 ftp://ftp.br.postgresql.org/pub/PostgreSQL/source/v$(PKG_VERSION)/ \
13 ftp://ftp.au.postgresql.org/pub/postgresql/source/v$(PKG_VERSION)/ \
14 ftp://ftp.tw.postgresql.org/pub/postgresql/source/v$(PKG_VERSION)/ \
15 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_CAT:=bzcat
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20
21 IPKG_LIBPQ:=$(PACKAGE_DIR)/libpq_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
22 IDIR_LIBPQ:=$(PKG_BUILD_DIR)/ipkg
23 INFO_LIBPQ:=$(IPKG_STATE_DIR)/info/libpq.list
24
25 $(DL_DIR)/$(PKG_SOURCE):
26 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
27
28 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
29 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
30 $(PATCH) $(PKG_BUILD_DIR) ./patches
31 touch $(PKG_BUILD_DIR)/.prepared
32
33 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
34 # ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
35 (cd $(PKG_BUILD_DIR); rm -rf config.cache config.status; \
36 $(TARGET_CONFIGURE_OPTS) \
37 CFLAGS="$(TARGET_CFLAGS)" \
38 CPPFLAGS="$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
39 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
40 ./configure \
41 --target=$(GNU_TARGET_NAME) \
42 --host=$(GNU_TARGET_NAME) \
43 --build=$(GNU_HOST_NAME) \
44 --program-prefix="" \
45 --program-suffix="" \
46 --prefix=/usr \
47 --exec-prefix=/usr \
48 --bindir=/usr/bin \
49 --datadir=/usr/share \
50 --includedir=/usr/include \
51 --docdir=/usr/share/info \
52 --libdir=/usr/lib \
53 --libexecdir=/usr/lib \
54 --localstatedir=/var \
55 --mandir=/usr/share/man \
56 --sbindir=/usr/sbin \
57 --sysconfdir=/etc \
58 $(DISABLE_NLS) \
59 $(DISABLE_LARGEFILE) \
60 --enable-shared \
61 --enable-static \
62 --disable-integer-datetimes \
63 --disable-rpath \
64 --without-java \
65 --without-krb4 \
66 --without-krb5 \
67 --without-openssl \
68 --without-pam \
69 --without-perl \
70 --without-python \
71 --without-readline \
72 --without-rendezvous \
73 --without-tcl \
74 --without-tk \
75 --with-zlib="yes" \
76 );
77 touch $(PKG_BUILD_DIR)/.configured
78
79 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
80 $(MAKE) -C "$(PKG_BUILD_DIR)" \
81 $(TARGET_CONFIGURE_OPTS)
82 touch $(PKG_BUILD_DIR)/.built
83
84 $(STAGING_DIR)/usr/lib/libpq.so: $(PKG_BUILD_DIR)/.built
85 $(MAKE) -C "$(PKG_BUILD_DIR)" \
86 DESTDIR="$(STAGING_DIR)" \
87 install
88
89 $(IPKG_LIBPQ): $(STAGING_DIR)/usr/lib/libpq.so
90 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBPQ) ./ipkg/libpq.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
91 mkdir -p $(IDIR_LIBPQ)/usr/lib
92 cp -fpR $(STAGING_DIR)/usr/lib/libpq.so.* $(IDIR_LIBPQ)/usr/lib/
93 $(STRIP) $(IDIR_LIBPQ)/usr/lib/*.so*
94 mkdir -p $(PACKAGE_DIR)
95 $(IPKG_BUILD) $(IDIR_LIBPQ) $(PACKAGE_DIR)
96
97 $(INFO_LIBPQ): $(IPKG_LIBPQ)
98 $(IPKG) install $(IPKG_LIBPQ)
99
100 prepare: $(PKG_BUILD_DIR)/.prepared
101 compile: $(IPKG_LIBPQ)
102 install: $(INFO_LIBPQ)
103
104 clean:
105 -$(MAKE) -C "$(PKG_BUILD_DIR)" \
106 DESTDIR="$(STAGING_DIR)" \
107 uninstall
108 rm -rf $(PKG_BUILD_DIR) $(IPKG_LIBPQ)
This page took 0.041018 seconds and 5 git commands to generate.