~ubuntu-branches/ubuntu/raring/psqlodbc/raring

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-05-13 10:47:36 UTC
  • Revision ID: james.westby@ubuntu.com-20040513104736-a530gmn0p3knep89
Tags: upstream-07.03.0200
ImportĀ upstreamĀ versionĀ 07.03.0200

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Process this file with autoconf to produce a configure script.
 
2
AC_INIT(psqlodbc, 07.03.0200, [pgsql-odbc@postgresql.org])
 
3
AC_PREREQ(2.52)
 
4
AM_INIT_AUTOMAKE
 
5
AC_CONFIG_SRCDIR([bind.c])
 
6
AM_CONFIG_HEADER([config.h])
 
7
AM_MAINTAINER_MODE
 
8
 
 
9
 
 
10
AC_DEFINE(DRIVER_CURSOR_IMPLEMENT, 1,
 
11
        [Define to 1 to build with driver cursors option)])
 
12
 
 
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)])])
 
17
 
 
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)])])
 
22
 
 
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])
 
25
fi
 
26
 
 
27
#
 
28
# Default odbc version number (--with-odbcver), default 0x0300
 
29
#
 
30
AC_MSG_CHECKING([for ODBC version number])
 
31
PGAC_ARG_REQ(with, odbcver, [  --with-odbcver=VERSION  change default ODBC version number
 
32
 [0x0300]],
 
33
             [AC_DEFINE_UNQUOTED(ODBCVER, ${withval},
 
34
                [Define to ODBC version (--with-odbcver)])])
 
35
AC_MSG_RESULT([$with_odbcver])
 
36
 
 
37
AM_CONDITIONAL(with_unixodbc, [test $with_unixodbc = yes])
 
38
AM_CONDITIONAL(with_iodbc, [test $with_iodbc = yes])
 
39
 
 
40
AC_CHECK_FUNCS(strtoll)
 
41
 
 
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])])
 
57
     fi
 
58
     AC_CHECK_FUNCS(localtime_r strtok_r)
 
59
     AC_CHECK_LIB(pthreads, pthread_create, [],
 
60
       [AC_CHECK_LIB(pthread, pthread_create)])
 
61
    ])
 
62
 
 
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])
 
70
 
 
71
AC_PROG_CC
 
72
 
 
73
AC_LIBTOOL_WIN32_DLL
 
74
AC_DISABLE_STATIC
 
75
AC_LIBTOOL_DLOPEN
 
76
AC_PROG_LIBTOOL
 
77
 
 
78
AC_CHECK_HEADERS([locale.h])
 
79
AC_CHECK_TYPES(uint8)
 
80
PGAC_VAR_INT_TIMEZONE
 
81
 
 
82
AC_CONFIG_FILES([Makefile])
 
83
AC_OUTPUT