summaryrefslogtreecommitdiff
path: root/configure.ac
blob: e3b28f6c1e3c72ef36363f6566adeb5ccd4071c2 (plain)
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
dnl Process this file with autoconf to produce a configure script.

AC_INIT(skytools, 2.1.1)
AC_CONFIG_SRCDIR(python/pgqadm.py)

dnl Find Python interpreter
AC_ARG_WITH(python, [  --with-python=PYTHON    name of the Python executable (default: python)],
[ AC_MSG_CHECKING(for python)
  PYTHON=$withval
  AC_MSG_RESULT($PYTHON)],
[ AC_PATH_PROGS(PYTHON, python) ])
test -n "$PYTHON" || AC_MSG_ERROR([Cannot continue without Python])

dnl Find PostgreSQL pg_config
AC_ARG_WITH(pgconfig, [  --with-pgconfig=PG_CONFIG    path to pg_config (default: pg_config)],
[ AC_MSG_CHECKING(for pg_config)
  PG_CONFIG=$withval
  AC_MSG_RESULT($PG_CONFIG)],
[ AC_PATH_PROGS(PG_CONFIG, pg_config) ])
test -n "$PG_CONFIG" || AC_MSG_ERROR([Cannot continue without pg_config])

AC_MSG_CHECKING(where PostgreSQL SQL extensions are installed)
cat > conftest.mak <<EOF
PGXS = \$(shell $PG_CONFIG --pgxs)
include \$(PGXS)
finddir:
	echo "\$(datadir)/contrib"
EOF
SQLDIR=`make -s -f conftest.mak finddir`
AC_MSG_RESULT($SQLDIR)
AC_SUBST(SQLDIR)

dnl Write result
AC_OUTPUT([config.mak python/skytools/installer_config.py])