1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(conf/pam_conv1/pam_conv.y)
4 dnl The configuration header file
5 AC_CONFIG_HEADER(_pam_aconf.h)
11 LIBPAM_VERSION_MAJOR=0
12 LIBPAM_VERSION_MINOR=76
14 AC_SUBST(LIBPAM_VERSION_MAJOR)
15 AC_SUBST(LIBPAM_VERSION_MINOR)
16 AC_DEFINE(LIBPAM_VERSION_MAJOR)
17 AC_DEFINE(LIBPAM_VERSION_MINOR)
20 dnl By default, everything under PAM is installed under the root fs.
26 dnl Useful info (believed to be portable)
28 LOCALSRCDIR=`/bin/pwd` ; AC_SUBST(LOCALSRCDIR)
29 OS=`uname|sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
33 dnl Rules needed for the following (hardcoded Linux defaults for now)
36 CONF_CFLAGS= ; AC_SUBST(CONF_CFLAGS)
37 MKDIR="mkdir -p" ; AC_SUBST(MKDIR)
39 SHLIBMODE=755 ; AC_SUBST(SHLIBMODE)
41 dnl These are most likely platform specific - I think HPUX differs
42 USESONAME=yes ; AC_SUBST(USESONAME)
43 SOSWITCH=-soname ; AC_SUBST(SOSWITCH)
44 NEEDSONAME=no ; AC_SUBST(NEEDSONAME)
45 LDCONFIG=/sbin/ldconfig ; AC_SUBST(LDCONFIG)
47 dnl ### Should enable this INSTALL detection.
48 dnl ### Would need to distribute GNU's config.guess and config.sub
50 if test "$OS" = "aix"; then
51 INSTALL=/usr/ucb/install -c
53 INSTALL=/usr/bin/install
57 dnl Checks for programs.
67 dnl options and defaults
70 dnl lots of debugging information goes to /tmp/pam-debug.log
72 [ --enable-debug specify you are building with debugging on],
73 WITH_DEBUG=yes ; AC_DEFINE(DEBUG) , WITH_DEBUG=no)
76 AC_ARG_ENABLE(memory-debug,
77 [ --enable-memory-debug specify you want every malloc etc. call tracked],
78 WITH_MEMORY_DEBUG=yes ; AC_DEFINE(MEMORY_DEBUG) , WITH_MEMORY_DEBUG=no)
79 AC_SUBST(WITH_MEMORY_DEBUG)
81 dnl build specially named libraries (for debugging purposes)
82 AC_ARG_ENABLE(libdebug,
83 [ --enable-libdebug specify you are building debugging libraries],
84 WITH_LIBDEBUG=yes ; AC_DEFINE(WITH_LIBDEBUG) , WITH_LIBDEBUG=no)
85 AC_SUBST(WITH_LIBDEBUG)
87 dnl packaging convenience
88 AC_ARG_ENABLE(fakeroot,
89 [ --enable-fakeroot=<path to packaging directory>], FAKEROOT=$enableval)
92 AC_ARG_ENABLE(securedir,
93 [ --enable-securedir=<path to location of PAMs> [default \$libdir/security]],
94 SECUREDIR=$enableval, SECUREDIR=$libdir/security)
97 AC_ARG_ENABLE(sconfigdir,
98 [ --enable-sconfigdir=<path to module conf files> [default \$sysconfdir/security]],
99 SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
102 AC_ARG_ENABLE(suplementedir,
103 [ --enable-suplementedir=<path to module helper binaries> [default \$sbindir]],
104 SUPLEMENTED=$enableval, SUPLEMENTED=$sbindir)
105 AC_SUBST(SUPLEMENTED)
107 AC_ARG_ENABLE(includedir,
108 [ --enable-includedir=<path to include location> - where to put <security>],
109 INCLUDEDIR=$enableval, INCLUDEDIR=/usr/include)
112 AC_ARG_ENABLE(docdir,
113 [ --enable-docdir=<path to store documentation in - /usr/share/doc/pam>],
114 DOCDIR=$enableval, DOCDIR=/usr/share/doc/pam)
117 AC_ARG_ENABLE(mandir,
118 [ --enable-mandir=<path to store manuals in - /usr/share/man>],
119 MANDIR=$enableval, MANDIR=/usr/share/man)
122 AC_ARG_ENABLE(pamlocking,
123 [ --enable-pamlocking configure libpam to observe a global authentication lock],
124 WITH_PAMLOCKING=yes ; AC_DEFINE(PAM_LOCKING) , WITH_PAMLOCKING=no)
125 AC_SUBST(WITH_PAMLOCKING)
127 AC_ARG_ENABLE(uglyhack,
128 [ --enable-uglyhack configure libpam to try to honor old pam_strerror syntax],
129 AC_DEFINE(UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT))
131 AC_ARG_ENABLE(read-both-confs,
132 [ --enable-read-both-confs read both /etc/pam.d and /etc/pam.conf files],
133 AC_DEFINE(PAM_READ_BOTH_CONFS))
134 AC_SUBST(PAM_READ_BOTH_CONFS)
136 AC_ARG_ENABLE(static-libpam, [ --enable-static-libpam build a libpam.a library],
137 STATIC_LIBPAM=yes , STATIC_LIBPAM=no)
138 AC_SUBST(STATIC_LIBPAM)
140 AC_ARG_ENABLE(dynamic-libpam,
141 [ --disable-dynamic-libpam do not build a shared libpam library],
142 DYNAMIC_LIBPAM=no, DYNAMIC_LIBPAM=yes)
143 AC_SUBST(DYNAMIC_LIBPAM)
145 DYNAMIC=-DPAM_DYNAMIC
148 AC_ARG_ENABLE(static-modules,
149 [ --enable-static-modules do not make the modules dynamically loadable],
153 AC_ARG_ENABLE(lckpwdf,
154 [ --disable-lckpwdf do not use the lckpwdf function],
155 WITH_LCKPWDF=no, WITH_LCKPWDF=yes)
156 AC_SUBST(WITH_LCKPWDF)
158 AC_CHECK_HEADERS(paths.h)
159 AC_ARG_WITH(mailspool,
160 [ --with-mailspool path to mail spool directory
161 [default _PATH_MAILDIR if defined in paths.h, otherwise /var/spool/mail]],
162 with_mailspool=${withval})
163 if test x$with_mailspool != x ; then
164 pam_mail_spool="\"$with_mailspool\""
174 }], pam_mail_spool="_PATH_MAILDIR",
175 pam_mail_spool="\"/var/spool/mail\"",
176 pam_mail_spool="\"/var/spool/mail\"")
178 AC_DEFINE_UNQUOTED(PAM_PATH_MAILDIR, $pam_mail_spool)
180 dnl Checks for libraries.
181 AC_CHECK_LIB(c, __libc_sched_setscheduler, PAM_NEEDS_LIBC=, PAM_NEEDS_LIBC=-lc)
182 AC_SUBST(PAM_NEEDS_LIBC)
184 dnl Checks for the existence of lckpwdf in libc
185 AC_CHECK_LIB(c, lckpwdf, HAVE_LCKPWDF=yes, HAVE_LCKPWDF=no)
186 AC_SUBST(HAVE_LCKPWDF)
188 dnl Checks for the existence of libdl - on BSD and Tru64 its part of libc
189 AC_CHECK_LIB(dl, dlopen, LIBDL=-ldl)
193 dnl At least on Solaris, the existing libcrack must be dynamic.
194 dnl Ought to introduce a check for this.
196 AC_CHECK_LIB(crack, FascistCheck, HAVE_LIBCRACK=yes ; AC_DEFINE(HAVE_LIBCRACK),
198 AC_SUBST(HAVE_LIBCRACK)
200 AC_CHECK_LIB(crypt, fcrypt, HAVE_LIBCRYPT=yes ; AC_DEFINE(HAVE_LIBCRYPT),
202 AC_SUBST(HAVE_LIBCRYPT)
203 AC_CHECK_LIB(util, logwtmp, HAVE_LIBUTIL=yes ; AC_DEFINE(HAVE_LIBUTIL),
205 AC_SUBST(HAVE_LIBUTIL)
206 AC_CHECK_LIB(ndbm, dbm_store, HAVE_LIBNDBM=yes ; AC_DEFINE(HAVE_LIBNDBM),
208 AC_SUBST(HAVE_LIBNDBM)
209 AC_CHECK_LIB(db, dbm_store, HAVE_LIBDB=yes ; AC_DEFINE(HAVE_LIBDB),
211 if test x$HAVE_LIBDB != xyes ; then
212 AC_CHECK_LIB(db, db_create, HAVE_LIBDB=yes ; AC_DEFINE(HAVE_LIBDB),
216 AC_CHECK_LIB(fl, yylex, yyterminate, HAVE_LIBFL=yes ; AC_DEFINE(HAVE_LIBFL),
219 AC_CHECK_LIB(nsl, yp_maplist, HAVE_LIBNSL=yes ; AC_DEFINE(HAVE_LIBNSL),
221 AC_SUBST(HAVE_LIBNSL)
222 AC_CHECK_LIB(pwdb, pwdb_db_name, HAVE_LIBPWDB=yes ; AC_DEFINE(HAVE_LIBPWDB),
224 AC_SUBST(HAVE_LIBPWDB)
226 dnl Checks for header files.
230 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)
232 dnl Linux wants features.h in some of the source files.
233 AC_CHECK_HEADERS(features.h)
235 dnl For module/pam_cracklib
236 AC_CHECK_HEADERS(crypt.h)
238 dnl For module/pam_userdb
239 AC_CHECK_HEADERS(ndbm.h db.h)
240 dnl I suspect the following two lines are a hack.
241 HAVE_NDBM_H=$ac_cv_header_ndbm_h
242 AC_SUBST(HAVE_NDBM_H)
244 dnl For module/pam_lastlog
245 AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h)
247 dnl This following rule should be made conditional upon HAVE_LIBCRYPT
250 dnl Look for cracklib dictionary
251 AC_MSG_CHECKING(path to cracklib dictionary)
252 DICT_DIR_CANDIDATES="/usr/lib /usr/share/dict /usr/share/lib \
253 /usr/local/lib /usr/local/share/lib"
254 DICT_FILE_CANDIDATES="pw_dict cracklib_dict"
256 for d in $DICT_DIR_CANDIDATES ; do
257 for f in $DICT_FILE_CANDIDATES ; do
258 if test -r $d/$f.hwm ; then
259 CRACKLIB_DICTPATH=$d/$f
261 elif test -r $d/dict/$f.hwm ; then
262 CRACKLIB_DICTPATH=$d/dict/$f
267 if test -z "$CRACKLIB_DICTPATH" ; then
268 AC_MSG_RESULT(none found)
270 AC_MSG_RESULT($CRACKLIB_DICTPATH)
272 AC_SUBST(CRACKLIB_DICTPATH)
274 dnl Set FLAGS, linker options etc. depending on C compiler.
275 dnl gcc is tested and much preferred; others less so, if at all
277 dnl If compiling with gcc, linking is also supposed to be done with gcc;
278 dnl since we use linker-specific arguments, we may not gain anything by
279 dnl switching LD_L over, but I think we can use LD_D as-is.
281 dnl For the moment, gcc is enforced above at "CC=gcc".
283 dnl There is an issue over _POSIX_SOURCE _BSD_SOURCE and _GNU_SOURCE .
284 dnl The original "Linux-PAM" had blanket inclusion. But portability
285 dnl requires their default absence: if particular OSes require them,
286 dnl this should be done selectively.
288 GCC_WARNINGS="-Wall -Wwrite-strings \
289 -Wpointer-arith -Wcast-qual -Wcast-align \
290 -Wstrict-prototypes -Wmissing-prototypes \
291 -Wnested-externs -Winline -Wshadow"
293 if test "$GCC" = yes; then
294 CC=gcc ; AC_SUBST(CC)
295 ### May need per-OS attention
296 ### Example: -D_POSIX_SOURCE: needed on Linux but harms Solaris.
299 OS_CFLAGS="-ansi -D_POSIX_SOURCE -pedantic"
300 LD_D="gcc -shared -Xlinker -x"
301 WARNINGS="$GCC_WARNINGS"
305 LD_L="$LD -x -shared"
308 CC_STATIC="-Xlinker -export-dynamic"
311 OS_CFLAGS="-ansi -pedantic"
312 LD_D="gcc -shared -Xlinker -x"
313 WARNINGS="$GCC_WARNINGS"
317 LD_L="$LD -x -shared"
320 CC_STATIC="-Xlinker -export-dynamic"
326 LD_L=ld -bexpall -bM:SRE -bnoentry
337 ### Non-gcc needs attention on per-OS basis
341 ### Support for Solaris-C
346 LD_D="cc -z text -G -R."
354 if test "$OSRELEASE" = 6.5; then
357 PIC= #PIC code is default for IRIX
358 LD="cc -shared" # modules friendly approach
360 LD_L="ld -G -z redlocsym"
365 echo "IRIX prior to 6.5 not allowed for"
369 *) echo "Native compiler on $OS is not yet supported"
386 dnl Checks for typedefs, structures, and compiler characteristics.
396 dnl Checks for library functions.
398 AC_PROG_GCC_TRADITIONAL
401 AC_CHECK_FUNCS(gethostname gettimeofday mkdir select strcspn strdup strerror strspn strstr strtol uname)
403 AC_CHECK_FUNCS(getpwnam_r getgrnam_r)
405 dnl Checks for programs/utilities
406 AC_CHECK_PROG(HAVE_SGML2TXT, sgml2txt, yes, no)
407 AC_CHECK_PROG(HAVE_SGML2HTML, sgml2html, yes, no)
408 AC_CHECK_PROG(HAVE_SGML2LATEX, sgml2latex, yes, no)
409 if test $HAVE_SGML2LATEX = "yes" ; then
410 if sgml2latex -h | grep -e --paper | grep ' -p ' > /dev/null ; then
411 PSER="sgml2latex -o ps"
416 AC_CHECK_PROG(HAVE_SGML2PS, sgml2ps, yes, no)
417 if test $HAVE_SGML2PS = yes ; then
423 dnl Files to be created from when we run configure
424 AC_OUTPUT(Make.Rules)