Skip to content

Commit 721856f

Browse files
committed
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 <[email protected]> Reviewed-by: Andres Freund <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/[email protected]
1 parent b72de09 commit 721856f

File tree

89 files changed

+175
-416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+175
-416
lines changed

GNUmakefile.in

+2-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ install-world-bin-contrib-recurse: install-world-bin-src-recurse
4141

4242
$(call recurse,installdirs uninstall init-po update-po,doc src config)
4343

44-
$(call recurse,distprep coverage,doc src config contrib)
44+
$(call recurse,coverage,doc src config contrib)
4545

4646
# clean, distclean, etc should apply to contrib too, even though
4747
# it's not built by default
@@ -53,7 +53,7 @@ clean:
5353

5454
# Important: distclean `src' last, otherwise Makefile.global
5555
# will be gone too soon.
56-
distclean maintainer-clean:
56+
distclean:
5757
$(MAKE) -C doc $@
5858
$(MAKE) -C contrib $@
5959
$(MAKE) -C config $@
@@ -109,7 +109,6 @@ distdir:
109109
|| cp "$(top_srcdir)/$$file" "$(distdir)/$$file"; \
110110
fi || exit; \
111111
done
112-
$(MAKE) -C $(distdir) distprep
113112
$(MAKE) -C $(distdir)/doc/src/sgml/ INSTALL
114113
cp $(distdir)/doc/src/sgml/INSTALL $(distdir)/
115114
$(MAKE) -C $(distdir) distclean
@@ -122,7 +121,6 @@ distcheck: dist
122121
install_prefix=`cd $(dummy) && pwd`; \
123122
cd $(distdir) \
124123
&& ./configure --prefix="$$install_prefix"
125-
$(MAKE) -C $(distdir) -q distprep
126124
$(MAKE) -C $(distdir)
127125
$(MAKE) -C $(distdir) install
128126
$(MAKE) -C $(distdir) uninstall

config/perl.m4

+2-7
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@ if test "$PERL"; then
1313
if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \
1414
$AWK '{ if ([$]1 == 5 && ([$]2 >= 14)) exit 1; else exit 0;}'
1515
then
16-
AC_MSG_WARN([
16+
AC_MSG_ERROR([
1717
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
1818
*** Perl version 5.14 or later is required, but this is $pgac_perl_version.])
19-
PERL=""
2019
fi
2120
fi
2221
2322
if test -z "$PERL"; then
24-
AC_MSG_WARN([
25-
*** Without Perl you will not be able to build PostgreSQL from Git.
26-
*** You can obtain Perl from any CPAN mirror site.
27-
*** (If you are using the official distribution of PostgreSQL then you do not
28-
*** need to worry about this, because the Perl output is pre-generated.)])
23+
AC_MSG_ERROR([Perl not found])
2924
fi
3025
])# PGAC_PATH_PERL
3126

config/programs.m4

+4-17
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ if test "$BISON"; then
3333
AC_MSG_NOTICE([using $pgac_bison_version])
3434
if echo "$pgac_bison_version" | $AWK '{ if ([$]4 < 2.3) exit 0; else exit 1;}'
3535
then
36-
AC_MSG_WARN([
36+
AC_MSG_ERROR([
3737
*** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
3838
*** Bison version 2.3 or later is required, but this is $pgac_bison_version.])
39-
BISON=""
4039
fi
4140
# Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
4241
# of the now preferred %name-prefix "base_yy", but the latter
@@ -49,12 +48,7 @@ if test "$BISON"; then
4948
fi
5049
5150
if test -z "$BISON"; then
52-
AC_MSG_WARN([
53-
*** Without Bison you will not be able to build PostgreSQL from Git nor
54-
*** change any of the parser definition files. You can obtain Bison from
55-
*** a GNU mirror site. (If you are using the official distribution of
56-
*** PostgreSQL then you do not need to worry about this, because the Bison
57-
*** output is pre-generated.)])
51+
AC_MSG_ERROR([bison not found])
5852
fi
5953
dnl We don't need AC_SUBST(BISON) because PGAC_PATH_PROGS did it
6054
AC_SUBST(BISONFLAGS)
@@ -95,7 +89,7 @@ else
9589
pgac_cv_path_flex=$pgac_candidate
9690
break 2
9791
else
98-
AC_MSG_WARN([
92+
AC_MSG_ERROR([
9993
*** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
10094
*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version.])
10195
fi
@@ -109,14 +103,7 @@ fi
109103
])[]dnl AC_CACHE_CHECK
110104
111105
if test x"$pgac_cv_path_flex" = x"no"; then
112-
AC_MSG_WARN([
113-
*** Without Flex you will not be able to build PostgreSQL from Git nor
114-
*** change any of the scanner definition files. You can obtain Flex from
115-
*** a GNU mirror site. (If you are using the official distribution of
116-
*** PostgreSQL then you do not need to worry about this because the Flex
117-
*** output is pre-generated.)])
118-
119-
FLEX=
106+
AC_MSG_ERROR([flex not found])
120107
else
121108
FLEX=$pgac_cv_path_flex
122109
pgac_flex_version=`$FLEX --version 2>/dev/null`

configure

+9-53
Original file line numberDiff line numberDiff line change
@@ -10162,13 +10162,9 @@ if test "$BISON"; then
1016210162
$as_echo "$as_me: using $pgac_bison_version" >&6;}
1016310163
if echo "$pgac_bison_version" | $AWK '{ if ($4 < 2.3) exit 0; else exit 1;}'
1016410164
then
10165-
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
10166-
*** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
10167-
*** Bison version 2.3 or later is required, but this is $pgac_bison_version." >&5
10168-
$as_echo "$as_me: WARNING:
10165+
as_fn_error $? "
1016910166
*** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
10170-
*** Bison version 2.3 or later is required, but this is $pgac_bison_version." >&2;}
10171-
BISON=""
10167+
*** Bison version 2.3 or later is required, but this is $pgac_bison_version." "$LINENO" 5
1017210168
fi
1017310169
# Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
1017410170
# of the now preferred %name-prefix "base_yy", but the latter
@@ -10181,18 +10177,7 @@ $as_echo "$as_me: WARNING:
1018110177
fi
1018210178

1018310179
if test -z "$BISON"; then
10184-
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
10185-
*** Without Bison you will not be able to build PostgreSQL from Git nor
10186-
*** change any of the parser definition files. You can obtain Bison from
10187-
*** a GNU mirror site. (If you are using the official distribution of
10188-
*** PostgreSQL then you do not need to worry about this, because the Bison
10189-
*** output is pre-generated.)" >&5
10190-
$as_echo "$as_me: WARNING:
10191-
*** Without Bison you will not be able to build PostgreSQL from Git nor
10192-
*** change any of the parser definition files. You can obtain Bison from
10193-
*** a GNU mirror site. (If you are using the official distribution of
10194-
*** PostgreSQL then you do not need to worry about this, because the Bison
10195-
*** output is pre-generated.)" >&2;}
10180+
as_fn_error $? "bison not found" "$LINENO" 5
1019610181
fi
1019710182

1019810183

@@ -10225,12 +10210,9 @@ else
1022510210
pgac_cv_path_flex=$pgac_candidate
1022610211
break 2
1022710212
else
10228-
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
10229-
*** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
10230-
*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." >&5
10231-
$as_echo "$as_me: WARNING:
10213+
as_fn_error $? "
1023210214
*** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
10233-
*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." >&2;}
10215+
*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." "$LINENO" 5
1023410216
fi
1023510217
fi
1023610218
fi
@@ -10244,20 +10226,7 @@ fi
1024410226
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_path_flex" >&5
1024510227
$as_echo "$pgac_cv_path_flex" >&6; }
1024610228
if test x"$pgac_cv_path_flex" = x"no"; then
10247-
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
10248-
*** Without Flex you will not be able to build PostgreSQL from Git nor
10249-
*** change any of the scanner definition files. You can obtain Flex from
10250-
*** a GNU mirror site. (If you are using the official distribution of
10251-
*** PostgreSQL then you do not need to worry about this because the Flex
10252-
*** output is pre-generated.)" >&5
10253-
$as_echo "$as_me: WARNING:
10254-
*** Without Flex you will not be able to build PostgreSQL from Git nor
10255-
*** change any of the scanner definition files. You can obtain Flex from
10256-
*** a GNU mirror site. (If you are using the official distribution of
10257-
*** PostgreSQL then you do not need to worry about this because the Flex
10258-
*** output is pre-generated.)" >&2;}
10259-
10260-
FLEX=
10229+
as_fn_error $? "flex not found" "$LINENO" 5
1026110230
else
1026210231
FLEX=$pgac_cv_path_flex
1026310232
pgac_flex_version=`$FLEX --version 2>/dev/null`
@@ -10331,27 +10300,14 @@ $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
1033110300
if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
1033210301
$AWK '{ if ($1 == 5 && ($2 >= 14)) exit 1; else exit 0;}'
1033310302
then
10334-
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
10335-
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
10336-
*** Perl version 5.14 or later is required, but this is $pgac_perl_version." >&5
10337-
$as_echo "$as_me: WARNING:
10303+
as_fn_error $? "
1033810304
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
10339-
*** Perl version 5.14 or later is required, but this is $pgac_perl_version." >&2;}
10340-
PERL=""
10305+
*** Perl version 5.14 or later is required, but this is $pgac_perl_version." "$LINENO" 5
1034110306
fi
1034210307
fi
1034310308

1034410309
if test -z "$PERL"; then
10345-
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
10346-
*** Without Perl you will not be able to build PostgreSQL from Git.
10347-
*** You can obtain Perl from any CPAN mirror site.
10348-
*** (If you are using the official distribution of PostgreSQL then you do not
10349-
*** need to worry about this, because the Perl output is pre-generated.)" >&5
10350-
$as_echo "$as_me: WARNING:
10351-
*** Without Perl you will not be able to build PostgreSQL from Git.
10352-
*** You can obtain Perl from any CPAN mirror site.
10353-
*** (If you are using the official distribution of PostgreSQL then you do not
10354-
*** need to worry about this, because the Perl output is pre-generated.)" >&2;}
10310+
as_fn_error $? "Perl not found" "$LINENO" 5
1035510311
fi
1035610312

1035710313
if test "$with_perl" = yes; then

contrib/cube/Makefile

+2-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ REGRESS = cube cube_sci
1818

1919
SHLIB_LINK += $(filter -lm, $(LIBS))
2020

21+
EXTRA_CLEAN = cubeparse.h cubeparse.c cubescan.c
22+
2123
ifdef USE_PGXS
2224
PG_CONFIG = pg_config
2325
PGXS := $(shell $(PG_CONFIG) --pgxs)
@@ -37,8 +39,3 @@ cubeparse.c: BISONFLAGS += -d
3739

3840
# Force these dependencies to be known even without dependency info built:
3941
cubeparse.o cubescan.o: cubeparse.h
40-
41-
distprep: cubeparse.c cubescan.c
42-
43-
maintainer-clean:
44-
rm -f cubeparse.h cubeparse.c cubescan.c

contrib/fuzzystrmatch/Makefile

+2-7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ PGFILEDESC = "fuzzystrmatch - similarities and distance between strings"
1515

1616
REGRESS = fuzzystrmatch fuzzystrmatch_utf8
1717

18+
EXTRA_CLEAN = daitch_mokotoff.h
19+
1820
ifdef USE_PGXS
1921
PG_CONFIG = pg_config
2022
PGXS := $(shell $(PG_CONFIG) --pgxs)
@@ -31,10 +33,3 @@ daitch_mokotoff.o: daitch_mokotoff.h
3133

3234
daitch_mokotoff.h: daitch_mokotoff_header.pl
3335
$(PERL) $< $@
34-
35-
# daitch_mokotoff.h is included in tarballs, so it has to be made by
36-
# "distprep" and not cleaned except by "maintainer-clean".
37-
distprep: daitch_mokotoff.h
38-
39-
maintainer-clean:
40-
rm -f daitch_mokotoff.h

contrib/seg/Makefile

+1-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ HEADERS = segdata.h
1616

1717
REGRESS = security seg
1818

19-
EXTRA_CLEAN = y.tab.c y.tab.h
19+
EXTRA_CLEAN = segparse.h segparse.c segscan.c
2020

2121
ifdef USE_PGXS
2222
PG_CONFIG = pg_config
@@ -38,8 +38,3 @@ segparse.c: BISONFLAGS += -d
3838

3939
# Force these dependencies to be known even without dependency info built:
4040
segparse.o segscan.o: segparse.h
41-
42-
distprep: segparse.c segscan.c
43-
44-
maintainer-clean:
45-
rm -f segparse.h segparse.c segscan.c

doc/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ subdir = doc
1212
top_builddir = ..
1313
include $(top_builddir)/src/Makefile.global
1414

15-
all distprep html man install installdirs uninstall clean distclean maintainer-clean:
15+
all html man install installdirs uninstall clean distclean:
1616
$(MAKE) -C src $@

doc/src/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ subdir = doc/src
44
top_builddir = ../..
55
include $(top_builddir)/src/Makefile.global
66

7-
all distprep html man install installdirs uninstall clean distclean maintainer-clean:
7+
all html man install installdirs uninstall clean distclean:
88
$(MAKE) -C sgml $@

doc/src/sgml/Makefile

+5-11
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
#----------------------------------------------------------------------------
88

99
# This makefile is for building and installing the documentation.
10-
# When a release tarball is created, the documentation files are
11-
# prepared using the distprep target. In Git-based trees these files
10+
# In Git-based trees these files
1211
# don't exist, unless explicitly built, so we skip the installation in
1312
# that case.
1413

@@ -28,8 +27,6 @@ include $(top_builddir)/src/Makefile.global
2827

2928
all: html man
3029

31-
distprep: html distprep-man
32-
3330

3431
ifndef DBTOEPUB
3532
DBTOEPUB = $(missing) dbtoepub
@@ -77,7 +74,7 @@ postgres-full.xml: postgres.sgml $(ALLSGML)
7774
## Man pages
7875
##
7976

80-
man distprep-man: man-stamp
77+
man: man-stamp
8178

8279
man-stamp: stylesheet-man.xsl postgres-full.xml
8380
$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_MAN_FLAGS) $^
@@ -89,10 +86,9 @@ man-stamp: stylesheet-man.xsl postgres-full.xml
8986
##
9087

9188
# Technically, this should depend on Makefile.global, but then
92-
# version.sgml would need to be rebuilt after every configure run,
93-
# even in distribution tarballs. So this is cheating a bit, but it
94-
# will achieve the goal of updating the version number when it
95-
# changes.
89+
# version.sgml would need to be rebuilt after every configure run. So
90+
# this is cheating a bit, but it will achieve the goal of updating the
91+
# version number when it changes.
9692
version.sgml: $(top_srcdir)/configure
9793
{ \
9894
echo "<!ENTITY version \"$(VERSION)\">"; \
@@ -305,8 +301,6 @@ clean:
305301
rm -f *.texixml *.texi *.info db2texi.refs
306302

307303
distclean: clean
308-
309-
maintainer-clean: distclean
310304
# HTML
311305
rm -fr html/ html-stamp
312306
# man

0 commit comments

Comments
 (0)