Commit Graph

49 Commits

Author SHA1 Message Date
Peter Eisentraut dbf2ec1a1c Fix parallel make risk with new check temp-install setup
The "check" target no longer needs to depend on "all", because it now
runs "install" directly, which in turn depends on "all".  Doing both
will cause problems with parallel make, because two builds will run next
to each other.

Also remove the redirection of the temp-install output into a log file.
This was appropriate when this was done from within pg_regress, but now
it's just a regular make run, and especially with the above changes this
will now take the place of running the "all" target before the test
suites.

problem report by Jeff Janes, patch in part by Michael Paquier
2015-04-29 20:34:22 -04:00
Peter Eisentraut ee8d392765 Don't overwrite EXTRA_INSTALL
The temp-install target sets EXTRA_INSTALL to install the current
directory.  But when doing so, it should append instead of overwrite,
otherwise settings of EXTRA_INSTALL from a makefile won't take effect.
This would cause the earthdistance test to fail when called directly,
because it would miss installing the cube module.
2015-04-25 21:00:39 -04:00
Peter Eisentraut dcae5facca Improve speed of make check-world
Before, make check-world would create a new temporary installation for
each test suite, which is slow and wasteful.  Instead, we now create one
test installation that is used by all test suites that are part of a
make run.

The management of the temporary installation is removed from pg_regress
and handled in the makefiles.  This allows for better control, and
unifies the code with that of test suites not run through pg_regress.

review and msvc support by Michael Paquier <michael.paquier@gmail.com>

more review by Fabien Coelho <coelho@cri.ensmp.fr>
2015-04-23 08:59:52 -04:00
Peter Eisentraut e4b5a070b4 Revert haphazard pgxs makefile changes
These changes were originally submitted as "adds support for VPATH with
USE_PGXS", but they are not necessary for VPATH support, so they just
add more lines of code for no reason.
2014-12-04 08:07:59 -05:00
Peter Eisentraut eb1c3f4786 Remove USE_VPATH make variable from PGXS
The user can just set VPATH directly.  There is no need to invent
another variable.
2014-12-04 08:07:41 -05:00
Peter Eisentraut 8dc626defe Fix suggested layout for PGXS makefile
Custom rules must come after pgxs inclusion, not before, because any
rule added before pgxs will break the default 'all' target.

Author: Cédric Villemain <cedric@2ndquadrant.fr>
2014-11-19 22:21:54 -05:00
Noah Misch 0ffc201a51 Add file version information to most installed Windows binaries.
Prominent binaries already had this metadata.  A handful of minor
binaries, such as pg_regress.exe, still lack it; efforts to eliminate
such exceptions are welcome.

Michael Paquier, reviewed by MauMau.
2014-07-14 14:07:52 -04:00
Andrew Dunstan eebdea08bb Ensure installation dirs are built before contents are installed (v2)
Push dependency on installdirs down to individual targets.

Christoph Berg
2013-09-30 10:17:30 -04:00
Andrew Dunstan d942f9d928 Ensure installation dirs are built before contents are installed.
Cédric Villemain
2013-09-29 16:12:58 -04:00
Andrew Dunstan 82b0102650 Install all a Makefile's extension controls, not just the first.
Bug introduced by commit 6697aa2bc2 and
reported by Robert Haas.
2013-07-03 19:03:31 -04:00
Andrew Dunstan 6697aa2bc2 Improve support for building PGXS modules with VPATH.
A VPATH build will be performed when the module's make file path is not
the current directory or when USE_VPATH is set.

This will assist packagers and others who prefer to build without
polluting the source directories.

There is still a bit of work to do here, notably documentation, but it's
probably a good idea to commit what we have so far and let people test
it out on their modules.

Cédric Villemain, with an addition from me.
2013-07-01 12:53:05 -04:00
Andrew Dunstan 9f10f7dc57 Make pgxs build executables with the right suffix.
Complaint and patch from Zoltán Böszörményi.

When cross-compiling, the native make doesn't know
about the Windows .exe suffix, so it only builds with
it when explicitly told to do so.

The native make will not see the link between the target
name and the built executable, and might this do unnecesary
work, but that's a bigger problem than this one, if in fact
we consider it a problem at all.

Back-patch to all live branches.
2013-01-19 14:54:29 -05:00
Andrew Dunstan ad69bd052f Add mode where contrib installcheck runs each module in a separately named database.
Normally each module is tested in a database named contrib_regression,
which is dropped and recreated at the beginhning of each pg_regress run.
This new mode, enabled by adding USE_MODULE_DB=1 to the make command
line, runs most modules in a database with the module name embedded in
it.

This will make testing pg_upgrade on clusters with the contrib modules
a lot easier.

Second attempt at this, this time accomodating make versions older
than 3.82.

Still to be done: adapt to the MSVC build system.

Backpatch to 9.0, which is the earliest version it is reasonably
possible to test upgrading from.
2012-12-11 11:52:45 -05:00
Andrew Dunstan fc5c1bbbeb Revert "Add mode where contrib installcheck runs each module in a separately named database."
This reverts commit e2b3c21b05.
2012-12-03 15:00:51 -05:00
Andrew Dunstan e2b3c21b05 Add mode where contrib installcheck runs each module in a separately named database.
Normally each module is tested in aq database named contrib_regression,
which is dropped and recreated at the beginhning of each pg_regress run.
This mode, enabled by adding USE_MODULE_DB=1 to the make command line,
runs most modules in a database with the module name embedded in it.

This will make testing pg_upgrade on clusters with the contrib modules
a lot easier.

Still to be done: adapt to the MSVC build system.

Backpatch to 9.0, which is the earliest version it is reasonably possible
to test upgrading from.
2012-12-02 17:20:38 -05:00
Tom Lane b1346822f3 Make sure sharedir/extension/ directory is created when needed.
The previous coding worked as long as MODULEDIR wasn't set explicitly,
because we create sharedir/$(datamoduledir) and the default value of
that is "extension".  But if some other value is specified for MODULEDIR
then the installation directory needed for the control file wasn't made.

Cédric Villemain
2012-12-01 16:04:39 -05:00
Peter Eisentraut 6ca365bff2 pgxs: Supply default values for BISON and FLEX variables
Otherwise, the availability of these variables depends on what
happened to be available at the time the PostgreSQL build was
configured.
2012-03-30 20:36:49 +03:00
Peter Eisentraut 08da2d282f Add pg_upgrade test suite
It runs the regression tests, runs pg_upgrade on the populated
database, and compares the before and after dumps.  While not actually
a cross-version upgrade, this does detect omissions and bugs in the
involved tools from time to time.  It's also possible to do a
cross-version upgrade by manually supplying parameters.
2011-11-27 22:42:32 +02:00
Tom Lane d1d388603e Fix pgxs.mk to always add --dbname=$(CONTRIB_TESTDB) to REGRESS_OPTS.
The previous coding resulted in contrib modules unintentionally overriding
the use of CONTRIB_TESTDB.  There seems no particularly good reason to
allow that (after all, the makefile can set CONTRIB_TESTDB if that's really
what it intends).

In passing, document REGRESS_OPTS where the other pgxs.mk options are
documented.

Back-patch to 9.1 --- in prior versions, there were no cases of contrib
modules setting REGRESS_OPTS without including the --dbname switch, so
while the coding was fragile there was no actual bug.
2011-08-24 15:16:50 -04:00
Robert Haas 8cca49d8a0 Add some environment checks prior to sepgsql regression testing.
This probably needs more work, but it's a start.

KaiGai Kohei
2011-07-25 10:51:02 -04:00
Peter Eisentraut b106195b17 Rewrite installation makefile rules without for loops
install-sh can install multiple files at once, so for loops are not
necessary.  This was already changed for the rest of the code some
time ago, but pgxs.mk was apparently forgotten, and the obsolete
coding style has now been copied to the PLs as well.

This also fixes the problem that the for loops in question did not
catch errors.
2011-05-02 01:05:08 +03:00
Peter Eisentraut f8ebe3bcc5 Support "make check" in contrib
Added a new option --extra-install to pg_regress to arrange installing
the respective contrib directory into the temporary installation.
This is currently not yet supported for Windows MSVC builds.

Updated the .gitignore files for contrib modules to ignore the
leftovers of a temp-install check run.

Changed the exit status of "make check" in a pgxs build (which still
does nothing) to 0 from 1.

Added "make check" in contrib to top-level "make check-world".
2011-04-25 22:27:11 +03:00
Peter Eisentraut 2fd77060a2 Allow make check in PL directories
Also add make check-world target, and refactor pg_regress invocation
code in makefiles a bit.
2011-02-15 06:52:12 +02:00
Tom Lane 24d1280c4d Clean up installation directory choices for extensions.
Arrange for the control files to be in $SHAREDIR/extension not
$SHAREDIR/contrib, since we're generally trying to deprecate the term
"contrib" and this is a once-in-many-moons opportunity to get rid of it in
install paths.  Fix PGXS to install the $EXTENSION file into that directory
no matter what MODULEDIR is set to; a nondefault MODULEDIR should only
affect the script and secondary extension files.  Fix the control file
directory parameter to be interpreted relative to $SHAREDIR, to avoid a
surprising disconnect between how you specify that and what you set
MODULEDIR to.

Per discussion with David Wheeler.
2011-02-11 22:53:43 -05:00
Tom Lane d9572c4e3b Core support for "extensions", which are packages of SQL objects.
This patch adds the server infrastructure to support extensions.
There is still one significant loose end, namely how to make it play nice
with pg_upgrade, so I am not yet committing the changes that would make
all the contrib modules depend on this feature.

In passing, fix a disturbingly large amount of breakage in
AlterObjectNamespace() and callers.

Dimitri Fontaine, reviewed by Anssi Kääriäinen,
Itagaki Takahiro, Tom Lane, and numerous others
2011-02-08 16:13:22 -05:00
Peter Eisentraut fc946c39ae Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
Magnus Hagander 9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Tom Lane f6af1435d9 Dept. of third thoughts: PG_LIBS may contain a -L switch, so it had better
stay in front of LDFLAGS.
2010-07-05 23:40:13 +00:00
Tom Lane bdf00543c2 Make sure LDFLAGS come before LIBS when linking contrib programs.
Solaris, at least, seems to be sensitive to the relative order of -L
and -l switches, so this is needed.  Per buildfarm results.
2010-07-05 23:30:50 +00:00
Tom Lane 291a957745 Split the LDFLAGS make variable into two parts: LDFLAGS is now used for
linking both executables and shared libraries, and we add on LDFLAGS_EX when
linking executables or LDFLAGS_SL when linking shared libraries.  This
provides a significantly cleaner way of dealing with link-time switches than
the former behavior.  Also, make sure that the various platform-specific
%.so: %.o rules incorporate LDFLAGS and LDFLAGS_SL; most of them missed that
before.  (I did not add these variables for the platforms that invoke $(LD)
directly, however.  It's not clear if we can do that safely, since for the
most part we assume these variables use CC command-line syntax.)

Per gripe from Aaron Swenson and subsequent investigation.
2010-07-05 18:54:38 +00:00
Tom Lane daf5b0f297 Fix a few places where we needed -I. in CPPFLAGS to work properly in
VPATH builds.  We had this already in several places, but not all.
2010-01-05 03:56:52 +00:00
Tom Lane 4c5b4c8bd0 Improve PGXS makefile system to allow the module's makefile to specify
where to install DATA and DOCS files.  This is mainly intended to allow
versioned installation, eg, install into contrib/fooM.N/ rather than
directly into contrib/.

Mark Cave-Ayland
2010-01-04 16:34:11 +00:00
Peter Eisentraut 9d182ef002 Update of install-sh, mkinstalldirs, and associated configury
Update install-sh to that from Autoconf 2.63, plus our Darwin-specific
changes (which I simplified a bit).  install-sh is now able to install
multiple files in one run, so we could simplify our makefiles sometime.

install-sh also now has a -d option to create directories, so we don't need
mkinstalldirs anymore.

Use AC_PROG_MKDIR_P in configure.in, so we can use mkdir -p when available
instead of install-sh -d.  For consistency with the rest of the world,
the corresponding make variable has been renamed from $(mkinstalldirs) to
$(MKDIR_P).
2009-08-26 22:24:44 +00:00
Peter Eisentraut df20667112 When calling unsupported "make check" with a pgxs module, return a nonzero
exit code.
2009-07-08 13:47:29 +00:00
Peter Eisentraut 8f1658cbf3 Put back the copying of some of the regression test data files for vpath
builds.  It is too complicated to fix in another way for now.
2008-10-03 08:00:16 +00:00
Tom Lane 2793af3cc0 Partial fix for contrib vpath breakage. 2008-10-02 12:25:25 +00:00
Peter Eisentraut feae7856af Allow pg_regress to be run outside the build tree. Look for input files
in both input and output dir, to handle vpath builds more simply.
2008-10-01 22:38:57 +00:00
Peter Eisentraut 46e76373ec Implement a few changes to how shared libraries and dynamically loadable
modules are built.  Foremost, it creates a solid distinction between these two
types of targets based on what had already been implemented and duplicated in
ad hoc ways before.  Specifically,

- Dynamically loadable modules no longer get a soname.  The numbers previously
set in the makefiles were dummy numbers anyway, and the presence of a soname
upset a few packaging tools, so it is nicer not to have one.

- The cumbersome detour taken on installation (build a libfoo.so.0.0.0 and
then override the rule to install foo.so instead) is removed.

- Lots of duplicated code simplified.
2008-04-07 14:15:58 +00:00
Tom Lane 9a4b29d832 Teach pgxs.mk and Install.pm how to install files from a contrib module
into SHAREDIR/tsearch_data.  Use this instead of ad-hoc coding in
dict_xsyn/Makefile.  Should fix current ContribCheck failures on MSVC.
2007-10-16 16:00:00 +00:00
Tom Lane b09c248bdd Fix PGXS conventions so that extensions can be built against Postgres
installations whose pg_config program does not appear first in the PATH.
Per gripe from Eddie Stanley and subsequent discussions with Fabien Coelho
and others.
2007-06-26 22:05:04 +00:00
Tom Lane bc660c4237 Ah, I finally realize why Magnus wanted to add a --bindir option to
pg_regress: there's no other way to cope with testing a relocated
installation.  Seems better to call it --psqldir though, since the
only thing we need to find in that case is psql.  It'd be better if
we could use find_other_exec, but that's not happening unless we are
willing to install pg_regress alongside psql, which seems unlikely
to happen.
2006-07-21 00:24:04 +00:00
Tom Lane a38c85bd5d Rewrite pg_regress as a C program instead of a shell script.
This allows it to be used on Windows without installing mingw
(though you do still need 'diff'), and opens the door to future
improvements such as message localization.
Magnus Hagander and Tom Lane.
2006-07-19 02:37:00 +00:00
Peter Eisentraut a29c04a541 Allow installation into directories containing spaces in the name. 2005-12-09 21:19:36 +00:00
Tom Lane 1610fcc351 Some marginal tweaks to make 'make installcheck' mostly work when
building contrib with USE_PGXS.  To make it work all the way, the
pg_regress script would need to be included in the installation tree.
2005-09-27 17:43:31 +00:00
Bruce Momjian 9cc5caea6c Fix this:
$ ./configure --without-docdir
	..
	$ cd contrib/pgstattuple/
	$ make install
	mkdir -p -- /contrib
	mkdir: cannot create directory `/contrib': Permission denied
	make: *** [installdirs] Error 1

ISHIDA Akio
2005-08-12 21:02:25 +00:00
Tom Lane 4e7d6f5349 Add a --dbname option to the pg_regress script, and use pl_regression
for testing PLs and contrib_regression for testing contrib, instead of
overwriting the core system's regression database as formerly done.
Andrew Dunstan
2005-05-17 18:26:23 +00:00
Tom Lane ea12f8e6a3 Remove gratuitous editorialization on rpath. 2004-10-10 16:13:03 +00:00
Bruce Momjian 513e89b44b please find attached an alternate submission which addresses open item
"make pgxs install by default". It is up to the committers to chose.

(1) there is only one "install" target. no more "install-all-headers".
    it simplifies/changes several makefiles.

(2) the documentation reflects the change.

(3) a minor fix on pgxs to use a nicer patch without a double slash.

Fabien Coelho
2004-10-06 08:50:02 +00:00
Peter Eisentraut adf57cd7e2 PostgreSQL extension makefile framework ("pgxs"), by Fabien Coelho, with
some massaging by Peter Eisentraut.  This is basically a simple
generalization of the existing contrib makefiles.
2004-07-30 12:26:40 +00:00