summaryrefslogtreecommitdiff
path: root/configure
Commit message (Collapse)AuthorAgeFilesLines
* Use --strip-unneeded when stripping static libraries with GNU strip.Tom Lane2023-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | We've long used "--strip-unneeded" for shared libraries but plain "-x" for static libraries when stripping symbols with GNU strip. There doesn't seem to be any really good reason for that though, since --strip-unneeded produces smaller output (as "-x" alone does not remove debug symbols). Moreover it seems that llvm-strip, although it identifies as GNU strip, misbehaves when given "-x" for this purpose. It's unclear whether that's intentional or a bug in llvm-strip, but in any case it seems like changing to use --strip-unneeded in all cases should be a win. Note that this doesn't change our behavior when dealing with non-GNU strip. Per gripes from Ed Maste and Palle Girgensohn. Back-patch, in case anyone wants to use llvm-strip with stable branches. Discussion: https://postgr.es/m/17898-5308d09543463266@postgresql.org Discussion: https://postgr.es/m/20230420153338.bbj2g5jiyy3afhjz@awork3.anarazel.de
* Build ICU support by default.Jeff Davis2023-04-181-24/+12
| | | | | Discussion: https://postgr.es/m/82c4c816-06f6-d3e3-ba02-fca4a5cef065%40enterprisedb.com Reviewed-by: Peter Eisentraut
* Update configure for ab969a376Stephen Frost2023-04-171-13/+13
| | | | | | | Commit ab969a376 updated configure.ac but neglected to update the actual configure script. Fix that. Pointed out by Tom Lane
* Explicitly require MIT Kerberos for GSSAPIStephen Frost2023-04-131-0/+27
| | | | | | | | | | 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
* Fix detection of unseekable files for fseek() and ftello() with MSVCMichael Paquier2023-04-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling fseek() or ftello() on a handle to a non-seeking device such as a pipe or a communications device is not supported. Unfortunately, MSVC's flavor of these routines, _fseeki64() and _ftelli64(), do not return an error when given a pipe as handle. Some of the logic of pg_dump and restore relies on these routines to check if a handle is seekable, causing failures when passing the contents of pg_dump to pg_restore through a pipe, for example. This commit introduces wrappers for fseeko() and ftello() on MSVC so as any callers are able to properly detect the cases of non-seekable handles. This relies mainly on GetFileType(), sharing a bit of code with the MSVC port for fstat(). The code in charge of getting a file type is refactored into a new file called win32common.c, shared by win32stat.c and the new win32fseek.c. It includes the MSVC ports for fseeko() and ftello(). Like 765f5df, this is backpatched down to 14, where the fstat() implementation for MSVC is able to understand about files larger than 4GB in size. Using a TAP test for that is proving to be tricky as IPC::Run handles the pipes by itself, still I have been able to check the fix manually. Reported-by: Daniel Watzinger Author: Juan José Santamaría Flecha, Michael Paquier Discussion: https://postgr.es/m/CAC+AXB26a4EmxM2suXxPpJaGrqAdxracd7hskLg-zxtPB50h7A@mail.gmail.com Backpatch-through: 14
* libpq: Add sslcertmode option to control client certificatesMichael Paquier2023-03-241-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* libpq: Remove code for SCM credential authenticationMichael Paquier2023-03-171-16/+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
* Remove obsolete platforms from ps_status.c.Thomas Munro2023-02-171-35/+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/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update copyright for 2023Bruce Momjian2023-01-021-2/+2
| | | | Backpatch-through: 11
* Disable clang 16's -Wcast-function-type-strict.Thomas Munro2022-12-131-0/+44
| | | | | | | | | | | | | | 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
* Add option to specify segment size in blocksAndres Freund2022-12-071-10/+53
| | | | | | | | | | | | | | 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
* autoconf: Move export_dynamic determination to configureAndres Freund2022-12-061-132/+77
| | | | | | | | | | | | | Previously export_dynamic was set in src/makefiles/Makefile.$port. For solaris this required exporting with_gnu_ld. The determination of with_gnu_ld would be nontrivial to copy for meson PGXS compatibility. It's also nice to delete libtool.m4. This uses -Wl,--export-dynamic on all platforms, previously all platforms but FreeBSD used -Wl,-E. The likelihood of a name conflict seems lower with the longer spelling. Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
* autoconf: Don't AC_SUBST() LD in configureAndres Freund2022-12-011-2/+0
| | | | | | | | | | | | | | The only use of $(LD) in Makefiles is for AIX, to generate the export file for the backend. We only support the system linker on AIX and we already hardcode the path to a number of other binaries. Removing LD substitution will simplify the upcoming meson PGXS compatibility. While at it, add a comment why -r is used. A subsequent commit will remove the determination of LD from configure as well. Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
* autoconf: Unify CFLAGS_SSE42 and CFLAGS_ARMV8_CRC32CAndres Freund2022-12-011-10/+9
| | | | | | | | | | | | | | | | | | Until now we emitted the cflags to build the CRC objects into architecture specific variables. That doesn't make a whole lot of sense to me - we're never going to target x86 and arm at the same time, so they don't need to be separate variables. It might be better to instead continue to have CFLAGS_SSE42 / CFLAGS_ARMV8_CRC32C be computed by PGAC_ARMV8_CRC32C_INTRINSICS / PGAC_SSE42_CRC32_INTRINSICS and then set CFLAGS_CRC based on those. But it seems unlikely that we'd need other sets of CRC specific flags for those two architectures at the same time. This simplifies the upcoming meson PGXS compatibility. Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
* Make finding openssl program a configure or meson optionPeter Eisentraut2022-10-201-0/+55
| | | | | | | | | | | | | | | | | 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
* Track LLVM 15 changes.Thomas Munro2022-10-191-0/+89
| | | | | | | | | | | | Per https://llvm.org/docs/OpaquePointers.html, support for non-opaque pointers still exists and we can request that on our context. We have until LLVM 16 to move to opaque pointers, a much larger change. Back-patch to 11, where LLVM support arrived. Author: Thomas Munro <thomas.munro@gmail.com> Author: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CAMHz58Sf_xncdyqsekoVsNeKcruKootLtVH6cYXVhhUR1oKPCg%40mail.gmail.com
* autoconf: Rely on ar supporting index creationAndres Freund2022-10-071-93/+0
| | | | | | | | | | | | | | | | | | | | This way we don't need RANLIB anymore, making it a bit simpler for the meson build to generate Makefile.global for PGXS compatibility. FreeBSD, NetBSD, OpenBSD, the only platforms where we didn't use AROPT=crs, all have supported the 's' option for a long time. On macOS we ran ranlib after installing a static library. This was added a long time ago, in 58ad65ec2def. I cannot reproduce an issue in more recent macOS versions. This is removed now. Based on discussion with Tom, I left the 'touch' at the end of static libraries generation, added in 826eff57c4c, in place. While it looks like current versions of Apple's ar/ranlib don't need it, it was needed not too long ago. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
* Add -Wshadow=compatible-local to the standard compilation flagsDavid Rowley2022-10-071-0/+91
| | | | | | | | | | | | | | | | | | | 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 initial version of meson based build systemAndres Freund2022-09-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autoconf is showing its age, fewer and fewer contributors know how to wrangle it. Recursive make has a lot of hard to resolve dependency issues and slow incremental rebuilds. Our home-grown MSVC build system is hard to maintain for developers not using Windows and runs tests serially. While these and other issues could individually be addressed with incremental improvements, together they seem best addressed by moving to a more modern build system. After evaluating different build system choices, we chose to use meson, to a good degree based on the adoption by other open source projects. We decided that it's more realistic to commit a relatively early version of the new build system and mature it in tree. This commit adds an initial version of a meson based build system. It supports building postgres on at least AIX, FreeBSD, Linux, macOS, NetBSD, OpenBSD, Solaris and Windows (however only gcc is supported on aix, solaris). For Windows/MSVC postgres can now be built with ninja (faster, particularly for incremental builds) and msbuild (supporting the visual studio GUI, but building slower). Several aspects (e.g. Windows rc file generation, PGXS compatibility, LLVM bitcode generation, documentation adjustments) are done in subsequent commits requiring further review. Other aspects (e.g. not installing test-only extensions) are not yet addressed. When building on Windows with msbuild, builds are slower when using a visual studio version older than 2019, because those versions do not support MultiToolTask, required by meson for intra-target parallelism. The plan is to remove the MSVC specific build system in src/tools/msvc soon after reaching feature parity. However, we're not planning to remove the autoconf/make build system in the near future. Likely we're going to keep at least the parts required for PGXS to keep working around until all supported versions build with meson. Some initial help for postgres developers is at https://wiki.postgresql.org/wiki/Meson With contributions from Thomas Munro, John Naylor, Stone Tickle and others. Author: Andres Freund <andres@anarazel.de> Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Author: Peter Eisentraut <peter@eisentraut.org> Reviewed-By: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/20211012083721.hvixq4pnh2pixr3j@alap3.anarazel.de
* Add definition pg_attribute_aligned() for MSVCMichael Paquier2022-09-211-0/+2
| | | | | | | | | | | | Visual Studio 2015+ has support for a macro to control the alignement of structures as of __declspec(align(#)), and this commit adds a definition of pg_attribute_aligned() based on that. It happens that this was already used in the implementation of atomics for MSVC. Note that there is still no definition fo pg_attribute_packed(), so this does not impact itemptr.h. Author: James Coleman Discussion: https://postgr.es/m/CAAaqYe-HbtZvR3msoMtk+hYW2S0e0OapzMW8icSMYTMA+mN8Aw@mail.gmail.com
* Remove DLLTOOL, DLLWRAP from configure / Makefile.global.inAndres Freund2022-09-171-186/+0
| | | | | | We got rid of the need for them in 4f5f485d10c and 846e91e0223. Discussion: https://postgr.es/m/20220915022626.5xx3ccgkzpkqw5mq@awork3.anarazel.de
* aix: xlc: Use -Wl,-b,expfull for old compiler versionsAndres Freund2022-09-161-0/+5
| | | | | | | | | | | | Unfortunately xlc 12.1 and earlier don't support -qvisibility. Therefore be7c15b194a doesn't suffice to make extension libraries work without the explicit mkldexport step removed in fe6a64a58ab. While 12.1 is EOL, there is some desire to leave buildfarm animals using it run a bit longer. But instead of adding back the complicated mkldexport step, we can use -Wl,-b,expfull to force all symbols to be exported. Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/2490844.1663123546@sss.pgh.pa.us
* Bump minimum Perl version to 5.14John Naylor2022-09-141-3/+3
| | | | | | | | | | | | | | | | | | | | The oldest vendor-shipped Perl in the buildfarm is 5.14.2, which is the last version that Debian Wheezy shipped. That OS is EOL, but we keep it running because there is no other convenient way to test certain non-mainstream 32-bit platforms. There is no bugfix in the 5.14.2 release that is required, and yet it's also not the latest minor release -- that would be 5.14.4. To clarify the situation, we have thus arranged the buildfarm to test 5.14.0. That allows configure scripts and documentation to state 5.14 without fine print. The MSVC build didn't check the version, since our previous minimum 5.8.3 was considered too old to check for on Windows. We will need a check for Windows sometime during the v16 cycle, but that could be rendered moot by the impending Meson conversion, so it seems safe to just document the requirement for now. Reviewed by Tom Lane Discussion: https://www.postgresql.org/message-id/20220902181553.ev4pgzhubhdkguuv@awork3.anarazel.de
* configure: Expand -fvisibility checks to more compilers, test for -qvisibilityAndres Freund2022-09-091-148/+252
| | | | | | | | | | | | | | | | It looks like icc and sunpro both support -fvisibility=hidden and xlc supports -qvisibility=hidden. I tested this on AIX and solaris with their proprietary compilers as well as gcc, and with gcc or clang on freebsd, linux, macos, netbsd and openbsd. Apparently my prior commit fe6a64a58ab only works in combination with this patch. While I tried to test them separately, an unknown caching issue prevented me from noticing the problem. Per discussion with Tom Lane and buildfarm member hoverfly. Discussion: https://postgr.es/m/20220910052741.t7w7csyrggwus2ze%40awork3.anarazel.de Discussion: https://postgr.es/m/20220820174213.d574qde4ptwdzoqz@awork3.anarazel.de
* Bump minimum version of Flex to 2.5.35John Naylor2022-09-091-3/+3
| | | | | | | | Since the retirement of some older buildfarm members, the oldest Flex that gets regular testing is 2.5.35. Reviewed by Andres Freund Discussion: https://www.postgresql.org/message-id/1097762.1662145681@sss.pgh.pa.us
* Bump minimum version of Bison to 2.3John Naylor2022-09-091-3/+3
| | | | | | | | | | | | Since the retirement of some older buildfarm members, the oldest Bison that gets regular testing is 2.3. MacOS ships that version, and will continue doing so for the forseeable future because of Apple's policy regarding GPLv3. While Mac users could use a package manager to install a newer version, there is no compelling reason to force them do so at this time. Reviewed by Andres Freund Discussion: https://www.postgresql.org/message-id/1097762.1662145681@sss.pgh.pa.us
* Remove configure probe for sockaddr_in6 and require AF_INET6.Thomas Munro2022-08-261-10/+0
| | | | | | | | | | | | | | | | | SUSv3 <netinet/in.h> defines struct sockaddr_in6, and all targeted Unix systems have it. Windows has it in <ws2ipdef.h>. Remove the configure probe, the macro and a small amount of dead code. Also remove a mention of IPv6-less builds from the documentation, since there aren't any. This is similar to commits f5580882 and 077bf2f2 for Unix sockets. Even though AF_INET6 is an "optional" component of SUSv3, there are no known modern operating system without it, and it seems even less likely to be omitted from future systems than AF_UNIX. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA+hUKGKErNfhmvb_H0UprEmp4LPzGN06yR2_0tYikjzB-2ECMw@mail.gmail.com
* Remove further unwanted linker flags from perl_embed_ldflagsPeter Eisentraut2022-08-231-2/+2
| | | | | | | | | | | | | | | | | | Remove the contents of $Config{ldflags} from ExtUtils::Embed's ldopts, like we already do with $Config{ccdlflags}. Those flags are the choices of those who built the Perl installation, which are not necessarily appropriate for building PostgreSQL. What we really want from ldopts are the options identifying the location and name of the libperl library, but unfortunately it doesn't appear possible to get that separately from the other stuff. The motivation for this was to strip -mmacosx-version-min options. We already did something similar for the -arch option. Both of those are now covered by this more general approach. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/flat/8c4fcb72-2574-ff7c-4c25-1f032d4a2a57%40enterprisedb.com
* Remove configure probes for sockaddr_storage members.Thomas Munro2022-08-221-48/+0
| | | | | | | | | | | | | | | | | | | | | Remove four probes for members of sockaddr_storage. Keep only the probe for sockaddr's sa_len, which is enough for our two remaining places that know about _len fields: 1. ifaddr.c needs to know if sockaddr has sa_len to understand the result of ioctl(SIOCGIFCONF). Only AIX is still using the relevant code today, but it seems like a good idea to keep it compilable on Linux. 2. ip.c was testing for presence of ss_len to decide whether to fill in sun_len in our getaddrinfo_unix() function. It's just as good to test for sa_len. If you have one, you have them all. (The code in #2 isn't actually needed at all on several OSes I checked since modern versions ignore sa_len on input to system calls. Proving that's the case for all relevant OSes is left for another day, but wouldn't get rid of that last probe anyway if we still want it for #1.) Discussion: https://postgr.es/m/CA%2BhUKGJJjF2AqdU_Aug5n2MAc1gr%3DGykNjVBZq%2Bd6Jrcp3Dyvg%40mail.gmail.com
* Don't add HAVE_LDAP_H HAVE_WINLDAP_H to pg_config.hAndres Freund2022-08-181-14/+2
| | | | | | | They're not referenced, so we don't need them in in pg_config.h. Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: http://postgr.es/m/e0c44fb2-8b66-a4b9-b274-7ed3a1a0ab74@enterprisedb.com
* Remove unused configure variable.Tom Lane2022-08-181-2/+1
| | | | | | | | | | configure extracts TCL_SHLIB_LD_LIBS from tclConfig.sh, and puts the value into Makefile.global, but then we never use it anywhere. It looks like I removed the only usage in cd75f94da, but didn't notice that it was the only usage. Might as well mop this up while we're trying to get rid of unnecessary configure steps. Discussion: https://postgr.es/m/2442359.1660835043@sss.pgh.pa.us
* Remove configure probe for netinet/tcp.h.Thomas Munro2022-08-181-1/+1
| | | | | | | | <netinet/tcp.h> is in SUSv3 and all targeted Unix systems have it. For Windows, we can provide a stub include file, to avoid some #ifdef noise. Discussion: https://postgr.es/m/CA+hUKGKErNfhmvb_H0UprEmp4LPzGN06yR2_0tYikjzB-2ECMw@mail.gmail.com
* Remove configure probe for sys/sockio.h.Thomas Munro2022-08-181-1/+1
| | | | | | | | | | | On BSD-family systems, header <sys/sockio.h> defines socket ioctl numbers like SIOCGIFCONF. Only AIX is using those now, but it defines them in <net/if.h> anyway. Supposing some PostgreSQL hacker wants to test that AIX-only code path on a more common development system by pretending not to have getifaddrs(). It's enough to include <sys/ioctl.h>, at least on macOS, FreeBSD and Linux, and we're already doing that.
* Remove configure probe for net/if.h.Thomas Munro2022-08-181-1/+1
| | | | | | | | | <net/if.h> is in SUSv3 and all targeted Unixes have it. It's used in a region that is already ifdef'd out for Windows. We're not using it for any standard definitions, but it's where AIX defines conventional socket ioctl numbers. Discussion: https://postgr.es/m/CA+hUKGKErNfhmvb_H0UprEmp4LPzGN06yR2_0tYikjzB-2ECMw@mail.gmail.com
* Remove configure probe for gethostbyname_r.Thomas Munro2022-08-141-61/+4
| | | | | | | It was only used by src/port/getaddrinfo.c, removed by the previous commit. Discussion: https://postgr.es/m/CA%2BhUKGJFLPCtAC58EAimF6a6GPw30TU_59FUY%3DGWB_kC%3DJEmVQ%40mail.gmail.com
* Remove replacement code for getaddrinfo.Thomas Munro2022-08-141-42/+0
| | | | | | | | | | SUSv3, all targeted Unixes and modern Windows have getaddrinfo() and related interfaces. Drop the replacement implementation, and adjust some headers slightly to make sure that the APIs are visible everywhere using standard POSIX headers and names. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Remove configure probe for struct sockaddr_storage.Thomas Munro2022-08-141-13/+0
| | | | | | | | <sys/socket.h> provides sockaddr_storage in SUSv3 and all targeted Unix systems have it. Windows has it too. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Remove configurability of PPC spinlock assembly code.Tom Lane2022-08-131-33/+1
| | | | | | | | | | | | | | | | | | | | | Assume that we can use LWARX hint flags and the LWSYNC instruction on any PPC machine. The check on the assembler's behavior was only needed for Apple's old assembler, which is no longer of interest now that we've de-supported all PPC-era versions of macOS (thanks to them not having clock_gettime()). Also, given an up-to-date assembler these instructions work even on Apple's old hardware. It seems quite unlikely that anyone would be interested in running current Postgres on PPC hardware that's so old as to not have these instructions. Hence, rip out associated configure test and manual configuration options, and just use the modernized instructions all the time. Also, update atomics/arch-ppc.h to use these instructions as well. (It was already using LWSYNC unconditionally in another place, providing further proof that nobody is using PG on hardware old enough to have a problem with that.) Discussion: https://postgr.es/m/166622.1660323391@sss.pgh.pa.us
* Remove configure probe for shl_load library.Thomas Munro2022-08-141-56/+0
| | | | | | | | This was needed only by HP-UX 10, so it became redundant with commit 9db300ce. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Remove configure probe for sys/resource.h and refactor.Thomas Munro2022-08-141-7/+7
| | | | | | | | | | | | <sys/resource.h> is in SUSv2 and is on all targeted Unix systems. We have a replacement for getrusage() on Windows, so let's just move its declarations into src/include/port/win32/sys/resource.h so that we can use a standard-looking #include. Also remove an obsolete reference to CLK_TCK. Also rename src/port/getrusage.c to win32getrusage.c, following the convention for Windows-only fallback code. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Remove configure probes for sys/ipc.h, sys/sem.h, sys/shm.h.Thomas Munro2022-08-141-5/+2
| | | | | | | | | These are in SUSv2 and every targeted Unix system has them. It's not hard to avoid including them on Windows system because they're mostly used in platform-specific translation units. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Remove configure probe for sys/select.h.Thomas Munro2022-08-141-1/+1
| | | | | | | | | <sys/select.h> is in SUSv3 and every targeted Unix system has it. Provide an empty header in src/include/port/win32 so that we can include it unguarded even on Windows. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Remove configure probes for sys/un.h and struct sockaddr_un.Thomas Munro2022-08-141-16/+1
| | | | | | | | | | | | | | | | <sys/un.h> is in SUSv3 and every targeted Unix has it. Some Windows tool chains may still lack the approximately equivalent header <afunix.h>, so we already defined struct sockaddr_un ourselves on that OS for now. To harmonize things a bit, move our definition into a new header src/include/port/win32/sys/un.h. HAVE_UNIX_SOCKETS is now defined unconditionally. We migh remove that in a separate commit, pending discussion. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Remove configure probe for sys/uio.h.Thomas Munro2022-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | <sys/uio.h> is in SUSv2, and all targeted Unix system have it, so we might as well drop the probe (in fact we never really needed this one). It's where struct iovec is defined, and as a common extension, it's also where non-standard preadv() and pwritev() are declared on systems that have them. We should also be able to assume that IOV_MAX is defined on Unix. To spell out what our pg_iovec.h header does for the OSes in the build farm as of today: Windows: our own struct and functions Solaris, Cygwin: <sys/uio.h>'s struct, our own functions Every other Unix: <sys/uio.h>'s struct and functions Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
* Trust a few system headers to stand on their ownAndres Freund2022-08-071-55/+1
| | | | | | | | | | At some point in the past some headers (net/if.h on some BSDs in 2009, netinet/tcp.h on IRIX in 2000, sys/ucred.h in 2013 on then older openbsd), only compiled if other heades were included first, complicating configure tests. More recent tests indicate that that's not required anymore. Reviewed-By: Thomas Munro <thomas.munro@gmail.com> Discussion: https://postgr.es/m/20220807012914.ydz73yte6j3coulo@awork3.anarazel.de
* windows: Remove HAVE_MINIDUMP_TYPE testAndres Freund2022-08-071-26/+0
| | | | | | | We've relied on it being present for msvc for ages... Reviewed-By: Thomas Munro <thomas.munro@gmail.com> Discussion: https://postgr.es/m/20220807012914.ydz73yte6j3coulo@awork3.anarazel.de
* Rely on __func__ being supportedAndres Freund2022-08-071-61/+0
| | | | | | | | | | | | Previously we fell back to __FUNCTION__ and then NULL. As __func__ is in C99 that shouldn't be necessary anymore. Solution.pm defined HAVE_FUNCNAME__FUNCTION instead of HAVE_FUNCNAME__FUNC (originating in 4164e6636e2), as at some point in the past MSVC only supported __FUNCTION__. Our minimum version supports __func__. Reviewed-By: Thomas Munro <thomas.munro@gmail.com> Discussion: https://postgr.es/m/20220807012914.ydz73yte6j3coulo@awork3.anarazel.de
* Simplify replacement code for strtof.Thomas Munro2022-08-071-15/+1
| | | | | | | | | | strtof() is in C99 and all targeted systems have it. We can remove the configure probe and some dead code, but we still need replacement code for a couple of systems that have known buggy implementations selected via platform template. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/152683.1659830125%40sss.pgh.pa.us
* Simplify gettimeofday() fallback logic.Andres Freund2022-08-061-47/+0
| | | | | | | | | | | | | | | | | | There's no known supported system needing 1 argument gettimeofday() support. The test for it was added a long time ago (92c6bf9775b). Remove. Until now we tested whether a gettimeofday() fallback is needed when targetting windows. Which lead to the odd result that HAVE_GETTIMEOFDAY only being defined when targetting MinGW (which has gettimeofday() since at least 2007). As the fallback is specific to msvc, remove the configure code and rename src/port/gettimeofday.c to src/port/win32gettimeofday.c. While at it, also remove the definition of struct timezone, a forward declaration of the struct is sufficient. Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-By: Thomas Munro <thomas.munro@gmail.com> Discussion: https://postgr.es/m/20220806000311.ywx65iuchvj4qn2k@awork3.anarazel.de