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=75
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 Rules needed for the following (hardcoded Linux defaults for now)
30 CONF_CFLAGS= ; AC_SUBST(CONF_CFLAGS)
31 MKDIR="mkdir -p" ; AC_SUBST(MKDIR)
32 LOCALSRCDIR=`/bin/pwd` ; AC_SUBST(LOCALSRCDIR)
33 OS=`uname|sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
36 dnl These are most likely platform specific - I think HPUX differs
37 DYNTYPE=so ; AC_SUBST(DYNTYPE)
38 LIBDL=-ldl ; AC_SUBST(LIBDL)
39 USESONAME=yes ; AC_SUBST(USESONAME)
40 NEEDSONAME=yes ; AC_SUBST(NEEDSONAME)
41 SHLIBMODE=755 ; AC_SUBST(SHLIBMODE)
43 dnl ### Should enable this INSTALL detection.
44 dnl ### Would need to distribute GNU's config.guess and config.sub
46 INSTALL=/usr/bin/install ; AC_SUBST(INSTALL)
48 dnl Checks for programs.
58 dnl options and defaults
61 dnl lots of debugging information goes to /tmp/pam-debug.log
63 [ --enable-debug qspecify you are building with debugging on],
64 WITH_DEBUG=yes ; AC_DEFINE(DEBUG) , WITH_DEBUG=no)
67 dnl build specially named libraries (for debugging purposes)
68 AC_ARG_ENABLE(libdebug,
69 [ --enable-libdebug specify you are building debugging libraries],
70 WITH_LIBDEBUG=yes ; AC_DEFINE(WITH_LIBDEBUG) , WITH_LIBDEBUG=no)
71 AC_SUBST(WITH_LIBDEBUG)
73 dnl packaging convenience
74 AC_ARG_ENABLE(fakeroot,
75 [ --enable-fakeroot=<path to packaging directory>], FAKEROOT=$enableval)
78 AC_ARG_ENABLE(securedir,
79 [ --enable-securedir=<path to location of PAMs> [default \$libdir/security]],
80 SECUREDIR=$enableval, SECUREDIR=$libdir/security)
83 AC_ARG_ENABLE(sconfigdir,
84 [ --enable-sconfigdir=<path to module conf files> [default \$sysconfdir/security]],
85 SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
88 AC_ARG_ENABLE(suplementedir,
89 [ --enable-suplementedir=<path to module helper binaries> [default \$sbindir]],
90 SUPLEMENTED=$enableval, SUPLEMENTED=$sbindir)
93 AC_ARG_ENABLE(includedir,
94 [ --enable-includedir=<path to include location> - where to put <security>],
95 INCLUDEDIR=$enableval, INCLUDEDIR=/usr/include)
98 AC_ARG_ENABLE(pamlocking,
99 [ --enable-pamlocking configure libpam to observe a global authentication lock],
100 WITH_PAMLOCKING=yes ; AC_DEFINE(PAM_LOCKING) , WITH_PAMLOCKING=no)
101 AC_SUBST(WITH_PAMLOCKING)
103 AC_ARG_ENABLE(uglyhack,
104 [ --enable-uglyhack configure libpam to try to honor old pam_strerror syntax],
105 AC_DEFINE(UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT))
107 AC_ARG_ENABLE(read-both-confs,
108 [ --enable-read-both-confs read both /etc/pam.d and /etc/pam.conf files],
109 AC_DEFINE(PAM_READ_BOTH_CONFS))
110 AC_SUBST(PAM_READ_BOTH_CONFS)
112 AC_ARG_ENABLE(static-libpam, [ --enable-static-libpam build a libpam.a library],
113 STATIC_LIBPAM=yes , STATIC_LIBPAM=no)
114 AC_SUBST(STATIC_LIBPAM)
116 AC_ARG_ENABLE(dynamic-libpam,
117 [ --disable-dynamic-libpam do not build a shared libpam library],
118 DYNAMIC_LIBPAM=no, DYNAMIC_LIBPAM=yes)
119 AC_SUBST(DYNAMIC_LIBPAM)
121 DYNAMIC=-DPAM_DYNAMIC
124 AC_ARG_ENABLE(static-modules,
125 [ --enable-static-modules do not make the modules dynamically loadable],
129 AC_ARG_ENABLE(lckpwdf,
130 [ --disable-lckpwdf do not use the lckpwdf function],
131 WITH_LCKPWDF=no, WITH_LCKPWDF=yes)
132 AC_SUBST(WITH_LCKPWDF)
134 AC_CHECK_HEADERS(paths.h)
135 AC_ARG_WITH(mailspool,
136 [ --with-mailspool path to mail spool directory
137 [default _PATH_MAILDIR if defined in paths.h, otherwise /var/spool/mail]],
138 with_mailspool=${withval})
139 if test x$with_mailspool != x ; then
140 pam_mail_spool="\"$with_mailspool\""
150 }], pam_mail_spool="_PATH_MAILDIR",
151 pam_mail_spool="\"/var/spool/mail\"",
152 pam_mail_spool="\"/var/spool/mail\"")
154 AC_DEFINE_UNQUOTED(PAM_PATH_MAILDIR, $pam_mail_spool)
156 dnl Checks for libraries.
157 AC_CHECK_LIB(c, __libc_sched_setscheduler, PAM_NEEDS_LIBC=, PAM_NEEDS_LIBC=-lc)
158 AC_SUBST(PAM_NEEDS_LIBC)
160 dnl Checks for the existence of lckpwdf in libc
161 AC_CHECK_LIB(c, lckpwdf, HAVE_LCKPWDF=yes, HAVE_LCKPWDF=no)
162 AC_SUBST(HAVE_LCKPWDF)
165 dnl At least on Solaris, the existing libcrack must be dynamic.
166 dnl Ought to introduce a check for this.
168 AC_CHECK_LIB(crack, FascistCheck, HAVE_LIBCRACK=yes ; AC_DEFINE(HAVE_LIBCRACK),
170 AC_SUBST(HAVE_LIBCRACK)
172 AC_CHECK_LIB(crypt, fcrypt, HAVE_LIBCRYPT=yes ; AC_DEFINE(HAVE_LIBCRYPT),
174 AC_SUBST(HAVE_LIBCRYPT)
175 AC_CHECK_LIB(ndbm, dbm_store, HAVE_LIBNDBM=yes ; AC_DEFINE(HAVE_LIBNDBM),
177 AC_SUBST(HAVE_LIBNDBM)
178 AC_CHECK_LIB(db, dbm_store, HAVE_LIBDB=yes ; AC_DEFINE(HAVE_LIBDB),
181 AC_CHECK_LIB(fl, yylex, yyterminate, HAVE_LIBFL=yes ; AC_DEFINE(HAVE_LIBFL),
184 AC_CHECK_LIB(nsl, yp_maplist, HAVE_LIBNSL=yes ; AC_DEFINE(HAVE_LIBNSL),
186 AC_SUBST(HAVE_LIBNSL)
187 AC_CHECK_LIB(pwdb, pwdb_db_name, HAVE_LIBPWDB=yes ; AC_DEFINE(HAVE_LIBPWDB),
189 AC_SUBST(HAVE_LIBPWDB)
191 dnl Checks for header files.
195 AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h termio.h unistd.h)
197 dnl Linux wants features.h in some of the source files.
198 AC_CHECK_HEADERS(features.h)
200 dnl For module/pam_cracklib
201 AC_CHECK_HEADERS(crypt.h)
203 dnl For module/pam_userdb
204 AC_CHECK_HEADERS(ndbm.h db.h)
205 dnl I suspect the following two lines are a hack.
206 HAVE_NDBM_H=$ac_cv_header_ndbm_h
207 AC_SUBST(HAVE_NDBM_H)
209 dnl For module/pam_lastlog
210 AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h)
212 dnl This following rule should be made conditional upon HAVE_LIBCRYPT
215 dnl Look for cracklib dictionary
216 AC_MSG_CHECKING(path to cracklib dictionary)
217 DICT_DIR_CANDIDATES="/usr/lib /usr/share/dict /usr/share/lib \
218 /usr/local/lib /usr/local/share/lib"
219 DICT_FILE_CANDIDATES="pw_dict cracklib_dict"
221 for d in $DICT_DIR_CANDIDATES ; do
222 for f in $DICT_FILE_CANDIDATES ; do
223 if test -r $d/$f.hwm ; then
224 CRACKLIB_DICTPATH=$d/$f
226 elif test -r $d/dict/$f.hwm ; then
227 CRACKLIB_DICTPATH=$d/dict/$f
232 if test -z $CRACKLIB_DICTPATH ; then
233 AC_MSG_RESULT(none found)
235 AC_MSG_RESULT($CRACKLIB_DICTPATH)
237 AC_SUBST(CRACKLIB_DICTPATH)
239 dnl Set FLAGS, linker options etc. depending on C compiler.
240 dnl gcc is tested and much preferred; others less so, if at all
242 dnl If compiling with gcc, linking is also supposed to be done with gcc;
243 dnl since we use linker-specific arguments, we may not gain anything by
244 dnl switching LD_L over, but I think we can use LD_D as-is.
246 dnl For the moment, gcc is enforced above at "CC=gcc".
248 dnl There is an issue over _POSIX_SOURCE _BSD_SOURCE and _GNU_SOURCE .
249 dnl The original "Linux-PAM" had blanket inclusion. But portability
250 dnl requires their default absence: if particular OSes require them,
251 dnl this should be done selectively.
253 GCC_WARNINGS="-Wall -Wwrite-strings \
254 -Wpointer-arith -Wcast-qual -Wcast-align \
255 -Wstrict-prototypes -Wmissing-prototypes \
256 -Wnested-externs -Winline -Wshadow"
258 if test "$GCC" = yes; then
260 ### Non-Linux needs attention on per-OS basis
261 OS_CFLAGS="-ansi -D_POSIX_SOURCE -pedantic"
262 WARNINGS="$GCC_WARNINGS"
264 #can/should we use LD=gcc ???
266 LD_D="gcc -shared -Xlinker -x"
267 LD_L="$LD -x -shared"
271 ### Non-gcc needs attention on per-OS basis
273 ### [These are Solaris-C specific...]
278 LD_D="cc -z text -G -R."
291 dnl Checks for typedefs, structures, and compiler characteristics.
301 dnl Checks for library functions.
303 AC_PROG_GCC_TRADITIONAL
306 AC_CHECK_FUNCS(gethostname gettimeofday mkdir select strcspn strdup strerror strspn strstr strtol uname)
308 dnl Checks for programs/utilities
309 AC_CHECK_PROG(HAVE_SGML2TXT, sgml2txt, yes, no)
310 AC_CHECK_PROG(HAVE_SGML2HTML, sgml2html, yes, no)
311 AC_CHECK_PROG(HAVE_SGML2LATEX, sgml2latex, yes, no)
312 if test $HAVE_SGML2LATEX = "yes" ; then
313 if sgml2latex -h | grep -e --paper | grep ' -p ' > /dev/null ; then
314 PSER="sgml2latex -o ps"
319 AC_CHECK_PROG(HAVE_SGML2PS, sgml2ps, yes, no)
320 if test $HAVE_SGML2PS = yes ; then
326 dnl Files to be created from when we run configure
327 AC_OUTPUT(Make.Rules)