Commit Graph

45 Commits

Author SHA1 Message Date
Peter Eisentraut 721856ff24 Remove distprep
A PostgreSQL release tarball contains a number of prebuilt files, in
particular files produced by bison, flex, perl, and well as html and
man documentation.  We have done this consistent with established
practice at the time to not require these tools for building from a
tarball.  Some of these tools were hard to get, or get the right
version of, from time to time, and shipping the prebuilt output was a
convenience to users.

Now this has at least two problems:

One, we have to make the build system(s) work in two modes: Building
from a git checkout and building from a tarball.  This is pretty
complicated, but it works so far for autoconf/make.  It does not
currently work for meson; you can currently only build with meson from
a git checkout.  Making meson builds work from a tarball seems very
difficult or impossible.  One particular problem is that since meson
requires a separate build directory, we cannot make the build update
files like gram.h in the source tree.  So if you were to build from a
tarball and update gram.y, you will have a gram.h in the source tree
and one in the build tree, but the way things work is that the
compiler will always use the one in the source tree.  So you cannot,
for example, make any gram.y changes when building from a tarball.
This seems impossible to fix in a non-horrible way.

Second, there is increased interest nowadays in precisely tracking the
origin of software.  We can reasonably track contributions into the
git tree, and users can reasonably track the path from a tarball to
packages and downloads and installs.  But what happens between the git
tree and the tarball is obscure and in some cases non-reproducible.

The solution for both of these issues is to get rid of the step that
adds prebuilt files to the tarball.  The tarball now only contains
what is in the git tree (*).  Getting the additional build
dependencies is no longer a problem nowadays, and the complications to
keep these dual build modes working are significant.  And of course we
want to get the meson build system working universally.

This commit removes the make distprep target altogether.  The make
dist target continues to do its job, it just doesn't call distprep
anymore.

(*) - The tarball also contains the INSTALL file that is built at make
dist time, but not by distprep.  This is unchanged for now.

The make maintainer-clean target, whose job it is to remove the
prebuilt files in addition to what make distclean does, is now just an
alias to make distprep.  (In practice, it is probably obsolete given
that git clean is available.)

The following programs are now hard build requirements in configure
(they were already required by meson.build):

- bison
- flex
- perl

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/flat/e07408d9-e5f2-d9fd-5672-f53354e9305e@eisentraut.org
2023-11-06 15:18:04 +01:00
John Naylor dac048f71e Build all Flex files standalone
The proposed Meson build system will need a way to ignore certain
generated files in order to coexist with the autoconf build system,
and C files generated by Flex which are #include'd into .y files make
this more difficult. In similar vein to 72b1e3a21, arrange for all Flex
C files to compile to their own .o targets.

Reviewed by Andres Freund

Discussion: https://www.postgresql.org/message-id/20220810171935.7k5zgnjwqzalzmtm%40awork3.anarazel.de
Discussion: https://www.postgresql.org/message-id/CAFBsxsF8Gc2StS3haXofshHCzqNMRXiSxvQEYGwnFsTmsdwNeg@mail.gmail.com
2022-09-04 12:09:01 +07:00
Andres Freund 01368e5d9d Split all OBJS style lines in makefiles into one-line-per-entry style.
When maintaining or merging patches, one of the most common sources
for conflicts are the list of objects in makefiles. Especially when
the split across lines has been changed on both sides, which is
somewhat common due to attempting to stay below 80 columns, those
conflicts are unnecessarily laborious to resolve.

By splitting, and alphabetically sorting, OBJS style lines into one
object per line, conflicts should be less frequent, and easier to
resolve when they still occur.

Author: Andres Freund
Discussion: https://postgr.es/m/20191029200901.vww4idgcxv74cwes@alap3.anarazel.de
2019-11-05 14:41:07 -08:00
Peter Eisentraut 8521d13194 Refactor flex and bison make rules
Numerous flex and bison make rules have appeared in the source tree
over time, and they are all virtually identical, so we can replace
them by pattern rules with some variables for customization.

Users of pgxs will also be able to benefit from this.
2012-10-11 06:57:04 -04: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 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
Peter Eisentraut 234c7ce9f2 Derived files that are shipped in the distribution used to be built in the
source directory even for out-of-tree builds.  They are now alsl built in
the build tree.  This should be more convenient for certain developers'
workflows, and shouldn't really break anything else.
2009-08-28 20:26:19 +00:00
Peter Eisentraut 7c31742a07 Remove all traces that suggest that a non-Bison yacc might be supported, and
change build system to use only Bison.  Simplify build rules, make file names
uniform.  Don't build the token table header file where it is not needed.
2008-08-29 13:02:33 +00:00
Peter Eisentraut 0474dcb608 Refactor backend makefiles to remove lots of duplicate code 2008-02-19 10:30:09 +00:00
Peter Eisentraut 2cc01004c6 Remove remains of old depend target. 2007-01-20 17:16:17 +00:00
Tom Lane fb51ad3419 Make all our flex and bison files use %option prefix or %name-prefix
(respectively) to rename yylex and related symbols.  Some were doing
it this way already, while others used not-too-reliable sed hacks in
the Makefiles.  It's all nice and consistent now.
2006-03-07 01:03:12 +00:00
Bruce Momjian a1675649e4 Remove QNX port. 2006-01-05 01:56:30 +00:00
PostgreSQL Daemon 969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
Tom Lane cab9437a43 Arrange to compile flex output files as inclusions into other files
(usually bison output files), not as standalone files.  This hack
works around flex's insistence on including <stdio.h> before we are
able to include postgres.h; postgres.h will already be read before
the compiler starts to read the flex output file.  Needed for largefile
support on some platforms.
2002-11-01 22:52:34 +00:00
Tom Lane d079c419d2 Fix include paths for case of VPATH build. 2002-01-09 00:06:42 +00:00
Peter Eisentraut aff53b27f0 Make the yacc rules safe for parallel make. See discussion on pgsql-patches
and comment in src/backend/parser/Makefile for the technical details.
2001-11-16 16:32:33 +00:00
Peter Eisentraut a4cc5770ef remove no longer needed -Wno-error 2001-08-22 20:02:56 +00:00
Peter Eisentraut 2660803697 Only look for bison as YACC; other yaccs need to be selected explicitly.
When no suitable YACC is configured, supply useful informational messages
to users.  (Same way flex has been handled for a while.)
2001-02-10 22:31:42 +00:00
Peter Eisentraut 805e431a38 Add support for VPATH builds, that is, building somewhere else than in the
source directory.  This involves mostly makefiles using $(srcdir) when they
might have used ".".  (Regression tests don't work with this, yet.)

Sort out usage of CPPFLAGS, CFLAGS (and CXXFLAGS).  Add "override" keyword
in most places, to preserve necessary flags even when the user overrode the
flags.
2000-10-20 21:04:27 +00:00
Peter Eisentraut f03fc94e7d New configure test for flex, which recognizes only flex but does so in all
incarnations (I hope). When an acceptable flex version is not found, print
instructive error messages from both configure and the makefiles, so that
users can continue building anyway.
2000-08-28 11:53:23 +00:00
Peter Eisentraut 32163099d7 Add distprep target to take some of the job of the release_prep script.
The latter updated accordingly. Also add `dist' and `distcheck' targets
to play with, but caveat packager.

Updated backend/bootstrap and backend/parser makefile to make them
marginally builddir aware and fix the usual set of things.

Add rule to automatically remake config.h dependent on config.h.in and
config.status. (Adopted from Autoconf manual and about every other
package.) On a good day we should now have a complete and accurate set
of dependencies throughout everything.
2000-07-19 16:30:27 +00:00
Peter Eisentraut e3059fc0f5 Gen_fmgrtab.sh is strange: it is a platform dependent way (because it uses
CPP) to create platform independent files. Unfortunately, that means that
every config.status (or configure) run invariably causes a relink of the
postmaster and also that we can't put these files in the distribution
(usefully). So we make it a little smarter: when the output files already
exist and it notices that it would recreate them in identical form, it
doesn't touch them. In order to avoid re-running the make rule all the time
we update a timestamp file instead.

Update release_prep accordingly. Also make Gen_fmgrtab.sh use the awk that
is detected at configure time, not necessarily named `awk' and have it check
for exit statuses a little better.

In other news... Remove USE_LOCALE from the templates, it was set to `no'
everywhere anyway. Also remove YACC and YFLAGS from the templates, configure
is smart enough to find bison or yacc itself. Use AC_PROG_YACC for that
instead of the hand-crafted code. Do not set YFLAGS to `-d'. The make rules
that need this flag should explicitly invoke it. YFLAGS should be a user
variable. Update the makefiles to that effect.
2000-06-07 16:27:00 +00:00
Tom Lane 091126fa28 Generated header files parse.h and fmgroids.h are now copied into
the src/include tree, so that -I backend is no longer necessary anywhere.
Also, clean up some bit rot in contrib tree.
2000-05-29 05:45:56 +00:00
Peter Eisentraut 533d516629 Removed MBFLAGS from makefiles since it's now done in include/config.h. 2000-01-19 02:59:03 +00:00
Peter Eisentraut 759fba4873 Included all yacc and lex files into the distribution. 2000-01-16 20:05:00 +00:00
Bruce Momjian 4cb1fb6f59 Update for QNX. 1999-12-16 16:52:53 +00:00
Bruce Momjian 7585deb087 I have done the QNX4 port with the current source tree. The number of
backend/Makefiles to be patched could significantly be reduced since
they
have been adopted to the QNX4 needs.

Andreas Kardos
1999-12-16 01:25:23 +00:00
Bruce Momjian a82f9ffde6 New LDOUT makefile variable for QNX os. 1999-12-13 22:35:27 +00:00
Bruce Momjian 3ffd3d82db Make LD -r as macros that can be changed for QNX. 1999-12-09 19:15:45 +00:00
Marc G. Fournier 5979d73841 From: t-ishii@sra.co.jp
As Bruce mentioned, this is due to the conflict among changes we made.
Included patches should fix the problem(I changed all MB to
MULTIBYTE). Please let me know if you have further problem.

P.S. I did not include pathces to configure and gram.c to save the
file size(configure.in and gram.y modified).
1998-07-26 04:31:41 +00:00
Marc G. Fournier bf00bbb0c4 I really hope that I haven't missed anything in this one...
From: t-ishii@sra.co.jp

Attached are patches to enhance the multi-byte support.  (patches are
against 7/18 snapshot)

* determine encoding at initdb/createdb rather than compile time

Now initdb/createdb has an option to specify the encoding. Also, I
modified the syntax of CREATE DATABASE to accept encoding option. See
README.mb for more details.

For this purpose I have added new column "encoding" to pg_database.
Also pg_attribute and pg_class are changed to catch up the
modification to pg_database.  Actually I haved added pg_database_mb.h,
pg_attribute_mb.h and pg_class_mb.h. These are used only when MB is
enabled. The reason having separate files is I couldn't find a way to
use ifdef or whatever in those files. I have to admit it looks
ugly. No way.

* support for PGCLIENTENCODING when issuing COPY command

commands/copy.c modified.

* support for SQL92 syntax "SET NAMES"

See gram.y.

* support for LATIN2-5
* add UNICODE regression test case
* new test suite for MB

New directory test/mb added.

* clean up source files

Basic idea is to have MB's own subdirectory for easier maintenance.
These are include/mb and backend/utils/mb.
1998-07-24 03:32:46 +00:00
Bruce Momjian 1e801a8f16 Hi,
Attached you'll find a (big) patch that fixes make dep and make
depend in all Makefiles where I found it to be appropriate.

It also removes the dependency in Makefile.global for NAMEDATALEN
and OIDNAMELEN by making backend/catalog/genbki.sh and bin/initdb/initdb.sh
a little smarter.

This no longer requires initdb.sh that is turned into initdb with
a sed script when installing Postgres, hence initdb.sh should be
renamed to initdb (after the patch has been applied :-) )

This patch is against the 6.3 sources, as it took a while to
complete.

Please review and apply,

Cheers,

Jeroen van Vianen
1998-04-06 00:32:26 +00:00
Marc G. Fournier 6e337eef45 Major cleanout of PORTNAME variables from Makefiles...bound to screw up
some of the ports...
1997-12-20 00:29:35 +00:00
Marc G. Fournier 542d4e528d First pass through, of many to come, towards making the whole source
tree "non-PORTNAME" dependent.  Technically, anything that is PORTNAME
dependent should be able to be derived at compile time, through configure
or through gcc
1997-12-17 04:59:16 +00:00
Marc G. Fournier 90d0cf0000 From: Robert Bruccoleri <bruc@bms.com>
Subject: [PORTS] Patches for Irix 6.4

I have worked out how to compile PostgreSQL on Irix 6.4 using the -n32 compiler
mode and version 7.1 of the C compiler. (The n32 compiler use 32 bits
addressing,
but allows access to all the instructions in the MIPS4 instruction set.)
There were several problems:

1) The ld command is not referenced as a macro in all the Makefiles. On
this platform, you have to include -n32 on all the ld commands. Makefiles
were changed as needed.

3) Lots of warnings are generated from the compiler. Since the regression
tests worked OK, I didn't attempt to fix them. If anyone wants the compilation
log, please let me know, and I'll email it to you.

The version of postgresql was 970602. Here is Makefile.custom:

CUSTOM_COPT = -O2 -n32
MK_NO_LORDER = 1
LD = ld -n32
CC += -n32
1997-06-11 01:13:10 +00:00
Marc G. Fournier 4ea3844680 From: "Brian E. Gallew" <geek+@cmu.edu>
Subject: Re: [PORTS] Re: [PATCHES] DG/UX 5.4R11 patches

Comments in boot.sed break DG/UX port
1997-06-11 01:05:48 +00:00
Vadim B. Mikheev 8466811335 Fix for -Wno-error 1997-04-18 08:57:39 +00:00
Marc G. Fournier 953ac7b55a Fix up the -Wno-error problem for non-gcc compilers
Pointed out by many many ppl
1997-04-15 17:24:26 +00:00
Marc G. Fournier c7b40e6058 This commit represents a clean compile with the new templates under
FreeBSD

The Makefile(s) have all been cleaned up such that there is a single
LDFLAGS vs LD_ADD or LDADD or LDFLAGS or LDFLAGS_BE.  The Makefile(s)
should be alot more straightforward then they were before...and
consistent
1997-04-04 10:43:16 +00:00
Marc G. Fournier 5b1311acfb From: Oleg Bartunov <oleg@sai.msu.su>
Subject: [HACKERS] locale patches !

Hi there,

here are little patches to get Postgres 6.1 works with locale stuff.
This is a patch against 970402.tar.gz, there are no problem to apply them
by hand to 6.0 release. Collate stuff tested about 1-2 months in real
working database but I'm sure there must be no problem. US hackers
could vote against locale implementation ( locale for sure will affect to
speed of postgres ), so I introduce variable USE_LOCALE which
controls locale stuff. Non-US users now could use ~* operator
for searching and <order by> for strings with nation alphabet.
Please, don't forget, as I did first time, to set environment variable
LC_CTYPE and LC_COLLATE because backend get locale information from them.
I start postmaster from a little script, assuming that shell is Bash shell
it looks like:

#!/bin/sh

export LC_CTYPE=koi8-r
export LC_COLLATE=koi8-r
postmaster -B 1024 -S -D/usr/local/pgsql/data/ -o '-Fe'
1997-04-02 18:13:47 +00:00
Bryan Henderson 902d2b8bac Use -Wno-error option only if compiler is gcc. 1996-11-14 07:33:34 +00:00
Bruce Momjian a0990e1884 Makefile cleanup after reorganization 1996-11-09 06:24:51 +00:00
Bruce Momjian 4b2b8592a0 Compile and warning cleanup 1996-11-08 06:02:30 +00:00
Bryan Henderson b0d6f0aa63 Simplify make files, add full dependencies. 1996-10-27 09:55:05 +00:00