diff --git a/configure b/configure index b3f3abe..2beee31 100755 --- a/configure +++ b/configure @@ -3099,6 +3099,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# It's worth testing for this because it creates a very confusing error +if test "$default_port" == ""; then + as_fn_error $? "Invalid empty string supplied for \$PGPORT or --with-pgport" "$LINENO" 5 +# This won't catch something like "PGPORT=11a" but that produces a pretty easy +# to understand compile error. +elif test "$default_port" -lt "1" -o "$default_port" -gt "65535"; then + as_fn_error $? "port must be between 1 and 65535" "$LINENO" 5 +fi # # '-rpath'-like feature can be disabled diff --git a/configure.in b/configure.in index 0bd90d7..54e9a16 100644 --- a/configure.in +++ b/configure.in @@ -164,6 +164,14 @@ but it's convenient if your clients have the right default compiled in. AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}", [Define to the default TCP port number as a string constant.]) AC_SUBST(default_port) +# It's worth testing for this because it creates a very confusing error +if test "$default_port" == ""; then + AC_MSG_ERROR([Invalid empty string supplied for \$PGPORT or --with-pgport]) +# This won't catch something like "PGPORT=11a" but that produces a pretty easy +# to understand compile error. +elif test "$default_port" -lt "1" -o "$default_port" -gt "65535"; then + AC_MSG_ERROR([port must be between 1 and 65535]) +fi # # '-rpath'-like feature can be disabled