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