aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2022-12-09 08:53:23 -0800
committerAndres Freund <andres@anarazel.de>2022-12-09 08:54:47 -0800
commitfc7852c6cb89a5384e0b4ad30874de92f63f88be (patch)
treeb4af1555bc877b61a5ce65cb9808e79ff0f6ebb0
parentbad5116957eea2dc360c6c233be08284bd3d5364 (diff)
downloadpostgresql-fc7852c6cb89a5384e0b4ad30874de92f63f88be.tar.gz
postgresql-fc7852c6cb89a5384e0b4ad30874de92f63f88be.zip
meson: Improve PG_VERSION_STR generation
Previously the host operating system and 32/64 bit were not included and the build machine's cpu was used, which is potentially wrong for cross builds. Author: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com> Author: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CAC+AXB16gwYhKCdS+t0pk3U7kKtpVj5L-ynmhK3Gbea330At3w@mail.gmail.com
-rw-r--r--meson.build12
1 files changed, 10 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 3cc941c7f33..a62d8171cc6 100644
--- a/meson.build
+++ b/meson.build
@@ -143,12 +143,11 @@ cdata.set_quoted('PACKAGE_TARNAME', 'postgresql')
pg_version += get_option('extra_version')
cdata.set_quoted('PG_VERSION', pg_version)
-cdata.set_quoted('PG_VERSION_STR', 'PostgreSQL @0@ on @1@, compiled by @2@-@3@'.format(
- pg_version, build_machine.cpu_family(), cc.get_id(), cc.version()))
cdata.set_quoted('PG_MAJORVERSION', pg_version_major.to_string())
cdata.set('PG_MAJORVERSION_NUM', pg_version_major)
cdata.set('PG_MINORVERSION_NUM', pg_version_minor)
cdata.set('PG_VERSION_NUM', pg_version_num)
+# PG_VERSION_STR is built later, it depends compiler test results
cdata.set_quoted('CONFIGURE_ARGS', '')
@@ -2453,6 +2452,15 @@ cdata.set('MEMSET_LOOP_LIMIT', memset_loop_limit)
cdata.set_quoted('DLSUFFIX', dlsuffix)
+# built later than the rest of the version metadata, we need SIZEOF_VOID_P
+cdata.set_quoted('PG_VERSION_STR',
+ 'PostgreSQL @0@ on @1@-@2@, compiled by @3@-@4@, @5@-bit'.format(
+ pg_version, host_machine.cpu_family(), host_system,
+ cc.get_id(), cc.version(), cdata.get('SIZEOF_VOID_P') * 8,
+ )
+)
+
+
###############################################################
# Threading