1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
|
dnl
dnl --------------------------------------------------------------------------
dnl AF_PATH_INCLUDE:
dnl
dnl Like AC_PATH_PROGS, but add to the .h file as well
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_PATH_INCLUDE,
[AC_PATH_PROGS($1,$2,$3,$4)
if test -n "$$1"; then
AC_DEFINE(HAVE_$1,1,[define if you have $1])
AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1])
HAVE_$1=1
else
HAVE_$1=0
fi
AC_SUBST(HAVE_$1)])
dnl --------------------------------------------------------------------------
dnl AF_CHECK_PROG:
dnl
dnl Like AC_CHECK_PROG, but fail configure if not found
dnl and only define PATH_<name> variable
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_CHECK_PROG,
[AC_PATH_PROGS($1,$2,$3,$4)
if test -n "$$1"; then
AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1])
PATH_$1="$$1"
else
AC_MSG_ERROR([required program $1 not found])
fi
AC_SUBST(PATH_$1)])
dnl --------------------------------------------------------------------------
dnl AF_CHECK_SSS_LIB:
dnl
dnl Check if a sss autofs library exists.
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_CHECK_SSS_LIB,
[if test -z "$sssldir"; then
AC_MSG_CHECKING(for sssd autofs library)
for libd in /usr/lib64 /usr/lib; do
if test -z "$sssldir"; then
if test -e "$libd/sssd/modules/$2"; then
sssldir=$libd/sssd/modules
fi
fi
done
fi
if test -n "$sssldir"; then
HAVE_$1=1
AC_MSG_RESULT(yes)
else
HAVE_$1=0
AC_MSG_RESULT(no)
fi])
dnl --------------------------------------------------------------------------
dnl AF_SLOPPY_MOUNT
dnl
dnl Check to see if mount(8) supports the sloppy (-s) option, and define
dnl the cpp variable HAVE_SLOPPY_MOUNT if so. This requires that MOUNT is
dnl already defined by a call to AF_PATH_INCLUDE or AC_PATH_PROGS.
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_SLOPPY_MOUNT,
[if test -n "$MOUNT" ; then
AC_MSG_CHECKING([if mount accepts the -s option])
if "$MOUNT" -s > /dev/null 2>&1 ; then
enable_sloppy_mount=yes
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi])
dnl --------------------------------------------------------------------------
dnl AF_NO_CANON_UMOUNT
dnl
dnl Check to see if umount(8) supports the no-canonicalize (-c) option, and define
dnl the cpp variable HAVE_NO_CANON_UMOUNT if so. This requires that UMOUNT is
dnl already defined by a call to AF_PATH_INCLUDE or AC_PATH_PROGS.
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_NO_CANON_UMOUNT,
[if test -n "$UMOUNT" ; then
AC_MSG_CHECKING([if umount accepts the -c option])
if "$UMOUNT" -h 2>&1 | grep -e '-c.*--no-canonicalize' > /dev/null 2>&1 ; then
enable_no_canon_umount=yes
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi])
dnl --------------------------------------------------------------------------
dnl AF_LINUX_PROCFS
dnl
dnl Check for the Linux /proc filesystem
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_LINUX_PROCFS,
[AC_CACHE_CHECK([for Linux proc filesystem], [ac_cv_linux_procfs],
[ac_cv_linux_procfs=no
test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" && ac_cv_linux_procfs=yes])
if test $ac_cv_linux_procfs = yes
then
AC_DEFINE(HAVE_LINUX_PROCFS, 1,
[Define if you have the Linux /proc filesystem.])
fi])
dnl --------------------------------------------------------------------------
dnl AF_INIT_D
dnl
dnl Check the location of the init.d directory
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_INIT_D,
[if test -z "$initdir"; then
AC_MSG_CHECKING([location of the init.d directory])
for init_d in /etc/init.d /etc/rc.d/init.d; do
if test -z "$initdir"; then
if test -d "$init_d"; then
initdir="$init_d"
AC_MSG_RESULT($initdir)
fi
fi
done
fi])
dnl --------------------------------------------------------------------------
dnl AF_CONF_D
dnl
dnl Check the location of the configuration defaults directory
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_CONF_D,
[if test -z "$confdir"; then
for conf_d in /etc/sysconfig /etc/defaults /etc/conf.d /etc/default; do
if test -z "$confdir"; then
if test -d "$conf_d"; then
confdir="$conf_d"
fi
fi
done
fi])
dnl --------------------------------------------------------------------------
dnl AF_MAP_D
dnl
dnl Check the location of the autofs maps directory
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_MAP_D,
[if test -z "$mapdir"; then
for map_d in /etc/autofs /etc; do
if test -z "$mapdir"; then
if test -d "$map_d"; then
mapdir="$map_d"
fi
fi
done
fi])
dnl --------------------------------------------------------------------------
dnl AF_PID_D
dnl
dnl Check the location of the pid file directory.
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_PID_D,
[if test -z "$piddir"; then
for pid_d in /run /var/run /tmp; do
if test -z "$piddir"; then
if test -d "$pid_d"; then
piddir="$pid_d"
fi
fi
done
fi])
dnl --------------------------------------------------------------------------
dnl AF_FIFO_D
dnl
dnl Check the location of the autofs fifos directory
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_FIFO_D,
[if test -z "$fifodir"; then
for fifo_d in /run /var/run /tmp; do
if test -z "$fifodir"; then
if test -d "$fifo_d"; then
fifodir="$fifo_d"
fi
fi
done
fi])
dnl --------------------------------------------------------------------------
dnl AF_FLAG_D
dnl
dnl Check the location of the autofs flag file directory
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_FLAG_D,
[if test -z "$flagdir"; then
for flag_d in /run /var/run /tmp; do
if test -z "$flagdir"; then
if test -d "$flag_d"; then
flagdir="$flag_d"
fi
fi
done
fi])
dnl ----------------------------------- ## -*- Autoconf -*-
dnl Check if --with-dmalloc was given. ##
dnl From Franc,ois Pinard ##
dnl ----------------------------------- ##
dnl
dnl Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005
dnl Free Software Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl serial 3
AC_DEFUN([AM_WITH_DMALLOC],
[AC_MSG_CHECKING([if malloc debugging is wanted])
AC_ARG_WITH(dmalloc,
[ --with-dmalloc use dmalloc, as in
http://www.dmalloc.com/dmalloc.tar.gz],
[if test "$withval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_DMALLOC,1,
[Define if using the dmalloc debugging malloc package])
DMALLOCLIB="-ldmallocth"
LDFLAGS="$LDFLAGS -g"
else
AC_MSG_RESULT(no)
fi], [AC_MSG_RESULT(no)])
])
dnl --------------------------------------------------------------------------
dnl AF_WITH_SYSTEMD
dnl
dnl Check the location of the systemd unit files directory
dnl --------------------------------------------------------------------------
AC_DEFUN([AF_WITH_SYSTEMD],
[AC_ARG_WITH(systemd,
[ --with-systemd@<:@=systemddir@:>@ install systemd unit file. If 'yes'
probe the system for unit directory.
If a path is specified, assume that
is a valid install path.],
[if test "$withval" = yes; then
if test -z "$systemddir"; then
AC_MSG_CHECKING([location of the systemd unit files directory])
for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do
if test -z "$systemddir"; then
if test -d "$systemd_d"; then
systemddir="$systemd_d"
fi
fi
done
fi
WITH_SYSTEMD=0
if test -n "$systemddir"; then
AC_MSG_RESULT($systemddir)
WITH_SYSTEMD=1
else
AC_MSG_RESULT(not found)
fi
else
if test "$withval" != no; then
systemddir=$withval
WITH_SYSTEMD=1
fi
fi])
])
dnl --------------------------------------------------------------------------
dnl AF_CHECK_KRB5
dnl
dnl Check for Kerberos 5
dnl --------------------------------------------------------------------------
AC_DEFUN([AF_CHECK_KRB5],
[AC_PATH_PROGS(KRB5_CONFIG, krb5-config, no)
AC_MSG_CHECKING(for Kerberos library)
if test "$KRB5_CONFIG" = "no"
then
AC_MSG_RESULT(no)
HAVE_KRB5=0
else
AC_MSG_RESULT(yes)
HAVE_KRB5=1
KRB5_LIBS=`$KRB5_CONFIG --libs`
KRB5_FLAGS=`$KRB5_CONFIG --cflags`
SAVE_CFLAGS=$CFLAGS
SAVE_LIBS=$LIBS
CFLAGS="$CFLAGS $KRB5_FLAGS"
LIBS="$LIBS $KRB5_LIBS"
AC_CHECK_FUNCS([krb5_principal_get_realm])
CFLAGS="$SAVE_CFLAGS"
LIBS="$SAVE_LIBS"
fi])
dnl --------------------------------------------------------------------------
dnl AF_CHECK_LIBHESIOD
dnl
dnl Check for lib hesiod
dnl --------------------------------------------------------------------------
AC_DEFUN([AF_CHECK_LIBHESIOD],
[AC_MSG_CHECKING(for libhesiod)
# save current libs
af_check_hesiod_save_libs="$LIBS"
LIBS="$LIBS -lhesiod -lresolv"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[ #include <hesiod.h> ]],
[[ void *c; hesiod_init(&c); ]])],
[ HAVE_HESIOD=1
LIBHESIOD="$LIBHESIOD -lhesiod -lresolv"
AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no) ])
# restore libs
LIBS="$af_check_hesiod_save_libs"
])
dnl --------------------------------------------------------------------------
dnl AF_CHECK_FUNC_LDAP_SUPPORT_SASL
dnl
dnl Check for sasl support in ldap
dnl --------------------------------------------------------------------------
AC_DEFUN(
[AF_CHECK_FUNC_LDAP_SUPPORT_SASL],
[AC_MSG_CHECKING(for cyrus sasl support in openldap)
have_openldap_cyrus_sasl=no
# save current libs
af_check_ldap_support_sasl_save_libs="$LIBS"
LIBS="$LIBLDAP"
AC_RUN_IFELSE(
[ AC_LANG_SOURCE(
[ #include <stdlib.h>
#include <ldap.h>
int main (int argc, char **argv) {
LDAP *ldap = NULL;
int lret = 0;
lret = ldap_initialize(&ldap, NULL);
if (lret != LDAP_OPT_SUCCESS) {
exit(1);
}
lret = ldap_set_option(ldap, LDAP_OPT_X_SASL_NOCANON,
LDAP_OPT_ON);
exit(lret == LDAP_OPT_SUCCESS ? 0 : 1);
} ])],
have_openldap_sasl=yes,
have_openldap_sasl=no,
have_openldap_sasl=yes)
AC_MSG_RESULT($have_openldap_sasl)
if test "$have_openldap_sasl" = "yes"; then
AC_DEFINE(WITH_LDAP_CYRUS_SASL,1,
[Define if OpenLDAP was built with Cyrus SASL])
fi
# restore libs
LIBS="$af_check_ldap_parse_page_control_save_libs"
])
dnl --------------------------------------------------------------------------
dnl AF_CHECK_FUNC_LDAP_CREATE_PAGE_CONTROL
dnl
dnl Check for function ldap_create_page_control
dnl --------------------------------------------------------------------------
AC_DEFUN([AF_CHECK_FUNC_LDAP_CREATE_PAGE_CONTROL],
[AC_MSG_CHECKING(for ldap_create_page_control in -lldap)
# save current libs
af_check_ldap_create_page_control_save_libs="$LIBS"
LIBS="$LIBS -lldap"
af_check_ldap_create_page_control_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
AC_LINK_IFELSE(
[ AC_LANG_PROGRAM([[ #include <ldap.h> ]],
[[ LDAP *ld;
ber_int_t ps;
struct berval *c;
int ic, ret;
LDAPControl **clp;
ret = ldap_create_page_control(ld,ps,c,ic,clp); ]])],
[ af_have_ldap_create_page_control=yes
AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no) ])
if test "$af_have_ldap_create_page_control" = "yes"; then
AC_DEFINE(HAVE_LDAP_CREATE_PAGE_CONTROL, 1,
[Define to 1 if you have the `ldap_create_page_control' function.])
fi
# restore libs
LIBS="$af_check_ldap_create_page_control_save_libs"
CFLAGS="$af_check_ldap_create_page_control_save_cflags"
])
dnl --------------------------------------------------------------------------
dnl AF_CHECK_FUNC_LDAP_PARSE_PAGE_CONTROL
dnl
dnl Check for function ldap_parse_page_control
dnl --------------------------------------------------------------------------
AC_DEFUN([AF_CHECK_FUNC_LDAP_PARSE_PAGE_CONTROL],
[AC_MSG_CHECKING(for ldap_parse_page_control in -lldap)
# save current libs
af_check_ldap_parse_page_control_save_libs="$LIBS"
LIBS="$LIBS -lldap"
af_check_ldap_parse_page_control_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[ #define LDAP_DEPRECATED 1
#include <ldap.h> ]],
[[ LDAP *ld;
ber_int_t *ct;
struct berval *c;
int ret;
LDAPControl **clp;
ret = ldap_parse_page_control(ld,clp,ct,c); ]])],
[ af_have_ldap_parse_page_control=yes
AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no) ])
if test "$af_have_ldap_create_page_control" = "yes"; then
AC_DEFINE(HAVE_LDAP_PARSE_PAGE_CONTROL, 1,
[Define to 1 if you have the `ldap_parse_page_control' function.])
fi
# restore libs
LIBS="$af_check_ldap_parse_page_control_save_libs"
CFLAGS="$af_check_ldap_parse_page_control_save_cflags"
])
dnl --------------------------------------------------------------------------
dnl AF_CHECK_YPCLNT_HEADER
dnl
dnl Check for include file rpcsvc/ypclnt.h for YellowPages support.
dnl --------------------------------------------------------------------------
AC_DEFUN([AF_CHECK_YPCLNT_HEADER],
[
# save current CFLAGS
af_check_ypclnt_header_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS $NSL_CFLAGS $TIRPC_CFLAGS"
HAVE_YPCLNT=0
AC_CHECK_HEADER([rpcsvc/ypclnt.h], HAVE_YPCLNT=1)
AC_SUBST(HAVE_YPCLNT)
if test "$HAVE_YPCLNT" = "1"; then
AC_DEFINE(HAVE_YPCLNT, 1,
[Define if using YellowPages])
fi
# restore libs
CFLAGS="$af_check_ypclnt_header_save_cflags"
])
dnl --------------------------------------------------------------------------
dnl AF_CHECK_NIS_HEADER
dnl
dnl Check for include file rpcsvc/nis.h for NIS+ support.
dnl --------------------------------------------------------------------------
AC_DEFUN([AF_CHECK_NIS_HEADER],
[
# save current CFLAGS
af_check_nis_header_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS $NSL_CFLAGS $TIRPC_CFLAGS"
HAVE_NISPLUS=0
AC_CHECK_HEADER([rpcsvc/nis.h], HAVE_NISPLUS=1)
AC_SUBST(HAVE_NISPLUS)
if test "$HAVE_NISPLUS" = "1"; then
AC_DEFINE(HAVE_NISPLUS, 1,
[Define if using NIS+])
fi
# restore libs
CFLAGS="$af_check_nis_header_save_cflags"
])
|