1
# Process this file with autoconf to produce a configure script.
2
AC_INIT(psqlodbc, 07.03.0200, [pgsql-odbc@postgresql.org])
5
AC_CONFIG_SRCDIR([bind.c])
6
AM_CONFIG_HEADER([config.h])
10
AC_DEFINE(DRIVER_CURSOR_IMPLEMENT, 1,
11
[Define to 1 to build with driver cursors option)])
13
PGAC_ARG_BOOL(with, unixodbc, no,
14
[ --with-unixodbc build ODBC driver for unixODBC],
15
[AC_DEFINE(WITH_UNIXODBC, 1,
16
[Define to 1 to build with unixODBC support (--with-unixodbc)])])
18
PGAC_ARG_BOOL(with, iodbc, no,
19
[ --with-iodbc build ODBC driver for iODBC],
20
[AC_DEFINE(WITH_IODBC, 1,
21
[Define to 1 to build with iODBC support (--with-iodbc)])])
23
if test "$with_unixodbc" = yes && test "$with_iodbc" = yes; then
24
AC_MSG_ERROR([ODBC driver cannot be built for both unixODBC and iODBC])
28
# Default odbc version number (--with-odbcver), default 0x0300
30
AC_MSG_CHECKING([for ODBC version number])
31
PGAC_ARG_REQ(with, odbcver, [ --with-odbcver=VERSION change default ODBC version number
33
[AC_DEFINE_UNQUOTED(ODBCVER, ${withval},
34
[Define to ODBC version (--with-odbcver)])])
35
AC_MSG_RESULT([$with_odbcver])
37
AM_CONDITIONAL(with_unixodbc, [test $with_unixodbc = yes])
38
AM_CONDITIONAL(with_iodbc, [test $with_iodbc = yes])
40
AC_CHECK_FUNCS(strtoll)
42
# to implement the thread-safe driver
43
PGAC_ARG_BOOL(enable, pthreads, no,
44
[ --enable-pthreads build pthread implementation if possible],
45
[AC_DEFINE(POSIX_MULTITHREAD_SUPPORT, 1,
46
[Define to 1 to build with pthreads support (--enable-pthreads)])
47
AC_DEFINE(_REENTRANT, 1,
48
[Define _REENTRANT for several plaforms])
49
AC_CHECK_LIB(c_r, gethostbyname)
50
AC_CHECK_LIB(nsl, gethostbyname_r, [],
51
[AC_CHECK_FUNCS(getipnodebyname gethostbyname_r, break)])
52
if test x"$ac_cv_func_gethostbyname_r" = xyes || test x"$ac_cv_lib_nsl_gethostbyname_r" = xyes; then
53
AC_TRY_COMPILE([#include <netdb.h>],
54
[ gethostbyname_r((char *) 0, (struct hostent *) 0, (char *) 0, 0, (int *) 0);],
55
[AC_DEFINE(PGS_REENTRANT_API_1, 1, [Define if you have 5 parameter gethostbyname_r])],
56
[AC_DEFINE(PGS_REENTRANT_API_2, 1, [Define if you have 6 parameter gethostbyname_r])])
58
AC_CHECK_FUNCS(localtime_r strtok_r)
59
AC_CHECK_LIB(pthreads, pthread_create, [],
60
[AC_CHECK_LIB(pthread, pthread_create)])
63
# Allow for overriding the default location of the odbcinst.ini
64
# file which is normally ${sysconfdir} (i.e., ${prefix}/etc).
65
PGAC_ARG_REQ(with, odbcinst,
66
[ --with-odbcinst=DIR default directory for odbcinst.ini [sysconfdir]],
67
[odbcinst_ini_dir=$withval],
68
[odbcinst_ini_dir="\${sysconfdir}"])
69
AC_SUBST([odbcinst_ini_dir])
78
AC_CHECK_HEADERS([locale.h])
82
AC_CONFIG_FILES([Makefile])