2
# configure.in for the autofs daemon
7
# Disable caching (the script is tiny, and it doesn't work with --with-path)
10
define([AC_CACHE_LOAD], )dnl
11
define([AC_CACHE_SAVE], )dnl
12
AC_INIT(.autofs-5.0.5)
15
# autofs installs by default in /usr
17
AC_PREFIX_DEFAULT(/usr)
20
# The user can specify --with-path=PATH rather than relying on the default
22
searchpath="/usr/bin:/bin:/usr/sbin:/sbin"
24
[ --with-path=PATH look in PATH for binaries needed by the automounter],
25
if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
29
searchpath="${withval}"
33
AC_MSG_CHECKING([for binaries in])
34
AC_MSG_RESULT([$searchpath])
37
# Make sure we have "/proc"
42
# Location of init.d directory?
48
# Location of system config script directory?
52
[ --with-confdir=DIR use DIR for autofs configuration files],
53
if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
60
AC_MSG_CHECKING([for autofs configuration file directory])
61
AC_MSG_RESULT([$confdir])
65
# The user can specify --with-mapsdir=PATH to specify autofs maps go
69
[ --with-mapdir=PATH look in PATH for mount maps used by the automounter],
70
if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
77
AC_MSG_CHECKING([for autofs maps directory])
78
AC_MSG_RESULT([$mapdir])
82
# The user can specify --with-fifodir=PATH to specify where autofs fifos go
86
[ --with-fifodir=PATH use PATH as the directory for fifos used by the automounter],
87
if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
94
AC_MSG_CHECKING([for autofs fifos directory])
95
AC_MSG_RESULT([$fifodir])
99
# The user can specify --with-flagdir=PATH to specify where autofs flag file goes
103
[ --with-flagdir=PATH use PATH as the directory for the flag file used by the automounter],
104
if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
108
filagdir="${withval}"
111
AC_MSG_CHECKING([for autofs flag file directory])
112
AC_MSG_RESULT([$flagdir])
122
# Optional include dmalloc
128
# Programs needed for various system functions or modules
130
AF_PATH_INCLUDE(MOUNT, mount, /bin/mount, $searchpath)
131
AF_PATH_INCLUDE(UMOUNT, umount, /bin/umount, $searchpath)
132
AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath)
133
AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath)
134
AF_PATH_INCLUDE(E4FSCK, fsck.ext4 e4fsck, , $searchpath)
135
AF_PATH_INCLUDE(MODPROBE, modprobe, , $searchpath)
137
AF_CHECK_PROG(LEX, flex lex, , $searchpath)
138
AF_CHECK_PROG(YACC, bison, , $searchpath)
139
AF_CHECK_PROG(RANLIB, ranlib, , $searchpath)
140
AF_CHECK_PROG(RPCGEN, rpcgen, , $searchpath)
143
# Newer mounts have the -s (sloppy) option to ignore unknown options,
144
# good for portability
148
# LDAP SASL auth need libxml
152
# glibc/libc 6 new libraries
154
AC_CHECK_LIB(nsl, yp_match, LIBNSL="-lnsl")
157
AC_CHECK_LIB(resolv, res_query, LIBRESOLV="-lresolv")
161
# Hesiod support? Expect that this may have a special directory...
163
AF_tmp_ldflags="$LDFLAGS"
167
[ --with-hesiod=DIR enable Hesiod support (libs and includes in DIR)],
168
if test "$withval" = no
170
HAVE_HESIOD=0 # Disable
171
elif test -z "$withval" -o "$withval" = 'yes'
173
: Search for Hesiod in normal directory path
175
: Search for Hesiod in specific directory
176
LDFLAGS="$LDFLAGS -L${withval}/lib"
177
LIBHESIOD="-L${withval}/lib"
178
HESIOD_FLAGS="-I${withval}/include"
182
if test -z "$HAVE_HESIOD" -o "$HAVE_HESIOD" != "0"
186
if test "$HAVE_HESIOD" == "1"; then
187
AC_DEFINE(WITH_HESIOD,1,
188
[Define if using Hesiod as a source of automount maps])
191
AC_SUBST(HAVE_HESIOD)
193
AC_SUBST(HESIOD_FLAGS)
194
LDFLAGS="${AF_tmp_ldflags}"
198
AC_CHECK_HEADER(rpcsvc/nis.h, HAVE_NISPLUS=1)
199
AC_SUBST(HAVE_NISPLUS)
202
# OpenLDAP support? Expect that this may have a special directory...
204
AF_tmp_ldflags="$LDFLAGS"
207
AC_ARG_WITH(openldap,
208
[ --with-openldap=DIR enable OpenLDAP map support (libs and includes in DIR)],
209
if test "$withval" = 'no'; then
210
HAVE_LDAP=0 # Disable
211
elif test -z "$withval" -o "$withval" = 'yes'
213
: Search for LDAP in normal directory path
215
: Search for LDAP in specific directory
216
LDFLAGS="$LDFLAGS -L${withval}/lib"
217
LIBLDAP="-L${withval}/lib"
218
LDAP_FLAGS="-I${withval}/include"
221
if test -z "$HAVE_LDAP" -o "$HAVE_LDAP" != "0"; then
223
LDAP_FLAGS="$LDAP_FLAGS -DLDAP_DEPRECATED=1"
224
AC_CHECK_LIB(ldap, ldap_initialize, HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap -llber -lresolv", ,
225
-llber -lresolv $LIBS)
226
if test "$HAVE_LDAP" = "1"; then
227
AC_DEFINE(WITH_LDAP,1,
228
[Define if using LDAP as a source of automount maps])
230
AF_CHECK_FUNC_LDAP_CREATE_PAGE_CONTROL()
231
AF_CHECK_FUNC_LDAP_PARSE_PAGE_CONTROL()
237
LDFLAGS="${AF_tmp_ldflags}"
241
# configure magic taken from:
242
# http://www.timof.qipc.org/autofs/autofs-4.1.4-ldap-20050930.patch
245
AF_tmp_ldflags="$LDFLAGS"
249
[ --with-sasl=DIR enable SASL support for LDAP maps (libs and includes in DIR)],
250
if test "$withval" = 'no'; then
251
HAVE_SASL=0 # Disable
252
elif test -z "$withval" -o "$withval" = 'yes'
254
: Search for SASL in normal directory path
256
: Search for SASL in specific directory
258
LDFLAGS="$LDFLAGS -L${withval}/lib"
259
LIBSASL="-L${withval}/lib"
260
SASL_FLAGS="-I${withval}/include"
263
if test -z "$HAVE_SASL" -o "$HAVE_SASL" != "0" -a "$HAVE_LIBXML" == "1"
266
AC_CHECK_LIB(sasl2, sasl_client_start, HAVE_SASL=1 LIBSASL="$LIBSASL -lsasl2", , -lsasl2 $LIBS)
267
if test "$HAVE_SASL" == "1"; then
268
AC_DEFINE(WITH_SASL,1,
269
[Define if using SASL authentication with the LDAP module])
278
LDFLAGS="${AF_tmp_ldflags}"
281
# Does gcc support building position independent executables?
284
cat > pietest.c <<EOF
285
int main(void) { return 0; }
291
AC_MSG_CHECKING([whether gcc -fPIE works])
292
AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])],
293
[gcc_supports_pie=yes], [gcc_supports_pie=no])
294
AC_MSG_RESULT([$gcc_supports_pie])
295
if test $gcc_supports_pie = yes ; then
296
DAEMON_CFLAGS="-fPIE"
297
DAEMON_LDFLAGS="-pie"
300
AC_SUBST(DAEMON_CFLAGS)
301
AC_SUBST(DAEMON_LDFLAGS)
304
# Enable ability to access value in external env variable
306
AC_ARG_ENABLE(ext-env,
307
[ --disable-ext-env disable search in environment for substitution variable],,
309
if test x$enable_ext_env = xyes; then
310
AC_DEFINE(ENABLE_EXT_ENV, 1, [leave this alone])
314
# Disable use of locking when spawning mount command
316
AC_ARG_ENABLE(mount-locking,
317
[ --disable-mount-locking disable use of locking when spawning mount command],,
319
if test x$enable_mount_locking = xyes -o x$enableval = xyes; then
320
AC_DEFINE(ENABLE_MOUNT_LOCKING, 1, [Disable use of locking when spawning mount command])
324
# Enable forced shutdown on USR1 signal (unlink umounts all mounts).
326
AC_ARG_ENABLE(forced-shutdown,
327
[ --enable-force-shutdown enable USR1 signal to force unlink umount of any
328
busy mounts during shutdown],,
330
if test x$enable_forced_shutdown = xyes -o x$enableval = xyes; then
331
AC_DEFINE(ENABLE_FORCED_SHUTDOWN, 1, [Enable forced shutdown on USR1 signal])
335
# Enable exit, ignoring busy mounts.
337
AC_ARG_ENABLE(ignore-busy,
338
[ --enable-ignore-busy enable exit without umounting busy mounts during
341
if test x$enable_ignore_busy_mounts = xyes -o x$enableval = xyes; then
342
AC_DEFINE(ENABLE_IGNORE_BUSY_MOUNTS, 1, [Enable exit, ignoring busy mounts])
346
# Write Makefile.conf and include/config.h
348
AC_CONFIG_HEADER(include/config.h)
349
AC_OUTPUT(Makefile.conf)
352
# Run make clean since we don't explicitly code the header file dependencies
354
AC_OUTPUT_COMMANDS([make clean])