summaryrefslogtreecommitdiff
path: root/configure.in
blob: 2cb747349eeba1bef982774236bd88864b362dfb (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
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT

dnl Checks for programs.
AC_PROG_CC

AM_INIT_AUTOMAKE(pgpool, 3.4.1)

AM_PROG_LEX

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/pstat.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 sockadr_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
])

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 setproctitle gai_strerror hstrerror)

PGSQL_INCLUDE_DIR=/usr/local/pgsql/include
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"
    ])

AC_SUBST(PGSQL_INCLUDE_DIR)

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

AM_CONFIG_HEADER(config.h)

AC_OUTPUT(Makefile)