1 AC_INIT(sql_postgresql.c)
2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_sql_postgresql])
8 if test x$with_[]modname != xno; then
12 dnl extra argument: --with-rlm-sql-postgresql-lib-dir
13 rlm_sql_postgresql_lib_dir=
14 AC_ARG_WITH(rlm-sql-postgresql-lib-dir,
15 [ --with-rlm-sql-postgresql-lib-dir=DIR Directory for PostgreSQL library files []],
18 AC_MSG_ERROR(Need rlm-sql-postgresql-lib-dir)
23 rlm_sql_postgresql_lib_dir="$withval"
28 dnl extra argument: --with-rlm-sql-postgresql-include-dir
29 rlm_sql_postgresql_include_dir=
30 AC_ARG_WITH(rlm-sql-postgresql-include-dir,
31 [ --with-rlm-sql-postgresql-include-dir=DIR Directory for PostgreSQL include files []],
34 AC_MSG_ERROR(Need rlm-sql-postgresql-include-dir)
39 rlm_sql_postgresql_include_dir="$withval"
44 smart_try_dir="$rlm_sql_postgresql_include_dir /usr/include/postgresql /usr/local/pgsql/include /usr/include/pgsql"
45 FR_SMART_CHECK_INCLUDE(libpq-fe.h)
46 if test "x$ac_cv_header_libpqmfe_h" != "xyes"; then
47 fail="$fail libpq-fe.h"
50 smart_try_dir="$rlm_sql_postgresql_lib_dir /usr/lib /usr/local/pgsql/lib"
51 FR_SMART_CHECK_LIB(pq, PQconnectdb)
52 if test "x$ac_cv_lib_pq_PQconnectdb" != "xyes"; then
59 echo \*\*\* module modname is disabled.
62 if test x"$fail" != x""; then
63 if test x"${enable_strict_dependencies}" = x"yes"; then
64 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
66 AC_MSG_WARN([silently not building ]modname[.])
67 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
68 if test x"$headersuggestion" != x; then
69 AC_MSG_WARN([$headersuggestion])
71 if test x"$libsuggestion" != x; then
72 AC_MSG_WARN([$libsuggestion])
78 postgresql_ldflags=$SMART_LIBS
79 postgresql_cflags=$SMART_CFLAGS
80 AC_SUBST(postgresql_ldflags)
81 AC_SUBST(postgresql_cflags)