1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(conf/pam_conv1/pam_conv_y.y)
3 AM_INIT_AUTOMAKE("Linux-PAM", 1.0.0)
5 AM_CONFIG_HEADER(config.h)
12 dnl By default, everything under PAM is installed below /usr.
14 AC_PREFIX_DEFAULT(/usr)
16 dnl and some hacks to use /etc and /lib
17 test "${prefix}" = "NONE" && prefix="/usr"
18 if test ${prefix} = '/usr'
20 dnl If we use /usr as prefix, use /etc for config files
21 if test ${sysconfdir} = '${prefix}/etc'
25 if test ${libdir} = '${exec_prefix}/lib'
28 x86_64|ppc64|s390x|sparc64)
34 if test ${sbindir} = '${exec_prefix}/sbin'
38 dnl If we use /usr as prefix, use /usr/share/man for manual pages
39 if test ${mandir} = '${prefix}/man'
41 mandir='${prefix}/share/man'
43 dnl Add security to include directory
44 if test ${includedir} = '${prefix}/include'
46 includedir="${prefix}/include/security"
49 dnl Add /var directory
50 if test ${localstatedir} = '${prefix}/var'
58 dnl check if we should link everything static into libpam
60 AC_ARG_ENABLE(static-modules,AS_HELP_STRING([--enable-static-modules],
61 [do not make the modules dynamically loadable]),
62 STATIC_MODULES=$enableval,STATIC_MODULES=no)
63 if test "$STATIC_MODULES" != "no" ; then
64 CFLAGS="$CFLAGS -DPAM_STATIC"
65 AC_ENABLE_STATIC([yes])
66 AC_ENABLE_SHARED([no])
68 # per default don't build static libraries
69 AC_ENABLE_STATIC([no])
70 AC_ENABLE_SHARED([yes])
72 AM_CONDITIONAL([STATIC_MODULES], [test "$STATIC_MODULES" != "no"])
74 dnl Checks for programs.
90 dnl icc claims to be GCC compatible, but use other flags for warnings
91 if eval "test x$GCC = xyes -a $CC != icc"; then
98 -Wmissing-declarations \
99 -Wmissing-prototypes \
102 -Wstrict-prototypes \
107 JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
110 dnl icc has special warning flags
111 if eval "test x$CC = xicc"; then
114 -Wmissing-prototypes \
117 -Wstrict-prototypes \
125 JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
132 dnl Check if --version-script is supported by ld
134 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
135 [cat > conftest.s <<EOF
138 .symver _sym,sym@VERS
140 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
141 libc_cv_asm_symver_directive=yes
143 libc_cv_asm_symver_directive=no
146 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
147 if test $libc_cv_asm_symver_directive = yes; then
148 cat > conftest.s <<EOF
151 .symver _sym,sym@VERS
153 cat > conftest.map <<EOF
162 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
164 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
165 -o conftest.so conftest.o
166 -nostartfiles -nostdlib
167 -Wl,--version-script,conftest.map
168 1>&AS_MESSAGE_LOG_FD]);
170 libc_cv_ld_version_script_option=yes
172 libc_cv_ld_version_script_option=no
175 libc_cv_ld_version_script_option=no
178 libc_cv_ld_version_script_option=no
181 AM_CONDITIONAL([HAVE_VERSIONING],
182 [test "$libc_cv_ld_version_script_option" = "yes"])
185 dnl check for -fPIE/-pie support
187 dnl icc handles -fpie as -fp without error, so blacklist icc
189 AC_ARG_ENABLE(pie,AS_HELP_STRING([--disable-pie],
190 [disable position-independent executeables (PIE)]),
191 USE_PIE=$enableval, USE_PIE=yes)
193 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
194 cat > conftest.c <<EOF
198 if test "$USE_PIE" = "yes" -a "$CC" != "icc" &&
199 AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
200 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
211 AC_SUBST(libc_cv_fpie)
213 AC_SUBST(PIE_LDFLAGS)
217 dnl options and defaults
220 AC_ARG_ENABLE([prelude],
221 AC_HELP_STRING([--disable-prelude],[do not use prelude]),
222 WITH_PRELUDE=$enableval, WITH_PRELUDE=yes)
223 if test "$WITH_PRELUDE" == "yes" ; then
224 AM_PATH_LIBPRELUDE([0.9.0])
225 if test "$LIBPRELUDE_CONFIG" != "no" ; then
226 LIBPRELUDE_CFLAGS="$LIBPRELUDE_CFLAGS -DPRELUDE=1"
230 dnl lots of debugging information goes to /var/run/pam-debug.log
231 AC_ARG_ENABLE([debug],
232 AC_HELP_STRING([--enable-debug],
233 [specify you are building with debugging on]),
234 WITH_DEBUG=yes ; AC_DEFINE([DEBUG],,
235 [lots of stuff gets written to /var/run/pam-debug.log]),
239 AC_ARG_ENABLE(securedir,
240 AC_HELP_STRING([--enable-securedir=DIR],[path to location of PAMs @<:@default=$libdir/security@:>@]),
241 SECUREDIR=$enableval, SECUREDIR=$libdir/security)
244 AC_ARG_ENABLE([isadir],
245 AC_HELP_STRING([--enable-isadir=DIR],[path to arch-specific module files @<:@default=../../(basename of $libdir)/security@:>@]),
247 ISA=../../`basename $libdir`/security)
249 AC_DEFINE_UNQUOTED(_PAM_ISA,"$ISA",[Define to the path, relative to SECUREDIR, where PAMs specific to this architecture can be found.])
250 AC_MSG_RESULT([Defining \$ISA to "$ISA"])
252 AC_ARG_ENABLE(sconfigdir,
253 AC_HELP_STRING([--enable-sconfigdir=DIR],[path to module conf files @<:@default=$sysconfdir/security@:>@]),
254 SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
257 AC_ARG_ENABLE(pamlocking,
258 AC_HELP_STRING([--enable-pamlocking],[configure libpam to observe a global authentication lock]),
259 WITH_PAMLOCKING=yes ; AC_DEFINE([PAM_LOCKING],,
260 [libpam should observe a global authentication lock]),
262 AC_SUBST(WITH_PAMLOCKING)
264 AC_ARG_ENABLE(read-both-confs,
265 AC_HELP_STRING([--enable-read-both-confs],[read both /etc/pam.d and /etc/pam.conf files]),
266 AC_DEFINE([PAM_READ_BOTH_CONFS],,
267 [read both /etc/pam.d and /etc/pam.conf files]))
268 AC_SUBST(PAM_READ_BOTH_CONFS)
270 AC_ARG_ENABLE([lckpwdf],
271 AC_HELP_STRING([--disable-lckpwdf],[do not use the lckpwdf function]),
272 WITH_LCKPWDF=$enableval, WITH_LCKPWDF=yes)
273 if test "$WITH_LCKPWDF" == "yes" ; then
274 AC_DEFINE([USE_LCKPWDF], 1,
275 [Define to 1 if the lckpwdf function should be used])
278 AC_CHECK_HEADERS(paths.h)
279 AC_ARG_WITH(mailspool,
280 [ --with-mailspool path to mail spool directory
281 [default _PATH_MAILDIR if defined in paths.h, otherwise /var/spool/mail]],
282 with_mailspool=${withval})
283 if test x$with_mailspool != x ; then
284 pam_mail_spool="\"$with_mailspool\""
294 }], pam_mail_spool="_PATH_MAILDIR",
295 pam_mail_spool="\"/var/spool/mail\"",
296 pam_mail_spool="\"/var/spool/mail\"")
298 AC_DEFINE_UNQUOTED(PAM_PATH_MAILDIR, $pam_mail_spool,
299 [Path where mails are stored])
302 [ --with-xauth additional path to check for xauth when it is called from pam_xauth
303 [added to the default of /usr/X11R6/bin/xauth, /usr/bin/xauth, /usr/bin/X11/xauth]],
304 pam_xauth_path=${withval})
305 if test x$with_xauth == x ; then
306 AC_PATH_PROG(pam_xauth_path, xauth)
307 dnl There is no sense in adding the first default path
308 if test x$pam_xauth_path == x/usr/X11R6/bin/xauth ; then
313 if test x$pam_xauth_path != x ; then
314 AC_DEFINE_UNQUOTED(PAM_PATH_XAUTH, "$pam_xauth_path",
315 [Additional path of xauth executable])
318 dnl Checks for the existence of libdl - on BSD and Tru64 its part of libc
319 AC_CHECK_LIB([dl], [dlopen], LIBDL="-ldl", LIBDL="")
323 AC_ARG_ENABLE([cracklib],
324 AC_HELP_STRING([--disable-cracklib],[do not use cracklib]),
325 WITH_CRACKLIB=$enableval, WITH_CRACKLIB=yes)
326 if test x"$WITH_CRACKLIB" != xno ; then
327 AC_CHECK_HEADERS([crack.h],
328 AC_CHECK_LIB([crack], [FascistCheck], LIBCRACK="-lcrack", LIBCRACK=""))
333 AM_CONDITIONAL([HAVE_LIBCRACK], [test ! -z "$LIBCRACK"])
335 dnl Look for Linux Auditing library - see documentation
336 AC_ARG_ENABLE([audit],
337 AC_HELP_STRING([--disable-audit],[do not enable audit support]),
338 WITH_LIBAUDIT=$enableval, WITH_LIBAUDIT=yes)
339 if test x"$WITH_LIBAUDIT" != xno ; then
340 AC_CHECK_HEADER([libaudit.h],
341 [AC_CHECK_LIB(audit, audit_log_acct_message, LIBAUDIT=-laudit, LIBAUDIT="")
342 AC_CHECK_TYPE([struct audit_tty_status],
343 [HAVE_AUDIT_TTY_STATUS=yes],
344 [HAVE_AUDIT_TTY_STATUS=""],
345 [#include <libaudit.h>])]
347 if test ! -z "$LIBAUDIT" -a "ac_cv_header_libaudit_h" != "no" ; then
348 AC_DEFINE([HAVE_LIBAUDIT], 1, [Define to 1 if audit support should be compiled in.])
350 if test ! -z "$HAVE_AUDIT_TTY_STATUS" ; then
351 AC_DEFINE([HAVE_AUDIT_TTY_STATUS], 1, [Define to 1 if struct audit_tty_status exists.])
357 AM_CONDITIONAL([HAVE_AUDIT_TTY_STATUS],
358 [test "x$HAVE_AUDIT_TTY_STATUS" = xyes])
361 AC_SEARCH_LIBS([crypt],[xcrypt crypt], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
362 AC_CHECK_FUNCS(crypt_r)
366 AC_ARG_WITH([randomdev], AC_HELP_STRING([--with-randomdev=(<path>|yes|no)], [use specified random device instead of /dev/urandom or 'no' to disable]), opt_randomdev=$withval)
367 if test "$opt_randomdev" = yes -o -z "$opt_randomdev"; then
368 opt_randomdev="/dev/urandom"
369 elif test "$opt_randomdev" = no; then
372 if test -n "$opt_randomdev"; then
373 AC_DEFINE_UNQUOTED(PAM_PATH_RANDOMDEV, "$opt_randomdev", [Random device path.])
376 dnl check for libdb or libndbm as fallback. Some libndbm compat
377 dnl libraries are unuseable, so try libdb first.
379 AC_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.]),
380 WITH_DB=$enableval, WITH_DB=yes)
381 AC_ARG_WITH([db-uniquename],
382 AC_HELP_STRING([--with-db-uniquename=extension],[Unique name for db libraries and functions.]))
383 if test x"$WITH_DB" != xno ; then
384 if test x"$WITH_DB" = xyes -o x"$WITH_DB" = xdb ; then
385 AC_CHECK_LIB([db$with_db_uniquename], [db_create$with_db_uniquename], LIBDB="-ldb$with_db_uniquename", LIBDB="")
386 if test -z "$LIBDB" ; then
387 AC_CHECK_LIB([db$with_db_uniquename], [dbm_store$with_db_uniquename], LIBDB="-ldb$with_db_uniquename", LIBDB="")
390 if test -z "$LIBDB" ; then
391 AC_CHECK_LIB([ndbm],[dbm_store], LIBDB="-lndbm", LIBDB="")
392 if test ! -z "$LIBDB" ; then
393 AC_CHECK_HEADERS(ndbm.h)
396 AC_CHECK_HEADERS(db.h)
400 AM_CONDITIONAL([HAVE_LIBDB], [test ! -z "$LIBDB"])
402 AC_CHECK_LIB([nsl],[yp_get_default_domain], LIBNSL="-lnsl", LIBNSL="")
405 AC_CHECK_FUNCS(yp_get_default_domain)
409 AC_ARG_ENABLE([selinux],
410 AC_HELP_STRING([--disable-selinux],[do not use SELinux]),
411 WITH_SELINUX=$enableval, WITH_SELINUX=yes)
412 if test "$WITH_SELINUX" == "yes" ; then
413 AC_CHECK_LIB([selinux],[getfilecon], LIBSELINUX="-lselinux", LIBSELINUX="")
418 AM_CONDITIONAL([HAVE_LIBSELINUX], [test ! -z "$LIBSELINUX"])
419 if test ! -z "$LIBSELINUX" ; then
420 AC_DEFINE([WITH_SELINUX], 1, [Defined if SE Linux support is compiled in])
422 LIBS="$LIBS $LIBSELINUX"
423 AC_CHECK_FUNCS(setkeycreatecon)
427 dnl Checks for header files.
431 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)
433 AC_CHECK_HEADERS(crypt.h)
435 dnl For module/pam_lastlog
436 AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h)
438 dnl Checks for typedefs, structures, and compiler characteristics.
448 dnl Checks for library functions.
450 AC_PROG_GCC_TRADITIONAL
453 AC_CHECK_FUNCS(fseeko gethostname gettimeofday lckpwdf mkdir select)
454 AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
455 AC_CHECK_FUNCS(getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
456 AC_CHECK_FUNCS(getgrouplist getline getdelim)
457 AC_CHECK_FUNCS(inet_ntop inet_pton ruserok_af)
459 AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no])
460 AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes])
463 dnl Check for xsltproc
466 AC_PATH_PROG([XSLTPROC], [xsltproc])
467 if test -z "$XSLTPROC"; then
470 AC_PATH_PROG([XMLLINT], [xmllint],[/bin/true])
471 dnl check for DocBook DTD and stylesheets in the local catalog.
472 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.4//EN],
473 [DocBook XML DTD V4.4], [], enable_man=no)
474 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
475 [DocBook XSL Stylesheets], [], enable_man=no)
477 AC_PATH_PROG([BROWSER], [w3m])
478 if test ! -z "$BROWSER"; then
479 BROWSER="$BROWSER -T text/html -dump"
484 AC_PATH_PROG([FO2PDF], [fop])
486 AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test x$enable_man != xno)
487 AM_CONDITIONAL(ENABLE_GENERATE_PDF, test ! -z "$FO2PDF")
490 AM_GNU_GETTEXT_VERSION
491 AM_GNU_GETTEXT([external])
492 AC_CHECK_FUNCS(dngettext)
494 AH_VERBATIM([_ZZENABLE_NLS],
497 #define _(msgid) dgettext(PACKAGE, msgid)
498 #define N_(msgid) msgid
500 #define _(msgid) (msgid)
501 #define N_(msgid) msgid
502 #endif /* ENABLE_NLS */])
505 dnl Check for the availability of the kernel key management facility
506 dnl - The pam_keyinit module only requires the syscalls, not the error codes
508 AC_CHECK_DECL(__NR_keyctl, [have_key_syscalls=1],[have_key_syscalls=0],[#include <sys/syscall.h>])
509 AC_CHECK_DECL(ENOKEY, [have_key_errors=1],[have_key_errors=0],[#include <errno.h>])
511 HAVE_KEY_MANAGEMENT=0
512 if test $have_key_syscalls$have_key_errors = 11
514 HAVE_KEY_MANAGEMENT=1
517 if test $HAVE_KEY_MANAGEMENT = 1; then
518 AC_DEFINE([HAVE_KEY_MANAGEMENT], 1,
519 [Defined if the kernel key management facility is available])
521 AC_SUBST([HAVE_KEY_MANAGEMENT], $HAVE_KEY_MANAGEMENT)
523 AM_CONDITIONAL([HAVE_KEY_MANAGEMENT], [test "$have_key_syscalls" = 1])
525 dnl Files to be created from when we run configure
526 AC_OUTPUT(Makefile libpam/Makefile libpamc/Makefile libpamc/test/Makefile \
527 libpam_misc/Makefile conf/Makefile conf/pam_conv1/Makefile \
530 modules/pam_access/Makefile modules/pam_cracklib/Makefile \
531 modules/pam_debug/Makefile modules/pam_deny/Makefile \
532 modules/pam_echo/Makefile modules/pam_env/Makefile \
533 modules/pam_faildelay/Makefile \
534 modules/pam_filter/Makefile modules/pam_filter/upperLOWER/Makefile \
535 modules/pam_ftp/Makefile modules/pam_group/Makefile \
536 modules/pam_issue/Makefile modules/pam_keyinit/Makefile \
537 modules/pam_lastlog/Makefile modules/pam_limits/Makefile \
538 modules/pam_listfile/Makefile modules/pam_localuser/Makefile \
539 modules/pam_loginuid/Makefile modules/pam_mail/Makefile \
540 modules/pam_mkhomedir/Makefile modules/pam_motd/Makefile \
541 modules/pam_namespace/Makefile \
542 modules/pam_nologin/Makefile modules/pam_permit/Makefile \
543 modules/pam_rhosts/Makefile \
544 modules/pam_rootok/Makefile modules/pam_exec/Makefile \
545 modules/pam_securetty/Makefile modules/pam_selinux/Makefile \
546 modules/pam_sepermit/Makefile \
547 modules/pam_shells/Makefile modules/pam_stress/Makefile \
548 modules/pam_succeed_if/Makefile modules/pam_tally/Makefile \
549 modules/pam_time/Makefile modules/pam_tty_audit/Makefile \
550 modules/pam_umask/Makefile \
551 modules/pam_unix/Makefile modules/pam_userdb/Makefile \
552 modules/pam_warn/Makefile modules/pam_wheel/Makefile \
553 modules/pam_xauth/Makefile doc/Makefile doc/specs/Makefile \
554 doc/man/Makefile doc/sag/Makefile doc/adg/Makefile \
555 doc/mwg/Makefile examples/Makefile tests/Makefile \