add readline support to postgres as well
[openwrt/svn-archive/archive.git] / libs / postgresql / Makefile
index 77f52382559fad8032ebcc633a0c475f37ce371a..12875c5161d43326d8b0da31a6ede9f91258f067 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=postgresql
 PKG_VERSION:=8.2.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
@@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/libpq
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+zlib
+  DEPENDS:=+zlib +libreadline +libncurses
   TITLE:=PostgreSQL client library
   DESCRIPTION:=PostgreSQL client library.
   URL:=http://www.postgresql.org/
@@ -53,7 +53,7 @@ define Package/pgsql-server
   URL:=http://www.postgresql.org/
 endef
 
-# Need a native ecpg and zic for build
+# Need a native ecpg ,pg_config, and zic for build
 define Build/Configure
        (cd $(PKG_BUILD_DIR); rm -f config.cache; \
                ./configure \
@@ -87,12 +87,16 @@ define Build/Configure
                        --without-tcl \
                        --without-tk \
                        --with-zlib="yes" \
+                       --enable-depend \
        );
-       $(MAKE) -C $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc CC="gcc" CFLAGS+="-I../../libpq"
+       $(MAKE) -C $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc CC="$(HOSTCC)" CFLAGS+="-I../../libpq"
        mv $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg \
                $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host
-       $(MAKE) -C $(PKG_BUILD_DIR)/src/timezone CC="gcc"
+       $(MAKE) -C $(PKG_BUILD_DIR)/src/timezone CC="$(HOSTCC)"
        mv $(PKG_BUILD_DIR)/src/timezone/zic $(PKG_BUILD_DIR)/src/timezone/zic.host
+       $(MAKE) -C $(PKG_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)"
+       mv $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config \
+               $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host
        $(MAKE) -C $(PKG_BUILD_DIR) distclean
 
        (cd $(PKG_BUILD_DIR); rm -f config.cache; \
@@ -132,11 +136,11 @@ define Build/Configure
                        --without-pam \
                        --without-perl \
                        --without-python \
-                       --without-readline \
                        --without-rendezvous \
                        --without-tcl \
                        --without-tk \
                        --with-zlib="yes" \
+                       --enable-depend \
        );
        $(SED) 's@ECPG = ../../preproc/ecpg@ECPG = ../../preproc/ecpg.host@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
        $(SED) 's@\./zic -d@./zic.host -d@' $(PKG_BUILD_DIR)/src/timezone/Makefile
@@ -237,7 +241,7 @@ endef
 
 define Build/InstallDev
        mkdir -p $(STAGING_DIR)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pg_config $(STAGING_DIR)/usr/bin/
+       $(CP) $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host $(STAGING_DIR)/usr/bin/pg_config
        mkdir -p $(STAGING_DIR)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/libpq $(STAGING_DIR)/usr/include/
        $(CP) $(PKG_INSTALL_DIR)/usr/include/libpq-fe.h $(STAGING_DIR)/usr/include/