package/postgresql: add configure and includedir-server output to pg_config
authorMaxim Kochetkov <fido_max@inbox.ru>
Mon, 5 Oct 2020 10:19:50 +0000 (13:19 +0300)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 8 Oct 2020 20:16:17 +0000 (22:16 +0200)
Some external packages call pg_config to determine the installed
PostgreSQL server includedir and configure options. Add this output to
Buildroots own pg_config, so these packages correctly compile.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/postgresql/pg_config
package/postgresql/postgresql.mk

index 642252f27f4182e42993841383f6e95b923d8213..59a9e6cfad10aa62a3b5ffd51c10cffad7efecc2 100644 (file)
@@ -11,12 +11,18 @@ case "$1" in
   --includedir)
        echo "$prefix/include"
        ;;
+  --includedir-server)
+       echo "$prefix/include/postgresql/server"
+       ;;
   --libdir)
        echo "$prefix/lib"
        ;;
   --version)
        echo "PostgreSQL @POSTGRESQL_VERSION@"
        ;;
+  --configure)
+       echo "@POSTGRESQL_CONF_OPTIONS@"
+       ;;
   *)
-       echo "Usage: $0 {--includedir|--libdir|--version}"
+       echo "Usage: $0 {--includedir|--includedir-server|--libdir|--version|--configure}"
 esac
index 18c7b2ade4ee9a0248fbcb3b3e8d8b01f380060c..3630b5a385aecac747d40be427749b8cba4f5f40 100644 (file)
@@ -115,6 +115,7 @@ POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP
 define POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
        $(INSTALL) -m 0755 -D package/postgresql/pg_config \
                $(STAGING_DIR)/usr/bin/pg_config
+       $(SED) "s|@POSTGRESQL_CONF_OPTIONS@|$(POSTGRESQL_CONF_OPTS)|g" $(STAGING_DIR)/usr/bin/pg_config
        $(SED) "s|@POSTGRESQL_VERSION@|$(POSTGRESQL_VERSION)|g" $(STAGING_DIR)/usr/bin/pg_config
 endef