2 # This line will prevent autoreconf from running aclocal again.
3 # generated automatically by aclocal 1.9.5 -*- Autoconf -*-
5 m4_include([libtool.m4])
7 dnl See whether we need a declaration for a function.
8 dnl RADIUSD_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
9 AC_DEFUN(RADIUSD_NEED_DECLARATION,
10 [AC_MSG_CHECKING([whether $1 must be declared])
11 AC_CACHE_VAL(radius_cv_decl_needed_$1,
24 #ifdef HAVE_RESOURCE_H
39 #ifdef HAVE_SYS_SELECT_H
40 #include <sys/select.h>
51 #ifdef HAVE_INTTYPES_H
57 #ifdef HAVE_ARPA_INET_H
58 #include <arpa/inet.h>
61 [char *(*pfn) = (char *(*)) $1],
62 eval "radius_cv_decl_needed_$1=no", eval "radius_cv_decl_needed_$1=yes")])
63 if eval "test \"`echo '$radius_cv_decl_needed_'$1`\" = yes"; then
65 radius_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
66 AC_DEFINE_UNQUOTED($radius_tr_decl)
72 dnl Check multiple functions to see whether each needs a declaration.
73 dnl RADIUSD_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
74 AC_DEFUN(RADIUSD_NEED_DECLARATIONS,
77 RADIUSD_NEED_DECLARATION($ac_func, $2)
81 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
82 dnl The program must properly implement --version.
83 AC_DEFUN(AM_MISSING_PROG,
84 [AC_MSG_CHECKING(for working $2)
85 # Run test in a subshell; some versions of sh will print an error if
86 # an executable is not found, even if stderr is redirected.
87 # Redirect stdin to placate older versions of autoconf. Sigh.
88 if ($2 --version) < /dev/null > /dev/null 2>&1; then
93 AC_MSG_RESULT(missing)
98 dnl Checks to see if this is SUNPro we're building with
100 dnl AC_PROG_CC_SUNPRO
101 AC_DEFUN(AC_PROG_CC_SUNPRO,
102 [AC_CACHE_CHECK(whether we are using SUNPro C, ac_cv_prog_suncc,
103 [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
104 cat > conftest.c <<EOF
109 if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
116 dnl # AC_CHECK_TYPE_INCLUDE([#includes ...], type, default-C-types)
118 dnl # This function is like AC_CHECK_TYPE, but you can give this one
119 dnl # a list of include files to check.
121 AC_DEFUN(AC_CHECK_TYPE_INCLUDE,
123 AC_CACHE_CHECK(for $2, ac_cv_type_$2,
132 if test "$ac_cv_type_$2" != "yes"; then
137 dnl #######################################################################
139 dnl # Look for SNMP in a variety of places.
141 AC_DEFUN(SNMP_CHECKS, [
143 AC_SUBST(SNMP_INCLUDE)
145 AC_MSG_CHECKING([for asn1.h,snmp.h,snmp_impl.h])
148 dnl # First, see if we can build it WITHOUT using any special includes and in ucd-snmp
151 #ifdef HAVE_SYS_TYPES_H
152 #include <sys/types.h>
166 #include <ucd-snmp/ucd-snmp-config.h>
167 #include <ucd-snmp/asn1.h>
168 #include <ucd-snmp/snmp.h>
169 #include <ucd-snmp/snmp_impl.h>],
171 SNMP_INCLUDE="";ucdsnmp=yes,
175 dnl # If not, look for it in a number of directories and in ucd-snmp.
177 if test "x$ucdsnmp" = "x"; then
179 for try in /usr/include /usr/local/include $with_snmp_include_dir; do
180 CFLAGS="$old_CFLAGS -I$try"
182 #ifdef HAVE_SYS_TYPES_H
183 #include <sys/types.h>
197 #include <ucd-snmp/ucd-snmp-config.h>
198 #include <ucd-snmp/asn1.h>
199 #include <ucd-snmp/snmp.h>
200 #include <ucd-snmp/snmp_impl.h>],
202 SNMP_INCLUDE="-I$try";ucdsnmp=yes,
204 if test "x$ucdsnmp" != "x"; then
211 if test "x$ucdsnmp" = "x"; then
213 for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $with_snmp_include_dir; do
214 CFLAGS="$old_CFLAGS -I$try"
216 dnl # First, see if we can build it WITHOUT using any special includes and without ucd-snmp
219 #ifdef HAVE_SYS_TYPES_H
220 #include <sys/types.h>
236 #include <snmp_impl.h>],
238 SNMP_INCLUDE="";ucdsnmp=no,
240 if test "x$ucdsnmp" != "x"; then
248 dnl # If not, look for it in a number of directories and without ucd-snmp
250 if test "x$ucdsnmp" = "x"; then
252 for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $with_snmp_include_dir; do
253 CFLAGS="$old_CFLAGS -I$try"
255 #ifdef HAVE_SYS_TYPES_H
256 #include <sys/types.h>
272 #include <snmp_impl.h>],
274 SNMP_INCLUDE="-I$try";ucdsnmp=no,
276 if test "x$ucdsnmp" != "x"; then
283 if test "x$ucdsnmp" = "x"; then
286 if test "x$ucdsnmp" = "xyes"; then
287 AC_MSG_RESULT((ucd-snmp)yes)
288 AC_DEFINE(HAVE_UCD_SNMP_ASN1_SNMP_SNMPIMPL_H)
291 AC_DEFINE(HAVE_ASN1_SNMP_SNMPIMPL_H)
294 dnl # Now do the same thing, looking for the SNMP library directory
296 AC_MSG_CHECKING([for snmp_build_var_op in -lsnmp])
299 dnl # First, see if we can build it WITHOUT using any special includes
302 LIBS="$old_LIBS -lsnmp"
303 AC_TRY_LINK([extern char snmp_build_var_op();],
304 [ snmp_build_var_op()],
308 if test "x$SNMP_LIBS" = "x"; then
309 for try in /usr/lib /usr/local/lib /usr/local/snmp/lib $with_snmp_lib_dir; do
310 LIBS="$old_LIBS -L$try -lsnmp"
311 AC_TRY_LINK([extern char snmp_build_var_op();],
312 [ snmp_build_var_op()],
313 SNMP_LIBS="-L$try -lsnmp",
315 if test "x$SNMP_LIBS" != "x"; then
319 dnl # That didn't work. Try adding the '-lcrypto' line.
320 dnl # Some SNMP libraries are linked against SSL...
322 LIBS="$old_LIBS -L$try -lsnmp -lcrypto"
323 AC_TRY_LINK([extern char snmp_build_var_op();],
324 [ snmp_build_var_op()],
325 SNMP_LIBS="-L$try -lsnmp -lcrypto",
327 if test "x$SNMP_LIBS" != "x"; then
331 dnl # That didn't work. Try adding the '-lkstat' line.
332 dnl # Some SNMP libraries are linked against Kernel Statistics,
333 dnl # in particular, Solaris 9...
335 LIBS="$old_LIBS -L$try -lsnmp -lcrypto -lkstat"
336 AC_TRY_LINK([extern char snmp_build_var_op();],
337 [ snmp_build_var_op()],
338 SNMP_LIBS="-L$try -lsnmp -lcrypto -lkstat",
340 if test "x$SNMP_LIBS" != "x"; then
348 dnl # If one or the other isn't found, disable them both..
349 dnl # If both are found, enable them both.
352 if test "x$SNMP_LIBS" = "x"; then
358 AC_DEFINE(HAVE_LIBSNMP)
365 dnl # Locate the directory in which a particular file is found.
367 dnl # Usage: AC_LOCATE_DIR(MYSQLLIB_DIR, libmysqlclient.a)
369 dnl # Defines the variable MYSQLLIB_DIR to be the directory(s) in
370 dnl # which the file libmysqlclient.a is to be found.
373 AC_DEFUN(AC_LOCATE_DIR,
375 dnl # If we have the program 'locate', then the problem of finding a
376 dnl # particular file becomes MUCH easier.
380 dnl # No 'locate' defined, do NOT do anything.
382 if test "x$LOCATE" != "x"; then
384 dnl # Root through a series of directories, looking for the given file.
389 for x in `${LOCATE} $file 2>/dev/null`; do
391 dnl # When asked for 'foo', locate will also find 'foo_bar', which we
392 dnl # don't want. We want that EXACT filename.
394 dnl # We ALSO want to be able to look for files like 'mysql/mysql.h',
395 dnl # and properly match them, too. So we try to strip off the last
396 dnl # part of the filename, using the name of the file we're looking
397 dnl # for. If we CANNOT strip it off, then the name will be unchanged.
399 base=`echo $x | sed "s%/${file}%%"`
400 if test "x$x" = "x$base"; then
404 dir=`${DIRNAME} $x 2>/dev/null`
406 dnl # Exclude a number of directories.
408 exclude=`echo ${dir} | ${GREP} /home`
409 if test "x$exclude" != "x"; then
414 dnl # OK, we have an exact match. Let's be sure that we only find ONE
415 dnl # matching directory.
417 already=`echo \$$1 ${DIRS} | ${GREP} ${dir}`
418 if test "x$already" = "x"; then
425 dnl # And remember the directory in which we found the file.
427 eval "$1=\"\$$1 $DIRS\""
431 dnl #######################################################################
433 dnl # Look for a library in a number of places.
435 dnl # AC_SMART_CHECK_LIB(library, function)
437 AC_DEFUN(AC_SMART_CHECK_LIB, [
439 sm_lib_safe=`echo "$1" | sed 'y%./+-%__p_%'`
440 sm_func_safe=`echo "$2" | sed 'y%./+-%__p_%'`
441 AC_MSG_CHECKING([for $2 in -l$1])
448 dnl # Try first any user-specified directory, otherwise we may pick up
449 dnl # the wrong version.
451 if test "x$smart_try_dir" != "x"; then
452 for try in $smart_try_dir; do
453 LIBS="-L$try -l$1 $old_LIBS"
454 AC_TRY_LINK([extern char $2();],
456 smart_lib="-L$try -l$1")
457 if test "x$smart_lib" != "x"; then
465 dnl # Try using the default library path.
467 if test "x$smart_lib" = "x"; then
468 LIBS="-l$1 $old_LIBS"
469 AC_TRY_LINK([extern char $2();],
476 dnl # Try to guess possible locations.
478 if test "x$smart_lib" = "x"; then
479 AC_LOCATE_DIR(smart_lib_dir,[lib$1${libltdl_cv_shlibext}])
480 AC_LOCATE_DIR(smart_lib_dir,[lib$1.a])
482 for try in $smart_lib_dir /usr/local/lib /opt/lib; do
483 LIBS="-L$try -l$1 $old_LIBS"
484 AC_TRY_LINK([extern char $2();],
486 smart_lib="-L$try -l$1")
487 if test "x$smart_lib" != "x"; then
495 dnl # Found it, set the appropriate variable.
497 if test "x$smart_lib" != "x"; then
499 eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
500 LIBS="$smart_lib $old_LIBS"
501 SMART_LIBS="$smart_lib $SMART_LIBS"
507 dnl #######################################################################
509 dnl # Look for a header file in a number of places.
511 dnl # AC_SMART_CHECK_INCLUDE(foo.h, [ #include <other.h> ])
513 AC_DEFUN(AC_SMART_CHECK_INCLUDE, [
515 ac_safe=`echo "$1" | sed 'y%./+-%__pm%'`
516 AC_MSG_CHECKING([for $1])
523 dnl # Try first any user-specified directory, otherwise we may pick up
524 dnl # the wrong version.
526 if test "x$smart_try_dir" != "x"; then
527 for try in $smart_try_dir; do
528 CFLAGS="$old_CFLAGS -I$try"
532 smart_include="-I$try",
534 if test "x$smart_include" != "x"; then
542 dnl # Try using the default includes
544 if test "x$smart_include" = "x"; then
553 dnl # Try to guess possible locations.
555 if test "x$smart_include" = "x"; then
556 AC_LOCATE_DIR(smart_include_dir,$1)
558 for try in $smart_include_dir /usr/local/include /opt/include; do
559 CFLAGS="$old_CFLAGS -I$try"
563 smart_include="-I$try",
565 if test "x$smart_include" != "x"; then
573 dnl # Found it, set the appropriate variable.
575 if test "x$smart_include" != "x"; then
577 eval "ac_cv_header_$ac_safe=yes"
578 CFLAGS="$old_CFLAGS $smart_include"
579 SMART_CFLAGS="$SMART_CFLAGS $smart_include"
585 dnl #######################################################################
587 dnl # Look for a header file in a number of places.
589 dnl # Usage: AC_CHECK_STRUCT_HAS_MEMBER([#include <foo.h>], [struct foo], member)
590 dnl # If the member is defined, then the variable
591 dnl # ac_cv_type_struct_foo_has_member is set to 'yes'
593 AC_DEFUN(AC_CHECK_STRUCT_HAS_MEMBER, [
594 AC_MSG_CHECKING([for $3 in $2])
596 dnl BASED on 'offsetof':
597 dnl #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
603 #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
606 [ int foo = offsetof($2, $3) ],
610 ac_safe_type=`echo "$2" | sed 'y% %_%'`
611 if test "x$has_element" != "x"; then
613 eval "ac_cv_type_${ac_safe_type}_has_$3=yes"
616 eval "ac_cv_type_${ac_safe_type}_has_$3="