mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Initial configure script
This commit is contained in:
43
configure.in
Normal file
43
configure.in
Normal file
@@ -0,0 +1,43 @@
|
||||
AC_INIT([repmgr4], [4.0], [pgsql-bugs@postgresql.org], [repmgr4], [https://2ndquadrant.com/en/resources/repmgr/])
|
||||
|
||||
AC_COPYRIGHT([Copyright (c) 2010-2017, 2ndQuadrant Ltd.])
|
||||
|
||||
AC_ARG_VAR([PG_CONFIG], [Location to find pg_config for target PostgreSQL (default PATH)])
|
||||
|
||||
AC_PROG_SED
|
||||
|
||||
if test -z "$PG_CONFIG"; then
|
||||
AC_PATH_PROG(PG_CONFIG, pg_config)
|
||||
fi
|
||||
|
||||
if test -z "$PG_CONFIG"; then
|
||||
AC_MSG_ERROR([could not find pg_config, set PG_CONFIG or PATH])
|
||||
fi
|
||||
|
||||
pgac_pg_config_version=$($PG_CONFIG --version 2>/dev/null)
|
||||
version_num=$(echo "$pgac_pg_config_version"|
|
||||
$SED -e 's/^PostgreSQL \([[0-9]]*\)\.\([[0-9]]*\)\([[a-zA-Z0-9.]]*\)$/\1.\2/')
|
||||
|
||||
if test -z "$version_num"; then
|
||||
AC_MSG_ERROR([could not detect the PostgreSQL version, wrong or broken pg_config?])
|
||||
fi
|
||||
|
||||
version_num_int=$(echo "$version_num"|
|
||||
$SED -e 's/^\([[0-9]]*\)\([[0-9]]*\)$/\1\2/')
|
||||
|
||||
if test "$version_num_int" -lt '93'; then
|
||||
AC_MSG_ERROR([repmgr is not compatible with detected PostgreSQL version: $version_num])
|
||||
else
|
||||
AC_MSG_NOTICE([building against PostgreSQL $version_num])
|
||||
fi
|
||||
|
||||
# add includedir to prerequisites, so tests for headers can succeed
|
||||
CPPFLAGS="-I$($PG_CONFIG --includedir-server) $CFLAGS"
|
||||
|
||||
# check whether we're building inside the source tree.
|
||||
if test "$srcdir" -ef '.' ; then
|
||||
vpath_build=no
|
||||
else
|
||||
vpath_build=yes
|
||||
fi
|
||||
AC_SUBST(vpath_build)
|
||||
Reference in New Issue
Block a user