summaryrefslogtreecommitdiff
path: root/src/tools/msvc/Project.pm
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright for 2023Bruce Momjian2023-01-021-1/+1
| | | | Backpatch-through: 11
* windows: remove date from version number in win32ver.rcAndres Freund2022-09-261-5/+0
| | | | | | | | | This may have served a purpose at some point, but these days it just contributes to a non-reproducible build. Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/c5736f70-bb6d-8d25-e35c-e3d886e4e905@enterprisedb.com Discussion: https://postgr.es/m/1cef5b48-32bd-5cbf-fb62-fb648860f5ef@enterprisedb.com
* Default to hidden visibility for extension libraries where possibleAndres Freund2022-07-171-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now postgres built extension libraries with global visibility, i.e. exporting all symbols. On the one platform where that behavior is not natively available, namely windows, we emulate it by analyzing the input files to the shared library and exporting all the symbols therein. Not exporting all symbols is actually desirable, as it can improve loading speed, reduces the likelihood of symbol conflicts and can improve intra extension library function call performance. It also makes the non-windows builds more similar to windows builds. Additionally, with meson implementing the export-all-symbols behavior for windows, turns out to be more verbose than desirable. This patch adds support for hiding symbols by default and, to counteract that, explicit symbol visibility annotation for compilers that support __attribute__((visibility("default"))) and -fvisibility=hidden. That is expected to be most, if not all, compilers except msvc (for which we already support explicit symbol export annotations). Now that extension library symbols are explicitly exported, we don't need to export all symbols on windows anymore, hence remove that behavior from src/tools/msvc. The supporting code can't be removed, as we still need to export all symbols from the main postgres binary. Author: Andres Freund <andres@anarazel.de> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/20211101020311.av6hphdl6xbjbuif@alap3.anarazel.de
* Pre-beta mechanical code beautification.Tom Lane2022-05-121-5/+5
| | | | | Run pgindent, pgperltidy, and reformat-dat-files. I manually fixed a couple of comments that pgindent uglified.
* Update copyright for 2022Bruce Momjian2022-01-071-1/+1
| | | | Backpatch-through: 10
* Disable unused-variable warning C4101 in MSVCDaniel Gustafsson2021-11-301-1/+1
| | | | | | | | | | The C4101 warning for unused variable cannot be individually suppressed with PG_USED_FOR_ASSERTS_ONLY, and thus cause false-positive warnings for variables which are defined but only read/written in an assertion. Until a satisfactory solution for per-variable suppression like how we do for gcc and clang, disable the warning. Discussion: https://postgr.es/m/CAJcOf-c+KniGAp31pn8TC=9a-WHXpkX-3+8-2BkaCsZchhu=8w@mail.gmail.com
* Remove some special cases from MSVC build scriptsDavid Rowley2021-08-091-0/+37
| | | | | | | | | | | | | | | | | | Here we add additional parsing of Makefiles to determine when to add references to libpgport and libpgcommon. We also remove the need for adding the current contrib_extrasource by adding sine very basic logic to implement the Makefile rules which add .l and .y files when they exist for a given .o file in the Makefile. This is just some very basic additional parsing of Makefiles to try to keep things more consistent between builds using make and MSVC builds. This happens to work with how our current Makefiles are laid out, but it could easily be broken in the future if someone chooses do something in the Makefile that we don't have parsing support for. We will cross that bridge when we come to it. Author: David Rowley Discussion: https://postgr.es/m/CAApHDvoPULi5JW3933NxgwxOmu9Ncvpcyt87UhEHAUX16QqmpA@mail.gmail.com
* Don't duplicate references and libraries in MSVC scriptsDavid Rowley2021-07-291-2/+9
| | | | | | | | | | In order not to duplicate references and libraries in the Visual Studio project files produced by the MSVC build scripts, have them check if a particular reference or library already exists before adding the same one again. Reviewed-by: Álvaro Herrera, Andrew Dunstan, Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/CAApHDvpo6g5csCTjc_0C7DMvgFPomVb0Rh-AcW5afd=Ya=LRuw@mail.gmail.com
* Make the includes field an array in MSVC build scriptsDavid Rowley2021-07-291-5/+7
| | | | | | | | | Previously the 'includes' field was a string. It's slightly nicer to manage this when it's defined as an array instead. This allows us to more easily detect and eliminate duplicates. Reviewed-by: Álvaro Herrera, Andrew Dunstan, Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/CAApHDvpo6g5csCTjc_0C7DMvgFPomVb0Rh-AcW5afd=Ya=LRuw@mail.gmail.com
* Use the AddFile function consistently in MSVC build scriptsDavid Rowley2021-07-281-5/+5
| | | | | | | | We seem to be using a mix of manually adding to the 'files' hash and calling the Addfile() method. Let's just consistently use AddFile(). Reviewed-by: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/CAApHDvpo6g5csCTjc_0C7DMvgFPomVb0Rh-AcW5afd=Ya=LRuw@mail.gmail.com
* Add a copyright notice to perl files lacking one.Andrew Dunstan2021-05-071-0/+3
|
* Use perl's $/ more idiomaticallyAndrew Dunstan2020-04-131-8/+2
| | | | | | | | This replaces a few occurrences of ugly code with a more clean and idiomatic usage. The problem was highlighted by perlcritic, but we're not enforcing the policy that led to the discovery. Discussion: https://postgr.es/m/20200412074245.GB623763@rfd.leadboat.com
* Allow running src/tools/msvc/mkvcbuild.pl under not WindowsPeter Eisentraut2020-02-211-1/+1
| | | | | | | | | | | | | This to allow verifying the MSVC build file generation without having to have Windows. To do this, we avoid Windows-specific Perl modules and don't run the "cl" compiler or "nmake". The resulting build files won't actually be completely correct, but it's useful enough. Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/d73b2c7b-f081-8357-8422-7564d55f1aac%402ndquadrant.com
* Remove libpq.rc, use win32ver.rc for libpqPeter Eisentraut2020-01-151-0/+8
| | | | | | | | | | | For historical reasons, libpq used a separate libpq.rc file for the Windows builds while all other components use a common file win32ver.rc. With a bit of tweaking, the libpq build can also use the win32ver.rc file. This removes a bit of duplicative code. Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/ad505e61-a923-e114-9f38-9867d161073f@2ndquadrant.com
* Handle spaces in OpenSSL install location for MSVCAndrew Dunstan2019-10-041-1/+2
| | | | | | | | | First, make sure that the .exe name is quoted when trying to get the version number. Also, don't quote the lib name for using in the project files if it's already been quoted. This second change applies to all libraries, not just OpenSSL. This has clearly been broken forever, so backpatch to all live branches.
* Fix inconsistencies and typos in the tree, take 9Michael Paquier2019-08-051-2/+1
| | | | | | | | This addresses more issues with code comments, variable names and unreferenced variables. Author: Alexander Lakhin Discussion: https://postgr.es/m/7ab243e0-116d-3e44-d120-76b3df7abefd@gmail.com
* Fix compile-time warnings on all perl codeAndrew Dunstan2018-05-311-0/+1
| | | | | | | | | | This patch does two things. First, it silences a number of compile-time warnings in the msvc tools files, mainly those due to the fact that in some cases we have more than one package per file. Second it supplies a dummy Perl library with just enough of the Windows API referred to in our code to let it run these checks cleanly, even on Unix machines where the code is never supposed to run. The dummy library should only be used for that purpose, as its README notes.
* Don't fall off the end of perl functionsAndrew Dunstan2018-05-271-0/+15
| | | | | | | | | | | | | | | This complies with the perlcritic policy Subroutines::RequireFinalReturn, which is a severity 4 policy. Since we only currently check at severity level 5, the policy is raised to that level until we move to level 4 or lower, so that any new infringements will be caught. A small cosmetic piece of tidying of the pgperlcritic script is included. Mike Blackwell Discussion: https://postgr.es/m/CAESHdJpfFm_9wQnQ3koY3c91FoRQsO-fh02za9R3OEMndOn84A@mail.gmail.com
* Restrict vertical tightness to parentheses in Perl codeAndrew Dunstan2018-05-091-2/+4
| | | | | | | | | | | | | | | | | The vertical tightness settings collapse vertical whitespace between opening and closing brackets (parentheses, square brakets and braces). This can make data structures in particular harder to read, and is not very consistent with our style in non-Perl code. This patch restricts that setting to parentheses only, and reformats all the perl code accordingly. Not applying this to parentheses has some unfortunate effects, so the consensus is to keep the setting for parentheses and not for the others. The diff for this patch does highlight some places where structures should have trailing commas. They can be added manually, as there is no automatic tool to do so. Discussion: https://postgr.es/m/a2f2b87c-56be-c070-bfc0-36288b4b41c1@2ndQuadrant.com
* perltidy: Add option --nooutdent-long-commentsPeter Eisentraut2018-04-271-4/+4
|
* Reindent Perl files with perltidy version 20170521.Tom Lane2018-04-251-1/+1
| | | | Discussion: https://postgr.es/m/CABUevEzK3cNiHZQ18f5tK0guoT+cN_jWeVzhYYxY=r+1Q3SmoA@mail.gmail.com
* Clean up Perl code according to perlcriticPeter Eisentraut2017-03-271-14/+14
| | | | | | | | Fix all perlcritic warnings of severity level 5, except in src/backend/utils/Gen_dummy_probes.pl, which is automatically generated. Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
* Change qr/foo$/m to qr/foo\n/m, for Perl 5.8.8.Noah Misch2016-11-071-1/+1
| | | | | | | | | | | | | | | | | | In each case, absence of a trailing newline would itself constitute a PostgreSQL bug. Therefore, this slightly enhances the changed tests. This works around a bug that last appeared in Perl 5.8.8, fixing src/test/modules/test_pg_dump when run against that version. Commit e7293e3271bf618eeb2d4779a15fc516a69fe463 worked around the bug, but the subsequent addition of test_pg_dump introduced affected code. As that commit had shown, slight increases in pattern complexity can suppress the bug. This commit edits qr/foo$/m patterns too complex to encounter the bug today, for style consistency and robustness against unrelated pattern changes. Back-patch to 9.6, where test_pg_dump was introduced. As of this writing, a fresh MSYS installation includes an affected Perl 5.8.8. The Perl 5.8.8 in Red Hat Enterprise Linux 5.11 carries a patch that renders it unaffected, but the Perl 5.8.5 of Red Hat Enterprise Linux 4.4 is affected.
* Fix various common mispellings.Greg Stark2016-06-031-2/+2
| | | | | | | | | | Mostly these are just comments but there are a few in documentation and a handful in code and tests. Hopefully this doesn't cause too much unnecessary pain for backpatching. I relented from some of the most common like "thru" for that reason. The rest don't seem numerous enough to cause problems. Thanks to Kevin Lyda's tool https://pypi.python.org/pypi/misspellings
* pgindent run for 9.5Bruce Momjian2015-05-231-0/+1
|
* Replace backslashes by forward slashes in MSVC build codePeter Eisentraut2015-04-251-23/+19
| | | | | | | | This makes it possible to run some stages of these build scripts on non-Windows systems. That way, we can more easily test whether file moves or makefile changes might break the MSVC build. Peter Eisentraut and Michael Paquier
* Finish adding file version information to installed Windows binaries.Noah Misch2014-08-181-11/+27
| | | | | | | In support of this, have the MSVC build follow GNU make in preferring GNUmakefile over Makefile when a directory contains both. Michael Paquier, reviewed by MauMau.
* MSVC: Process Makefile line continuations more like "make" does.Noah Misch2014-07-141-1/+1
| | | | | | | | Unlike "make" itself, the MSVC build process recognized a continuation even with whitespace after the backslash. (Due to a typo, some code sites accepted the letter "s" instead of whitespace). Also, it would consume any number of newlines following a single backslash. This is mere cleanup; those behaviors were unlikely to cause bugs.
* pgindent run for release 9.3Bruce Momjian2013-05-291-1/+2
| | | | | This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
* Create libpgcommon, and move pg_malloc et al to itAlvaro Herrera2013-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | libpgcommon is a new static library to allow sharing code among the various frontend programs and backend; this lets us eliminate duplicate implementations of common routines. We avoid libpgport, because that's intended as a place for porting issues; per discussion, it seems better to keep them separate. The first use case, and the only implemented by this patch, is pg_malloc and friends, which many frontend programs were already using. At the same time, we can use this to provide palloc emulation functions for the frontend; this way, some palloc-using files in the backend can also be used by the frontend cleanly. To do this, we change palloc() in the backend to be a function instead of a macro on top of MemoryContextAlloc(). This was previously believed to cause loss of performance, but this implementation has been tweaked by Tom and Andres so that on modern compilers it provides a slight improvement over the previous one. This lets us clean up some places that were already with localized hacks. Most of the pg_malloc/palloc changes in this patch were authored by Andres Freund. Zoltán Böszörményi also independently provided a form of that. libpgcommon infrastructure was authored by Álvaro.
* Properly zero-pad the day-of-year part of the win32 build numberMagnus Hagander2013-01-311-1/+1
| | | | | | | | | This ensure the version number increases over time. The first three digits in the version number is still set to the actual PostgreSQL version number, but the last one is intended to be an ever increasing build number, which previosly failed when it changed between 1, 2 and 3 digits long values. Noted by Deepak
* Run newly-configured perltidy script on Perl files.Bruce Momjian2012-07-041-43/+49
| | | | Run on HEAD and 9.2.
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-101-303/+304
| | | | commit-fest.
* Move CRC tables to libpgport, and provide them in a separate include file.Tom Lane2012-02-281-2/+2
| | | | | | | | | | | | | | | | | | This makes it much more convenient to build tools for Postgres that are separately compiled and require a matching CRC implementation. To prevent multiple copies of the CRC polynomial tables being introduced into the postgres binaries, they are now included in the static library libpgport that is mainly meant for replacement system functions. That seems like a bit of a kludge, but there's no better place. This cleans up building of the tools pg_controldata and pg_resetxlog, which previously had to build their own copies of pg_crc.o. In the future, external programs that need access to the CRC tables can include the tables directly from the new header file pg_crc_tables.h. Daniel Farina, reviewed by Abhijit Menon-Sen and Tom Lane
* Support for building with MS Visual Studio 2010.Andrew Dunstan2012-01-031-208/+24
| | | | Brar Piening, reviewed by Craig Ringer.
* Remove cvs keywords from all files.Magnus Hagander2010-09-201-1/+1
|
* Perltidy run over the MSVC build system files, to clean up code formattingMagnus Hagander2010-04-091-13/+16
| | | | and indentation styles.
* Disable linker warning 4197 on Win64, that is caused by the fact that we exportMagnus Hagander2010-01-051-2/+8
| | | | | | | | | symbols both using __declspec(dllexport) (via the PGDLLIMPORT macro) and using full-dll-export. This works without warning on Win32, but not on Win64. In passing, fix the fact that the framework could never deal with more than one disbled linker warning - because MSVC wants commas between linker warnings, and semicolons between compiler warnings...
* Silence compiler warning about size of size_t being larger than the resultMagnus Hagander2010-01-021-2/+2
| | | | variable it's stored in. We know this can never happen. Per discussion.
* Detect a 64-bit build environment on Windows, and generate the appropriateMagnus Hagander2010-01-011-14/+16
| | | | | | project files. Based on the work of Tsutomu Yamada, but much refactored.
* Add basic build support for Visual Studio 2008, without resorting toMagnus Hagander2009-12-231-3/+4
| | | | generating the build files for 2005 and then converting them.
* Remove plpgsql's separate lexer (finally!), in favor of using the core lexerTom Lane2009-11-121-2/+1
| | | | | | | directly. This was a lot of trouble, but should be worth it in terms of not having to keep the plpgsql lexer in step with core anymore. In addition the handling of keywords is significantly better-structured, allowing us to de-reserve a number of words that plpgsql formerly treated as reserved.
* Enable the use of multiple CPUs/cores when building on MSVC. This onlyMagnus Hagander2009-07-271-1/+2
| | | | | affects the C compiler step - we still only build one target at a time.
* Add multi-line flag to regex that needs it. Backpatch to 8.2. Fix from ↵Andrew Dunstan2008-04-151-2/+3
| | | | Andreas Zeugswetter
* Un-break msvc port yet again (it started pulling in the DarwinMagnus Hagander2008-02-191-1/+4
| | | | port files, which obviously didn't compile)
* Replace time_t with pg_time_t (same values, but always int64) in on-diskTom Lane2008-02-171-2/+2
| | | | | | | | | | | | | | data structures and backend internal APIs. This solves problems we've seen recently with inconsistent layout of pg_control between machines that have 32-bit time_t and those that have already migrated to 64-bit time_t. Also, we can get out from under the problem that Windows' Unix-API emulation is not consistent about the width of time_t. There are a few remaining places where local time_t variables are used to hold the current or recent result of time(NULL). I didn't bother changing these since they do not affect any cross-module APIs and surely all platforms will have 64-bit time_t before overflow becomes an actual risk. time_t should be avoided for anything visible to extension modules, however.
* Handle libraries in directories with spaces in them.Magnus Hagander2008-02-051-1/+6
| | | | Gevik Babakhani
* Use _USE_32BIT_TIME_T when building with MSVC. Also, enforce that it'sMagnus Hagander2007-12-111-2/+2
| | | | | | used when building addons. Dave Page
* Build snowball DLL for tsearch-in-core.Magnus Hagander2007-08-211-1/+14
| | | | | (Still needs to build the .sql output files, but this handles the C part of the build)
* Disable warning 4090 = different const qualifiers on msvc since itMagnus Hagander2007-07-251-2/+2
| | | | warns about things that aren't wrong.