]> granicus.if.org Git - shadow/blob - configure.in
Danish translation update
[shadow] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT
3 AM_INIT_AUTOMAKE(shadow, 4.1.5)
4 AC_CONFIG_HEADERS([config.h])
5
6 dnl Some hacks...
7 test "$prefix" = "NONE" && prefix="/usr"
8 test "$prefix" = "/usr" && exec_prefix=""
9
10 AC_GNU_SOURCE
11
12 AM_DISABLE_SHARED
13 AM_ENABLE_STATIC
14
15 AM_MAINTAINER_MODE
16
17 dnl Checks for programs.
18 AC_PROG_CC
19 AC_ISC_POSIX
20 AC_PROG_LN_S
21 AC_PROG_YACC
22 AM_C_PROTOTYPES
23 AM_PROG_LIBTOOL
24
25 dnl Checks for libraries.
26
27 dnl Checks for header files.
28 AC_HEADER_DIRENT
29 AC_HEADER_STDC
30 AC_HEADER_SYS_WAIT
31 AC_HEADER_STDBOOL
32
33 AC_CHECK_HEADERS(errno.h fcntl.h limits.h unistd.h sys/time.h utmp.h \
34         utmpx.h termios.h termio.h sgtty.h sys/ioctl.h syslog.h paths.h \
35         utime.h ulimit.h sys/resource.h gshadow.h lastlog.h \
36         locale.h rpc/key_prot.h netdb.h acl/libacl.h attr/libattr.h \
37         attr/error_context.h)
38
39 dnl shadow now uses the libc's shadow implementation
40 AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
41
42 AC_CHECK_FUNCS(l64a fchmod fchown fsync futimes getgroups gethostname getspnam \
43         gettimeofday getusershell getutent initgroups lchown lckpwdf lstat \
44         lutimes memcpy memset setgroups sigaction strchr updwtmp updwtmpx innetgr \
45         getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r getaddrinfo)
46 AC_SYS_LARGEFILE
47
48 dnl Checks for typedefs, structures, and compiler characteristics.
49 AC_C_CONST
50 AC_TYPE_UID_T
51 AC_TYPE_OFF_T
52 AC_TYPE_PID_T
53 AC_TYPE_MODE_T
54 AC_HEADER_STAT
55 AC_CHECK_MEMBERS([struct stat.st_rdev])
56 AC_CHECK_MEMBERS([struct stat.st_atim])
57 AC_CHECK_MEMBERS([struct stat.st_atimensec])
58 AC_CHECK_MEMBERS([struct stat.st_mtim])
59 AC_CHECK_MEMBERS([struct stat.st_mtimensec])
60 AC_HEADER_TIME
61 AC_STRUCT_TM
62
63 AC_CHECK_MEMBERS([struct utmp.ut_type,
64                   struct utmp.ut_id,
65                   struct utmp.ut_name,
66                   struct utmp.ut_user,
67                   struct utmp.ut_host,
68                   struct utmp.ut_syslen,
69                   struct utmp.ut_addr,
70                   struct utmp.ut_addr_v6,
71                   struct utmp.ut_time,
72                   struct utmp.ut_xtime,
73                   struct utmp.ut_tv],,,[[#include <utmp.h>]])
74 dnl There are dependencies:
75 dnl If UTMPX has to be used, the utmp structure shall have a ut_id field.
76 if test "$ac_cv_header_utmpx_h" = "yes" &&
77    test "$ac_cv_member_struct_utmp_ut_id" != "yes"; then
78         AC_MSG_ERROR(Systems with UTMPX and no ut_id field in the utmp structure are not supported)
79 fi
80
81 AC_CHECK_MEMBERS([struct utmpx.ut_name,
82                   struct utmpx.ut_host,
83                   struct utmpx.ut_syslen,
84                   struct utmpx.ut_addr,
85                   struct utmpx.ut_addr_v6,
86                   struct utmpx.ut_time,
87                   struct utmpx.ut_xtime],,,[[#include <utmpx.h>]])
88
89 if test "$ac_cv_header_lastlog_h" = "yes"; then
90         AC_CACHE_CHECK(for ll_host in struct lastlog,
91                 ac_cv_struct_lastlog_ll_host,
92                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <lastlog.h>],
93                                         [struct lastlog ll; char *cp = ll.ll_host;]
94                                 )],
95                         [ac_cv_struct_lastlog_ll_host=yes],
96                         [ac_cv_struct_lastlog_ll_host=no]
97                 )
98         )
99
100         if test "$ac_cv_struct_lastlog_ll_host" = "yes"; then
101                 AC_DEFINE(HAVE_LL_HOST, 1,
102                         [Define if struct lastlog has ll_host])
103         fi
104 fi
105
106 dnl Checks for library functions.
107 AC_TYPE_GETGROUPS
108 AC_TYPE_SIGNAL
109 AC_FUNC_UTIME_NULL
110 AC_FUNC_STRFTIME
111 AC_REPLACE_FUNCS(mkdir putgrent putpwent putspent rename rmdir)
112 AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent)
113 AC_REPLACE_FUNCS(snprintf strcasecmp strdup strerror strstr)
114
115 AC_CHECK_FUNC(setpgrp)
116
117 if test "$ac_cv_header_shadow_h" = "yes"; then
118         AC_CACHE_CHECK(for working shadow group support,
119                 ac_cv_libc_shadowgrp,
120                 AC_RUN_IFELSE([AC_LANG_SOURCE([
121                                 #include <shadow.h>
122                                 main()
123                                 {
124                                         struct sgrp *sg = sgetsgent("test:x::");
125                                         /* NYS libc on Red Hat 3.0.3 has broken shadow group support */
126                                         return !sg || !sg->sg_adm || !sg->sg_mem;
127                                 }]
128                         )],
129                         [ac_cv_libc_shadowgrp=yes],
130                         [ac_cv_libc_shadowgrp=no],
131                         [ac_cv_libc_shadowgrp=no]
132                 )
133         )
134
135         if test "$ac_cv_libc_shadowgrp" = "yes"; then
136                 AC_DEFINE(HAVE_SHADOWGRP, 1, [Have working shadow group support in libc])
137         fi
138 fi
139
140 AC_CACHE_CHECK([location of shared mail directory], shadow_cv_maildir,
141 [for shadow_cv_maildir in /var/mail /var/spool/mail /usr/spool/mail /usr/mail none; do
142         if test -d $shadow_cv_maildir; then
143                 break
144         fi
145 done])
146 if test $shadow_cv_maildir != none; then
147         AC_DEFINE_UNQUOTED(MAIL_SPOOL_DIR, "$shadow_cv_maildir",
148                 [Location of system mail spool directory.])
149 fi
150
151 AC_CACHE_CHECK([location of user mail file], shadow_cv_mailfile,
152 [for shadow_cv_mailfile in Mailbox mailbox Mail mail .mail none; do
153         if test -f $HOME/$shadow_cv_mailfile; then
154                 break
155         fi
156 done])
157 if test $shadow_cv_mailfile != none; then
158         AC_DEFINE_UNQUOTED(MAIL_SPOOL_FILE, "$shadow_cv_mailfile",
159                 [Name of user's mail spool file if stored in user's home directory.])
160 fi
161
162 AC_CACHE_CHECK([location of utmp], shadow_cv_utmpdir,
163 [for shadow_cv_utmpdir in /var/run /var/adm /usr/adm /etc none; do
164         if test -f $shadow_cv_utmpdir/utmp; then
165                 break
166         fi
167 done])
168 if test "$shadow_cv_utmpdir" = "none"; then
169         AC_MSG_WARN(utmp file not found)
170 fi
171 AC_DEFINE_UNQUOTED(_UTMP_FILE, "$shadow_cv_utmpdir/utmp",
172         [Path for utmp file.])
173
174 AC_CACHE_CHECK([location of faillog/lastlog/wtmp], shadow_cv_logdir,
175 [for shadow_cv_logdir in /var/log /var/adm /usr/adm /etc; do
176         if test -d $shadow_cv_logdir; then
177                 break
178         fi
179 done])
180 AC_DEFINE_UNQUOTED(_WTMP_FILE, "$shadow_cv_logdir/wtmp",
181         [Path for wtmp file.])
182 AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$shadow_cv_logdir/lastlog",
183         [Path for lastlog file.])
184 AC_DEFINE_UNQUOTED(FAILLOG_FILE, "$shadow_cv_logdir/faillog",
185         [Path for faillog file.])
186
187 AC_CACHE_CHECK([location of the passwd program], shadow_cv_passwd_dir,
188 [if test -f /usr/bin/passwd; then
189         shadow_cv_passwd_dir=/usr/bin
190 else
191         shadow_cv_passwd_dir=/bin
192 fi])
193 AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$shadow_cv_passwd_dir/passwd",
194         [Path to passwd program.])
195
196 dnl XXX - quick hack, should disappear before anyone notices :).
197 AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().])
198 AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.])
199 AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).])
200
201 AC_ARG_ENABLE(shadowgrp,
202         [AC_HELP_STRING([--enable-shadowgrp], [enable shadow group support @<:@default=yes@:>@])],
203         [case "${enableval}" in
204          yes) enable_shadowgrp="yes" ;;
205           no) enable_shadowgrp="no" ;;
206            *) AC_MSG_ERROR(bad value ${enableval} for --enable-shadowgrp) ;;
207          esac],
208         [enable_shadowgrp="yes"]
209 )
210
211 AC_ARG_ENABLE(man,
212         [AC_HELP_STRING([--enable-man],
213                 [regenerate roff man pages from Docbook @<:@default=no@:>@])],
214         [enable_man="${enableval}"],
215         [enable_man="no"]
216 )
217
218 AC_ARG_ENABLE(account-tools-setuid,
219         [AC_HELP_STRING([--enable-account-tools-setuid],
220                 [Install the user and group management tools setuid and authenticate the callers. This requires --with-pam.])],
221         [case "${enableval}" in
222          yes) enable_acct_tools_setuid="yes" ;;
223           no) enable_acct_tools_setuid="no" ;;
224            *) AC_MSG_ERROR(bad value ${enableval} for --enable-account-tools-setuid)
225            ;;
226          esac],
227         [enable_acct_tools_setuid="maybe"]
228 )
229
230 AC_ARG_ENABLE(utmpx,
231         [AC_HELP_STRING([--enable-utmpx],
232                         [enable loggin in utmpx / wtmpx @<:@default=no@:>@])],
233         [case "${enableval}" in
234          yes) enable_utmpx="yes" ;;
235           no) enable_utmpx="no" ;;
236            *) AC_MSG_ERROR(bad value ${enableval} for --enable-utmpx) ;;
237          esac],
238         [enable_utmpx="no"]
239 )
240
241 AC_ARG_WITH(audit, 
242         [AC_HELP_STRING([--with-audit], [use auditing support @<:@default=yes if found@:>@])],
243         [with_audit=$withval], [with_audit=maybe])
244 AC_ARG_WITH(libpam,
245         [AC_HELP_STRING([--with-libpam], [use libpam for PAM support @<:@default=yes if found@:>@])],
246         [with_libpam=$withval], [with_libpam=maybe])
247 AC_ARG_WITH(selinux,
248         [AC_HELP_STRING([--with-selinux], [use SELinux support @<:@default=yes if found@:>@])],
249         [with_selinux=$withval], [with_selinux=maybe])
250 AC_ARG_WITH(acl,
251         [AC_HELP_STRING([--with-acl], [use ACL support @<:@default=yes if found@:>@])],
252         [with_acl=$withval], [with_acl=maybe])
253 AC_ARG_WITH(attr,
254         [AC_HELP_STRING([--with-attr], [use Extended Attribute support @<:@default=yes if found@:>@])],
255         [with_attr=$withval], [with_attr=maybe])
256 AC_ARG_WITH(skey,
257         [AC_HELP_STRING([--with-skey], [use S/Key support @<:@default=no@:>@])],
258         [with_skey=$withval], [with_skey=no])
259 AC_ARG_WITH(tcb,
260         [AC_HELP_STRING([--with-tcb], [use tcb support (incomplete) @<:@default=yes if found@:>@])],
261         [with_tcb=$withval], [with_tcb=maybe])
262 AC_ARG_WITH(libcrack,
263         [AC_HELP_STRING([--with-libcrack], [use libcrack @<:@default=no@:>@])],
264         [with_libcrack=$withval], [with_libcrack=no])
265 AC_ARG_WITH(sha-crypt,
266         [AC_HELP_STRING([--with-sha-crypt], [allow the SHA256 and SHA512 password encryption algorithms @<:@default=yes@:>@])],
267         [with_sha_crypt=$withval], [with_sha_crypt=yes])
268 AC_ARG_WITH(nscd,
269         [AC_HELP_STRING([--with-nscd], [enable support for nscd @<:@default=yes@:>@])],
270         [with_nscd=$withval], [with_nscd=yes])
271 AC_ARG_WITH(group-name-max-length,
272         [AC_HELP_STRING([--with-group-name-max-length], [set max group name length @<:@default=16@:>@])],
273         [with_group_name_max_length=$withval], [with_group_name_max_length=yes])
274
275 if test "$with_group_name_max_length" = "no" ; then
276         with_group_name_max_length=0
277 elif test "$with_group_name_max_length" = "yes" ; then
278         with_group_name_max_length=16
279 fi
280 AC_DEFINE_UNQUOTED(GROUP_NAME_MAX_LENGTH, $with_group_name_max_length, [max group name length])
281 AC_SUBST(GROUP_NAME_MAX_LENGTH)
282 GROUP_NAME_MAX_LENGTH="$with_group_name_max_length"
283
284 AM_CONDITIONAL(USE_SHA_CRYPT, test "x$with_sha_crypt" = "xyes")
285 if test "$with_sha_crypt" = "yes"; then
286         AC_DEFINE(USE_SHA_CRYPT, 1, [Define to allow the SHA256 and SHA512 password encryption algorithms])
287 fi
288
289 if test "$with_nscd" = "yes"; then
290         AC_CHECK_FUNC(posix_spawn,
291                       [AC_DEFINE(USE_NSCD, 1, [Define to support flushing of nscd caches])],
292                       [AC_MSG_ERROR([posix_spawn is needed for nscd support])])
293 fi
294
295 dnl Check for some functions in libc first, only if not found check for
296 dnl other libraries.  This should prevent linking libnsl if not really
297 dnl needed (Linux glibc, Irix), but still link it if needed (Solaris).
298
299 AC_SEARCH_LIBS(inet_ntoa, inet)
300 AC_SEARCH_LIBS(socket, socket)
301 AC_SEARCH_LIBS(gethostbyname, nsl)
302
303 if test "$enable_shadowgrp" = "yes"; then
304         AC_DEFINE(SHADOWGRP, 1, [Define to support the shadow group file.])
305 fi
306 AM_CONDITIONAL(SHADOWGRP, test "x$enable_shadowgrp" = "xyes")
307
308 if test "$enable_man" = "yes"; then
309         dnl
310         dnl Check for xsltproc
311         dnl
312         AC_PATH_PROG([XSLTPROC], [xsltproc])
313         if test -z "$XSLTPROC"; then
314                 enable_man=no
315         fi
316
317         dnl check for DocBook DTD and stylesheets in the local catalog.
318         JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
319                 [DocBook XML DTD V4.1.2], [], enable_man=no)
320         JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
321                 [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
322 fi
323 AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
324
325 AC_SUBST(LIBCRYPT)
326 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT=-lcrypt],
327         [AC_MSG_ERROR([crypt() not found])])
328
329 AC_SUBST(LIBACL)
330 if test "$with_acl" != "no"; then
331         AC_CHECK_HEADERS(acl/libacl.h attr/error_context.h, [acl_header="yes"], [acl_header="no"])
332         if test "$acl_header$with_acl" = "noyes" ; then
333                 AC_MSG_ERROR([acl/libacl.h or attr/error_context.h is missing])
334         elif test "$acl_header" = "yes" ; then
335                 AC_CHECK_LIB(acl, perm_copy_file,
336                              [AC_CHECK_LIB(acl, perm_copy_fd,
337                                            [acl_lib="yes"],
338                                            [acl_lib="no"])],
339                              [acl_lib="no"])
340                 if test "$acl_lib$with_acl" = "noyes" ; then
341                         AC_MSG_ERROR([libacl not found])
342                 elif test "$acl_lib" = "no" ; then
343                         with_acl="no"
344                 else
345                         AC_DEFINE(WITH_ACL, 1,
346                                   [Build shadow with ACL support])
347                         LIBACL="-lacl"
348                         with_acl="yes"
349                 fi
350         else
351                 with_acl="no"
352         fi
353 fi
354
355 AC_SUBST(LIBATTR)
356 if test "$with_attr" != "no"; then
357         AC_CHECK_HEADERS(attr/libattr.h attr/error_context.h, [attr_header="yes"], [attr_header="no"])
358         if test "$attr_header$with_attr" = "noyes" ; then
359                 AC_MSG_ERROR([attr/libattr.h or attr/error_context.h is missing])
360         elif test "$attr_header" = "yes" ; then
361                 AC_CHECK_LIB(attr, attr_copy_file,
362                              [AC_CHECK_LIB(attr, attr_copy_fd,
363                                            [attr_lib="yes"],
364                                            [attr_lib="no"])],
365                              [attr_lib="no"])
366                 if test "$attr_lib$with_attr" = "noyes" ; then
367                         AC_MSG_ERROR([libattr not found])
368                 elif test "$attr_lib" = "no" ; then
369                         with_attr="no"
370                 else
371                         AC_DEFINE(WITH_ATTR, 1,
372                                   [Build shadow with Extended Attributes support])
373                         LIBATTR="-lattr"
374                         with_attr="yes"
375                 fi
376         else
377                 with_attr="no"
378         fi
379 fi
380
381 AC_SUBST(LIBAUDIT)
382 if test "$with_audit" != "no"; then
383         AC_CHECK_HEADER(libaudit.h, [audit_header="yes"], [audit_header="no"])
384         if test "$audit_header$with_audit" = "noyes" ; then
385                 AC_MSG_ERROR([libaudit.h is missing])
386         elif test "$audit_header" = "yes"; then
387                 AC_CHECK_DECL(AUDIT_ADD_USER,,[audit_header="no"],[#include <libaudit.h>])
388                 AC_CHECK_DECL(AUDIT_DEL_USER,,[audit_header="no"],[#include <libaudit.h>])
389                 AC_CHECK_DECL(AUDIT_ADD_GROUP,,[audit_header="no"],[#include <libaudit.h>])
390                 AC_CHECK_DECL(AUDIT_DEL_GROUP,,[audit_header="no"],[#include <libaudit.h>])
391                 if test "$audit_header$with_audit" = "noyes" ; then
392                         AC_MSG_ERROR([AUDIT_ADD_USER AUDIT_DEL_USER AUDIT_ADD_GROUP or AUDIT_DEL_GROUP missing from libaudit.h])
393                 fi
394         fi
395         if test "$audit_header" = "yes"; then
396                 AC_CHECK_LIB(audit, audit_log_acct_message,
397                              [audit_lib="yes"], [audit_lib="no"])
398                 if test "$audit_lib$with_audit" = "noyes" ; then
399                         AC_MSG_ERROR([libaudit not found])
400                 elif test "$audit_lib" = "no" ; then
401                         with_audit="no"
402                 else
403                         AC_DEFINE(WITH_AUDIT, 1,
404                                   [Define if you want to enable Audit messages])
405                         LIBAUDIT="-laudit"
406                         with_audit="yes"
407                 fi
408         else
409                 with_audit="no"
410         fi
411 fi
412
413 AC_SUBST(LIBCRACK)
414 if test "$with_libcrack" = "yes"; then
415         echo "checking cracklib flavour, don't be surprised by the results"
416         AC_CHECK_LIB(crack, FascistCheck,
417                 [LIBCRACK=-lcrack AC_DEFINE(HAVE_LIBCRACK, 1, [Defined if you have libcrack.])])
418         AC_CHECK_LIB(crack, FascistHistory,
419                 AC_DEFINE(HAVE_LIBCRACK_HIST, 1, [Defined if you have the ts&szs cracklib.]))
420         AC_CHECK_LIB(crack, FascistHistoryPw,
421                 AC_DEFINE(HAVE_LIBCRACK_PW, 1, [Defined if it includes *Pw functions.]))
422 fi
423
424 AC_SUBST(LIBSELINUX)
425 AC_SUBST(LIBSEMANAGE)
426 if test "$with_selinux" != "no"; then
427         AC_CHECK_HEADERS(selinux/selinux.h, [selinux_header="yes"], [selinux_header="no"])
428         if test "$selinux_header$with_selinux" = "noyes" ; then
429                 AC_MSG_ERROR([selinux/selinux.h is missing])
430         fi
431
432         AC_CHECK_HEADERS(semanage/semanage.h, [semanage_header="yes"], [semanage_header="no"])
433         if test "$semanage_header$with_selinux" = "noyes" ; then
434                 AC_MSG_ERROR([semanage/semanage.h is missing])
435         fi
436
437         if test "$selinux_header$semanage_header" = "yesyes" ; then
438                 AC_CHECK_LIB(selinux, is_selinux_enabled, [selinux_lib="yes"], [selinux_lib="no"])
439                 if test "$selinux_lib$with_selinux" = "noyes" ; then
440                         AC_MSG_ERROR([libselinux not found])
441                 fi
442
443                 AC_CHECK_LIB(semanage, semanage_connect, [semanage_lib="yes"], [semanage_lib="no"])
444                 if test "$semanage_lib$with_selinux" = "noyes" ; then
445                         AC_MSG_ERROR([libsemanage not found])
446                 fi
447
448                 if test "$selinux_lib$semanage_lib" == "yesyes" ; then
449                         AC_DEFINE(WITH_SELINUX, 1,
450                                   [Build shadow with SELinux support])
451                         LIBSELINUX="-lselinux"
452                         LIBSEMANAGE="-lsemanage"
453                         with_selinux="yes"
454                 else
455                         with_selinux="no"
456                 fi
457         else
458                 with_selinux="no"
459         fi
460 fi
461
462 AC_SUBST(LIBTCB)
463 if test "$with_tcb" != "no"; then
464         AC_CHECK_HEADERS(tcb.h, [tcb_header="yes"], [tcb_header="no"])
465         if test "$tcb_header$with_tcb" = "noyes" ; then
466                 AC_MSG_ERROR([tcb.h is missing])
467         elif test "$tcb_header" = "yes" ; then
468                 AC_CHECK_LIB(tcb, tcb_is_suspect, [tcb_lib="yes"], [tcb_lib="no"])
469                 if test "$tcb_lib$with_tcb" = "noyes" ; then
470                         AC_MSG_ERROR([libtcb not found])
471                 elif test "$tcb_lib" = "no" ; then
472                         with_tcb="no"
473                 else
474                         AC_DEFINE(WITH_TCB, 1, [Build shadow with tcb support (incomplete)])
475                         LIBTCB="-ltcb"
476                         with_tcb="yes"
477                 fi
478         else
479                 with_tcb="no"
480         fi
481 fi
482 AM_CONDITIONAL(WITH_TCB, test x$with_tcb = xyes)
483
484 AC_SUBST(LIBPAM)
485 if test "$with_libpam" != "no"; then
486         AC_CHECK_LIB(pam, pam_start,
487                      [pam_lib="yes"], [pam_lib="no"])
488         if test "$pam_lib$with_libpam" = "noyes" ; then
489                 AC_MSG_ERROR(libpam not found)
490         fi
491
492         LIBPAM="-lpam"
493         pam_conv_function="no"
494
495         AC_CHECK_LIB(pam, openpam_ttyconv,
496                      [pam_conv_function="openpam_ttyconv"],
497                      AC_CHECK_LIB(pam_misc, misc_conv,
498                                   [pam_conv_function="misc_conv"; LIBPAM="$LIBPAM -lpam_misc"])
499                     )
500
501         if test "$pam_conv_function$with_libpam" = "noyes" ; then
502                 AC_MSG_ERROR(PAM conversation function not found)
503         fi
504
505         pam_headers_found=no
506         AC_CHECK_HEADERS( [security/openpam.h security/pam_misc.h],
507                          [ pam_headers_found=yes ; break ], [],
508                          [ #include <security/pam_appl.h> ] )
509         if test "$pam_headers_found$with_libpam" = "noyes" ; then
510                         AC_MSG_ERROR(PAM headers not found)
511         fi
512
513
514         if test "$pam_lib$pam_headers_found" = "yesyes" -a "$pam_conv_function" != "no" ; then
515                 with_libpam="yes"
516         else
517                 with_libpam="no"
518                 unset LIBPAM
519         fi
520 fi
521 dnl Now with_libpam is either yes or no
522 if test "$with_libpam" = "yes"; then
523         AC_CHECK_DECLS([PAM_ESTABLISH_CRED,
524                         PAM_DELETE_CRED,
525                         PAM_NEW_AUTHTOK_REQD,
526                         PAM_DATA_SILENT],
527                        [], [], [#include <security/pam_appl.h>])
528
529
530         save_libs=$LIBS
531         LIBS="$LIBS $LIBPAM"
532         # We do not use AC_CHECK_FUNCS to avoid duplicated definition with
533         # Linux PAM.
534         AC_CHECK_FUNC(pam_fail_delay, [AC_DEFINE(HAS_PAM_FAIL_DELAY, 1, [Define to 1 if you have the declaration of 'pam_fail_delay'])])
535         LIBS=$save_libs
536
537         AC_DEFINE(USE_PAM, 1, [Define to support Pluggable Authentication Modules])
538         AC_DEFINE_UNQUOTED(SHADOW_PAM_CONVERSATION, [$pam_conv_function],[PAM converstation to use])
539         AM_CONDITIONAL(USE_PAM, [true])
540
541         AC_MSG_CHECKING(use login and su access checking if PAM not used)
542         AC_MSG_RESULT(no)
543 else
544         AC_DEFINE(SU_ACCESS, 1, [Define to support /etc/suauth su access control.])
545         AM_CONDITIONAL(USE_PAM, [false])
546         AC_MSG_CHECKING(use login and su access checking if PAM not used)
547         AC_MSG_RESULT(yes)
548 fi
549
550 if test "$enable_acct_tools_setuid" != "no"; then
551         if test "$with_libpam" != "yes"; then
552                 if test "$enable_acct_tools_setuid" = "yes"; then
553                         AC_MSG_ERROR(PAM support is required for --enable-account-tools-setuid)
554                 else
555                         enable_acct_tools_setuid="no"
556                 fi
557         else
558                 enable_acct_tools_setuid="yes"
559         fi
560         if test "$enable_acct_tools_setuid" = "yes"; then
561                 AC_DEFINE(ACCT_TOOLS_SETUID,
562                           1,
563                           [Define if account management tools should be installed setuid and authenticate the callers])
564         fi
565 fi
566 AM_CONDITIONAL(ACCT_TOOLS_SETUID, test "x$enable_acct_tools_setuid" = "xyes")
567
568 AC_SUBST(LIBSKEY)
569 AC_SUBST(LIBMD)
570 if test "$with_skey" = "yes"; then
571         AC_CHECK_LIB(md, MD5Init, [LIBMD=-lmd])
572         AC_CHECK_LIB(skey, skeychallenge, [LIBSKEY=-lskey],
573                 [AC_MSG_ERROR([liskey missing. You can download S/Key source code from http://rsync1.it.gentoo.org/gentoo/distfiles/skey-1.1.5.tar.bz2])])
574         AC_DEFINE(SKEY, 1, [Define to support S/Key logins.])
575         AC_TRY_COMPILE([
576                 #include <stdio.h>
577                 #include <skey.h>
578         ],[
579                 skeychallenge((void*)0, (void*)0, (void*)0, 0);
580         ],[AC_DEFINE(SKEY_BSD_STYLE, 1, [Define to support newer BSD S/Key API])])
581 fi
582
583 if test "$enable_utmpx" = "yes"; then
584         if test "$ac_cv_header_utmpx_h" != "yes"; then
585                 AC_MSG_ERROR([The utmpx.h header file is required for utmpx support.])
586         fi
587         AC_DEFINE(USE_UTMPX,
588                   1,
589                   [Define if utmpx should be used])
590 fi
591
592 AC_DEFINE_UNQUOTED(SHELL, ["$SHELL"], [The default shell.])
593
594 AM_GNU_GETTEXT_VERSION(0.16)
595 AM_GNU_GETTEXT([external], [need-ngettext])
596 AM_CONDITIONAL(USE_NLS, test "x$USE_NLS" = "xyes")
597
598 AC_CONFIG_FILES([
599         Makefile
600         po/Makefile.in
601         doc/Makefile
602         man/Makefile
603         man/config.xml
604         man/po/Makefile
605         man/cs/Makefile
606         man/de/Makefile
607         man/es/Makefile
608         man/fi/Makefile
609         man/fr/Makefile
610         man/hu/Makefile
611         man/id/Makefile
612         man/it/Makefile
613         man/ja/Makefile
614         man/ko/Makefile
615         man/pl/Makefile
616         man/pt_BR/Makefile
617         man/ru/Makefile
618         man/sv/Makefile
619         man/tr/Makefile
620         man/zh_CN/Makefile
621         man/zh_TW/Makefile
622         libmisc/Makefile
623         lib/Makefile
624         src/Makefile
625         contrib/Makefile
626         etc/Makefile
627         etc/pam.d/Makefile
628         shadow.spec
629 ])
630 AC_OUTPUT
631
632 echo
633 echo "shadow will be compiled with the following features:"
634 echo
635 echo "  auditing support:               $with_audit"
636 echo "  CrackLib support:               $with_libcrack"
637 echo "  PAM support:                    $with_libpam"
638 if test "$with_libpam" = "yes"; then
639 echo "  suid account management tools:  $enable_acct_tools_setuid"
640 fi
641 echo "  SELinux support:                $with_selinux"
642 echo "  ACL support:                    $with_acl"
643 echo "  Extended Attributes support:    $with_attr"
644 echo "  tcb support (incomplete):       $with_tcb"
645 echo "  shadow group support:           $enable_shadowgrp"
646 echo "  S/Key support:                  $with_skey"
647 echo "  SHA passwords encryption:       $with_sha_crypt"
648 echo "  nscd support:                   $with_nscd"
649 echo