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])
247 dnl Checks for the existence of libdl - on BSD and Tru64 its part of libc
248 AC_CHECK_LIB([dl], [dlopen], LIBDL="-ldl", LIBDL="")
252 AC_SEARCH_LIBS([FascistCheck],[crack], LIBCRACK="-l$ac_lib", LIBCRACK="")
255 AM_CONDITIONAL([HAVE_LIBCRACK], [test ! -z "$LIBCRACK"])
258 AC_SEARCH_LIBS([crypt],[xcrypt crypt], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
262 dnl check for libndbm or libdb as fallback
264 AC_CHECK_LIB([ndbm],[dbm_store], LIBDB="-lndbm", LIBDB="")
266 if test -z "$LIBDB" ; then
268 AC_CHECK_LIB([db], [dbm_store], LIBDB="-ldb", LIBDB="")
271 if test -z "$LIBDB" ; then
273 AC_CHECK_LIB([db], [db_create], LIBDB="-ldb", LIBDB="")
277 AM_CONDITIONAL([HAVE_LIBDB], [test ! -z "$LIBDB"])
280 AC_CHECK_LIB([nsl],[yp_get_default_domain], LIBNSL="-lnsl", LIBNSL="")
285 AC_CHECK_LIB([selinux],[getfilecon], LIBSELINUX="-lselinux", LIBSELINUX="")
288 AM_CONDITIONAL([HAVE_LIBSELINUX], [test ! -z "$LIBSELINUX"])
290 dnl Checks for Libcap
292 AC_CHECK_LIB([cap], [cap_get_proc], LIBCAP="-lcap", LIBCAP="" )
295 AM_CONDITIONAL([HAVE_LIBCAP], [test ! -z "$LIBCAP"])
298 AC_CHECK_LIB([pwdb],[pwdb_db_name], LIBPWDB="-lpwdb", LIBPWDB="")
301 AM_CONDITIONAL([HAVE_LIBPWDB], [test ! -z "$LIBPWDB"])
303 dnl Checks for header files.
307 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)
309 AC_CHECK_HEADERS(crypt.h)
310 AC_CHECK_HEADERS(crack.h)
312 dnl For module/pam_userdb
313 AC_CHECK_HEADERS(ndbm.h db.h)
314 dnl I suspect the following two lines are a hack.
315 HAVE_NDBM_H=$ac_cv_header_ndbm_h
316 AC_SUBST(HAVE_NDBM_H)
318 dnl For module/pam_lastlog
319 AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h)
321 dnl Checks for typedefs, structures, and compiler characteristics.
331 dnl Checks for library functions.
333 AC_PROG_GCC_TRADITIONAL
336 AC_CHECK_FUNCS(gethostname gettimeofday lckpwdf mkdir select strcspn strdup strerror strspn strstr strtol uname)
338 AC_CHECK_FUNCS(getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r getgrouplist)
340 dnl Checks for programs/utilities
341 AC_CHECK_PROG(SGML2PS, sgml2ps, yes, no)
342 AC_CHECK_PROG(SGML2TXT, sgml2txt, yes, no)
343 AC_CHECK_PROG(SGML2HTML, sgml2html, yes, no)
344 AC_CHECK_PROG(SGML2LATEX, sgml2latex, yes, no)
345 AC_CHECK_PROG(PS2PDF, ps2pdf, yes, no)
346 AM_CONDITIONAL([HAVE_SGML2PS], [test "$SGML2PS" = yes || test "$SGML2LATEX" = yes])
347 AM_CONDITIONAL([HAVE_SGML2TXT], [test "$SGML2TXT" = yes])
348 AM_CONDITIONAL([HAVE_SGML2HTML], [test "$SGML2HTML" = yes])
349 AM_CONDITIONAL([HAVE_PS2PDF], [test "$PS2PDF" = yes])
350 if test $SGML2LATEX = "yes" ; then
351 if sgml2latex -h | grep -e --paper | grep ' -p ' > /dev/null ; then
352 PSER="sgml2latex -o ps"
357 if test $SGML2PS = yes ; then
363 AM_GNU_GETTEXT_VERSION
364 AM_GNU_GETTEXT([external])
366 AH_VERBATIM([_ZZENABLE_NLS],
369 #define _(msgid) dgettext("Linux-PAM", msgid)
370 #define N_(msgid) msgid
372 #define _(msgid) (msgid)
373 #define N_(msgid) msgid
374 #endif /* ENABLE_NLS */])
376 dnl Files to be created from when we run configure
377 AC_OUTPUT(Makefile libpam/Makefile libpamc/Makefile libpamc/test/Makefile \
378 libpam_misc/Makefile conf/Makefile conf/pam_conv1/Makefile \
381 modules/pam_access/Makefile modules/pam_cracklib/Makefile \
382 modules/pam_debug/Makefile modules/pam_deny/Makefile \
383 modules/pam_echo/Makefile modules/pam_env/Makefile \
384 modules/pam_filter/Makefile modules/pam_filter/upperLOWER/Makefile \
385 modules/pam_ftp/Makefile modules/pam_group/Makefile \
386 modules/pam_issue/Makefile modules/pam_lastlog/Makefile \
387 modules/pam_limits/Makefile modules/pam_listfile/Makefile \
388 modules/pam_localuser/Makefile modules/pam_mail/Makefile \
389 modules/pam_mkhomedir/Makefile modules/pam_motd/Makefile \
390 modules/pam_nologin/Makefile modules/pam_permit/Makefile \
391 modules/pam_pwdb/Makefile modules/pam_rhosts/Makefile \
392 modules/pam_rootok/Makefile \
393 modules/pam_securetty/Makefile modules/pam_selinux/Makefile \
394 modules/pam_shells/Makefile modules/pam_stress/Makefile \
395 modules/pam_succeed_if/Makefile modules/pam_tally/Makefile \
396 modules/pam_time/Makefile modules/pam_umask/Makefile \
397 modules/pam_unix/Makefile modules/pam_userdb/Makefile \
398 modules/pam_warn/Makefile modules/pam_wheel/Makefile \
399 modules/pam_xauth/Makefile doc/Makefile doc/specs/Makefile \