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", 0.99.6.3)
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'
29 if test ${sbindir} = '${exec_prefix}/sbin'
33 dnl If we use /usr as prefix, use /usr/share/man for manual pages
34 if test ${mandir} = '${prefix}/man'
36 mandir='${prefix}/share/man'
38 dnl Add security to include directory
39 if test ${includedir} = '${prefix}/include'
41 includedir="${prefix}/include/security"
46 dnl check if we should link everything static into libpam
48 AC_ARG_ENABLE(static-modules,AS_HELP_STRING([--enable-static-modules],
49 [do not make the modules dynamically loadable]),
50 STATIC_MODULES=$enableval,STATIC_MODULES=no)
51 if test "$STATIC_MODULES" != "no" ; then
52 CFLAGS="$CFLAGS -DPAM_STATIC"
53 AC_ENABLE_STATIC([yes])
54 AC_ENABLE_SHARED([no])
56 # per default don't build static libraries
57 AC_ENABLE_STATIC([no])
58 AC_ENABLE_SHARED([yes])
60 AM_CONDITIONAL([STATIC_MODULES], [test "$STATIC_MODULES" != "no"])
62 dnl Checks for programs.
78 dnl icc claims to be GCC compatible, but use other flags for warnings
79 if eval "test x$GCC = xyes -a $CC != icc"; then
86 -Wmissing-declarations \
87 -Wmissing-prototypes \
95 JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
98 dnl icc has special warning flags
99 if eval "test x$CC = xicc"; then
102 -Wmissing-prototypes \
105 -Wstrict-prototypes \
113 JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
120 dnl Check if --version-script is supported by ld
122 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
123 [cat > conftest.s <<EOF
126 .symver _sym,sym@VERS
128 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
129 libc_cv_asm_symver_directive=yes
131 libc_cv_asm_symver_directive=no
134 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
135 if test $libc_cv_asm_symver_directive = yes; then
136 cat > conftest.s <<EOF
139 .symver _sym,sym@VERS
141 cat > conftest.map <<EOF
150 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
152 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
153 -o conftest.so conftest.o
154 -nostartfiles -nostdlib
155 -Wl,--version-script,conftest.map
156 1>&AS_MESSAGE_LOG_FD]);
158 libc_cv_ld_version_script_option=yes
160 libc_cv_ld_version_script_option=no
163 libc_cv_ld_version_script_option=no
166 libc_cv_ld_version_script_option=no
169 AM_CONDITIONAL([HAVE_VERSIONING],
170 [test "$libc_cv_ld_version_script_option" = "yes"])
173 dnl check for -fPIE/-pie support
175 dnl icc handles -fpie as -fp without error, so blacklist icc
177 AC_ARG_ENABLE(pie,AS_HELP_STRING([--disable-pie],
178 [disable position-independent executeables (PIE)]),
179 USE_PIE=$enableval, USE_PIE=yes)
181 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
182 cat > conftest.c <<EOF
186 if test "$USE_PIE" = "yes" -a "$CC" != "icc" &&
187 AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
188 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
199 AC_SUBST(libc_cv_fpie)
201 AC_SUBST(PIE_LDFLAGS)
205 dnl options and defaults
208 AC_ARG_ENABLE([prelude],
209 AC_HELP_STRING([--disable-prelude],[do not use prelude]),
210 WITH_PRELUDE=$enableval, WITH_PRELUDE=yes)
211 if test "$WITH_PRELUDE" == "yes" ; then
212 AM_PATH_LIBPRELUDE([0.9.0])
213 if test "$LIBPRELUDE_CONFIG" != "no" ; then
214 LIBPRELUDE_CFLAGS="$LIBPRELUDE_CFLAGS -DPRELUDE=1"
218 dnl lots of debugging information goes to /var/run/pam-debug.log
219 AC_ARG_ENABLE([debug],
220 AC_HELP_STRING([--enable-debug],
221 [specify you are building with debugging on]),
222 WITH_DEBUG=yes ; AC_DEFINE([DEBUG],,
223 [lots of stuff gets written to /var/run/pam-debug.log]),
227 AC_ARG_ENABLE(securedir,
228 AC_HELP_STRING([--enable-securedir=DIR],[path to location of PAMs @<:@default=$libdir/security@:>@]),
229 SECUREDIR=$enableval, SECUREDIR=$libdir/security)
232 AC_ARG_ENABLE([isadir],
233 AC_HELP_STRING([--enable-isadir=DIR],[path to arch-specific module files @<:@default=../../(basename of $libdir)/security@:>@]),
235 ISA=../../`basename $libdir`/security)
237 AC_DEFINE_UNQUOTED(_PAM_ISA,"$ISA",[Define to the path, relative to SECUREDIR, where PAMs specific to this architecture can be found.])
238 AC_MSG_RESULT([Defining \$ISA to "$ISA"])
240 AC_ARG_ENABLE(sconfigdir,
241 AC_HELP_STRING([--enable-sconfigdir=DIR],[path to module conf files @<:@default=$sysconfdir/security@:>@]),
242 SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
245 AC_ARG_ENABLE(pamlocking,
246 AC_HELP_STRING([--enable-pamlocking],[configure libpam to observe a global authentication lock]),
247 WITH_PAMLOCKING=yes ; AC_DEFINE([PAM_LOCKING],,
248 [libpam should observe a global authentication lock]),
250 AC_SUBST(WITH_PAMLOCKING)
252 AC_ARG_ENABLE(read-both-confs,
253 AC_HELP_STRING([--enable-read-both-confs],[read both /etc/pam.d and /etc/pam.conf files]),
254 AC_DEFINE([PAM_READ_BOTH_CONFS],,
255 [read both /etc/pam.d and /etc/pam.conf files]))
256 AC_SUBST(PAM_READ_BOTH_CONFS)
258 AC_ARG_ENABLE([lckpwdf],
259 AC_HELP_STRING([--disable-lckpwdf],[do not use the lckpwdf function]),
260 WITH_LCKPWDF=$enableval, WITH_LCKPWDF=yes)
261 if test "$WITH_LCKPWDF" == "yes" ; then
262 AC_DEFINE([USE_LCKPWDF], 1,
263 [Define to 1 if the lckpwdf function should be used])
266 AC_CHECK_HEADERS(paths.h)
267 AC_ARG_WITH(mailspool,
268 [ --with-mailspool path to mail spool directory
269 [default _PATH_MAILDIR if defined in paths.h, otherwise /var/spool/mail]],
270 with_mailspool=${withval})
271 if test x$with_mailspool != x ; then
272 pam_mail_spool="\"$with_mailspool\""
282 }], pam_mail_spool="_PATH_MAILDIR",
283 pam_mail_spool="\"/var/spool/mail\"",
284 pam_mail_spool="\"/var/spool/mail\"")
286 AC_DEFINE_UNQUOTED(PAM_PATH_MAILDIR, $pam_mail_spool,
287 [Path where mails are stored])
290 [ --with-xauth additional path to check for xauth when it is called from pam_xauth
291 [added to the default of /usr/X11R6/bin/xauth, /usr/bin/xauth, /usr/bin/X11/xauth]],
292 pam_xauth_path=${withval})
293 if test x$with_xauth == x ; then
294 AC_PATH_PROG(pam_xauth_path, xauth)
295 dnl There is no sense in adding the first default path
296 if test x$pam_xauth_path == x/usr/X11R6/bin/xauth ; then
301 if test x$pam_xauth_path != x ; then
302 AC_DEFINE_UNQUOTED(PAM_PATH_XAUTH, "$pam_xauth_path",
303 [Additional path of xauth executable])
306 dnl Checks for the existence of libdl - on BSD and Tru64 its part of libc
307 AC_CHECK_LIB([dl], [dlopen], LIBDL="-ldl", LIBDL="")
311 AC_ARG_ENABLE([cracklib],
312 AC_HELP_STRING([--disable-cracklib],[do not use cracklib]),
313 WITH_CRACKLIB=$enableval, WITH_CRACKLIB=yes)
314 if test x"$WITH_CRACKLIB" != xno ; then
315 AC_CHECK_HEADER([crack.h],
316 AC_CHECK_LIB([crack], [FascistCheck], LIBCRACK="-lcrack", LIBCRACK=""))
321 AM_CONDITIONAL([HAVE_LIBCRACK], [test ! -z "$LIBCRACK"])
323 dnl Look for Linux Auditing library - see documentation
324 AC_ARG_ENABLE([audit],
325 AC_HELP_STRING([--disable-audit],[do not enable audit support]),
326 WITH_LIBAUDIT=$enableval, WITH_LIBAUDIT=yes)
327 if test x"$WITH_LIBAUDIT" != xno ; then
328 AC_CHECK_HEADER([libaudit.h],
329 [AC_CHECK_LIB(audit, audit_log_user_message, LIBAUDIT=-laudit, LIBAUDIT="")]
331 if test ! -z "$LIBAUDIT" -a "ac_cv_header_libaudit_h" != "no" ; then
332 AC_DEFINE([HAVE_LIBAUDIT], 1, [Defined if audit support should be compiled in])
340 AC_SEARCH_LIBS([crypt],[xcrypt crypt], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
344 dnl check for libdb or libndbm as fallback. Some libndbm compat
345 dnl libraries are unuseable, so try libdb first.
347 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.]),
348 WITH_DB=$enableval, WITH_DB=yes)
349 if test x"$WITH_DB" != xno ; then
350 if test x"$WITH_DB" = xyes -o x"$WITH_DB" = xdb ; then
351 AC_CHECK_LIB([db], [db_create], LIBDB="-ldb", LIBDB="")
352 if test -z "$LIBDB" ; then
353 AC_CHECK_LIB([db], [dbm_store], LIBDB="-ldb", LIBDB="")
356 if test -z "$LIBDB" ; then
357 AC_CHECK_LIB([ndbm],[dbm_store], LIBDB="-lndbm", LIBDB="")
358 if test ! -z "$LIBDB" ; then
359 AC_CHECK_HEADERS(ndbm.h)
362 AC_CHECK_HEADERS(db.h)
366 AM_CONDITIONAL([HAVE_LIBDB], [test ! -z "$LIBDB"])
368 AC_CHECK_LIB([nsl],[yp_get_default_domain], LIBNSL="-lnsl", LIBNSL="")
370 AC_CHECK_FUNCS(yp_get_default_domain)
374 AC_ARG_ENABLE([selinux],
375 AC_HELP_STRING([--disable-selinux],[do not use SELinux]),
376 WITH_SELINUX=$enableval, WITH_SELINUX=yes)
377 if test "$WITH_SELINUX" == "yes" ; then
378 AC_CHECK_LIB([selinux],[getfilecon], LIBSELINUX="-lselinux", LIBSELINUX="")
383 AM_CONDITIONAL([HAVE_LIBSELINUX], [test ! -z "$LIBSELINUX"])
384 if test ! -z "$LIBSELINUX" ; then
385 AC_DEFINE([WITH_SELINUX], 1, [Defined if SE Linux support is compiled in])
388 dnl Checks for header files.
392 AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h termio.h unistd.h sys/fsuid.h inittypes.h)
394 AC_CHECK_HEADERS(crypt.h)
396 dnl For module/pam_lastlog
397 AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h)
399 dnl Checks for typedefs, structures, and compiler characteristics.
409 dnl Checks for library functions.
411 AC_PROG_GCC_TRADITIONAL
414 AC_CHECK_FUNCS(fseeko gethostname gettimeofday lckpwdf mkdir select)
415 AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
416 AC_CHECK_FUNCS(getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
417 AC_CHECK_FUNCS(getgrouplist getline getdelim)
418 AC_CHECK_FUNCS(inet_ntop inet_pton ruserok_af)
420 AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no])
421 AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes])
424 dnl Check for xsltproc
427 AC_PATH_PROG([XSLTPROC], [xsltproc])
428 if test -z "$XSLTPROC"; then
431 AC_PATH_PROG([XMLLINT], [xmllint],[/bin/true])
432 dnl check for DocBook DTD and stylesheets in the local catalog.
433 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.4//EN],
434 [DocBook XML DTD V4.4], [], enable_man=no)
435 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
436 [DocBook XSL Stylesheets], [], enable_man=no)
438 AC_PATH_PROG([BROWSER], [w3m])
439 if test ! -z "$BROWSER"; then
440 BROWSER="$BROWSER -T text/html -dump"
445 AC_PATH_PROG([FO2PDF], [fop])
447 AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test x$enable_man != xno)
448 AM_CONDITIONAL(ENABLE_GENERATE_PDF, test ! -z "$FO2PDF")
451 AM_GNU_GETTEXT_VERSION
452 AM_GNU_GETTEXT([external])
453 AC_CHECK_FUNCS(dngettext)
455 AH_VERBATIM([_ZZENABLE_NLS],
458 #define _(msgid) dgettext(PACKAGE, msgid)
459 #define N_(msgid) msgid
461 #define _(msgid) (msgid)
462 #define N_(msgid) msgid
463 #endif /* ENABLE_NLS */])
466 dnl Check for the availability of the kernel key management facility
467 dnl - The pam_keyinit module only requires the syscalls, not the error codes
470 AC_CHECK_DECL(__NR_keyctl, [have_key_syscalls=1],,[#include <sys/syscall.h>])
472 AC_CHECK_DECL(ENOKEY, [have_key_errors=1])
474 HAVE_KEY_MANAGEMENT=0
475 if test $have_key_syscalls$have_key_errors = 11
477 HAVE_KEY_MANAGEMENT=1
480 if test $HAVE_KEY_MANAGEMENT = 1; then
481 AC_DEFINE([HAVE_KEY_MANAGEMENT], 1,
482 [Defined if the kernel key management facility is available])
484 AC_SUBST([HAVE_KEY_MANAGEMENT], $HAVE_KEY_MANAGEMENT)
486 AM_CONDITIONAL([HAVE_KEY_MANAGEMENT], [test "$have_key_syscalls" = 1])
488 dnl Files to be created from when we run configure
489 AC_OUTPUT(Makefile libpam/Makefile libpamc/Makefile libpamc/test/Makefile \
490 libpam_misc/Makefile conf/Makefile conf/pam_conv1/Makefile \
493 modules/pam_access/Makefile modules/pam_cracklib/Makefile \
494 modules/pam_debug/Makefile modules/pam_deny/Makefile \
495 modules/pam_echo/Makefile modules/pam_env/Makefile \
496 modules/pam_faildelay/Makefile \
497 modules/pam_filter/Makefile modules/pam_filter/upperLOWER/Makefile \
498 modules/pam_ftp/Makefile modules/pam_group/Makefile \
499 modules/pam_issue/Makefile modules/pam_keyinit/Makefile \
500 modules/pam_lastlog/Makefile modules/pam_limits/Makefile \
501 modules/pam_listfile/Makefile modules/pam_localuser/Makefile \
502 modules/pam_loginuid/Makefile modules/pam_mail/Makefile \
503 modules/pam_mkhomedir/Makefile modules/pam_motd/Makefile \
504 modules/pam_namespace/Makefile \
505 modules/pam_nologin/Makefile modules/pam_permit/Makefile \
506 modules/pam_rhosts/Makefile \
507 modules/pam_rootok/Makefile modules/pam_exec/Makefile \
508 modules/pam_securetty/Makefile modules/pam_selinux/Makefile \
509 modules/pam_shells/Makefile modules/pam_stress/Makefile \
510 modules/pam_succeed_if/Makefile modules/pam_tally/Makefile \
511 modules/pam_time/Makefile modules/pam_umask/Makefile \
512 modules/pam_unix/Makefile modules/pam_userdb/Makefile \
513 modules/pam_warn/Makefile modules/pam_wheel/Makefile \
514 modules/pam_xauth/Makefile doc/Makefile doc/specs/Makefile \
515 doc/man/Makefile doc/sag/Makefile doc/adg/Makefile \
516 doc/mwg/Makefile examples/Makefile tests/Makefile \