/
configure.in
68 lines (52 loc) · 2.14 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
AC_INIT([BDR], [bdr-next], [pgsql-bugs@postgresql.org], [bdr], [http://2ndquadrant.com/en/resources/bdr/])
AC_COPYRIGHT([Copyright (c) 1996-2015, PostgreSQL Global Development Group])
AC_SUBST(configure_args, [$ac_configure_args])
AC_ARG_ENABLE([bdr],
[AS_HELP_STRING([--enable-bdr],
[enable full bi-directional replication for patched PostgreSQL 9.4 [yes/no/auto] @<:@default=auto@:>@])],
[],
[enable_bdr=auto])
AC_PROG_SED
AC_ARG_VAR([PG_CONFIG], [Location to find pg_config for target PostgresQL (default PATH)])
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
if test "$version_num" != '9.4' -a "$version_num" != '9.5'; then
AC_MSG_ERROR([bdr is not compatible with detected postgres 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"
# now that we found pg_config, check whether we're building against
# a stock postgres or not.
AC_CHECK_HEADERS([replication/replication_identifier.h], [], [],
[#include "postgres.h"
])
AC_ARG_VAR([PATH], [PATH for target PostgreSQL install pg_config])
if test "$ac_cv_header_replication_replication_identifier_h" != 'yes'; then
AC_MSG_ERROR([BDR can be built only against postgres-bdr])
fi;
# 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)
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile.global])
AC_CONFIG_FILES([doc/Makefile])
AC_CONFIG_FILES([run_tests], [chmod +x run_tests])
AC_CONFIG_HEADERS([bdr_config_generated.h])
AH_TOP([/* Do not include directly, use bdr_config.h instead. */])
AC_OUTPUT