summaryrefslogtreecommitdiff
path: root/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* Fix various typosDavid Rowley2023-04-181-1/+1
| | | | | | | | | | | | This fixes many spelling mistakes in comments, but a few references to invalid parameter names, function names and option names too in comments and also some in string constants Also, fix an #undef that was undefining the incorrect definition Author: Alexander Lakhin Reviewed-by: Justin Pryzby Discussion: https://postgr.es/m/d5f68d19-c0fc-91a9-118d-7c6a5a3f5fad@gmail.com
* Update Kerberos/GSSAPI configure/meson checkStephen Frost2023-04-171-2/+2
| | | | | | | Instead of checking for the much older gss_init_sec_context, check for gss_store_cred_into which was added in MIT Kerberos 1.11 (circa 2012). Discussion: https://postgr.es/m/2313469.1681695223%40sss.pgh.pa.us
* Explicitly require MIT Kerberos for GSSAPIStephen Frost2023-04-131-0/+10
| | | | | | | | | | WHen building with GSSAPI support, explicitly require MIT Kerberos and check for gssapi_ext.h in configure.ac and meson.build. Also add documentation explicitly stating that we now require MIT Kerberos when building with GSSAPI support. Reveiwed by: Johnathan Katz Discussion: https://postgr.es/m/abcc73d0-acf7-6896-e0dc-f5bc12a61bb1@postgresql.org
* meson: add docs, docs_pdf optionsAndres Freund2023-04-041-0/+37
| | | | | | | | | | | | | Detect and report if the tools necessary to build documentation are available during configure. This is represented as two new options 'docs' and 'docs_pdf', both defaulting to 'auto'. This should also fix a meson error about the installdocs target, when none of the doc tools are found. Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://postgr.es/m/20230325201414.sh7c6xlut2fpunnv@awork3.anarazel.de Discussion: https://postgr.es/m/ZB8331v5IhUA/pNu@telsasoft.com
* pg_regress: Emit TAP compliant outputDaniel Gustafsson2023-03-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts pg_regress output format to emit TAP compliant output while keeping it as human readable as possible for use without TAP test harnesses. As verbose harness related information isn't really supported by TAP this also reduces the verbosity of pg_regress runs which makes scrolling through log output in buildfarm/CI runs a bit easier as well. As the meson TAP parser conumes whitespace, the leading indentation for differentiating parallel tests from sequential tests has been changed to a single character prefix. This patch has been around for an extended period of time, reviewers listed below may have been involved in reviewing a version quite different from the version in this commit. The original idea for this patch was a hacking session with Jinbao Chen. TAP format testing is also enabled in meson as of this. Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Nikolay Shaplov <dhyan@nataraj.su> Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/BD4B107D-7E53-4794-ACBA-275BEB4327C9@yesql.se Discussion: https://postgr.es/m/20220221164736.rq3ornzjdkmwk2wo@alap3.anarazel.de
* meson: Change default buildtype to debugoptimizedPeter Eisentraut2023-03-291-1/+1
| | | | | | | | | This matches the Autoconf default (-O2 + debug) better. The previous default setting "release" used -O3, which resulted in different compiler warnings. At least for now, we want to avoid such divergence. Discussion: https://www.postgresql.org/message-id/flat/CAFj8pRBJD_Y-XcqwXSbWS24z%2B84FFX7ajhCan9ixc_m4bD63sA%40mail.gmail.com
* meson: Fix support for empty darwin sysrootPeter Eisentraut2023-03-271-2/+4
| | | | | | | | The -isysroot options should only be added if the sysroot resolved to a nonempty string. This matches the behavior in src/template/darwin (also documented in installation.sgml). Discussion: https://www.postgresql.org/message-id/flat/60765bf0-5027-4b23-9f78-4a365d28823f%40enterprisedb.com
* meson: Fix oversight in install-quietAndres Freund2023-03-241-1/+1
| | | | | | | | | | In e522049f239 I accidentally forgot to add meson_bin to the argument list for install-quiet. That kind of works on some platforms because the executable is just 'python', wich the path to meson in an argument. But on windows meson might be installed as an executable. Reported-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://postgr.es/m/b36dd6a4-748a-4737-54d5-dc8a50fdbe4b@dunslane.net
* libpq: Add sslcertmode option to control client certificatesMichael Paquier2023-03-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sslcertmode option controls whether the server is allowed and/or required to request a certificate from the client. There are three modes: - "allow" is the default and follows the current behavior, where a configured client certificate is sent if the server requests one (via one of its default locations or sslcert). With the current implementation, will happen whenever TLS is negotiated. - "disable" causes the client to refuse to send a client certificate even if sslcert is configured or if a client certificate is available in one of its default locations. - "require" causes the client to fail if a client certificate is never sent and the server opens a connection anyway. This doesn't add any additional security, since there is no guarantee that the server is validating the certificate correctly, but it may helpful to troubleshoot more complicated TLS setups. sslcertmode=require requires SSL_CTX_set_cert_cb(), available since OpenSSL 1.0.2. Note that LibreSSL does not include it. Using a connection parameter different than require_auth has come up as the simplest design because certificate authentication does not rely directly on any of the AUTH_REQ_* codes, and one may want to require a certificate to be sent in combination of a given authentication method, like SCRAM-SHA-256. TAP tests are added in src/test/ssl/, some of them relying on sslinfo to check if a certificate has been set. These are compatible across all the versions of OpenSSL supported on HEAD (currently down to 1.0.1). Author: Jacob Champion Reviewed-by: Aleksander Alekseev, Peter Eisentraut, David G. Johnston, Michael Paquier Discussion: https://postgr.es/m/9e5a8ccddb8355ea9fa4b75a1e3a9edc88a70cd3.camel@vmware.com
* meson: add install-{quiet, world} targetsAndres Freund2023-03-231-15/+61
| | | | | | | To define our own install target, we need dependencies on the i18n targets, which we did not collect so far. Discussion: https://postgr.es/m/3fc3bb9b-f7f8-d442-35c1-ec82280c564a@enterprisedb.com
* meson: add install-{docs,doc-html,doc-man} targetsAndres Freund2023-03-231-1/+1
| | | | Discussion: https://postgr.es/m/3fc3bb9b-f7f8-d442-35c1-ec82280c564a@enterprisedb.com
* meson: make install_test_files more generic, rename to install_filesAndres Freund2023-03-231-2/+3
| | | | | | | Now it supports installing directories and directory contents as well. This will be used in a subsequent patch to install documentation. Discussion: https://postgr.es/m/3fc3bb9b-f7f8-d442-35c1-ec82280c564a@enterprisedb.com
* libpq: Remove code for SCM credential authenticationMichael Paquier2023-03-171-14/+0
| | | | | | | | | | | | | | | | | | | | Support for SCM credential authentication has been removed in the backend in 9.1, and libpq has kept some code to handle it for compatibility. Commit be4585b, that did the cleanup of the backend code, has done so because the code was not really portable originally. And, as there are likely little chances that this is used these days, this removes the remaining code from libpq. An error will now be raised by libpq if attempting to connect to a server that returns AUTH_REQ_SCM_CREDS, instead. References to SCM credential authentication are removed from the protocol documentation. This removes some meson and configure checks. Author: Michael Paquier Reviewed-by: Tom Lane Discussion: https://postgr.es/m/ZBLH8a4otfqgd6Kn@paquier.xyz
* meson: fix openssl detection issues in 6a30027Andres Freund2023-03-131-6/+12
| | | | | | | | | | When not detecting openssl via pkg-config, we'd error out if the headers weren't found, even if -Dssl=auto. When detecting via pkg-config, but the headers could not be found, we'd error out because the ssl_int variable would not exist. Reported-by: Nathan Bossart <nathandbossart@gmail.com> Discussion: https://postgr.es/m/20230313180432.GA246741@nathanxps13
* meson: Make auto the default of the ssl optionPeter Eisentraut2023-03-131-48/+70
| | | | | | | | | | The 'ssl' option is of type 'combo', but we add a choice 'auto' that simulates the behavior of a feature option. This way, openssl is used automatically by default if present, but we retain the ability to potentially select another ssl library. Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/ad65ffd1-a9a7-fda1-59c6-f7dc763c3051%40enterprisedb.com
* meson: fix header path of ossp-uuidAndres Freund2023-03-111-1/+1
| | | | | | | | | The ossp-uuid pkg-config file includes the necessary -I to include the header as uuid.h. Previously this would only work if ossp-uuid has its headers in ossp/ in an already searched path. Reported-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://postgr.es/m/7bb8b8a5-5297-ab3c-3412-466fd0124d00@dunslane.net
* meson: Add target for installing test files & improve install_test_filesAndres Freund2023-03-081-14/+18
| | | | | | | | | | | | | | | | | | | | The changes in b6a0d469cae prevented installation of the test files during a normal install. However, the buildfarm intentionally tries to trun the tests against a "real" installation. The new install-test-files target provides that ability. Because we want to install into a normal directory, I removed the necessary munging of the target paths from meson.build and moved it into install-test-files. I also added DESTDIR support, so that installing can redirect the directory if desired. That's used for the tmp_install/ installation now. I didn't like the number of arguments necessary for install_test_files, so I changed it to use --install target list of files which makes it easier to use for further directories, if/when we need them. Discussion: https://postgr.es/m/20230308012940.edexipb3vqylcu6r@awork3.anarazel.de
* meson: don't require 'touch' binary, make use of 'cp' optionalAndres Freund2023-03-071-1/+1
| | | | | | | | | | | | We already didn't use touch (some earlier version of the meson build did ), and cp is only used for updating unicode files. The latter already depends on the optional availability of 'wget', so doing the same for 'cp' makes sense. Eventually we probably want a portable command for updating source code as part of a target, but for now... Reported-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://postgr.es/m/70e96c34-64ee-e549-8c4a-f91a7a668804@dunslane.net
* meson: Prevent installation of test files during main installPeter Eisentraut2023-03-031-1/+31
| | | | | | | | | | | | | | | Previously, meson installed modules under src/test/modules/ as part of a normal installation, even though these files are only meant for use by tests. This is because there is no way to set up up the build system to install extra things only when told. This patch fixes that with a workaround: We don't install these modules as part of meson install, but we create a new "test" that runs before the real tests whose action it is to install these files. The installation is done by manual copies using a small helper script. Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/2a039e8e-f31f-31e8-afe7-bab3130ad2de%40enterprisedb.com
* meson: Add equivalent of configure --disable-rpath optionPeter Eisentraut2023-03-011-3/+13
| | | | Discussion: https://www.postgresql.org/message-id/flat/33e957e6-4b4e-b0ed-1cc1-6335a24543ff%40enterprisedb.com
* meson: windows: Fix tmp_install + prefix computation with meson 1.0.1Andres Freund2023-02-231-3/+3
| | | | | | | | | | | | | | In d0366bfb3b21 I said: Instead of trying to do this in meson.build, call out to the implementation meson install uses. This isn't pretty, but it's more reliable than what we had before. Unfortunately it was too ugly - to fix a bug, meson 1.0.1 changed the way the meson internal runpython helper works, resulting in the previous sys.argv[] indices not working anymore. Just open-code it - it's just a few characters longer. Committing this quickly to allow ci/cfbot to work with meson 1.0.1 on windows.
* Remove obsolete platforms from ps_status.c.Thomas Munro2023-02-171-17/+0
| | | | | | | | Time to remove various code, comments and configure/meson probes relating to ancient BSD, SunOS, GNU/Hurd, IRIX, NeXT and Unixware. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKGJMNGUAqf27WbckYFrM-Mavy0RKJvocfJU%3DJ2XcAZyv%2Bw%40mail.gmail.com
* Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS certificatesMichael Paquier2023-02-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL 1.1.1 and newer versions have added support for RSA-PSS certificates, which requires the use of a specific routine in OpenSSL to determine which hash function to use when compiling it when using channel binding in SCRAM-SHA-256. X509_get_signature_nid(), that is the original routine the channel binding code has relied on, is not able to determine which hash algorithm to use for such certificates. However, X509_get_signature_info(), new to OpenSSL 1.1.1, is able to do it. This commit switches the channel binding logic to rely on X509_get_signature_info() over X509_get_signature_nid(), which would be the choice when building with 1.1.1 or newer. The error could have been triggered on the client or the server, hence libpq and the backend need to have their related code paths patched. Note that attempting to load an RSA-PSS certificate with OpenSSL 1.1.0 or older leads to a failure due to an unsupported algorithm. The discovery of relying on X509_get_signature_info() comes from Jacob, the tests have been written by Heikki (with few tweaks from me), while I have bundled the whole together while adding the bits needed for MSVC and meson. This issue exists since channel binding exists, so backpatch all the way down. Some tests are added in 15~, triggered if compiling with OpenSSL 1.1.1 or newer, where the certificate and key files can easily be generated for RSA-PSS. Reported-by: Gunnar "Nick" Bluth Author: Jacob Champion, Heikki Linnakangas Discussion: https://postgr.es/m/17760-b6c61e752ec07060@postgresql.org Backpatch-through: 11
* meson: Fix installation path computationPeter Eisentraut2023-01-271-4/+6
| | | | | | | | | | | | We have the long-standing logic to append "postgresql" to some installation paths if it does not already contain "pgsql" or "postgres". The existing meson implementation of that only considered the subdirectory under the prefix, not the prefix itself. Fix that, so that it now works the same way as the implementation in Makefile.global. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/a6a6de12-f705-2b33-2fd9-9743277deb08@enterprisedb.com
* Use unnamed POSIX semaphores on Cygwin.Thomas Munro2023-01-061-0/+1
| | | | | | | | | | | | | | | Testing on CI showed that Cygwin's semctl() can fail with EAGAIN (possibly due to resource limits in cygserver that could be tuned, not examined). Switch to so-called POSIX semaphores instead, which don't seem to fail in that way (possibly due to a more direct implementation using Windows semaphore primitives instead of talking to cygserver, based on a cursory glance at the source). Other known problems still prevent PostgreSQL from running on Cygwin without random crashes, but this rarer problem was noticed while testing. Discussion: https://postgr.es/m/CA%2BhUKG%2BQ6DU4Ov9LrvUyDcF3oHS4KMRVSKmVGaeePq-kOyG9gA%40mail.gmail.com
* Fix typos in comments, code and documentationMichael Paquier2023-01-031-2/+2
| | | | | | | | | | While on it, newlines are removed from the end of two elog() strings. The others are simple grammar mistakes. One comment in pg_upgrade referred incorrectly to sequences since a7e5457. Author: Justin Pryzby Discussion: https://postgr.es/m/20221230231257.GI1153@telsasoft.com Backpatch-through: 11
* Update copyright for 2023Bruce Momjian2023-01-021-1/+1
| | | | Backpatch-through: 11
* Add copyright notices to meson filesAndrew Dunstan2022-12-201-0/+2
| | | | Discussion: https://postgr.es/m/222b43a5-2fb3-2c1b-9cd0-375d376c8246@dunslane.net
* Disable clang 16's -Wcast-function-type-strict.Thomas Munro2022-12-131-0/+3
| | | | | | | | | | | | | | Clang 16 is still in development, but seawasp reveals that it has started warning about many of our casts of function pointers (those introduced by commit 1c27d16e, and some older ones). Disable the new warning for now, since otherwise buildfarm animal seawasp fails, and we have no current plans to change our strategy for these callback function types. May be back-patched with other Clang/LLVM 16 changes around release time. Discussion: https://postgr.es/m/CA%2BhUKGJvX%2BL3aMN84ksT-cGy08VHErRNip3nV-WmTx7f6Pqhyw%40mail.gmail.com
* meson: Improve PG_VERSION_STR generationAndres Freund2022-12-091-2/+10
| | | | | | | | | 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
* Add option to specify segment size in blocksAndres Freund2022-12-071-5/+19
| | | | | | | | | | | | | | The tests don't have much coverage of segment related code, as we don't create large enough tables. To make it easier to test these paths, add a new option specifying the segment size in blocks. Set the new option to 6 blocks in one of the CI tasks. Smaller numbers currently fail one of the tests, for understandable reasons. While at it, fix some segment size related issues in the meson build. Author: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20221107171355.c23fzwanfzq2pmgt@awork3.anarazel.de
* meson: Add 'running' test setup, as a replacement for installcheckAndres Freund2022-12-071-14/+77
| | | | | | | | | | | | | To run all tests that support running against existing server: $ meson test --setup running To run just the main pg_regress tests against existing server: $ meson test --setup running regress-running/regress To ensure the 'running' setup continues to work, test it as part of the freebsd CI task. Discussion: https://postgr.es/m/CAH2-Wz=XDQcmLoo7RR_i6FKQdDmcyb9q5gStnfuuQXrOGhB2sQ@mail.gmail.com
* meson: Add basic PGXS compatibilityAndres Freund2022-12-061-6/+2
| | | | | | | | | | | | | Generate a Makefile.global that's complete enough for PGXS to work for some extensions. It is likely that this compatibility layer will not suffice for every extension and not all platforms - we can expand it over time. This allows extensions to use a single buildsystem across all the supported postgres versions. Once all supported PG versions support meson, we can remove the compatibility layer. Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
* meson: Basic cygwin supportAndres Freund2022-12-061-2/+6
| | | | | | | | | | | There likely are further issues, but as evidenced by the CI task proposed by Justin in the referenced thread, this suffices to build and run basic tests in cygwin (some fixes for the test infrastructure are needed, but that's independent of the meson aspect). Author: Justin Pryzby <pryzby@telsasoft.com> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20221021034040.GT16921@telsasoft.com
* meson: Fix binary mismatch for MSVC plperl vs gcc built perl libsAndres Freund2022-11-281-0/+6
| | | | This mirrors ccc59a83cd9.
* meson: Define HAVE_LOCALE_T for msvcPeter Eisentraut2022-11-111-1/+11
| | | | | | | | | | Meson doesn't see the redefinition of locale_t done in src/include/port/win32_port.h, so it is not defining HAVE_LOCALE_T, HAVE_WCSTOMBS_L nor HAVE_MBSTOWCS_L as the current src/tools/msvc/build.pl script does. Add manual overrides to fix. Author: Author: Juan Jose Santamaria Flecha <juanjo.santamaria@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAC%2BAXB1wJEqfKCuVcNpoH%3Dgxd61N%3D7c2fR3Ew6YRPpSfEUA%3DyQ%40mail.gmail.com
* meson: Mark PROVE as not requiredAndres Freund2022-11-041-1/+1
| | | | | | | | | In the meson build the prove binary is currently not even used. It will soon be, for PGXS compatibility, but even then we should build without it around. Author: Justin Pryzby <pryzbyj@telsasoft.com> Discussion: https://postgr.es/m/20221021034040.GT16921@telsasoft.com Discussion: https://postgr.es/m/20221104235412.GE16921@telsasoft.com
* Make finding openssl program a configure or meson optionPeter Eisentraut2022-10-201-0/+1
| | | | | | | | | | | | | | | | | Various test suites use the "openssl" program as part of their setup. There isn't a way to override which openssl program is to be used, other than by fiddling with the path, perhaps. This has gotten increasingly problematic because different versions of openssl have different capabilities and do different things by default. This patch checks for an openssl binary in configure and meson setup, with appropriate ways to override it. This is similar to how "lz4" and "zstd" are handled, for example. The meson build system actually already did this, but the result was only used in some places. This is now applied more uniformly. Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/dc638b75-a16a-007d-9e1c-d16ed6cf0ad2%40enterprisedb.com
* meson: macos: Use -Wl,-undefined,error for modulesAndres Freund2022-10-151-0/+4
| | | | | | | | meson defaults to -Wl,-undefined,dynamic_lookup for modules, which we don't want because a) it's different from what we do for autoconf, b) it causes warnings starting in macOS Ventura. Discussion: https://postgr.es/m/20221015211955.q4cwbsfkyk3c4ty3@awork3.anarazel.de
* meson: catch up to a few configure changesAndres Freund2022-10-151-3/+8
| | | | | | | | | | | | | | | | | | | | | I (Andres) missed a few recent changes to configure when merging e6927270cd1 "meson: Add initial version of meson based build system". Mirror the changes in - ec3c9cc202f "Add definition pg_attribute_aligned() for MSVC" - b086a47a270 "Bump minimum version of Bison to 2.3" - 8b878bffa8d "Bump minimum version of Flex to 2.5.35" As MSVC does not implement 128 bit integers, the oversight of not using pg_attribute_aligned() should not have current practical consequences. But of course the code from c.h should still be correctly mirrored. I (Andres) also hadn't implemented the minimum perl version check. Added that now. Reported-by: Junwang Zhao <zhjwpku@gmail.com> Author: Junwang Zhao <zhjwpku@gmail.com> Author: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CAEG8a3K9c87EwAwmdOgmS0Li1J6P_7r-Uc0-zN6cJtrMr7VvPg@mail.gmail.com
* Add -Wshadow=compatible-local to the standard compilation flagsDavid Rowley2022-10-071-0/+1
| | | | | | | | | | | | | | | | | | | Since cd4e8caaa, we've been able to build the source tree with -Wshadow=compatible-local without any warnings. Lots of work was done by Justin Pryzby and I (David) to get all our code to compile warning free with that flag. In that process, 2 bugs (16d69ec29 and af7d270dd) were discovered and fixed. Additionally, "git log --grep=shadow" shows that there is no shortage of other bugs that have been fixed over the years which were caused by variable shadowing. In light of the above, it seems very much worthwhile to add at least -Wshadow=compatible-local to our standard compilation flags. We *may* want to go further and take this to -Wshadow=local in the future, but we're not ready for that today, so let's add -Wshadow=compatible-local now to help make sure we don't introduce further local variable shadowing. Author: Andres Freund Discussion: https://postgr.es/m/20221006003920.6xlqaoccxwisza5k@awork3.anarazel.de
* meson: Add support for building with precompiled headersAndres Freund2022-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This substantially speeds up building for windows, due to the vast amount of headers included via windows.h. A cross build from linux targetting mingw goes from 994.11user 136.43system 0:31.58elapsed 3579%CPU to 422.41user 89.05system 0:14.35elapsed 3562%CPU The wins on windows are similar-ish (but I don't have a system at hand just now for actual numbers). Targetting other operating systems the wins are far smaller (tested linux, macOS, FreeBSD). For now precompiled headers are disabled by default, it's not clear how well they work on all platforms. E.g. on FreeBSD gcc doesn't seem to have working support, but clang does. When doing a full build precompiled headers are only beneficial for targets with multiple .c files, as meson builds a separate precompiled header for each target (so that different compilation options take effect). This commit therefore only changes target with at least two .c files to use precompiled headers. Because this commit adds b_pch=false to the default_options new build directories will have precompiled headers disabled by default, however existing build directories will continue use the default value of b_pch, which is true. Note that using precompiled headers with ccache requires setting CCACHE_SLOPPINESS=pch_defines,time_macros to get hits. Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://postgr.es/m/CA+hUKG+50eOUbN++ocDc0Qnp9Pvmou23DSXu=ZA6fepOcftKqA@mail.gmail.com Discussion: https://postgr.es/m/c5736f70-bb6d-8d25-e35c-e3d886e4e905@enterprisedb.com Discussion: https://postgr.es/m/20190826054000.GE7005%40paquier.xyz
* meson: Add windows resource filesAndres Freund2022-10-051-0/+59
| | | | | | | | | | | | | The generated resource files aren't exactly the same ones as the old buildsystems generate. Previously "InternalName" and "OriginalFileName" were mostly wrong / not set (despite being required), but that was hard to fix in at least the make build. Additionally, the meson build falls back to a "auto-generated" description when not set, and doesn't set it in a few cases - unlikely that anybody looks at these descriptions in detail. Author: Andres Freund <andres@anarazel.de> Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
* meson: libpq: Revise static / shared library setupAndres Freund2022-10-051-5/+18
| | | | | | | | | | | | | | | Improvements: - we don't need -DFRONTEND for libpq anymore since 1d77afefbd1 - the .pc file contents for a static libpq were wrong (referencing {pgport, common}_shlib) - incidentally fixes meson not supporting link_whole on AIX yet - added explanatory comments Previously I tried to avoid building libpq's sources twice, once for the static and once for the shared library. We could still do so, but it's not clear that it's worth the complication. Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
* meson: respect -Dldap=disabledAndres Freund2022-10-031-1/+4
| | | | | | I noticed during some manual testing that -Dldap=disabled (or --auto-features=disabled) doesn't disable ldap if available - that's obviously wrong.
* meson: Add prefix=/usr/local/pgsql to default_optionsAndres Freund2022-10-011-0/+4
| | | | | | | | | | | autoconf set PREFIX to /usr/local/pgsql, so using the same default for meson makes sense. The effect on windows is that installation defaults to installing to C:/usr/local/pgsql rather than meson's default of C:/, which doesn't seem perfect, but OK enough. Signed-off-by: Junwang Zhao <zhjwpku@gmail.com> Author: Junwang Zhao <zhjwpku@gmail.com> Discussion: https://postgr.es/CAEG8a3LGWE-gG6vuddmH91RORhi8gWs0mMB-hcTmP3_NVgM7dg@mail.gmail.com
* meson: windows: Determine path to tmp_install + prefix using mesonAndres Freund2022-10-011-24/+16
| | | | | | | | | | | | Previously some paths (like c:\ or d:/) worked, but plenty others (like /path/to or //computer/share/path) didn't. As we'd like to change the default prefix to /usr/local/pgsql, that's a problem. Instead of trying to do this in meson.build, call out to the implementation meson install uses. This isn't pretty, but it's more reliable than what we had before. Discussion: https://postgr.es/CAEG8a3LGWE-gG6vuddmH91RORhi8gWs0mMB-hcTmP3_NVgM7dg@mail.gmail.com
* meson: mingw: Add -Wl,--disable-auto-import, enable when linking with readlineAndres Freund2022-09-301-0/+9
| | | | | | | | | | | | | | | | I hadn't ported -Wl,--disable-auto-import over from the win32 template as I had focused on msvc for windows. The flag is desirable as it makes it easier to find problems one would have with msvc, particularly useful during cross compilation. This turned out to be a somewhat happy accident, as it allowed me to realize that readline actually works on windows these days, as long as auto imports to enable. Therefore enable auto-import again as part of linking to readline. We perhaps can come up with a better solution for the readline issue, but this seems good enough for now. Discussion: http://postgr.es/m/20220928022724.erzuk5v4ai4b53do@awork3.anarazel.de
* meson: Implement getopt logic from autoconfAndres Freund2022-09-281-2/+11
| | | | | | | | Not replacing getopt/getopt_long definitely causes issues on mingw. It's not as clear whether the solaris & openbsd aspect is still needed, but if not, we should remove it from both autoconf and meson. Discussion: http://postgr.es/m/20220928022724.erzuk5v4ai4b53do@awork3.anarazel.de
* meson: mingw: Allow multiple definitionsAndres Freund2022-09-281-0/+2
| | | | | | | | I didn't carry this forward from the win32 template. It's not needed anymore for the reason stated therein, but it turns out to be required to e.g. override getopt. Possibly a better solution exists, but that's for later. Discussion: http://postgr.es/m/20220928022724.erzuk5v4ai4b53do@awork3.anarazel.de