spec: change license name "BSD-3-Clause" to "BSD-2.0"
[platform/upstream/pam.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT
3 AC_CONFIG_SRCDIR([conf/pam_conv1/pam_conv_y.y])
4 AC_CONFIG_AUX_DIR([build-aux])
5 AM_INIT_AUTOMAKE("Linux-PAM", 1.1.6)
6 AC_PREREQ(2.61)
7 AC_CONFIG_HEADERS([config.h])
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_CANONICAL_HOST
10
11 AC_SUBST(PACKAGE)
12 AC_SUBST(VERSION)
13
14 dnl
15 dnl By default, everything under PAM is installed below /usr.
16 dnl
17 AC_PREFIX_DEFAULT(/usr)
18
19 dnl and some hacks to use /etc and /lib
20 test "${prefix}" = "NONE" && prefix="/usr"
21 if test ${prefix} = '/usr'
22 then
23 dnl If we use /usr as prefix, use /etc for config files
24         if test ${sysconfdir} = '${prefix}/etc'
25         then
26                 sysconfdir="/etc"
27         fi
28         if test ${libdir} = '${exec_prefix}/lib'
29         then
30                 case "`uname -m`" in
31                     x86_64|ppc64|s390x|sparc64)
32                         libdir="/lib64" ;;
33                     *)
34                         libdir="/lib" ;;
35                 esac
36         fi
37         if test ${sbindir} = '${exec_prefix}/sbin'
38         then
39                 sbindir="/sbin"
40         fi
41 dnl If we use /usr as prefix, use /usr/share/man for manual pages
42         if test ${mandir} = '${prefix}/man'
43         then
44                 mandir='${prefix}/share/man'
45         fi
46 dnl Add security to include directory
47         if test ${includedir} = '${prefix}/include'
48         then
49                 includedir="${prefix}/include/security"
50         fi
51
52 dnl Add /var directory
53         if test ${localstatedir} = '${prefix}/var'
54         then
55                 localstatedir="/var"
56         fi
57
58 fi
59
60 dnl
61 dnl check if we should link everything static into libpam
62 dnl
63 AC_ARG_ENABLE(static-modules,AS_HELP_STRING([--enable-static-modules],
64         [do not make the modules dynamically loadable]),
65         STATIC_MODULES=$enableval,STATIC_MODULES=no)
66 if test "$STATIC_MODULES" != "no" ; then
67         CFLAGS="$CFLAGS -DPAM_STATIC"
68         AC_ENABLE_STATIC([yes])
69         AC_ENABLE_SHARED([no])
70 else
71 # per default don't build static libraries
72         AC_ENABLE_STATIC([no])
73         AC_ENABLE_SHARED([yes])
74 fi
75 AM_CONDITIONAL([STATIC_MODULES], [test "$STATIC_MODULES" != "no"])
76
77 dnl Checks for programs.
78 AC_USE_SYSTEM_EXTENSIONS
79 AC_PROG_CC
80 AC_PROG_YACC
81 AM_PROG_LEX
82 AC_PROG_INSTALL
83 AC_PROG_LN_S
84 AC_PROG_MAKE_SET
85 AC_PROG_LIBTOOL
86 AM_PROG_CC_C_O
87 PAM_LD_AS_NEEDED
88 PAM_LD_NO_UNDEFINED
89 PAM_LD_O1
90
91 dnl Largefile support
92 AC_SYS_LARGEFILE
93
94 dnl icc claims to be GCC compatible, but use other flags for warnings
95 if eval "test x$GCC = xyes -a $CC != icc"; then
96   for flag in \
97       -W \
98       -Wall \
99       -Wbad-function-cast \
100       -Wcast-align \
101       -Wcast-qual \
102       -Wmissing-declarations \
103       -Wmissing-prototypes \
104       -Wpointer-arith \
105       -Wreturn-type \
106       -Wstrict-prototypes \
107       -Wwrite-strings \
108       -Winline \
109       -Wshadow
110   do
111     JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
112   done
113 fi
114 dnl icc has special warning flags
115 if eval "test x$CC = xicc"; then
116   for flag in \
117       -Wall \
118       -Wmissing-prototypes \
119       -Wpointer-arith \
120       -Wreturn-type \
121       -Wstrict-prototypes \
122       -Wwrite-strings \
123       -Wshadow \
124       -Wp64 \
125       -Wdeprecated \
126       -Wuninitialized \
127       -Wmain
128   do
129     JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
130   done
131 fi
132
133 if test "x${CC_FOR_BUILD+set}" != "xset" ; then
134   if test "x$cross_compiling" = "xyes" ; then
135     AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
136   else
137     CC_FOR_BUILD=${CC}
138   fi
139 fi
140 AC_MSG_CHECKING([for CC_FOR_BUILD])
141 AC_MSG_RESULT([$CC_FOR_BUILD])
142 AC_SUBST(CC_FOR_BUILD)
143
144 if test "x${BUILD_CFLAGS+set}" != "xset" ; then
145   if test "x$cross_compiling" = "xyes" ; then
146     BUILD_CFLAGS=
147   else
148     BUILD_CFLAGS=${CFLAGS}
149   fi
150 fi
151 AC_SUBST(BUILD_CFLAGS)
152
153 if test "x${BUILD_LDFLAGS+set}" != "xset" ; then
154   if test "x$cross_compiling" = "xyes" ; then
155     BUILD_LDFLAGS=
156   else
157     BUILD_LDFLAGS=${LDFLAGS}
158   fi
159 fi
160 AC_SUBST(BUILD_LDFLAGS)
161
162 AC_C___ATTRIBUTE__
163
164 dnl
165 dnl Check if --version-script is supported by ld
166 dnl
167 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
168 [cat > conftest.s <<EOF
169 ${libc_cv_dot_text}
170 _sym:
171 .symver _sym,sym@VERS
172 EOF
173 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
174   libc_cv_asm_symver_directive=yes
175 else
176   libc_cv_asm_symver_directive=no
177 fi
178 rm -f conftest*])
179 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
180 if test $libc_cv_asm_symver_directive = yes; then
181   cat > conftest.s <<EOF
182 ${libc_cv_dot_text}
183 _sym:
184 .symver _sym,sym@VERS
185 EOF
186   cat > conftest.map <<EOF
187 VERS_1 {
188         global: sym;
189 };
190
191 VERS_2 {
192         global: sym;
193 } VERS_1;
194 EOF
195   if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
196 then
197     if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
198                                 -o conftest.so conftest.o
199                                 -nostartfiles -nostdlib
200                                 -Wl,--version-script,conftest.map
201                        1>&AS_MESSAGE_LOG_FD]);
202     then
203       libc_cv_ld_version_script_option=yes
204     else
205       libc_cv_ld_version_script_option=no
206     fi
207   else
208     libc_cv_ld_version_script_option=no
209   fi
210 else
211   libc_cv_ld_version_script_option=no
212 fi
213 rm -f conftest*])
214 AM_CONDITIONAL([HAVE_VERSIONING],
215         [test "$libc_cv_ld_version_script_option" = "yes"])
216
217 dnl
218 dnl check for -fPIE/-pie support
219 dnl
220 dnl icc handles -fpie as -fp without error, so blacklist icc
221 dnl
222 AC_ARG_ENABLE(pie,AS_HELP_STRING([--disable-pie],
223                         [disable position-independent executeables (PIE)]),
224         USE_PIE=$enableval, USE_PIE=yes)
225
226 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
227   cat > conftest.c <<EOF
228 int foo;
229 main () { return 0;}
230 EOF
231   if test "$USE_PIE" = "yes" -a "$CC" != "icc" &&
232         AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
233                               -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
234   then
235     libc_cv_fpie=yes
236     PIE_CFLAGS="-fpie"
237     PIE_LDFLAGS="-pie"
238   else
239     libc_cv_fpie=no
240     PIE_CFLAGS=""
241     PIE_LDFLAGS=""
242   fi
243   rm -f conftest*])
244 AC_SUBST(libc_cv_fpie)
245 AC_SUBST(PIE_CFLAGS)
246 AC_SUBST(PIE_LDFLAGS)
247
248
249 dnl
250 dnl options and defaults
251 dnl
252
253 AC_ARG_ENABLE([prelude],
254         AS_HELP_STRING([--disable-prelude],[do not use prelude]),
255         WITH_PRELUDE=$enableval, WITH_PRELUDE=yes)
256 if test "$WITH_PRELUDE" == "yes" ; then
257   AM_PATH_LIBPRELUDE([0.9.0])
258   if test "$LIBPRELUDE_CONFIG" != "no" ; then
259     LIBPRELUDE_CFLAGS="$LIBPRELUDE_CFLAGS -DPRELUDE=1"
260   fi
261 fi
262
263 dnl lots of debugging information goes to /var/run/pam-debug.log
264 AC_ARG_ENABLE([debug],
265     AS_HELP_STRING([--enable-debug],[specify you are building with debugging on]))
266
267 if test x"$enable_debug" = x"yes" ; then
268    AC_DEFINE([PAM_DEBUG],,
269                 [lots of stuff gets written to /var/run/pam-debug.log])
270 fi
271
272 AC_ARG_ENABLE(securedir,
273         AS_HELP_STRING([--enable-securedir=DIR],[path to location of PAMs @<:@default=$libdir/security@:>@]),
274         SECUREDIR=$enableval, SECUREDIR=$libdir/security)
275 AC_SUBST(SECUREDIR)
276
277 AC_ARG_ENABLE([isadir],
278         AS_HELP_STRING([--enable-isadir=DIR],[path to arch-specific module files @<:@default=../../(basename of $libdir)/security@:>@]),
279 ISA=$enableval,
280 ISA=../../`basename $libdir`/security)
281 unset mylibdirbase
282 AC_DEFINE_UNQUOTED(_PAM_ISA,"$ISA",[Define to the path, relative to SECUREDIR, where PAMs specific to this architecture can be found.])
283 AC_MSG_RESULT([Defining \$ISA to "$ISA"])
284
285 AC_ARG_ENABLE(sconfigdir,
286         AS_HELP_STRING([--enable-sconfigdir=DIR],[path to module conf files @<:@default=$sysconfdir/security@:>@]),
287         SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
288 AC_SUBST(SCONFIGDIR)
289
290 AC_ARG_ENABLE(pamlocking,
291         AS_HELP_STRING([--enable-pamlocking],[configure libpam to observe a global authentication lock]))
292
293 if test x"$enable_pamlocking" = "xyes"; then
294    AC_DEFINE([PAM_LOCKING],,
295         [libpam should observe a global authentication lock])
296 fi
297
298 AC_ARG_ENABLE(read-both-confs,
299         AS_HELP_STRING([--enable-read-both-confs],[read both /etc/pam.d and /etc/pam.conf files]))
300
301 if test x"$enable_read_both_confs" = "xyes"; then
302    AC_DEFINE([PAM_READ_BOTH_CONFS],,
303                 [read both /etc/pam.d and /etc/pam.conf files])
304 fi
305
306 AC_ARG_ENABLE([lckpwdf],
307         AS_HELP_STRING([--disable-lckpwdf],[do not use the lckpwdf function]),
308         WITH_LCKPWDF=$enableval, WITH_LCKPWDF=yes)
309 if test "$WITH_LCKPWDF" == "yes" ; then
310     AC_DEFINE([USE_LCKPWDF], 1,
311                 [Define to 1 if the lckpwdf function should be used])
312 fi
313
314 AC_CHECK_HEADERS(paths.h)
315 AC_ARG_WITH(mailspool,
316 [  --with-mailspool        path to mail spool directory
317                           [default _PATH_MAILDIR if defined in paths.h, otherwise /var/spool/mail]],
318 with_mailspool=${withval})
319 if test x$with_mailspool != x ; then
320         pam_mail_spool="\"$with_mailspool\""
321 else
322         AC_RUN_IFELSE([AC_LANG_SOURCE([[
323 #include <paths.h>
324 int main() {
325 #ifdef _PATH_MAILDIR
326 exit(0);
327 #else
328 exit(1);
329 #endif
330 }]])],[pam_mail_spool="_PATH_MAILDIR"],[pam_mail_spool="\"/var/spool/mail\""],[pam_mail_spool="\"/var/spool/mail\""])
331 fi
332 AC_DEFINE_UNQUOTED(PAM_PATH_MAILDIR, $pam_mail_spool,
333         [Path where mails are stored])
334
335 AC_ARG_WITH(xauth,
336 [  --with-xauth            additional path to check for xauth when it is called from pam_xauth
337                           [added to the default of /usr/X11R6/bin/xauth, /usr/bin/xauth, /usr/bin/X11/xauth]],
338 pam_xauth_path=${withval})
339 if test x$with_xauth == x ; then
340         AC_PATH_PROG(pam_xauth_path, xauth)
341 dnl There is no sense in adding the first default path
342         if test x$pam_xauth_path == x/usr/X11R6/bin/xauth ; then
343                 unset pam_xauth_path
344         fi
345 fi
346
347 if test x$pam_xauth_path != x ; then
348         AC_DEFINE_UNQUOTED(PAM_PATH_XAUTH, "$pam_xauth_path",
349         [Additional path of xauth executable])
350 fi
351
352 dnl Checks for the existence of libdl - on BSD and Tru64 its part of libc
353 AC_CHECK_LIB([dl], [dlopen], LIBDL="-ldl", LIBDL="")
354 AC_SUBST(LIBDL)
355
356 # Check for cracklib
357 AC_ARG_ENABLE([cracklib],
358         AS_HELP_STRING([--disable-cracklib],[do not use cracklib]),
359         WITH_CRACKLIB=$enableval, WITH_CRACKLIB=yes)
360 if test x"$WITH_CRACKLIB" != xno ; then
361         AC_CHECK_HEADERS([crack.h],
362               AC_CHECK_LIB([crack], [FascistCheck], LIBCRACK="-lcrack", LIBCRACK=""))
363 else
364         LIBCRACK=""
365 fi
366 if test -n "$LIBCRACK"; then
367         AC_DEFINE([HAVE_LIBCRACK], [1], [Define to 1 if you have cracklib.])
368 fi
369 AC_SUBST(LIBCRACK)
370 AM_CONDITIONAL([HAVE_LIBCRACK], [test -n "$LIBCRACK"])
371
372 dnl Look for Linux Auditing library - see documentation
373 AC_ARG_ENABLE([audit],
374         AS_HELP_STRING([--disable-audit],[do not enable audit support]),
375         WITH_LIBAUDIT=$enableval, WITH_LIBAUDIT=yes)
376 if test x"$WITH_LIBAUDIT" != xno ; then
377         AC_CHECK_HEADER([libaudit.h],
378               [AC_CHECK_LIB(audit, audit_log_acct_message, LIBAUDIT=-laudit, LIBAUDIT="")
379                AC_CHECK_TYPE([struct audit_tty_status],
380                              [HAVE_AUDIT_TTY_STATUS=yes],
381                              [HAVE_AUDIT_TTY_STATUS=""],
382                              [#include <libaudit.h>])]
383         )
384         if test ! -z "$LIBAUDIT" -a "$ac_cv_header_libaudit_h" != "no" ; then
385             AC_DEFINE([HAVE_LIBAUDIT], 1, [Define to 1 if audit support should be compiled in.])
386         fi
387         if test ! -z "$HAVE_AUDIT_TTY_STATUS" ; then
388             AC_DEFINE([HAVE_AUDIT_TTY_STATUS], 1, [Define to 1 if struct audit_tty_status exists.])
389         fi
390 else
391         LIBAUDIT=""
392 fi
393 AC_SUBST(LIBAUDIT)
394 AM_CONDITIONAL([HAVE_AUDIT_TTY_STATUS],
395                [test "x$HAVE_AUDIT_TTY_STATUS" = xyes])
396
397 AC_CHECK_HEADERS(xcrypt.h crypt.h)
398 AS_IF([test "x$ac_cv_header_xcrypt_h" = "xyes"],
399   [crypt_libs="xcrypt crypt"],
400   [crypt_libs="crypt"])
401
402 BACKUP_LIBS=$LIBS
403 AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
404 AC_CHECK_FUNCS(crypt_r crypt_gensalt_r)
405 LIBS=$BACKUP_LIBS
406 AC_SUBST(LIBCRYPT)
407 if test "$LIBCRYPT" = "-lxcrypt" -a "$ac_cv_header_xcrypt_h" = "yes" ; then
408         AC_DEFINE([HAVE_LIBXCRYPT], 1, [Define to 1 if xcrypt support should be compiled in.])
409 fi
410
411 AC_ARG_WITH([randomdev], AS_HELP_STRING([--with-randomdev=(<path>|yes|no)],[use specified random device instead of /dev/urandom or 'no' to disable]), opt_randomdev=$withval)
412 if test "$opt_randomdev" = yes -o -z "$opt_randomdev"; then
413        opt_randomdev="/dev/urandom"
414 elif test "$opt_randomdev" = no; then
415        opt_randomdev=
416 fi
417 if test -n "$opt_randomdev"; then
418        AC_DEFINE_UNQUOTED(PAM_PATH_RANDOMDEV, "$opt_randomdev", [Random device path.])
419 fi
420
421 dnl check for libdb or libndbm as fallback. Some libndbm compat
422 dnl libraries are unuseable, so try libdb first.
423 AC_ARG_ENABLE([db],
424         AS_HELP_STRING([--enable-db=(db|ndbm|yes|no)],[Default behavior 'yes', which is to check for libdb first, followed by ndbm. Use 'no' to disable db support.]),
425         WITH_DB=$enableval, WITH_DB=yes)
426 AC_ARG_WITH([db-uniquename],
427         AS_HELP_STRING([--with-db-uniquename=extension],[Unique name for db libraries and functions.]))
428 if test x"$WITH_DB" != xno ; then
429         if test x"$WITH_DB" = xyes -o x"$WITH_DB" = xdb ; then
430               old_libs=$LIBS
431               LIBS="$LIBS -ldb$with_db_uniquename"
432               AC_CHECK_FUNCS([db_create$with_db_uniquename db_create dbm_store$with_db_uniquename dbm_store],
433                 [LIBDB="-ldb$with_db_uniquename"; break])
434               LIBS=$old_libs
435         fi
436         if test -z "$LIBDB" ; then
437             AC_CHECK_LIB([ndbm],[dbm_store], LIBDB="-lndbm", LIBDB="")
438             if test ! -z "$LIBDB" ; then
439                 AC_CHECK_HEADERS(ndbm.h)
440             fi
441         else
442             AC_CHECK_HEADERS(db.h)
443         fi
444 fi
445 AC_SUBST(LIBDB)
446 AM_CONDITIONAL([HAVE_LIBDB], [test ! -z "$LIBDB"])
447
448 AC_ARG_ENABLE([nis],
449         AS_HELP_STRING([--disable-nis], [Disable building NIS/YP support in pam_unix and pam_access]))
450
451 AS_IF([test "x$enable_nis" != "xno"], [
452   CFLAGS=$old_CFLAGS
453   LIBS=$old_LIBS
454
455   dnl if there's libtirpc available, prefer that over the system
456   dnl implementation.
457   PKG_CHECK_MODULES([libtirpc], [libtirpc], [
458     CFLAGS="$CFLAGS $libtirpc_CFLAGS"
459     LIBS="$LIBS $libtirpc_LIBS"
460   ], [:;])
461
462   AC_SEARCH_LIBS([yp_get_default_domain], [nsl])
463
464   AC_CHECK_FUNCS([yp_get_default_domain yperr_string yp_master yp_bind yp_match yp_unbind])
465   AC_CHECK_HEADERS([rpc/rpc.h rpcsvc/ypclnt.h rpcsvc/yp_prot.h])
466   AC_CHECK_DECLS([getrpcport], , , [
467     #if HAVE_RPC_RPC_H
468     # include <rpc/rpc.h>
469     #endif
470   ])
471
472   NIS_CFLAGS="${CFLAGS%${old_CFLAGS}}"
473   NIS_LIBS="${LIBS%${old_LIBS}}"
474
475   CFLAGS="$old_CFLAGS"
476   LIBS="$old_LIBS"
477 ])
478
479 AC_SUBST([NIS_CFLAGS])
480 AC_SUBST([NIS_LIBS])
481
482 AC_ARG_ENABLE([selinux],
483         AS_HELP_STRING([--disable-selinux],[do not use SELinux]),
484         WITH_SELINUX=$enableval, WITH_SELINUX=yes)
485 if test "$WITH_SELINUX" == "yes" ; then
486   AC_CHECK_LIB([selinux],[getfilecon], LIBSELINUX="-lselinux", LIBSELINUX="")
487 else
488   LIBSELINUX=""
489 fi
490 AC_SUBST(LIBSELINUX)
491 AM_CONDITIONAL([HAVE_LIBSELINUX], [test ! -z "$LIBSELINUX"])
492 if test ! -z "$LIBSELINUX" ; then
493     AC_DEFINE([WITH_SELINUX], 1, [Defined if SE Linux support is compiled in])
494     BACKUP_LIBS=$LIBS
495     LIBS="$LIBS $LIBSELINUX"
496     AC_CHECK_FUNCS(setkeycreatecon)
497     AC_CHECK_FUNCS(getseuser)
498     LIBS=$BACKUP_LIBS
499 fi
500
501 dnl hacks for pam_smack
502 PKG_CHECK_MODULES([LIBSMACK], [libsmack])
503
504 dnl Checks for header files.
505 AC_HEADER_DIRENT
506 AC_HEADER_STDC
507 AC_HEADER_SYS_WAIT
508 AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h net/if.h termio.h unistd.h sys/fsuid.h inittypes.h)
509
510 dnl For module/pam_lastlog
511 AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h)
512
513 dnl Checks for typedefs, structures, and compiler characteristics.
514 AC_C_BIGENDIAN
515 AC_C_CONST
516 AC_TYPE_UID_T
517 AC_TYPE_OFF_T
518 AC_TYPE_PID_T
519 AC_TYPE_SIZE_T
520 AC_HEADER_TIME
521 AC_STRUCT_TM
522
523 dnl Checks for library functions.
524 AC_TYPE_GETGROUPS
525 AC_PROG_GCC_TRADITIONAL
526 AC_FUNC_MEMCMP
527 AC_FUNC_VPRINTF
528 AC_CHECK_FUNCS(fseeko getdomainname gethostname gettimeofday lckpwdf mkdir select)
529 AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
530 AC_CHECK_FUNCS(getutent_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
531 AC_CHECK_FUNCS(getgrouplist getline getdelim)
532 AC_CHECK_FUNCS(inet_ntop inet_pton innetgr ruserok_af)
533
534 AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no])
535 AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes])
536
537 AC_ARG_ENABLE([regenerate-docu],
538   AC_HELP_STRING([--disable-regenerate-docu], [Don't re-build documentation from XML souces]),
539   [enable_docu=$enableval], [enable_docu=yes])
540 dnl
541 dnl Check for xsltproc
542 dnl
543 AC_PATH_PROG([XSLTPROC], [xsltproc])
544 if test -z "$XSLTPROC"; then
545      enable_docu=no
546 fi
547 AC_PATH_PROG([XMLLINT], [xmllint],[/bin/true])
548 dnl check for DocBook DTD and stylesheets in the local catalog.
549 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.4//EN],
550                 [DocBook XML DTD V4.4], [], enable_docu=no)
551 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
552                 [DocBook XSL Stylesheets], [], enable_docu=no)
553
554 AC_PATH_PROG([BROWSER], [w3m])
555 if test ! -z "$BROWSER"; then
556      BROWSER="$BROWSER -T text/html -dump"
557 else
558      enable_docu=no
559 fi
560
561 AC_PATH_PROG([FO2PDF], [fop])
562
563 AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test x$enable_docu != xno)
564 AM_CONDITIONAL(ENABLE_GENERATE_PDF, test ! -z "$FO2PDF")
565
566
567 AM_GNU_GETTEXT_VERSION([0.15])
568 AM_GNU_GETTEXT([external])
569 AC_CHECK_FUNCS(dngettext)
570
571 AH_BOTTOM([#ifdef ENABLE_NLS
572 #include <libintl.h>
573 #define _(msgid) dgettext(PACKAGE, msgid)
574 #define N_(msgid) msgid
575 #else
576 #define _(msgid) (msgid)
577 #define N_(msgid) msgid
578 #endif /* ENABLE_NLS */])
579
580 dnl
581 dnl Check for the availability of the kernel key management facility
582 dnl - The pam_keyinit module only requires the syscalls, not the error codes
583 dnl
584 AC_CHECK_DECL(__NR_keyctl, [have_key_syscalls=1],[have_key_syscalls=0],[#include <sys/syscall.h>])
585 AC_CHECK_DECL(ENOKEY, [have_key_errors=1],[have_key_errors=0],[#include <errno.h>])
586
587 HAVE_KEY_MANAGEMENT=0
588 if test $have_key_syscalls$have_key_errors = 11
589 then
590         HAVE_KEY_MANAGEMENT=1
591 fi
592
593 if test $HAVE_KEY_MANAGEMENT = 1; then
594    AC_DEFINE([HAVE_KEY_MANAGEMENT], 1,
595              [Defined if the kernel key management facility is available])
596 fi
597 AC_SUBST([HAVE_KEY_MANAGEMENT], $HAVE_KEY_MANAGEMENT)
598
599 AM_CONDITIONAL([HAVE_KEY_MANAGEMENT], [test "$have_key_syscalls" = 1])
600
601 dnl Files to be created from when we run configure
602 AC_CONFIG_FILES([Makefile libpam/Makefile libpamc/Makefile libpamc/test/Makefile \
603         libpam_misc/Makefile conf/Makefile conf/pam_conv1/Makefile \
604         po/Makefile.in \
605         modules/Makefile \
606         modules/pam_access/Makefile modules/pam_cracklib/Makefile \
607         modules/pam_debug/Makefile modules/pam_deny/Makefile \
608         modules/pam_echo/Makefile modules/pam_env/Makefile \
609         modules/pam_faildelay/Makefile \
610         modules/pam_filter/Makefile modules/pam_filter/upperLOWER/Makefile \
611         modules/pam_ftp/Makefile modules/pam_group/Makefile \
612         modules/pam_issue/Makefile modules/pam_keyinit/Makefile \
613         modules/pam_lastlog/Makefile modules/pam_limits/Makefile \
614         modules/pam_listfile/Makefile modules/pam_localuser/Makefile \
615         modules/pam_loginuid/Makefile modules/pam_mail/Makefile \
616         modules/pam_mkhomedir/Makefile modules/pam_motd/Makefile \
617         modules/pam_namespace/Makefile \
618         modules/pam_nologin/Makefile modules/pam_permit/Makefile \
619         modules/pam_pwhistory/Makefile modules/pam_rhosts/Makefile \
620         modules/pam_rootok/Makefile modules/pam_exec/Makefile \
621         modules/pam_securetty/Makefile modules/pam_selinux/Makefile \
622         modules/pam_sepermit/Makefile \
623         modules/pam_shells/Makefile modules/pam_stress/Makefile \
624         modules/pam_succeed_if/Makefile modules/pam_tally/Makefile \
625         modules/pam_tally2/Makefile modules/pam_time/Makefile \
626         modules/pam_timestamp/Makefile modules/pam_tty_audit/Makefile \
627         modules/pam_umask/Makefile \
628         modules/pam_unix/Makefile modules/pam_userdb/Makefile \
629         modules/pam_warn/Makefile modules/pam_wheel/Makefile \
630         modules/pam_xauth/Makefile doc/Makefile doc/specs/Makefile \
631         modules/pam_smack/Makefile \
632         doc/man/Makefile doc/sag/Makefile doc/adg/Makefile \
633         doc/mwg/Makefile examples/Makefile tests/Makefile \
634         xtests/Makefile])
635 AC_OUTPUT