]> jfr.im git - irc/evilnet/mod.auth.git/blob - configure.ac
Various fixes for mod.auth...
[irc/evilnet/mod.auth.git] / configure.ac
1 dnl $Id$
2 dnl ----------------------------------------------------------
3
4 echo Configuring mod.auth...
5 echo
6
7 AC_REVISION($Revision$)
8 AC_INIT
9 AC_CONFIG_SRCDIR([auth.cc])
10 AM_INIT_AUTOMAKE(auth,1.0)
11 AC_CONFIG_HEADERS(defs_auth.h)
12
13 AC_DISABLE_STATIC
14 AC_ENABLE_SHARED
15
16 AC_PROG_INSTALL
17
18 dnl Substitute INCLTDL and LIBLTDL in the Makefiles
19 dnl For some reason, INCLTDL and LIBLTDL aren't set
20 dnl properly on OpenBSD
21 LIBLTDL="$srcdir/../libltdl/libltdlc.la"
22
23 AM_MAINTAINER_MODE
24 AC_ISC_POSIX
25 AC_PREFIX_DEFAULT(`pwd`/..)
26
27 dnl Check for dlopen support
28 AC_LIBTOOL_DLOPEN
29
30 dnl Configure libtool
31 AM_PROG_LIBTOOL
32
33 CXXFLAGS="-W -Wall -pipe -I$srcdir/../libltdl -I$srcdir/../include"
34 CXXFLAGS="$CXXFLAGS -I$srcdir/../libgnuworld"
35 CFLAGS="$CXXFLAGS"
36
37 AC_PROG_CC
38 AC_PROG_CXX
39 AC_PROG_CPP
40 AC_LANG([C++])
41
42 AC_PROG_MAKE_SET(gmake)
43
44 dnl ----------------------------------------------------------
45 dnl
46 dnl Checking for headers, functions, and a type declarations
47 dnl
48
49 AC_CHECK_HEADERS(sys/file.h unistd.h sys/stat.h sys/ioctl.h sys/resource.h )
50 AC_CHECK_HEADERS(sys/time.h asm/ioctls.h xti_inet.h sys/filio.h getopt.h)
51 AC_CHECK_HEADERS(sys/types.h sys/socket.h netinet/in.h sys/un.h pthread.h)
52
53 AC_HEADER_STDC
54 AC_HEADER_TIME
55 AC_TYPE_SIGNAL
56 AC_TYPE_MODE_T
57 AC_TYPE_PID_T
58 AC_TYPE_SIZE_T
59 AC_TYPE_UID_T
60
61 AC_ARG_WITH(debug,
62 AC_HELP_STRING([--without-debug],
63 [Disable debugging in the executables]),
64 [dummy=true],
65 [CXXFLAGS="$CXXFLAGS -g"]
66 )
67
68 AC_ARG_WITH(pedantic,
69 AC_HELP_STRING([--with-pedantic],
70 [Add -pedantic to compile options]),
71 [CXXFLAGS="$CXXFLAGS -pedantic"]
72 )
73
74 AC_ARG_WITH(optimization,
75 AC_HELP_STRING([--with-optimization],
76 [Optimize the executables]),
77 [CXXFLAGS="$CXXFLAGS -O2"],
78 [CXXFLAGS="$CXXFLAGS -O0"]
79 )
80
81 AC_ARG_WITH(prof,
82 AC_HELP_STRING([--with-prof],
83 [Generate profiling information]),
84 [CXXFLAGS="$CXXFLAGS -pg"]
85 )
86
87 check_pgsql=yes
88 AC_ARG_WITH(pgsql,
89 AC_HELP_STRING([--without-pgsql],
90 [Do not check for pgsql. This will cause \
91 several modules to be uncompilable]),
92 [check_pgsql=$withval]
93 )
94
95 PGSQL_LIB=/usr/local/pgsql/lib
96 AC_ARG_WITH(pgsql-lib,
97 AC_HELP_STRING([--with-pgsql-lib=PGSQLLIBDIR],
98 [Specify location to find libpq++.so, default is \
99 /usr/local/pgsql/lib]),
100 [PGSQL_LIB=$withval]
101 )
102 dnl echo PGSQL_LIB: $PGSQL_LIB
103
104 PGSQL_INCLUDE=/usr/local/pgsql/include
105 AC_ARG_WITH(pgsql-include,
106 AC_HELP_STRING([--with-pgsql-include=PGSQLINCLUDEDIR],
107 [Specify location to find libpq++.h, default is \
108 /usr/local/pgsql/include]),
109 [PGSQL_INCLUDE=$withval]
110 )
111 dnl echo PGSQL_INCLUDE: $PGSQL_INCLUDE
112
113 if [test $check_pgsql = "yes" ]; then
114 AC_MSG_CHECKING(for libpq++.h)
115 if [test -f "$PGSQL_INCLUDE/libpq++.h"]; then
116 /bin/true
117 elif [test -f "/usr/local/include/libpq++.h"]; then
118 PGSQL_INCLUDE=/usr/local/include
119 elif [test -f "/usr/include/postgresql/libpq++.h"]; then
120 PGSQL_INCLUDE=/usr/include/postgresql
121 elif [test -f "/usr/include/pgsql/libpq++.h"]; then
122 PGSQL_INCLUDE=/usr/include/pgsql
123 elif [test -f "/usr/include/libpq++.h"]; then
124 PGSQL_INCLUDE=/usr/include
125 else
126 AC_MSG_ERROR( Unable to find libpq++.h )
127 fi
128 AC_MSG_RESULT(yes)
129 fi
130
131 if [test $check_pgsql = "yes" ]; then
132 AC_MSG_CHECKING(for libpq++.so)
133 if [test -f "$PGSQL_LIB/libpq++.so"]; then
134 /bin/true
135 elif [test -f "/usr/local/lib/libpq++.so"]; then
136 PGSQL_LIB=/usr/local/lib
137 elif [test -f "/usr/lib/libpq++.so"]; then
138 PGSQL_LIB=/usr/lib
139 elif [test -f "/usr/lib/postgresql/libpq++.so"]; then
140 PGSQL_LIB=/usr/lib/postgresql
141 elif [test -f "/usr/lib/pgsql/libpq++.so"]; then
142 PGSQL_LIB=/usr/lib/pgsql
143 elif [test -f "/usr/local/pgsql/lib/libpq++.so"]; then
144 PGSQL_LIB=/usr/local/pgsql/lib
145 elif [test -f "/usr/local/postgresql/lib/libpq++.so"]; then
146 PGSQL_LIB=/usr/local/postgresql/lib
147 else
148 AC_MSG_ERROR( Unable to find libpq++.so)
149 fi
150 AC_MSG_RESULT(yes)
151 fi
152
153 dnl echo "PGSQL_INCLUDE: $PGSQL_INCLUDE"
154 dnl echo "PGSQL_LIB: $PGSQL_LIB"
155 dnl exit
156
157 LIBGNUWORLD="../libgnuworld/libgnuworld.la"
158 AC_SUBST(LIBGNUWORLD)
159
160 AC_SUBST(CXXFLAGS)
161 AC_SUBST(INCLTDL)
162 AC_SUBST(LIBLTDL)
163 AC_SUBST(PGSQL_INCLUDE)
164 AC_SUBST(PGSQL_LIB)
165
166 AC_CONFIG_FILES([Makefile \
167 auth.example.conf])
168
169 AC_OUTPUT