File: configure.in

package info (click to toggle)
pgpool2 1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 4,292 kB
  • ctags: 5,482
  • sloc: ansic: 30,138; sh: 9,037; yacc: 6,944; lex: 2,140; sql: 86; makefile: 81
file content (148 lines) | stat: -rw-r--r-- 4,156 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
dnl Process this file with autoconf to produce a configure script.
AC_INIT

dnl Checks for programs.
AC_PROG_CC

AM_INIT_AUTOMAKE(pgpool-II, 1.3)
AC_PROG_RANLIB
AC_PROG_LIBTOOL

AM_PROG_LEX
AC_PROG_YACC

dnl Checks for libraries.
AC_CHECK_LIB(m,        main)
AC_CHECK_LIB(nsl,      main)
AC_CHECK_LIB(socket,   main)
AC_CHECK_LIB(ipc,      main)
AC_CHECK_LIB(IPC,      main)
AC_CHECK_LIB(lc,       main)
AC_CHECK_LIB(compat,   main)
AC_CHECK_LIB(BSD,      main)
AC_CHECK_LIB(gen,      main)
AC_CHECK_LIB(PW,       main)
AC_CHECK_LIB(resolv,   main)

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h unistd.h getopt.h netinet/tcp.h netinet/in.h netdb.h sys/param.h sys/types.h sys/socket.h sys/un.h sys/time.h sys/sem.h sys/shm.h sys/select.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_HEADER_TIME

dnl Checks for sockaddr_storage structure, members and necessary types
m4_include([ac_func_accept_argtypes.m4])
AC_CHECK_TYPES([struct sockaddr_storage], [], [],
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family,
                  struct sockaddr_storage.__ss_family,
                  struct sockaddr_storage.ss_len,
                  struct sockaddr_storage.__ss_len,
                  struct sockaddr.sa_len], [], [],
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])

AC_CHECK_TYPES([union semun],[],[],[#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>])

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_FUNC_WAIT3
AC_FUNC_ACCEPT_ARGTYPES
AC_CHECK_FUNCS(setsid select socket sigprocmask strdup strerror strftime strtok asprintf gai_strerror hstrerror)

dnl Checks for pg_config command.
AC_CHECK_PROGS(PGCONFIG, pg_config)

if test -z $PGCONFIG
then
  PGSQL_INCLUDE_DIR=/usr/local/pgsql/include
  PGSQL_LIB_DIR=/usr/local/pgsql/lib
else
  PGSQL_INCLUDE_DIR=`pg_config --includedir`
  PGSQL_LIB_DIR=`pg_config --libdir`
fi


AC_ARG_WITH(pgsql,
    [  --with-pgsql=DIR     site header files for PostgreSQL in DIR],
    [
	case "$withval" in
	"" | y | ye | yes | n | no)
	    AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql option.])
	  ;;
	esac
	PGSQL_INCLUDE_DIR="$withval"/include
	PGSQL_LIB_DIR="$withval"/lib
    ])

AC_ARG_WITH(pgsql-includedir,
    [  --with-pgsql-includedir=DIR     site header files for PostgreSQL in DIR],
    [
	case "$withval" in
	"" | y | ye | yes | n | no)
	    AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql-includedir option.])
	  ;;
	esac
	PGSQL_INCLUDE_DIR="$withval"
    ])

AC_ARG_WITH(pgsql-libdir,
    [  --with-pgsql-libdir=DIR     site library files for PostgreSQL in DIR],
    [
	case "$withval" in
	"" | y | ye | yes | n | no)
	    AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql-libdir option.])
	  ;;
	esac
	PGSQL_LIB_DIR="$withval"
    ])

AC_ARG_WITH(pam,
    [  --with-pam     build with PAM support],
    [AC_DEFINE([USE_PAM], 1, [Define to 1 to build with PAM support. (--with-pam)])])
if test "$with_pam" = yes ; then
   AC_CHECK_LIB(pam, pam_start, [], [AC_MSG_ERROR([library 'pam' is required for PAM])])
   AC_CHECK_HEADERS(security/pam_appl.h, [],
                    [AC_CHECK_HEADERS(pam/pam_appl.h, [],
                                      [AC_MSG_ERROR([header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM.])])])
fi

OLD_LDFLAGS="$LDFLAGS"
LDFLAGS="-L$PGSQL_LIB_DIR"
OLD_LIBS="$LIBS"
AC_CHECK_LIB(pq, PQexecPrepared, [], [AC_MSG_ERROR(libpq is not installed or libpq is old)])
AC_CHECK_FUNCS(PQprepare)
LDFLAGS="$OLD_LDFLAGS"
LIBS="$OLD_LIBS"

AC_SUBST(PGSQL_INCLUDE_DIR)
AC_SUBST(PGSQL_LIB_DIR)

# --enable(disable)-rpath option
AC_ARG_ENABLE(rpath,
    [  --disable-rpath     do not embed shared library search path in executables],
    [case "${enableval}" in
      yes) rpath=yes ;;
      no)  rpath=no ;;
      esac],
    [rpath=yes]
)
AM_CONDITIONAL([enable_rpath], test x$rpath = xyes)

AM_CONFIG_HEADER(config.h)

AC_OUTPUT([Makefile parser/Makefile pcp/Makefile])