Meson: check for pg_config_paths.h left over from make
authorDavid Rowley <[email protected]>
Wed, 23 Aug 2023 22:33:48 +0000 (10:33 +1200)
committerDavid Rowley <[email protected]>
Wed, 23 Aug 2023 22:33:48 +0000 (10:33 +1200)
The meson build scripts attempt to find files left over from configure
and fail, mentioning that "make maintainer-clean" should be run to remove
these.  This seems to have been done for files generated from configure.
pg_config_paths.h is generated during the actual make build, so seems to
have been missed.  This would result in compilation using the wrong
pg_config_paths.h file.

Here we just add this file to generated_sources_ac so that meson errors
out if pg_config_paths.h exists.

Likely this wasn't noticed before because make maintainer-clean will
remove pg_config_paths.h, however, people using the MSVC build scripts
are more likely to run into issues and they have to manually remove
these files and pg_config_paths.h wasn't listed as a conflicting file to
remove in the meson log.

Backpatch-through: 16, where meson support was added
Discussion: https://postgr.es/m/CAApHDvqjYOxZfmLKAOWKFEE7LOr9_E6UA6YNmx9r8nxStcS3gg@mail.gmail.com

src/port/meson.build

index 24416b9bfc07cbb2f05c433485b4a5278b5da922..0a16f1c7f5ff7725ae06aba8376afa4ac5f1aee6 100644 (file)
@@ -192,3 +192,6 @@ endforeach
 pgport_srv = pgport['_srv']
 pgport_static = pgport['']
 pgport_shlib = pgport['_shlib']
+
+# autoconf generates the file there, ensure we get a conflict
+generated_sources_ac += {'src/port': ['pg_config_paths.h']}