File: configure.in

package info (click to toggle)
cyrus-imspd 1.8-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 3,448 kB
  • sloc: ansic: 15,708; sh: 2,200; makefile: 188
file content (270 lines) | stat: -rw-r--r-- 8,352 bytes parent folder | download | duplicates (3)
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
dnl Process this file with autoconf to produce a configure script.
dnl $Id: configure.in,v 1.24 2004/04/07 20:04:18 rjs3 Exp $

AC_INIT(imsp/imsp_server.c)
AC_CONFIG_HEADER(config.h)

AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_AIX
AC_ISC_POSIX
AC_C_CONST
AC_SYS_LONG_FILE_NAMES
if test $ac_cv_sys_long_file_names = no; then
	AC_MSG_ERROR(The Cyrus IMSPD requires support for long file names)
fi
AC_CHECK_HEADERS(unistd.h stdarg.h)
AC_REPLACE_FUNCS(memmove strcasecmp ftruncate getdtablesize getaddrinfo getnameinfo)
AC_CHECK_FUNCS(strlcat strlcpy)
AC_HEADER_DIRENT
AC_SUBST(CPPFLAGS)
AC_SUBST(PRE_SUBDIRS)
AC_SUBST(EXTRA_SUBDIRS)
AC_SUBST(DEPLIBS)
AC_FUNC_VPRINTF
dnl for et routines
AC_FUNC_CHECK(strerror,AC_DEFINE(HAS_STRERROR,[],[Do we have strerror?]))

AC_MSG_CHECKING(nonblocking method)
AC_CACHE_VAL(cyrus_cv_sys_nonblock,AC_TRY_LINK([#include <sys/types.h>
#include <sys/file.h>
#include <fcntl.h>
#ifndef	FNDELAY
#define FNDELAY		O_NDELAY
#endif],[fcntl(0, F_GETFL, 0)&FNDELAY],
cyrus_cv_sys_nonblock=fcntl,cyrus_cv_sys_nonblock=ioctl))
WITH_NONBLOCK=$cyrus_cv_sys_nonblock
AC_SUBST(WITH_NONBLOCK)
AC_MSG_RESULT($WITH_NONBLOCK)

AC_MSG_CHECKING(timezone GMT offset method)
AC_CACHE_VAL(cyrus_cv_struct_sys_gmtoff,AC_TRY_COMPILE([
#include <time.h>],[struct tm tm;
tm.tm_gmtoff = 0;
],cyrus_cv_struct_sys_gmtoff=tm,cyrus_cv_struct_sys_gmtoff=gmtime))
WITH_GMTOFF=$cyrus_cv_struct_sys_gmtoff
AC_SUBST(WITH_GMTOFF)
AC_MSG_RESULT($WITH_GMTOFF)

dnl
dnl check for -R, etc. switch
dnl
CMU_GUESS_RUNPATH_SWITCH
dnl let's just link against local.  otherwise we never find anything useful.
CPPFLAGS="-I/usr/local/include ${CPPFLAGS}"
CMU_ADD_LIBPATH("/usr/local/lib")

dnl
dnl  Get ready to use DB
dnl

AC_CHECK_FUNC(dbopen, [AC_DEFINE(HAVE_LIBDB,[],[Berkeley DB?])
                       use_db=1], 
  AC_CHECK_LIB(db,dbopen,[AC_DEFINE(HAVE_LIBDB,[],[Berkeley DB?])
                          LIBS=" -ldb ${LIBS}"
                          use_db=1]))
dnl if db_185.h is present, we're using db2 or 3 and should include db_185.h
dnl instead of db.h; otherwise, include db.h.  this is handled in the code
dnl itself.
AC_CHECK_HEADER(db_185.h, [AC_DEFINE(HAVE_DB_185_H,[],[DB 185 h?])
                           AC_DEFINE(HAVE_LIBDB,[],[Berkeley DB?])
                           LIBS="-ldb ${LIBS}"
                           use_db=1])

if test -z "use_db"; then
  AC_CHECK_LIB(ndbm, dbm_open)
  AC_CHECK_LIB(dbm, dbm_open)
fi

dnl
dnl  Random other libraries
dnl

AC_CHECK_LIB(socket, accept, LIBS="${LIBS} -lsocket -lnsl",,-lnsl)
AC_CHECK_LIB(resolv, res_search)

dnl
dnl  Do the checks for SASL
dnl

AC_CHECK_FUNC(dlopen,,AC_CHECK_LIB(dl,dlopen))
CMU_SASL2_REQUIRED
LIBS="${LIB_SASL} ${LIBS}"



dnl
dnl  Stuff that takes configure command-line arguments
dnl

AC_ARG_WITH(ldap,[  --with-ldap=LIBRARY     use LDAP address book features
                          LIBRARY is the name of your LDAP library],
	[if test "$with_ldap" = "yes"; then
		AC_MSG_ERROR(Must provide a library name for --with-ldap)
	fi
	if test "$with_ldap" != "no"; then
		AC_CHECK_LIB("$with_ldap", ldap_init,
			[AC_DEFINE(HAVE_LDAP,[],[Do we have ldap support?])
			HAVE_LDAP_OBJS="abook_ldap.o"
			LIBS="-l$with_ldap -llber -lssl -lcrypto $LIBS"],
			AC_MSG_ERROR(LDAP library does not provide ldap_init),
			-llber -lssl -lcrypto)
	fi],
	AC_SEARCH_LIBS(ldap_init, [ldap10 ldap], 
		[AC_DEFINE(HAVE_LDAP)
		 HAVE_LDAP_OBJS="abook_ldap.o"],
		-llber -lssl -lcrypto))
AC_SUBST(HAVE_LDAP_OBJS)

AC_ARG_WITH(lock,[  --with-lock=METHOD      force use of METHOD for locking (flock or fcntl)],
  WITH_LOCK="$withval", [
  AC_CHECK_FUNC(fcntl,WITH_LOCK="fcntl",[
		AC_CHECK_FUNC(flock,WITH_LOCK="flock",[
				AC_ERROR(unable to detect locking method)
			      ])
		])
  ])
AC_SUBST(WITH_LOCK)

AC_ARG_WITH(login,,AC_ERROR([--with-login is no longer supported.
Configure SASL appropriately instead.]))

AC_ARG_WITH(auth,[  --with-auth=METHOD      use authorization module METHOD
                          METHOD is unix, krb, or krb_pts],
	WITH_AUTH="$withval",
	if test -f /etc/krb.conf -o -f /etc/kerberosIV/krb.conf ; then
		WITH_AUTH="krb"
	else
		WITH_AUTH="unix"
	fi)
AC_SUBST(WITH_AUTH)

dnl this is the new simple check for kerberos; since the person had to
dnl compile SASL, we might as well use the same checks.
AC_ARG_WITH(krb,[  --with-krb=PATH         use Kerberos from PATH],
	with_krb="$withval", with_krb="yes")

if test "$WITH_AUTH" = "krb" -o "$WITH_AUTH" = "krb_pts" ; then
  dnl In order to compile kerberos4, we need libkrb and libdes.

  dnl we might need -lresolv for kerberos
  AC_CHECK_LIB(resolv,res_search)

  dnl Do we need DES for kerberos?
  AC_ARG_WITH(krbdes,[  --with-krbdes           use Kerberos DES implementation [[yes]]],
        with_krbdes="$withval", with_krbdes="yes")
  if test "$with_krbdes" = "yes"; then
    AC_CHECK_LIB(des,des_ecb_encrypt, LIBS="${LIBS} -ldes",
      AC_MSG_ERROR([The Kerberos DES library is required for Kerberos support.]))
  fi

  dnl if we were ambitious, we'd look more aggressively for the
  dnl krb4 install
  if test -d ${with_krb}; then
     AC_CACHE_CHECK(for Kerberos includes, cyrus_krbinclude, [
       for krbhloc in include/kerberosIV include
       do
         if test -f ${with_krb}/${krbhloc}/krb.h ; then
           cyrus_krbinclude=${with_krb}/${krbhloc}
           break
         fi
       done
       ])

     if test -n "${cyrus_krbinclude}"; then
       CPPFLAGS="$CPPFLAGS -I${cyrus_krbinclude}"
     fi
     LDFLAGS="$LDFLAGS -L${with_krb}/lib"
  fi

  AC_CHECK_HEADER(krb.h,
    AC_CHECK_LIB(krb, krb_mk_priv,,
                 AC_WARN(No Kerberos V4 found); krb4=no),
    AC_WARN(No Kerberos V4 found); krb4=no)

  if test "${krb4}" != no; then
    AC_DEFINE(HAVE_KRB, [], [Do we have kerberos support?])
  else
    AC_ERROR([Kerberos not found for authorization module])
  fi
fi

AC_ARG_WITH(afs,[  --with-afs=PATH         use AFS libraries from PATH],
	[with_afs="${withval}"
	CFLAGS="${CFLAGS} -I${withval}/include"],with_afs="/usr/local")

if test "$WITH_AUTH" = "krb_pts" ; then
	EXTRA_SUBDIRS="${EXTRA_SUBDIRS} ptclient"
	EXTRA_OUTPUT="${EXTRA_OUTPUT} ptclient/Makefile"
	AFS_LIBS="${with_afs}/lib/afs/libkauth.a ${with_afs}/lib/afs/libprot.a  ${with_afs}/lib/afs/libauth.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/librxkad.a ${with_afs}/lib/librx.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/libubik.a  ${with_afs}/lib/liblwp.a ${with_afs}/lib/afs/util.a"
	if test -f ${with_afs}/lib/afs/libaudit.a; then
		AFS_LIBS="$AFS_LIBS ${with_afs}/lib/afs/libaudit.a"
	fi
	if test -f /usr/ucblib/libucb.a; then
		CMU_ADD_LIBPATH_TO(/usr/ucblib, AFS_LDFLAGS)
		AFS_LIBS="$AFS_LIBS -lc -lucb"
	fi

	AC_CACHE_VAL(cyrus_afs_pr_end,[
		SAVE_LIBS="$LIBS"
		LIBS="$AFS_LIBS"
		AC_MSG_CHECKING(if AFS libraries have pr_End)
		AC_TRY_LINK([pr_End();],
			[pr_End()],
			[
				dnl it linked; have it
				AC_MSG_RESULT(yes)
				cyrus_afs_pr_end="yes"
			], [
				dnl didn't link; use old code
				AC_MSG_RESULT(no)
				cyrus_afs_pr_end="no"
			])
		])
	LIBS="$SAVE_LIBS"
	if test "$cyrus_afs_pr_end" = no; then
		AC_DEFINE(HAVE_PR_END)
	fi
	AC_CACHE_VAL(cyrus_afs_sigvec,[
		SAVE_LIBS="$LIBS"
		LIBS="${with_afs}/lib/liblwp.a"
		AC_MSG_CHECKING(if AFS libraries need sigvec)
		dnl Does AFS need sigvec?  We have to link against lwp and see
		dnl if IOMGR_Initialize wants it
		AC_TRY_LINK([IOMGR_Initialize();],
			[IOMGR_Initialize()],
			[
				dnl it linked; don't need it
				AC_MSG_RESULT(no)
				cyrus_afs_sigvec="no"
			], [
				dnl didn't link; pick up sigvec
				AC_MSG_RESULT(yes)
				cyrus_afs_sigvec="yes"
			])
		])
	if test "$cyrus_afs_sigvec" = yes; then
	  if test "$cant_find_sigvec" = yes; then
            AC_MSG_WARN([Can't find a sigvec for AFS libraries which seem to])
	    AC_MSG_WARN([need one; ptloader may not build.])
          else
	    AFS_LIBS="${AFS_LIBS} $cyrus_sigveclib"
	  fi
	fi
	LIBS="$SAVE_LIBS"
	AC_SUBST(AFS_LIBS)
	AC_SUBST(AFS_LDFLAGS)

   AC_ARG_WITH(statedir,
	[  --with-statedir=DIR     use DIR as state directory for ptclient,
                          only needed when using krb_pts for authorization],
        statedir="$withval",statedir="/var")
   AC_DEFINE_UNQUOTED(STATEDIR,"$statedir",[ptclient state directory?])
fi


AC_SUBST(EXTRA_SUBDIRS)
AC_OUTPUT(Makefile ptclient/Makefile lib/Makefile imsp/Makefile)