1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(conf/pam_conv1/pam_conv.y)
3 AM_INIT_AUTOMAKE("Linux-PAM", 0.99.4.0)
4 AM_CONFIG_HEADER(config.h)
11 dnl By default, everything under PAM is installed below /usr.
13 AC_PREFIX_DEFAULT(/usr)
15 dnl and some hacks to use /etc and /lib
16 test "${prefix}" = "NONE" && prefix="/usr"
17 if test ${prefix} = '/usr'
19 dnl If we use /usr as prefix, use /etc for config files
20 if test ${sysconfdir} = '${prefix}/etc'
24 if test ${libdir} = '${exec_prefix}/lib'
28 if test ${sbindir} = '${exec_prefix}/sbin'
32 dnl If we use /usr as prefix, use /usr/share/man for manual pages
33 if test ${mandir} = '${prefix}/man'
35 mandir='${prefix}/share/man'
37 dnl Add security to include directory
38 if test ${includedir} = '${prefix}/include'
40 includedir="${prefix}/include/security"
45 dnl check if we should link everything static into libpam
47 AC_ARG_ENABLE(static-modules,AS_HELP_STRING([--enable-static-modules],
48 [do not make the modules dynamically loadable]),
49 STATIC_MODULES=$enableval,STATIC_MODULES=no)
50 if test "$STATIC_MODULES" != "no" ; then
51 CFLAGS="$CFLAGS -DPAM_STATIC"
52 AC_ENABLE_STATIC([yes])
53 AC_ENABLE_SHARED([no])
55 # per default don't build static libraries
56 AC_ENABLE_STATIC([no])
57 AC_ENABLE_SHARED([yes])
59 AM_CONDITIONAL([STATIC_MODULES], [test "$STATIC_MODULES" != "no"])
61 dnl Checks for programs.
76 dnl icc claims to be GCC compatible, but use other flags for warnings
77 if eval "test x$GCC = xyes -a $CC != icc"; then
84 -Wmissing-declarations \
85 -Wmissing-prototypes \
93 JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
96 dnl icc has special warning flags
97 if eval "test x$CC = xicc"; then
100 -Wmissing-prototypes \
103 -Wstrict-prototypes \
111 JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
118 dnl Check if --version-script is supported by ld
120 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
121 [cat > conftest.s <<EOF
124 .symver _sym,sym@VERS
126 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
127 libc_cv_asm_symver_directive=yes
129 libc_cv_asm_symver_directive=no
132 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
133 if test $libc_cv_asm_symver_directive = yes; then
134 cat > conftest.s <<EOF
137 .symver _sym,sym@VERS
139 cat > conftest.map <<EOF
148 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
150 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
151 -o conftest.so conftest.o
152 -nostartfiles -nostdlib
153 -Wl,--version-script,conftest.map
154 1>&AS_MESSAGE_LOG_FD]);
156 libc_cv_ld_version_script_option=yes
158 libc_cv_ld_version_script_option=no
161 libc_cv_ld_version_script_option=no
164 libc_cv_ld_version_script_option=no
167 AM_CONDITIONAL([HAVE_VERSIONING],
168 [test "$libc_cv_ld_version_script_option" = "yes"])
171 dnl check for -fPIE/-pie support
173 dnl icc handles -fpie as -fp without error, so blacklist icc
175 AC_ARG_ENABLE(pie,AS_HELP_STRING([--disable-pie],
176 [Disable position-independent executeables (PIE)]),
177 USE_PIE=$enableval, USE_PIE=yes)
179 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
180 cat > conftest.c <<EOF
184 if test "$USE_PIE" = "yes" -a "$CC" != "icc" &&
185 AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
186 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
197 AC_SUBST(libc_cv_fpie)
199 AC_SUBST(PIE_LDFLAGS)
203 dnl options and defaults
206 AC_ARG_ENABLE([prelude],
207 AC_HELP_STRING([--disable-prelude],[do not use prelude]),
208 WITH_PRELUDE=$enableval, WITH_PRELUDE=yes)
209 if test "$WITH_PRELUDE" == "yes" ; then
210 AM_PATH_LIBPRELUDE([0.9.0])
211 if test "$LIBPRELUDE_CONFIG" != "no" ; then
212 LIBPRELUDE_CFLAGS="$LIBPRELUDE_CFLAGS -DPRELUDE=1"
216 dnl lots of debugging information goes to /var/run/pam-debug.log
217 AC_ARG_ENABLE([debug],
218 AC_HELP_STRING([--enable-debug],
219 [specify you are building with debugging on]),
220 WITH_DEBUG=yes ; AC_DEFINE([DEBUG],,
221 [lots of stuff gets written to /var/run/pam-debug.log]),
225 AC_ARG_ENABLE(securedir,
226 [ --enable-securedir=<path to location of PAMs> [default \$libdir/security]],
227 SECUREDIR=$enableval, SECUREDIR=$libdir/security)
230 AC_ARG_ENABLE([isadir],
231 AC_HELP_STRING([--enable-isadir=DIR],[path to arch-specific module files [default ../../`basename $libdir`/security]]),
233 ISA=../../`basename $libdir`/security)
235 AC_DEFINE_UNQUOTED(_PAM_ISA,"$ISA",[Define to the path, relative to SECUREDIR, where PAMs specific to this architecture can be found.])
236 AC_MSG_RESULT([Defining \$ISA to "$ISA"])
238 AC_ARG_ENABLE(sconfigdir,
239 [ --enable-sconfigdir=<path to module conf files> [default \$sysconfdir/security]],
240 SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
243 AC_ARG_ENABLE(docdir,
244 [ --enable-docdir=<path to store documentation in - /usr/share/doc/pam>],
245 DOCDIR=$enableval, DOCDIR=/usr/share/doc/pam)
249 AC_ARG_ENABLE(pamlocking,
250 [ --enable-pamlocking configure libpam to observe a global authentication lock],
251 WITH_PAMLOCKING=yes ; AC_DEFINE([PAM_LOCKING],,
252 [libpam should observe a global authentication lock]),
254 AC_SUBST(WITH_PAMLOCKING)
256 AC_ARG_ENABLE(read-both-confs,
257 [ --enable-read-both-confs read both /etc/pam.d and /etc/pam.conf files],
258 AC_DEFINE([PAM_READ_BOTH_CONFS],,
259 [read both /etc/pam.d and /etc/pam.conf files]))
260 AC_SUBST(PAM_READ_BOTH_CONFS)
262 AC_ARG_ENABLE([lckpwdf],
263 AC_HELP_STRING([--disable-lckpwdf],[do not use the lckpwdf function]),
264 WITH_LCKPWDF=$enableval, WITH_LCKPWDF=yes)
265 if test "$WITH_LCKPWDF" == "yes" ; then
266 AC_DEFINE([USE_LCKPWDF], 1,
267 [Define to 1 if the lckpwdf function should be used])
270 AC_CHECK_HEADERS(paths.h)
271 AC_ARG_WITH(mailspool,
272 [ --with-mailspool path to mail spool directory
273 [default _PATH_MAILDIR if defined in paths.h, otherwise /var/spool/mail]],
274 with_mailspool=${withval})
275 if test x$with_mailspool != x ; then
276 pam_mail_spool="\"$with_mailspool\""
286 }], pam_mail_spool="_PATH_MAILDIR",
287 pam_mail_spool="\"/var/spool/mail\"",
288 pam_mail_spool="\"/var/spool/mail\"")
290 AC_DEFINE_UNQUOTED(PAM_PATH_MAILDIR, $pam_mail_spool,
291 [Path where mails are stored])
294 [ --with-xauth additional path to check for xauth when it is called from pam_xauth
295 [added to the default of /usr/X11R6/bin/xauth, /usr/bin/xauth, /usr/bin/X11/xauth]],
296 pam_xauth_path=${withval})
297 if test x$with_xauth == x ; then
298 AC_PATH_PROG(pam_xauth_path, xauth)
299 dnl There is no sense in adding the first default path
300 if test x$pam_xauth_path == x/usr/X11R6/bin/xauth ; then
305 if test x$pam_xauth_path != x ; then
306 AC_DEFINE_UNQUOTED(PAM_PATH_XAUTH, "$pam_xauth_path",
307 [Additional path of xauth executable])
310 dnl Checks for the existence of libdl - on BSD and Tru64 its part of libc
311 AC_CHECK_LIB([dl], [dlopen], LIBDL="-ldl", LIBDL="")
314 AC_CHECK_LIB([crack], [FascistCheck], LIBCRACK="-lcrack", LIBCRACK="")
316 AM_CONDITIONAL([HAVE_LIBCRACK], [test ! -z "$LIBCRACK"])
318 dnl Look for Linux Auditing library - see documentation
319 AC_CHECK_HEADER([libaudit.h],
320 [AC_CHECK_LIB(audit, audit_log_user_message, LIBAUDIT=-laudit, LIBAUDIT="")]
323 if test ! -z "$LIBAUDIT" -a "ac_cv_header_libaudit_h" != "no" ; then
324 AC_DEFINE([HAVE_LIBAUDIT], 1, [Defined if audit support should be compiled in])
328 AC_SEARCH_LIBS([crypt],[xcrypt crypt], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
332 dnl check for libdb or libndbm as fallback. Some libndbm compat
333 dnl libraries are unuseable, so try libdb first.
334 AC_CHECK_LIB([db], [db_create], LIBDB="-ldb", LIBDB="")
335 if test -z "$LIBDB" ; then
336 AC_CHECK_LIB([db], [dbm_store], LIBDB="-ldb", LIBDB="")
338 if test -z "$LIBDB" ; then
339 AC_CHECK_LIB([ndbm],[dbm_store], LIBDB="-lndbm", LIBDB="")
340 if test ! -z "$LIBDB" ; then
341 AC_CHECK_HEADERS(ndbm.h)
344 AC_CHECK_HEADERS(db.h)
347 AM_CONDITIONAL([HAVE_LIBDB], [test ! -z "$LIBDB"])
349 AC_CHECK_LIB([nsl],[yp_get_default_domain], LIBNSL="-lnsl", LIBNSL="")
351 AC_CHECK_FUNCS(yp_get_default_domain)
355 AC_CHECK_LIB([selinux],[getfilecon], LIBSELINUX="-lselinux", LIBSELINUX="")
357 AM_CONDITIONAL([HAVE_LIBSELINUX], [test ! -z "$LIBSELINUX"])
359 dnl Checks for Libcap
360 AC_CHECK_LIB([cap], [cap_get_proc], LIBCAP="-lcap", LIBCAP="" )
362 AM_CONDITIONAL([HAVE_LIBCAP], [test ! -z "$LIBCAP"])
364 dnl Checks for header files.
368 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)
370 AC_CHECK_HEADERS(crypt.h)
371 AC_CHECK_HEADERS(crack.h)
373 dnl For module/pam_lastlog
374 AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h)
376 dnl Checks for typedefs, structures, and compiler characteristics.
386 dnl Checks for library functions.
388 AC_PROG_GCC_TRADITIONAL
391 AC_CHECK_FUNCS(fseeko gethostname gettimeofday lckpwdf mkdir select)
392 AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
393 AC_CHECK_FUNCS(getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
394 AC_CHECK_FUNCS(getgrouplist getline getdelim)
395 AC_CHECK_FUNCS(inet_ntop inet_pton)
397 dnl Checks for programs/utilities
398 AC_CHECK_PROG(SGML2PS, sgml2ps, yes, no)
399 AC_CHECK_PROG(SGML2TXT, sgml2txt, yes, no)
400 AC_CHECK_PROG(SGML2HTML, sgml2html, yes, no)
401 AC_CHECK_PROG(SGML2LATEX, sgml2latex, yes, no)
402 AC_CHECK_PROG(PS2PDF, ps2pdf, yes, no)
403 AM_CONDITIONAL([HAVE_SGML2PS], [test "$SGML2PS" = yes || test "$SGML2LATEX" = yes])
404 AM_CONDITIONAL([HAVE_SGML2TXT], [test "$SGML2TXT" = yes])
405 AM_CONDITIONAL([HAVE_SGML2HTML], [test "$SGML2HTML" = yes])
406 AM_CONDITIONAL([HAVE_PS2PDF], [test "$PS2PDF" = yes])
407 if test $SGML2LATEX = "yes" ; then
408 if sgml2latex -h | grep -e --paper | grep ' -p ' > /dev/null ; then
409 PSER="sgml2latex -o ps"
414 if test $SGML2PS = yes ; then
421 dnl Check for xsltproc
424 AC_PATH_PROG([XSLTPROC], [xsltproc])
425 if test -z "$XSLTPROC"; then
428 AC_PATH_PROG([XMLLINT], [xmllint],[/bin/true])
429 dnl check for DocBook DTD and stylesheets in the local catalog.
430 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.4//EN],
431 [DocBook XML DTD V4.4], [], enable_man=no)
432 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
433 [DocBook XSL Stylesheets], [], enable_man=no)
435 AC_PATH_PROG([BROWSER], [w3m])
436 if test ! -z "$BROWSER"; then
437 BROWSER="$BROWSER -T text/html -dump"
442 AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test x$enable_man != xno)
445 AM_GNU_GETTEXT_VERSION
446 AM_GNU_GETTEXT([external])
447 AC_CHECK_FUNCS(dngettext)
449 AH_VERBATIM([_ZZENABLE_NLS],
452 #define _(msgid) dgettext(PACKAGE, msgid)
453 #define N_(msgid) msgid
455 #define _(msgid) (msgid)
456 #define N_(msgid) msgid
457 #endif /* ENABLE_NLS */])
459 dnl Files to be created from when we run configure
460 AC_OUTPUT(Makefile libpam/Makefile libpamc/Makefile libpamc/test/Makefile \
461 libpam_misc/Makefile conf/Makefile conf/pam_conv1/Makefile \
464 modules/pam_access/Makefile modules/pam_cracklib/Makefile \
465 modules/pam_debug/Makefile modules/pam_deny/Makefile \
466 modules/pam_echo/Makefile modules/pam_env/Makefile \
467 modules/pam_filter/Makefile modules/pam_filter/upperLOWER/Makefile \
468 modules/pam_ftp/Makefile modules/pam_group/Makefile \
469 modules/pam_issue/Makefile modules/pam_lastlog/Makefile \
470 modules/pam_limits/Makefile modules/pam_listfile/Makefile \
471 modules/pam_localuser/Makefile modules/pam_mail/Makefile \
472 modules/pam_mkhomedir/Makefile modules/pam_motd/Makefile \
473 modules/pam_nologin/Makefile modules/pam_permit/Makefile \
474 modules/pam_rhosts/Makefile \
475 modules/pam_rootok/Makefile modules/pam_exec/Makefile \
476 modules/pam_securetty/Makefile modules/pam_selinux/Makefile \
477 modules/pam_shells/Makefile modules/pam_stress/Makefile \
478 modules/pam_succeed_if/Makefile modules/pam_tally/Makefile \
479 modules/pam_time/Makefile modules/pam_umask/Makefile \
480 modules/pam_unix/Makefile modules/pam_userdb/Makefile \
481 modules/pam_warn/Makefile modules/pam_wheel/Makefile \
482 modules/pam_xauth/Makefile doc/Makefile doc/specs/Makefile \
483 doc/man/Makefile examples/Makefile tests/Makefile)