From: Maxim Kochetkov <fido_max@inbox.ru>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/postgresql: add some additional output to pg_config
Date: Mon, 25 Jan 2021 14:36:12 +0300 [thread overview]
Message-ID: <20210125113613.865987-1-fido_max@inbox.ru> (raw)
Some external packages call pg_config to determine the installed
PostgreSQL options. Add this output to Buildroots own pg_config,
so these packages correctly compile.
Added options:
--pkgincludedir
--pgxs
--cflags
--cc
--pkglibdir
--bindir
--sharedir
--localedir
--docdir
--mandir
Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
---
package/postgresql/pg_config | 51 ++++++++++++++++++++++++++++++--
package/postgresql/postgresql.mk | 2 ++
2 files changed, 51 insertions(+), 2 deletions(-)
diff --git a/package/postgresql/pg_config b/package/postgresql/pg_config
index 59a9e6cfad..3b0cb35f2c 100644
--- a/package/postgresql/pg_config
+++ b/package/postgresql/pg_config
@@ -2,7 +2,6 @@
#
# Minimal pg_config implementation as replacement for the native pg_config application
-# Only implements --includedir and --libdir
#
prefix=/usr
@@ -11,6 +10,9 @@ case "$1" in
--includedir)
echo "$prefix/include"
;;
+ --pkgincludedir)
+ echo "$prefix/include/postgresql"
+ ;;
--includedir-server)
echo "$prefix/include/postgresql/server"
;;
@@ -23,6 +25,51 @@ case "$1" in
--configure)
echo "@POSTGRESQL_CONF_OPTIONS@"
;;
+ --pgxs)
+ echo "$prefix/lib/postgresql/pgxs/src/makefiles/pgxs.mk"
+ ;;
+ --cflags)
+ echo "@TARGET_CFLAGS@"
+ ;;
+ --cc)
+ echo "@TARGET_CC@"
+ ;;
+ --pkglibdir)
+ echo "/usr/lib/postgresql"
+ ;;
+ --bindir)
+ echo "/usr/bin"
+ ;;
+ --sharedir)
+ echo "/usr/share/postgresql"
+ ;;
+ --localedir)
+ echo "/usr/share/locale"
+ ;;
+ --docdir)
+ echo "/usr/share/doc/postgresql"
+ ;;
+ --mandir)
+ echo "/usr/share/man"
+ ;;
*)
- echo "Usage: $0 {--includedir|--includedir-server|--libdir|--version|--configure}"
+ echo "Usage: $0 {OPTION}"
+ echo
+ echo "Options:"
+ echo
+ echo " --includedir show location of C header files of the client interfaces"
+ echo " --pkgincludedir show location of other C header files"
+ echo " --includedir-server show location of C header files for the server"
+ echo " --libdir show location of object code libraries"
+ echo " --version show the PostgreSQL version"
+ echo " --configure show options given to configure script"
+ echo " --pgxs show location of extension makefile"
+ echo " --cflags show CFLAGS value used when PostgreSQL was built"
+ echo " --cc show CC value used when PostgreSQL was built"
+ echo " --pkglibdir show location of dynamically loadable modules"
+ echo " --bindir show location of user executables"
+ echo " --sharedir show location of architecture-independent support files"
+ echo " --localedir show location of locale support files"
+ echo " --docdir show location of documentation files"
+ echo " --mandir show location of manual pages"
esac
diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
index 31c83d64c7..6c0726e88b 100644
--- a/package/postgresql/postgresql.mk
+++ b/package/postgresql/postgresql.mk
@@ -116,6 +116,8 @@ define POSTGRESQL_INSTALL_CUSTOM_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
+ $(SED) "s|@TARGET_CFLAGS@|$(TARGET_CFLAGS)|g" $(STAGING_DIR)/usr/bin/pg_config
+ $(SED) "s|@TARGET_CC@|$(TARGET_CC)|g" $(STAGING_DIR)/usr/bin/pg_config
endef
POSTGRESQL_POST_INSTALL_STAGING_HOOKS += POSTGRESQL_INSTALL_CUSTOM_PG_CONFIG
--
2.29.2
next reply other threads:[~2021-01-25 11:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-25 11:36 Maxim Kochetkov [this message]
2021-01-25 11:36 ` [Buildroot] [PATCH] package/postgresql: add full build option Maxim Kochetkov
2021-01-25 20:56 ` Thomas Petazzoni
2021-01-25 20:56 ` [Buildroot] [PATCH] package/postgresql: add some additional output to pg_config Thomas Petazzoni
2021-01-28 17:37 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210125113613.865987-1-fido_max@inbox.ru \
--to=fido_max@inbox.ru \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.