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