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.1.0)
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 options and defaults
148 AM_PATH_LIBPRELUDE([0.9.0])
149 if test "$LIBPRELUDE_CONFIG" != "no" ; then
150 LIBPRELUDE_CFLAGS="$LIBPRELUDE_CFLAGS -DPRELUDE=1"
153 dnl lots of debugging information goes to /var/run/pam-debug.log
154 AC_ARG_ENABLE([debug],
155 AC_HELP_STRING([--enable-debug],
156 [specify you are building with debugging on]),
157 WITH_DEBUG=yes ; AC_DEFINE([DEBUG],,
158 [lots of stuff gets written to /var/run/pam-debug.log]),
162 AC_ARG_ENABLE([memory-debug],
163 AC_HELP_STRING([--enable-memory-debug],[specify you want every malloc etc. call tracked]),
164 WITH_MEMORY_DEBUG=$enableval, WITH_MEMORY_DEBUG=no)
165 if test "$WITH_MEMORY_DEBUG" != "no" ; then
166 AC_DEFINE([MEMORY_DEBUG], 1, [Every malloc etc. call will be tracked])
168 AH_VERBATIM([_MEMORY_DEBUG],
171 * this is basically a hack - we need to include a semiarbitrary
172 * number of headers to ensure that we don't get silly prototype/macro
176 # include <security/pam_malloc.h>
177 #endif /* MEMORY_DEBUG */])
179 AC_ARG_ENABLE(securedir,
180 [ --enable-securedir=<path to location of PAMs> [default \$libdir/security]],
181 SECUREDIR=$enableval, SECUREDIR=$libdir/security)
184 AC_ARG_ENABLE([isadir],
185 AC_HELP_STRING([--enable-isadir=DIR],[path to arch-specific module files [default ../../`basename $libdir`/security]]),
187 ISA=../../`basename $libdir`/security)
189 AC_DEFINE_UNQUOTED(_PAM_ISA,"$ISA",[Define to the path, relative to SECUREDIR, where PAMs specific to this architecture can be found.])
190 AC_MSG_RESULT([Defining \$ISA to "$ISA"])
192 AC_ARG_ENABLE(sconfigdir,
193 [ --enable-sconfigdir=<path to module conf files> [default \$sysconfdir/security]],
194 SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
197 AC_ARG_ENABLE(docdir,
198 [ --enable-docdir=<path to store documentation in - /usr/share/doc/pam>],
199 DOCDIR=$enableval, DOCDIR=/usr/share/doc/pam)
203 AC_ARG_ENABLE(pamlocking,
204 [ --enable-pamlocking configure libpam to observe a global authentication lock],
205 WITH_PAMLOCKING=yes ; AC_DEFINE([PAM_LOCKING],,
206 [libpam should observe a global authentication lock]),
208 AC_SUBST(WITH_PAMLOCKING)
210 AC_ARG_ENABLE(read-both-confs,
211 [ --enable-read-both-confs read both /etc/pam.d and /etc/pam.conf files],
212 AC_DEFINE([PAM_READ_BOTH_CONFS],,
213 [read both /etc/pam.d and /etc/pam.conf files]))
214 AC_SUBST(PAM_READ_BOTH_CONFS)
216 AC_ARG_ENABLE([lckpwdf],
217 AC_HELP_STRING([--disable-lckpwdf],[do not use the lckpwdf function]),
218 WITH_LCKPWDF=$enableval, WITH_LCKPWDF=yes)
219 if test "$WITH_LCKPWDF" == "yes" ; then
220 AC_DEFINE([USE_LCKPWDF], 1,
221 [Define to 1 if the lckpwdf function should be used])
224 AC_CHECK_HEADERS(paths.h)
225 AC_ARG_WITH(mailspool,
226 [ --with-mailspool path to mail spool directory
227 [default _PATH_MAILDIR if defined in paths.h, otherwise /var/spool/mail]],
228 with_mailspool=${withval})
229 if test x$with_mailspool != x ; then
230 pam_mail_spool="\"$with_mailspool\""
240 }], pam_mail_spool="_PATH_MAILDIR",
241 pam_mail_spool="\"/var/spool/mail\"",
242 pam_mail_spool="\"/var/spool/mail\"")
244 AC_DEFINE_UNQUOTED(PAM_PATH_MAILDIR, $pam_mail_spool,
245 [Path where mails are stored])
248 [ --with-xauth additional path to check for xauth when it is called from pam_xauth
249 [added to the default of /usr/X11R6/bin/xauth, /usr/bin/xauth, /usr/bin/X11/xauth]],
250 pam_xauth_path=${withval})
251 if test x$with_xauth == x ; then
252 AC_PATH_PROG(pam_xauth_path, xauth)
253 dnl There is no sense in adding the first default path
254 if test x$pam_xauth_path == x/usr/X11R6/bin/xauth ; then
259 if test x$pam_xauth_path != x ; then
260 AC_DEFINE_UNQUOTED(PAM_PATH_XAUTH, "$pam_xauth_path",
261 [Additional path of xauth executable])
264 dnl Checks for the existence of libdl - on BSD and Tru64 its part of libc
265 AC_CHECK_LIB([dl], [dlopen], LIBDL="-ldl", LIBDL="")
269 AC_SEARCH_LIBS([FascistCheck],[crack], LIBCRACK="-l$ac_lib", LIBCRACK="")
272 AM_CONDITIONAL([HAVE_LIBCRACK], [test ! -z "$LIBCRACK"])
275 AC_SEARCH_LIBS([crypt],[xcrypt crypt], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
279 dnl check for libndbm or libdb as fallback
281 AC_CHECK_LIB([ndbm],[dbm_store], LIBDB="-lndbm", LIBDB="")
283 if test -z "$LIBDB" ; then
285 AC_CHECK_LIB([db], [dbm_store], LIBDB="-ldb", LIBDB="")
288 if test -z "$LIBDB" ; then
290 AC_CHECK_LIB([db], [db_create], LIBDB="-ldb", LIBDB="")
294 AM_CONDITIONAL([HAVE_LIBDB], [test ! -z "$LIBDB"])
297 AC_CHECK_LIB([nsl],[yp_get_default_domain], LIBNSL="-lnsl", LIBNSL="")
302 AC_CHECK_LIB([selinux],[getfilecon], LIBSELINUX="-lselinux", LIBSELINUX="")
305 AM_CONDITIONAL([HAVE_LIBSELINUX], [test ! -z "$LIBSELINUX"])
307 dnl Checks for Libcap
309 AC_CHECK_LIB([cap], [cap_get_proc], LIBCAP="-lcap", LIBCAP="" )
312 AM_CONDITIONAL([HAVE_LIBCAP], [test ! -z "$LIBCAP"])
315 AC_CHECK_LIB([pwdb],[pwdb_db_name], LIBPWDB="-lpwdb", LIBPWDB="")
318 AM_CONDITIONAL([HAVE_LIBPWDB], [test ! -z "$LIBPWDB"])
320 dnl Checks for header files.
324 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)
326 AC_CHECK_HEADERS(crypt.h)
327 AC_CHECK_HEADERS(crack.h)
329 dnl For module/pam_userdb
330 AC_CHECK_HEADERS(ndbm.h db.h)
331 dnl I suspect the following two lines are a hack.
332 HAVE_NDBM_H=$ac_cv_header_ndbm_h
333 AC_SUBST(HAVE_NDBM_H)
335 dnl For module/pam_lastlog
336 AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h)
338 dnl Checks for typedefs, structures, and compiler characteristics.
348 dnl Checks for library functions.
350 AC_PROG_GCC_TRADITIONAL
353 AC_CHECK_FUNCS(gethostname gettimeofday lckpwdf mkdir select strcspn strdup strerror strspn strstr strtol uname)
355 AC_CHECK_FUNCS(getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r getgrouplist)
357 dnl Checks for programs/utilities
358 AC_CHECK_PROG(SGML2PS, sgml2ps, yes, no)
359 AC_CHECK_PROG(SGML2TXT, sgml2txt, yes, no)
360 AC_CHECK_PROG(SGML2HTML, sgml2html, yes, no)
361 AC_CHECK_PROG(SGML2LATEX, sgml2latex, yes, no)
362 AC_CHECK_PROG(PS2PDF, ps2pdf, yes, no)
363 AM_CONDITIONAL([HAVE_SGML2PS], [test "$SGML2PS" = yes || test "$SGML2LATEX" = yes])
364 AM_CONDITIONAL([HAVE_SGML2TXT], [test "$SGML2TXT" = yes])
365 AM_CONDITIONAL([HAVE_SGML2HTML], [test "$SGML2HTML" = yes])
366 AM_CONDITIONAL([HAVE_PS2PDF], [test "$PS2PDF" = yes])
367 if test $SGML2LATEX = "yes" ; then
368 if sgml2latex -h | grep -e --paper | grep ' -p ' > /dev/null ; then
369 PSER="sgml2latex -o ps"
374 if test $SGML2PS = yes ; then
380 AM_GNU_GETTEXT_VERSION
381 AM_GNU_GETTEXT([external])
383 AH_VERBATIM([_ZZENABLE_NLS],
386 #define _(msgid) dgettext("Linux-PAM", msgid)
387 #define N_(msgid) msgid
389 #define _(msgid) (msgid)
390 #define N_(msgid) msgid
391 #endif /* ENABLE_NLS */])
393 dnl Files to be created from when we run configure
394 AC_OUTPUT(Makefile libpam/Makefile libpamc/Makefile libpamc/test/Makefile \
395 libpam_misc/Makefile conf/Makefile conf/pam_conv1/Makefile \
398 modules/pam_access/Makefile modules/pam_cracklib/Makefile \
399 modules/pam_debug/Makefile modules/pam_deny/Makefile \
400 modules/pam_echo/Makefile modules/pam_env/Makefile \
401 modules/pam_filter/Makefile modules/pam_filter/upperLOWER/Makefile \
402 modules/pam_ftp/Makefile modules/pam_group/Makefile \
403 modules/pam_issue/Makefile modules/pam_lastlog/Makefile \
404 modules/pam_limits/Makefile modules/pam_listfile/Makefile \
405 modules/pam_localuser/Makefile modules/pam_mail/Makefile \
406 modules/pam_mkhomedir/Makefile modules/pam_motd/Makefile \
407 modules/pam_nologin/Makefile modules/pam_permit/Makefile \
408 modules/pam_pwdb/Makefile modules/pam_rhosts/Makefile \
409 modules/pam_rootok/Makefile \
410 modules/pam_securetty/Makefile modules/pam_selinux/Makefile \
411 modules/pam_shells/Makefile modules/pam_stress/Makefile \
412 modules/pam_succeed_if/Makefile modules/pam_tally/Makefile \
413 modules/pam_time/Makefile modules/pam_umask/Makefile \
414 modules/pam_unix/Makefile modules/pam_userdb/Makefile \
415 modules/pam_warn/Makefile modules/pam_wheel/Makefile \
416 modules/pam_xauth/Makefile doc/Makefile doc/specs/Makefile \