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.2.1)
4 AM_CONFIG_HEADER(config.h)
10 ALL_LINGUAS="cs de es fi fr hu it ja nb pa pl pt_BR pt zh_CN zh_TW"
13 dnl By default, everything under PAM is installed below /usr.
15 AC_PREFIX_DEFAULT(/usr)
17 dnl and some hacks to use /etc and /lib
18 test "${prefix}" = "NONE" && prefix="/usr"
19 if test ${prefix} = '/usr'
21 dnl If we use /usr as prefix, use /etc for config files
22 if test ${sysconfdir} = '${prefix}/etc'
26 if test ${libdir} = '${exec_prefix}/lib'
30 if test ${sbindir} = '${exec_prefix}/sbin'
34 dnl If we use /usr as prefix, use /usr/share/man for manual pages
35 if test ${mandir} = '${prefix}/man'
37 mandir='${prefix}/share/man'
39 dnl Add security to include directory
40 if test ${includedir} = '${prefix}/include'
42 includedir="${prefix}/include/security"
47 dnl Checks for programs.
55 # per default don't build static libraries
59 if test "$enable_static" = yes; then
60 CFLAGS="$CFLAGS -DPAM_STATIC"
62 if test "$enable_shared" = yes; then
63 CFLAGS="$CFLAGS -DPAM_DYNAMIC"
69 if eval "test x$GCC = xyes"; then
76 -Wmissing-declarations \
77 -Wmissing-prototypes \
85 JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
92 dnl Check if --version-script is supported by ld
94 AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
95 [cat > conftest.s <<EOF
100 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
101 libc_cv_asm_symver_directive=yes
103 libc_cv_asm_symver_directive=no
106 AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
107 if test $libc_cv_asm_symver_directive = yes; then
108 cat > conftest.s <<EOF
111 .symver _sym,sym@VERS
113 cat > conftest.map <<EOF
122 if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD;
124 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
125 -o conftest.so conftest.o
126 -nostartfiles -nostdlib
127 -Wl,--version-script,conftest.map
128 1>&AS_MESSAGE_LOG_FD]);
130 libc_cv_ld_version_script_option=yes
132 libc_cv_ld_version_script_option=no
135 libc_cv_ld_version_script_option=no
138 libc_cv_ld_version_script_option=no
141 AM_CONDITIONAL([HAVE_VERSIONING],
142 [test "$libc_cv_ld_version_script_option" = "yes"])
145 dnl check for -fPIE/-pie support
147 AC_ARG_ENABLE(pie,AS_HELP_STRING([--disable-pie],
148 [Disable position-independent executeables (PIE)]),
149 USE_PIE=$enableval, USE_PIE=yes)
151 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
152 cat > conftest.c <<EOF
156 if test "$USE_PIE" = "yes" &&
157 AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
158 -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
169 AC_SUBST(libc_cv_fpie)
171 AC_SUBST(PIE_LDFLAGS)
175 dnl options and defaults
178 AM_PATH_LIBPRELUDE([0.9.0])
179 if test "$LIBPRELUDE_CONFIG" != "no" ; then
180 LIBPRELUDE_CFLAGS="$LIBPRELUDE_CFLAGS -DPRELUDE=1"
183 dnl lots of debugging information goes to /var/run/pam-debug.log
184 AC_ARG_ENABLE([debug],
185 AC_HELP_STRING([--enable-debug],
186 [specify you are building with debugging on]),
187 WITH_DEBUG=yes ; AC_DEFINE([DEBUG],,
188 [lots of stuff gets written to /var/run/pam-debug.log]),
192 AC_ARG_ENABLE([memory-debug],
193 AC_HELP_STRING([--enable-memory-debug],[specify you want every malloc etc. call tracked]),
194 WITH_MEMORY_DEBUG=$enableval, WITH_MEMORY_DEBUG=no)
195 if test "$WITH_MEMORY_DEBUG" != "no" ; then
196 AC_DEFINE([MEMORY_DEBUG], 1, [Every malloc etc. call will be tracked])
198 AH_VERBATIM([_MEMORY_DEBUG],
201 * this is basically a hack - we need to include a semiarbitrary
202 * number of headers to ensure that we don't get silly prototype/macro
206 # include <security/pam_malloc.h>
207 #endif /* MEMORY_DEBUG */])
209 AC_ARG_ENABLE(securedir,
210 [ --enable-securedir=<path to location of PAMs> [default \$libdir/security]],
211 SECUREDIR=$enableval, SECUREDIR=$libdir/security)
214 AC_ARG_ENABLE([isadir],
215 AC_HELP_STRING([--enable-isadir=DIR],[path to arch-specific module files [default ../../`basename $libdir`/security]]),
217 ISA=../../`basename $libdir`/security)
219 AC_DEFINE_UNQUOTED(_PAM_ISA,"$ISA",[Define to the path, relative to SECUREDIR, where PAMs specific to this architecture can be found.])
220 AC_MSG_RESULT([Defining \$ISA to "$ISA"])
222 AC_ARG_ENABLE(sconfigdir,
223 [ --enable-sconfigdir=<path to module conf files> [default \$sysconfdir/security]],
224 SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
227 AC_ARG_ENABLE(docdir,
228 [ --enable-docdir=<path to store documentation in - /usr/share/doc/pam>],
229 DOCDIR=$enableval, DOCDIR=/usr/share/doc/pam)
233 AC_ARG_ENABLE(pamlocking,
234 [ --enable-pamlocking configure libpam to observe a global authentication lock],
235 WITH_PAMLOCKING=yes ; AC_DEFINE([PAM_LOCKING],,
236 [libpam should observe a global authentication lock]),
238 AC_SUBST(WITH_PAMLOCKING)
240 AC_ARG_ENABLE(read-both-confs,
241 [ --enable-read-both-confs read both /etc/pam.d and /etc/pam.conf files],
242 AC_DEFINE([PAM_READ_BOTH_CONFS],,
243 [read both /etc/pam.d and /etc/pam.conf files]))
244 AC_SUBST(PAM_READ_BOTH_CONFS)
246 AC_ARG_ENABLE([lckpwdf],
247 AC_HELP_STRING([--disable-lckpwdf],[do not use the lckpwdf function]),
248 WITH_LCKPWDF=$enableval, WITH_LCKPWDF=yes)
249 if test "$WITH_LCKPWDF" == "yes" ; then
250 AC_DEFINE([USE_LCKPWDF], 1,
251 [Define to 1 if the lckpwdf function should be used])
254 AC_CHECK_HEADERS(paths.h)
255 AC_ARG_WITH(mailspool,
256 [ --with-mailspool path to mail spool directory
257 [default _PATH_MAILDIR if defined in paths.h, otherwise /var/spool/mail]],
258 with_mailspool=${withval})
259 if test x$with_mailspool != x ; then
260 pam_mail_spool="\"$with_mailspool\""
270 }], pam_mail_spool="_PATH_MAILDIR",
271 pam_mail_spool="\"/var/spool/mail\"",
272 pam_mail_spool="\"/var/spool/mail\"")
274 AC_DEFINE_UNQUOTED(PAM_PATH_MAILDIR, $pam_mail_spool,
275 [Path where mails are stored])
278 [ --with-xauth additional path to check for xauth when it is called from pam_xauth
279 [added to the default of /usr/X11R6/bin/xauth, /usr/bin/xauth, /usr/bin/X11/xauth]],
280 pam_xauth_path=${withval})
281 if test x$with_xauth == x ; then
282 AC_PATH_PROG(pam_xauth_path, xauth)
283 dnl There is no sense in adding the first default path
284 if test x$pam_xauth_path == x/usr/X11R6/bin/xauth ; then
289 if test x$pam_xauth_path != x ; then
290 AC_DEFINE_UNQUOTED(PAM_PATH_XAUTH, "$pam_xauth_path",
291 [Additional path of xauth executable])
294 dnl Checks for the existence of libdl - on BSD and Tru64 its part of libc
295 AC_CHECK_LIB([dl], [dlopen], LIBDL="-ldl", LIBDL="")
299 AC_SEARCH_LIBS([FascistCheck],[crack], LIBCRACK="-l$ac_lib", LIBCRACK="")
302 AM_CONDITIONAL([HAVE_LIBCRACK], [test ! -z "$LIBCRACK"])
304 dnl Look for Linux Auditing library - see documentation
305 AC_CHECK_HEADER([libaudit.h])
307 AC_CHECK_LIB(audit, audit_log_user_message, LIBAUDIT=-laudit, LIBAUDIT="")
310 if test ! -z "$LIBAUDIT" ; then
311 AC_DEFINE([HAVE_LIBAUDIT], 1, [Defined if audit support should be compiled in])
315 AC_SEARCH_LIBS([crypt],[xcrypt crypt], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
319 dnl check for libndbm or libdb as fallback
321 AC_CHECK_LIB([ndbm],[dbm_store], LIBDB="-lndbm", LIBDB="")
323 if test -z "$LIBDB" ; then
325 AC_CHECK_LIB([db], [dbm_store], LIBDB="-ldb", LIBDB="")
328 if test -z "$LIBDB" ; then
330 AC_CHECK_LIB([db], [db_create], LIBDB="-ldb", LIBDB="")
334 AM_CONDITIONAL([HAVE_LIBDB], [test ! -z "$LIBDB"])
337 AC_CHECK_LIB([nsl],[yp_get_default_domain], LIBNSL="-lnsl", LIBNSL="")
342 AC_CHECK_LIB([selinux],[getfilecon], LIBSELINUX="-lselinux", LIBSELINUX="")
345 AM_CONDITIONAL([HAVE_LIBSELINUX], [test ! -z "$LIBSELINUX"])
347 dnl Checks for Libcap
349 AC_CHECK_LIB([cap], [cap_get_proc], LIBCAP="-lcap", LIBCAP="" )
352 AM_CONDITIONAL([HAVE_LIBCAP], [test ! -z "$LIBCAP"])
355 AC_CHECK_LIB([pwdb],[pwdb_db_name], LIBPWDB="-lpwdb", LIBPWDB="")
358 AM_CONDITIONAL([HAVE_LIBPWDB], [test ! -z "$LIBPWDB"])
360 dnl Checks for header files.
364 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)
366 AC_CHECK_HEADERS(crypt.h)
367 AC_CHECK_HEADERS(crack.h)
369 dnl For module/pam_userdb
370 AC_CHECK_HEADERS(ndbm.h db.h)
371 dnl I suspect the following two lines are a hack.
372 HAVE_NDBM_H=$ac_cv_header_ndbm_h
373 AC_SUBST(HAVE_NDBM_H)
375 dnl For module/pam_lastlog
376 AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h)
378 dnl Checks for typedefs, structures, and compiler characteristics.
388 dnl Checks for library functions.
390 AC_PROG_GCC_TRADITIONAL
393 AC_CHECK_FUNCS(gethostname gettimeofday lckpwdf mkdir select strcspn strdup strspn strstr strtol uname)
395 AC_CHECK_FUNCS(getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r getgrouplist)
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
420 AM_GNU_GETTEXT_VERSION
421 AM_GNU_GETTEXT([external])
423 AH_VERBATIM([_ZZENABLE_NLS],
426 #define _(msgid) dgettext("Linux-PAM", msgid)
427 #define N_(msgid) msgid
429 #define _(msgid) (msgid)
430 #define N_(msgid) msgid
431 #endif /* ENABLE_NLS */])
433 dnl Files to be created from when we run configure
434 AC_OUTPUT(Makefile libpam/Makefile libpamc/Makefile libpamc/test/Makefile \
435 libpam_misc/Makefile conf/Makefile conf/pam_conv1/Makefile \
438 modules/pam_access/Makefile modules/pam_cracklib/Makefile \
439 modules/pam_debug/Makefile modules/pam_deny/Makefile \
440 modules/pam_echo/Makefile modules/pam_env/Makefile \
441 modules/pam_filter/Makefile modules/pam_filter/upperLOWER/Makefile \
442 modules/pam_ftp/Makefile modules/pam_group/Makefile \
443 modules/pam_issue/Makefile modules/pam_lastlog/Makefile \
444 modules/pam_limits/Makefile modules/pam_listfile/Makefile \
445 modules/pam_localuser/Makefile modules/pam_mail/Makefile \
446 modules/pam_mkhomedir/Makefile modules/pam_motd/Makefile \
447 modules/pam_nologin/Makefile modules/pam_permit/Makefile \
448 modules/pam_pwdb/Makefile modules/pam_rhosts/Makefile \
449 modules/pam_rootok/Makefile \
450 modules/pam_securetty/Makefile modules/pam_selinux/Makefile \
451 modules/pam_shells/Makefile modules/pam_stress/Makefile \
452 modules/pam_succeed_if/Makefile modules/pam_tally/Makefile \
453 modules/pam_time/Makefile modules/pam_umask/Makefile \
454 modules/pam_unix/Makefile modules/pam_userdb/Makefile \
455 modules/pam_warn/Makefile modules/pam_wheel/Makefile \
456 modules/pam_xauth/Makefile doc/Makefile doc/specs/Makefile \