Commit 8de003f5 8de003f5902cf5cc91163cdba69f57b88067f976 by Sergey Poznyakoff

Check for prototypes of strtok_r, strchrnul,

strndup, asprintf, vasprintf. Create auth/Makefile
1 parent 1a9f0f6a
...@@ -20,6 +20,9 @@ AC_CHECK_LIB(resolv, res_query) ...@@ -20,6 +20,9 @@ AC_CHECK_LIB(resolv, res_query)
20 20
21 MU_DEBUG_MODE 21 MU_DEBUG_MODE
22 22
23 # Initialize authlibs
24 AUTHLIBS=../auth/libmuauth.la
25
23 dnl Check for arguments 26 dnl Check for arguments
24 AC_ARG_ENABLE(pam, 27 AC_ARG_ENABLE(pam,
25 [ --disable-pam disable pam], 28 [ --disable-pam disable pam],
...@@ -196,6 +199,19 @@ jm_INCLUDED_REGEX(lib/regex.c) ...@@ -196,6 +199,19 @@ jm_INCLUDED_REGEX(lib/regex.c)
196 #AC_FUNC_MEMCMP 199 #AC_FUNC_MEMCMP
197 AC_FUNC_MMAP 200 AC_FUNC_MMAP
198 AC_FUNC_FNMATCH 201 AC_FUNC_FNMATCH
202
203 AC_CHECK_DECLS([strtok_r, strchrnul, strndup, asprintf, vasprintf] , , , [
204 #include <stdio.h>
205 #include <string.h>
206 #ifdef HAVE_STRINGS_H
207 # include <strings.h>
208 #endif])
209
210 AH_BOTTOM([
211 #if !HAVE_DECL_STRTOK_R
212 extern char *strtok_r (char *s, const char *delim, char **save_ptr);
213 #endif])
214
199 AC_REPLACE_FUNCS(fgetpwent getpass setenv snprintf strtok_r strncasecmp \ 215 AC_REPLACE_FUNCS(fgetpwent getpass setenv snprintf strtok_r strncasecmp \
200 strcasecmp strsignal vasprintf strndup strnlen strchrnul) 216 strcasecmp strsignal vasprintf strndup strnlen strchrnul)
201 AC_CHECK_FUNCS(mkstemp sigaction sysconf getdelim vsyslog setreuid \ 217 AC_CHECK_FUNCS(mkstemp sigaction sysconf getdelim vsyslog setreuid \
...@@ -252,6 +268,7 @@ AC_CHECK_FUNCS(_obstack_begin, ...@@ -252,6 +268,7 @@ AC_CHECK_FUNCS(_obstack_begin,
252 [AC_DEFINE(HAVE_OBSTACK,1,[Define if GNU obstack is present])], 268 [AC_DEFINE(HAVE_OBSTACK,1,[Define if GNU obstack is present])],
253 [AC_LIBOBJ(obstack)]) 269 [AC_LIBOBJ(obstack)])
254 270
271
255 dnl check if mysql support was added 272 dnl check if mysql support was added
256 AC_SUBST(BUILD_LIBMYSQL) 273 AC_SUBST(BUILD_LIBMYSQL)
257 AC_SUBST(MYSQLLIBS) 274 AC_SUBST(MYSQLLIBS)
...@@ -277,7 +294,7 @@ if test x"$use_virtual_domains" = x"yes"; then ...@@ -277,7 +294,7 @@ if test x"$use_virtual_domains" = x"yes"; then
277 [SITE_VIRTUAL_PWDDIR="\$(sysconfdir)/domain"]) 294 [SITE_VIRTUAL_PWDDIR="\$(sysconfdir)/domain"])
278 fi 295 fi
279 296
280 dnl Use either PAM or CRYPT, not both. 297
281 if test x"$testpam" = x"yes"; then 298 if test x"$testpam" = x"yes"; then
282 AC_CHECK_HEADERS(security/pam_appl.h) 299 AC_CHECK_HEADERS(security/pam_appl.h)
283 if test x"$ac_cv_header_security_pam_appl_h" = x"yes"; then 300 if test x"$ac_cv_header_security_pam_appl_h" = x"yes"; then
...@@ -289,12 +306,12 @@ if test x"$testpam" = x"yes"; then ...@@ -289,12 +306,12 @@ if test x"$testpam" = x"yes"; then
289 fi 306 fi
290 fi 307 fi
291 308
292 if test x"$ac_cv_have_libpam" != x"yes"; then 309 AC_CHECK_HEADERS(crypt.h)
293 AC_CHECK_FUNCS(crypt) 310 AC_CHECK_FUNCS(crypt)
294 if test x"$ac_cv_func_crypt" = x"no"; then 311 if test x"$ac_cv_func_crypt" = x"no"; then
295 AC_CHECK_LIB(crypt, crypt, AUTHLIBS="-lcrypt",, -lcrypt) 312 AC_CHECK_LIB(crypt, crypt, AUTHLIBS="$AUTHLIBS -lcrypt",, -lcrypt)
296 fi
297 fi 313 fi
314
298 AC_SUBST(AUTHLIBS) 315 AC_SUBST(AUTHLIBS)
299 AC_SUBST(AUTHINCS) 316 AC_SUBST(AUTHINCS)
300 317
...@@ -447,6 +464,7 @@ AC_CONFIG_FILES([Makefile mailutils.spec ...@@ -447,6 +464,7 @@ AC_CONFIG_FILES([Makefile mailutils.spec
447 doc/Makefile doc/man/Makefile doc/rfc/Makefile doc/texinfo/Makefile 464 doc/Makefile doc/man/Makefile doc/rfc/Makefile doc/texinfo/Makefile
448 lib/Makefile lib/posix/Makefile 465 lib/Makefile lib/posix/Makefile
449 mailbox/Makefile 466 mailbox/Makefile
467 auth/Makefile
450 imap4d/Makefile 468 imap4d/Makefile
451 mailbox/include/Makefile 469 mailbox/include/Makefile
452 from/Makefile 470 from/Makefile
......