From 9b4504ce0e247b840b8cef424e44d922bc7cde88 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 5 Oct 2023 17:39:24 +0200 Subject: [PATCH v5 1/2] Make bison, flex, perl hard build requirements ... see next patch --- config/perl.m4 | 9 +--- config/programs.m4 | 21 ++------- configure | 62 ++++---------------------- doc/src/sgml/installation.sgml | 80 +++++++++++++++------------------- doc/src/sgml/sourcerepo.sgml | 10 ----- src/Makefile.global.in | 16 +------ 6 files changed, 52 insertions(+), 146 deletions(-) diff --git a/config/perl.m4 b/config/perl.m4 index 8126e79f67..1a3bb55649 100644 --- a/config/perl.m4 +++ b/config/perl.m4 @@ -13,19 +13,14 @@ if test "$PERL"; then if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \ $AWK '{ if ([$]1 == 5 && ([$]2 >= 14)) exit 1; else exit 0;}' then - AC_MSG_WARN([ + AC_MSG_ERROR([ *** The installed version of Perl, $PERL, is too old to use with PostgreSQL. *** Perl version 5.14 or later is required, but this is $pgac_perl_version.]) - PERL="" fi fi if test -z "$PERL"; then - AC_MSG_WARN([ -*** Without Perl you will not be able to build PostgreSQL from Git. -*** You can obtain Perl from any CPAN mirror site. -*** (If you are using the official distribution of PostgreSQL then you do not -*** need to worry about this, because the Perl output is pre-generated.)]) + AC_MSG_ERROR([Perl not found]) fi ])# PGAC_PATH_PERL diff --git a/config/programs.m4 b/config/programs.m4 index 8a118b4e03..490ec9fe9f 100644 --- a/config/programs.m4 +++ b/config/programs.m4 @@ -33,10 +33,9 @@ if test "$BISON"; then AC_MSG_NOTICE([using $pgac_bison_version]) if echo "$pgac_bison_version" | $AWK '{ if ([$]4 < 2.3) exit 0; else exit 1;}' then - AC_MSG_WARN([ + AC_MSG_ERROR([ *** The installed version of Bison, $BISON, is too old to use with PostgreSQL. *** Bison version 2.3 or later is required, but this is $pgac_bison_version.]) - BISON="" fi # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead # of the now preferred %name-prefix "base_yy", but the latter @@ -49,12 +48,7 @@ if test "$BISON"; then fi if test -z "$BISON"; then - AC_MSG_WARN([ -*** Without Bison you will not be able to build PostgreSQL from Git nor -*** change any of the parser definition files. You can obtain Bison from -*** a GNU mirror site. (If you are using the official distribution of -*** PostgreSQL then you do not need to worry about this, because the Bison -*** output is pre-generated.)]) + AC_MSG_ERROR([bison not found]) fi dnl We don't need AC_SUBST(BISON) because PGAC_PATH_PROGS did it AC_SUBST(BISONFLAGS) @@ -95,7 +89,7 @@ else pgac_cv_path_flex=$pgac_candidate break 2 else - AC_MSG_WARN([ + AC_MSG_ERROR([ *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL. *** Flex version 2.5.35 or later is required, but this is $pgac_flex_version.]) fi @@ -109,14 +103,7 @@ fi ])[]dnl AC_CACHE_CHECK if test x"$pgac_cv_path_flex" = x"no"; then - AC_MSG_WARN([ -*** Without Flex you will not be able to build PostgreSQL from Git nor -*** change any of the scanner definition files. You can obtain Flex from -*** a GNU mirror site. (If you are using the official distribution of -*** PostgreSQL then you do not need to worry about this because the Flex -*** output is pre-generated.)]) - - FLEX= + AC_MSG_ERROR([flex not found]) else FLEX=$pgac_cv_path_flex pgac_flex_version=`$FLEX --version 2>/dev/null` diff --git a/configure b/configure index d47e0f8b26..514cee190d 100755 --- a/configure +++ b/configure @@ -10160,13 +10160,9 @@ if test "$BISON"; then $as_echo "$as_me: using $pgac_bison_version" >&6;} if echo "$pgac_bison_version" | $AWK '{ if ($4 < 2.3) exit 0; else exit 1;}' then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** The installed version of Bison, $BISON, is too old to use with PostgreSQL. -*** Bison version 2.3 or later is required, but this is $pgac_bison_version." >&5 -$as_echo "$as_me: WARNING: + as_fn_error $? " *** The installed version of Bison, $BISON, is too old to use with PostgreSQL. -*** Bison version 2.3 or later is required, but this is $pgac_bison_version." >&2;} - BISON="" +*** Bison version 2.3 or later is required, but this is $pgac_bison_version." "$LINENO" 5 fi # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead # of the now preferred %name-prefix "base_yy", but the latter @@ -10179,18 +10175,7 @@ $as_echo "$as_me: WARNING: fi if test -z "$BISON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** Without Bison you will not be able to build PostgreSQL from Git nor -*** change any of the parser definition files. You can obtain Bison from -*** a GNU mirror site. (If you are using the official distribution of -*** PostgreSQL then you do not need to worry about this, because the Bison -*** output is pre-generated.)" >&5 -$as_echo "$as_me: WARNING: -*** Without Bison you will not be able to build PostgreSQL from Git nor -*** change any of the parser definition files. You can obtain Bison from -*** a GNU mirror site. (If you are using the official distribution of -*** PostgreSQL then you do not need to worry about this, because the Bison -*** output is pre-generated.)" >&2;} + as_fn_error $? "bison not found" "$LINENO" 5 fi @@ -10223,12 +10208,9 @@ else pgac_cv_path_flex=$pgac_candidate break 2 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL. -*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." >&5 -$as_echo "$as_me: WARNING: + as_fn_error $? " *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL. -*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." >&2;} +*** Flex version 2.5.35 or later is required, but this is $pgac_flex_version." "$LINENO" 5 fi fi fi @@ -10242,20 +10224,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_path_flex" >&5 $as_echo "$pgac_cv_path_flex" >&6; } if test x"$pgac_cv_path_flex" = x"no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** Without Flex you will not be able to build PostgreSQL from Git nor -*** change any of the scanner definition files. You can obtain Flex from -*** a GNU mirror site. (If you are using the official distribution of -*** PostgreSQL then you do not need to worry about this because the Flex -*** output is pre-generated.)" >&5 -$as_echo "$as_me: WARNING: -*** Without Flex you will not be able to build PostgreSQL from Git nor -*** change any of the scanner definition files. You can obtain Flex from -*** a GNU mirror site. (If you are using the official distribution of -*** PostgreSQL then you do not need to worry about this because the Flex -*** output is pre-generated.)" >&2;} - - FLEX= + as_fn_error $? "flex not found" "$LINENO" 5 else FLEX=$pgac_cv_path_flex pgac_flex_version=`$FLEX --version 2>/dev/null` @@ -10329,27 +10298,14 @@ $as_echo "$as_me: using perl $pgac_perl_version" >&6;} if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \ $AWK '{ if ($1 == 5 && ($2 >= 14)) exit 1; else exit 0;}' then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** The installed version of Perl, $PERL, is too old to use with PostgreSQL. -*** Perl version 5.14 or later is required, but this is $pgac_perl_version." >&5 -$as_echo "$as_me: WARNING: + as_fn_error $? " *** The installed version of Perl, $PERL, is too old to use with PostgreSQL. -*** Perl version 5.14 or later is required, but this is $pgac_perl_version." >&2;} - PERL="" +*** Perl version 5.14 or later is required, but this is $pgac_perl_version." "$LINENO" 5 fi fi if test -z "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** Without Perl you will not be able to build PostgreSQL from Git. -*** You can obtain Perl from any CPAN mirror site. -*** (If you are using the official distribution of PostgreSQL then you do not -*** need to worry about this, because the Perl output is pre-generated.)" >&5 -$as_echo "$as_me: WARNING: -*** Without Perl you will not be able to build PostgreSQL from Git. -*** You can obtain Perl from any CPAN mirror site. -*** (If you are using the official distribution of PostgreSQL then you do not -*** need to worry about this, because the Perl output is pre-generated.)" >&2;} + as_fn_error $? "Perl not found" "$LINENO" 5 fi if test "$with_perl" = yes; then diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index f4b1f81189..468759583c 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -102,6 +102,41 @@ Requirements + + + + flex + + + lex + + + bison + + + yacc + + + Flex 2.5.35 or later and + Bison 2.3 or later are required. Other + lex and yacc + programs cannot be used. + + + + + + + perl + + + Perl 5.14 or later is needed during the build + process and to run some test suites. (This requirement is separate from + the requirements for building PL/Perl; see + below.) + + + @@ -315,51 +350,6 @@ Requirements - - If you are building from a Git tree instead of - using a released source package, or if you want to do server development, - you also need the following packages: - - - - - - flex - - - lex - - - bison - - - yacc - - - Flex and Bison - are needed to build from a Git checkout, or if you changed the actual - scanner and parser definition files. If you need them, be sure - to get Flex 2.5.35 or later and - Bison 2.3 or later. Other lex - and yacc programs cannot be used. - - - - - - perl - - - Perl 5.14 or later is needed to build from a Git checkout, - or if you changed the input files for any of the build steps that - use Perl scripts. If building on Windows you will need - Perl in any case. Perl is - also required to run some test suites. - - - - - If you need to get a GNU package, you can find it at your local GNU mirror site (see The Source Code Repository has some discussion on working with Git. - - Note that building PostgreSQL from the source - repository requires reasonably up-to-date versions of bison, - flex, and Perl. - These tools are not needed to build from a distribution tarball, because - the files generated with these tools are included in the tarball. - Other tool requirements - are the same as shown in . - - Getting the Source via <productname>Git</productname> diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 7b66590801..985b3ea62b 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -319,12 +319,8 @@ X = @EXEEXT@ # Perl -ifneq (@PERL@,) - # quoted to protect pathname with spaces - PERL = '@PERL@' -else - PERL = $(missing) perl -endif +# quoted to protect pathname with spaces +PERL = '@PERL@' perl_archlibexp = @perl_archlibexp@ perl_privlibexp = @perl_privlibexp@ perl_includespec = @perl_includespec@ @@ -777,21 +773,13 @@ TAS = @TAS@ # Global targets and rules %.c: %.l -ifdef FLEX $(FLEX) $(if $(FLEX_NO_BACKUP),-b) $(FLEXFLAGS) -o'$@' $< @$(if $(FLEX_NO_BACKUP),if [ `wc -l &2; exit 1; fi) $(if $(FLEX_FIX_WARNING),$(PERL) $(top_srcdir)/src/tools/fix-old-flex-code.pl '$@') -else - @$(missing) flex $< '$@' -endif %.c: %.y $(if $(BISON_CHECK_CMD),$(BISON_CHECK_CMD)) -ifdef BISON $(BISON) $(BISONFLAGS) -o $@ $< -else - @$(missing) bison $< $@ -endif %.i: %.c $(CPP) $(CPPFLAGS) -o $@ $< -- 2.42.0