From 5eef8a99c3641d90dd49dad4c337b7ee0c662ff8 Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Fri, 24 Jun 2022 15:34:35 +0200 Subject: [PATCH] add configure option to suppress pg version check in ./configure --- configure | 36 +++++++++++++++++++++++++++++++++++- configure.in | 8 +++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 612180c77..5cf8925fe 100755 --- a/configure +++ b/configure @@ -644,6 +644,7 @@ LDFLAGS CFLAGS CC vpath_build +with_pg_version_check PATH PG_CONFIG FLEX @@ -692,6 +693,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking with_extra_version +with_pg_version_check enable_coverage with_libcurl with_reports_hostname @@ -1337,6 +1339,8 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-extra-version=STRING append STRING to version + --without-pg-version-check + do not check postgres version during build --without-libcurl do not use libcurl for anonymous statistics collection --with-reports-hostname=HOSTNAME @@ -2555,7 +2559,37 @@ if test -z "$version_num"; then as_fn_error $? "Could not detect PostgreSQL version from pg_config." "$LINENO" 5 fi -if test "$version_num" != '13' -a "$version_num" != '14'; then + + + +# Check whether --with-pg-version-check was given. +if test ${with_pg_version_check+y} +then : + withval=$with_pg_version_check; + case $withval in + yes) + : + ;; + no) + : + ;; + *) + as_fn_error $? "no argument expected for --with-pg-version-check option" "$LINENO" 5 + ;; + esac + +else $as_nop + with_pg_version_check=yes + +fi + + + + +if test "$with_pg_version_check" = no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: building against PostgreSQL $version_num (skipped compatibility check)" >&5 +printf "%s\n" "$as_me: building against PostgreSQL $version_num (skipped compatibility check)" >&6;} +elif test "$version_num" != '13' -a "$version_num" != '14'; then as_fn_error $? "Citus is not compatible with the detected PostgreSQL version ${version_num}." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: building against PostgreSQL $version_num" >&5 diff --git a/configure.in b/configure.in index 06f78e0b7..75162978a 100644 --- a/configure.in +++ b/configure.in @@ -74,7 +74,13 @@ if test -z "$version_num"; then AC_MSG_ERROR([Could not detect PostgreSQL version from pg_config.]) fi -if test "$version_num" != '13' -a "$version_num" != '14'; then +PGAC_ARG_BOOL(with, pg-version-check, yes, + [do not check postgres version during build]) +AC_SUBST(with_pg_version_check) + +if test "$with_pg_version_check" = no; then + AC_MSG_NOTICE([building against PostgreSQL $version_num (skipped compatibility check)]) +elif test "$version_num" != '13' -a "$version_num" != '14'; then AC_MSG_ERROR([Citus is not compatible with the detected PostgreSQL version ${version_num}.]) else AC_MSG_NOTICE([building against PostgreSQL $version_num])