1 dnl #############################################################
3 dnl # For information about autoconf, see:
5 dnl # http://www.gnu.org/software/autoconf/
7 dnl # The recommended order is:
10 dnl # 0. checks for compiler, libtool, and command line options
11 dnl # 1. checks for programs
12 dnl # 2. checks for libraries
13 dnl # 3. checks for header files
14 dnl # 4. checks for typedefs
15 dnl # 5. checks for structures and functions
16 dnl # 6. checks for compiler characteristics
17 dnl # 7. checks for library functions
18 dnl # 8. checks for system services
19 dnl # AC_OUTPUT([file...])
21 dnl #############################################################
24 export CFLAGS LIBS LDFLAGS CPPFLAGS
25 AC_INIT(src/main/radiusd.c)
26 AC_CONFIG_HEADER(src/include/autoconf.h)
27 AC_REVISION($Revision$)dnl
29 dnl # The version of the software
30 RADIUSD_MAJOR_VERSION=1
31 RADIUSD_MINOR_VERSION=1.0-pre0
32 RADIUSD_VERSION="${RADIUSD_MAJOR_VERSION}.${RADIUSD_MINOR_VERSION}"
35 dnl #############################################################
37 dnl # 0. Checks for compiler, libtool, and command line options.
39 dnl #############################################################
46 dnl # check for AIX, to allow us to use some BSD functions
47 dnl # must be before macros that call the compiler.
51 AC_PROG_GCC_TRADITIONAL
55 abs_top_builddir=`pwd`
56 AC_SUBST(abs_top_builddir)
58 dnl Compile in large (2G+) file support.
61 dnl # check for system bytesex
62 dnl # AC_DEFINES WORDS_BIGENDIAN
66 AC_CHECK_PROG(GMAKE, gmake, yes, no)
67 if test $GMAKE = no; then
68 AC_PATH_PROG(MAKE, make, /usr/local/bin/make)
70 AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make)
72 makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"`
73 if test -z "$makever"; then
74 AC_MSG_ERROR(GNU Make is not installed. Please download and install it
75 from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.)
78 dnl libltdl is installable
79 AC_LIBLTDL_INSTALLABLE
81 dnl use system-wide libtool, if it exists
82 AC_ARG_WITH(system-libtool,
83 [ --with-system-libtool try to use libtool installed in your system [default=use our own]],
84 [ AC_PATH_PROG(LIBTOOL, libtool,,$PATH:/usr/local/bin) ],
86 LIBTOOL="`pwd`/libtool"
88 dnl ensure that we're looking for dlopen
91 dnl Figure out how to build shared libraries
96 dnl Put this in later, when all distributed modules use autoconf.
97 dnl AC_ARG_WITH(disablemodulefoo,
98 dnl [ --without-rlm_foo Disables module compilation. Module list:]
99 dnl esyscmd([find src/modules -type d -name rlm_\* -print |\
100 dnl sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\
101 dnl awk '{print " "$0}']))
103 AC_ARG_ENABLE(strict-dependencies,
104 [ --enable-strict-dependencies Fail configure on lack of module dependancy.])
106 dnl extra argument: --with-logdir
107 logdir='${localstatedir}/log/radius'
108 AC_MSG_CHECKING(logdir)
110 [ --with-logdir=DIR Directory for logfiles [LOCALSTATEDIR/log/radius] ],
113 AC_MSG_ERROR(Need logdir)
123 AC_MSG_RESULT($logdir)
125 dnl extra argument: --with-radacctdir
126 radacctdir='${logdir}/radacct'
127 AC_MSG_CHECKING(radacctdir)
128 AC_ARG_WITH(radacctdir,
129 [ --with-radacctdir=PATH Directory for detail files [LOGDIR/radacct] ],
132 AC_MSG_ERROR(Need radacctdir)
137 radacctdir="$withval"
142 AC_MSG_RESULT($radacctdir)
144 dnl extra argument: --with-raddbdir
145 raddbdir='${sysconfdir}/raddb'
146 AC_MSG_CHECKING(raddbdir)
147 AC_ARG_WITH(raddbdir,
148 [ --with-raddbdir=DIR Directory for config files [SYSCONFDIR/raddb] ],
151 AC_MSG_ERROR(Need raddbdir)
161 AC_MSG_RESULT($raddbdir)
163 dnl extra argument: --with-ascend-binary
165 AC_ARG_WITH(ascend-binary,
166 [ --with-ascend-binary Include support for Ascend binary filter attributes (default=yes)],
174 if test "X$ASCEND_BINARY" = "Xyes"; then
175 AC_DEFINE(ASCEND_BINARY, [], [Include support for Ascend binary filter attributes])
178 dnl extra argument: --with-threads
181 [ --with-threads Use threads, if available. (default=yes) ],
190 dnl extra argument: --with-snmp
193 [ --with-snmp Compile in SNMP support. (default=yes)],
202 dnl AC_ARG_ENABLE(ltdl-install,
203 dnl [ --disable-ltdl-install do not install libltdl])
204 dnl if test x"${enable_ltdl_install+set}" != xset; then
205 dnl enable_ltdl_install=yes
206 dnl ac_configure_args="$ac_configure_args --enable-ltdl-install"
208 dnl AC_CONFIG_SUBDIRS(libltdl)
211 dnl # Allow the user to specify a list of modules to be linked
212 dnl # statically to the server.
215 AC_ARG_WITH(static_modules,
216 [ --with-static-modules=QUOTED-MODULE-LIST],[
217 for i in $withval; do
218 STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
223 dnl # Enable developer C compiler warnings
225 AC_ARG_ENABLE(developer,
226 [ --enable-developer Enables features of interest to developers.],
227 [ case "$enableval" in
236 if test "x$developer" != "xno" -a -d $srcdir/CVS; then
237 dnl turn on the developer flag when taken from a CVS checkout (not a release)
241 dnl extra argument: --with-experimental-modules
243 AC_ARG_WITH(experimental-modules,
244 [ --with-experimental-modules Use experimental and unstable modules. (default=no) ],
254 dnl # extra argument: --openssl-includes=dir
256 AC_ARG_WITH(openssl-includes,
257 [ --with-openssl-includes=DIR Directory to look for OpenSSL include files],
259 *) OPENSSL_INCLUDE_DIR="$withval"
265 dnl # extra argument: --openssl-libraries=dir
267 AC_ARG_WITH(openssl-libraries,
268 [ --with-openssl-libraries=DIR Directory to look for OpenSSL library files],
270 *) OPENSSL_LIB_DIR="$withval"
276 dnl # These next two arguments don't actually do anything. They're
277 dnl # place holders so that the top-level configure script can tell
278 dnl # the user how to configure lower-level modules
282 dnl # extra argument: --with-rlm-FOO-lib-dir
284 AC_ARG_WITH(rlm-FOO-lib-dir,
285 [ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO],
293 dnl # extra argument: --with-rlm-FOO-include-dir
295 AC_ARG_WITH(rlm-FOO-include-dir,
296 [ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO],
303 dnl See what include-style is used by the make program.
304 dnl AC_MSG_CHECKING(include style for make)
305 dnl echo "include /dev/null" > testmake.$$
306 dnl echo "all:" >> testmake.$$
307 dnl make -f testmake.$$ >/dev/null 2>&1
316 dnl rm -f testmake.$$
317 dnl AC_MSG_RESULT(" $INCLUDE")
318 dnl AC_SUBST(INCLUDE)
321 dnl extra argument: --with-udpfromto
323 AC_ARG_WITH(udpfromto,
324 [ --with-udpfromto Compile in UDPFROMTO support. (default=no)],
334 if test "x$WITH_UDPFROMTO" = "xyes"; then
335 AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto])
338 dnl #############################################################
340 dnl # 1. Checks for programs
342 dnl #############################################################
345 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
346 if test "x$ac_cv_path_PERL" = "x"; then
347 AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
349 AC_PATH_PROG(SNMPGET, snmpget)
350 if test "x$ac_cv_path_SNMPGET" = "x"; then
351 AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
354 AC_PATH_PROG(SNMPWALK, snmpwalk)
355 if test "x$ac_cv_path_SNMPWALK" = "x"; then
356 AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
359 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
361 dnl FIXME This is truly gross.
362 missing_dir=`cd $ac_aux_dir && pwd`
363 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
364 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
365 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
367 AC_PATH_PROG(LOCATE,locate)
368 AC_PATH_PROG(DIRNAME,dirname)
369 AC_PATH_PROG(GREP,grep)
371 dnl #############################################################
373 dnl # 2. Checks for libraries
375 dnl #############################################################
377 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
379 if test "x$WITH_THREADS" = "xyes"; then
380 if test $ac_cv_prog_suncc = "yes"; then
384 AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
387 dnl # pthread stuff is usually in -lpthread
388 dnl # or in -lc_r, on *BSD
390 dnl # On Some systems, we need extra pre-processor flags, to get them to
391 dnl # to do the threading properly.
393 AC_CHECK_LIB(pthread, pthread_create,
394 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
395 LIBS="$LIBS -lpthread" ],
396 AC_CHECK_LIB(c_r, pthread_create,
397 [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
398 [ WITH_THREADS="no" ]
404 dnl # If we have NO pthread libraries, remove any knowledge of threads.
406 if test "x$WITH_THREADS" != "xyes"; then
408 ac_cv_header_pthread_h="no"
412 dnl # We need sem_init() and friends, as they're the friendliest
413 dnl # semaphore functions for threading.
415 dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
416 dnl # Some systems have them in -lsem
417 dnl # Solaris has them in -lposix4
418 dnl # NetBSD has them in -lsemaphore
420 AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore,
422 [AC_MSG_ERROR(-lsem not found. You may want to download it from ftp://ftp.to.gd-es.com/pub/BSDI/libsem.tar.bz2 or ftp://ftp.freeradius.org/pub/radius/contrib/libsem.tar.gz)]
426 dnl Check if we need -lsocket
427 AC_CHECK_LIB(socket, getsockname)
429 dnl Check for -lresolv
430 dnl This library may be needed later.
431 AC_CHECK_LIB(resolv, inet_aton)
433 dnl Check if we need -lnsl. Usually if we want to
434 dnl link against -lsocket we need to include -lnsl as well.
435 AC_CHECK_LIB(nsl, inet_ntoa)
437 dnl #############################################################
439 dnl # 3. Checks for header files
441 dnl #############################################################
444 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
445 dnl # getopt will be #included, but won't link. <sigh>
450 CFLAGS="$CFLAGS -D_ALL_SOURCE"
453 CFLAGS="$CFLAGS -DDARWIN"
495 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H, [], [define this if we have the <regex.h> header file]))
496 if test "x$ac_cv_header_regex_h" = "xyes"; then
504 ], [AC_DEFINE(HAVE_REG_EXTENDED, [], [define this if we have REG_EXTENDED (from <regex.h>)]) REGEX_EXTENDED=yes])
507 AC_SUBST(REGEX_EXTENDED)
510 dnl # other checks which require headers
512 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
514 AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication])
517 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
519 AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication])
522 smart_try_dir="$OPENSSL_INCLUDE_DIR"
523 dnl # stupid RedHat shit
524 CFLAGS="$CFLAGS -DOPENSSL_NO_KRB5"
525 FR_SMART_CHECK_INCLUDE(openssl/ssl.h)
528 if test "x$ac_cv_header_openssl_ssl_h" = "xyes"; then
529 AC_DEFINE(HAVE_OPENSSL_SSL_H, [], [define if you have openssl/ssl.h])
530 old_CPPFLAGS="$CPPFLAGS"
531 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
532 CPPFLAGS="-I$OPENSSL_INCLUDE_DIR $CPPFLAGS"
540 CPPFLAGS="$old_CPPFLAGS"
542 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
543 old_CPPFLAGS=$CPPFLAGS
545 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
546 CPPFLAGS="-I$OPENSSL_INCLUDE_DIR"
549 [#include <openssl/crypto.h>
550 #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
554 if test "x$goodssl" != "xyes"; then
561 # Look for the OpenSSL libraries.
562 smart_try_dir=$OPENSSL_LIB_DIR
563 FR_SMART_CHECK_LIB(crypto, DH_new)
564 if test "x$ac_cv_lib_crypto_DH_new" = "xyes"; then
565 FR_SMART_CHECK_LIB(ssl, SSL_new)
566 if test "x$ac_cv_lib_ssl_SSL_new" = "xyes"; then
567 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
568 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR"
570 if test "x$OPENSSL_LIB_DIR" != "x"; then
571 OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
573 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
580 CPPFLAGS=$old_CPPFLAGS
583 AC_SUBST(OPENSSL_INCLUDE)
584 AC_SUBST(OPENSSL_LIBS)
587 dnl #############################################################
589 dnl # 4. Checks for typedefs
591 dnl #############################################################
594 dnl # Ensure that these are defined
601 dnl check for socklen_t
602 FR_CHECK_TYPE_INCLUDE([
603 #ifdef HAVE_SYS_TYPES_H
604 #include <sys/types.h>
606 #ifdef HAVE_SYS_SOCKET_H
607 #include <sys/socket.h>
609 ],socklen_t, int, [socklen_t is generally 'int' on systems which don't use it])
611 dnl check for uint8_t
612 FR_CHECK_TYPE_INCLUDE([
613 #ifdef HAVE_INTTYPES_H
614 #include <inttypes.h>
619 ],uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic])
621 dnl check for uint16_t
622 FR_CHECK_TYPE_INCLUDE([
623 #ifdef HAVE_INTTYPES_H
624 #include <inttypes.h>
629 ],uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic])
631 dnl check for uint32_t
632 FR_CHECK_TYPE_INCLUDE([
633 #ifdef HAVE_INTTYPES_H
634 #include <inttypes.h>
639 ],uint32_t, unsigned int, [uint32_t should be the canonical 'network integer])
641 AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [], [
642 #ifdef HAVE_NETINET_IN_H
643 #include <netinet/in.h>
647 AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [], [
648 #ifdef HAVE_NETINET_IN_H
649 #include <netinet/in.h>
651 #ifdef HAVE_SYS_SOCKET_H
652 #include <sys/socket.h>
656 AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], [
657 #ifdef HAVE_NETINET_IN_H
658 #include <netinet/in.h>
662 AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [], [
663 #ifdef HAVE_SYS_TYPES_H
664 #include <sys/types.h>
666 #ifdef HAVE_SYS_SOCKET_H
667 #include <sys/socket.h>
674 dnl #############################################################
676 dnl # 5. Checks for structures and functions
678 dnl #############################################################
709 RADIUSD_NEED_DECLARATIONS( \
722 dnl # check if we have utmpx.h
723 dnl # if so, check if struct utmpx has entry ut_xtime
724 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
725 if test "x$ac_cv_header_utmpx_h" = "xyes"
727 FR_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
728 if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
730 AC_DEFINE(ut_xtime,ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx])
734 dnl # struct ip_pktinfo
735 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
736 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
738 AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)])
741 dnl # struct in6_pktinfo
742 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in6_pktinfo], ipi6_addr)
743 if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes"
745 AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)])
748 dnl #############################################################
750 dnl # 6. Checks for compiler characteristics
752 dnl #############################################################
755 dnl # Ensure that these are defined
760 dnl # See if this is OS/2
762 AC_MSG_CHECKING(type of OS)
765 if test "$OS" = "OS/2"; then
773 dnl # Set Default CFLAGS
775 if test "x$GCC" = "xyes"; then
776 CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
779 AC_MSG_CHECKING(for developer gcc flags)
780 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
781 devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"
782 CFLAGS="$CFLAGS $devflags"
784 AC_MSG_RESULT(yes. Using $devflags)
787 CFLAGS="$CFLAGS -DNDEBUG"
792 dnl #############################################################
794 dnl # 7. Checks for library functions
796 dnl #############################################################
798 dnl Check for libcrypt
799 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
800 AC_CHECK_LIB(crypt, crypt,
803 if test "$CRYPTLIB" != ""; then
804 AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])
806 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]))
809 dnl Check for libcipher
810 AC_CHECK_LIB(cipher, setkey,
811 CRYPTLIB="${CRYPTLIB} -lcipher"
815 if test "x$WITH_SNMP" = "xyes"; then
819 dnl Check the style of gethostbyaddr, in order of preference
820 dnl GNU (_r eight args)
821 AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r])
822 dnl SYSV (_r six args)
823 AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r])
824 dnl BSD (three args, may not be thread safe)
825 AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r])
826 dnl Tru64 has BSD version, but it is thread safe
827 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
828 dnl We need #stdio.h to define NULL on FreeBSD (at least)
829 gethostbyaddrrstyle=""
830 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
833 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
834 gethostbyaddrrstyle=BSD
835 AC_MSG_WARN([FreeBSD overridden to BSD-style])
838 if test "x$gethostbyaddrrstyle" = "x"; then
842 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
843 AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ])
844 gethostbyaddrrstyle=GNU
847 if test "x$gethostbyaddrrstyle" = "x"; then
851 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
852 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ])
853 gethostbyaddrrstyle=SYSV
856 if test "x$gethostbyaddrrstyle" = "x"; then
860 ], [ gethostbyaddr(NULL, 0, 0) ], [
861 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
862 gethostbyaddrrstyle=BSD
866 if test "x$gethostbyaddrrstyle" = "x"; then
867 AC_MSG_RESULT([none! It must not exist, here.])
869 AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
872 if test "x$gethostbyaddrrstyle" = "xBSD"; then
873 AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
876 dnl Check the style of gethostbyname, in order of preference
877 dnl GNU (_r seven args)
878 dnl SYSV (_r five args)
879 dnl BSD (two args, may not be thread safe)
880 dnl Tru64 has BSD version, but it _is_ thread safe
881 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
882 dnl We need #stdio.h to define NULL on FreeBSD (at least)
883 gethostbynamerstyle=""
884 AC_MSG_CHECKING([gethostbyname_r() syntax])
888 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
889 AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ])
890 gethostbynamerstyle=GNU
892 if test "x$gethostbynamerstyle" = "x"; then
896 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
897 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ])
898 gethostbynamerstyle=SYSV
901 if test "x$gethostbynamerstyle" = "x"; then
905 ], [ gethostbyname(NULL) ], [
906 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ])
907 gethostbynamerstyle=BSD
911 if test "x$gethostbynamerstyle" = "x"; then
912 AC_MSG_RESULT([none! It must not exist, here.])
914 AC_MSG_RESULT([${gethostbynamerstyle}-style])
917 if test "x$gethostbynamerstyle" = "xBSD"; then
918 AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
921 dnl check for non-posix solaris ctime_r (extra buflen int arg)
922 AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r])
923 AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r])
925 AC_MSG_CHECKING([ctime_r() syntax])
928 ], [ ctime_r(NULL, NULL, 0) ], [
929 AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function])
930 ctimerstyle="SOLARIS"
932 if test "x$ctimerstyle" = "x"; then
935 ], [ ctime_r(NULL, NULL) ], [
936 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function])
941 if test "x$ctimerstyle" = "x"; then
942 AC_MSG_RESULT([none! It must not exist, here.])
944 AC_MSG_RESULT([${ctimerstyle}-style])
947 AC_SUBST(HOSTINFO, $host)
949 dnl #############################################################
951 dnl # 8. Checks for system services
953 dnl #############################################################
956 dnl # Figure out where libtool is located,
960 AC_MSG_RESULT([top_builddir=$top_builddir])
961 dnl # AC_SUBST(top_builddir)
966 dnl # Work around stupid autoconf crap
968 if test "x$INCLTDL" != "x";then
969 INCLTDL='-I${top_builddir}/''libltdl'
972 dnl import libtool stuff
974 dnl #############################################################
976 dnl # Configure in any module directories.
978 dnl #############################################################
980 mysubdirs="$LIBLTDLPATH"
981 if test "x$EXPERIMENTAL" = "xyes"; then
982 bar=`ls -1 src/modules/rlm_*/configure | sed 's%/configure%%'`
983 dnl # get rid of LF's.
984 mysubdirs=`echo $mysubdirs $bar`
987 dnl # Find 'configure' in ONLY the stable modules
989 for bar in `cat src/modules/stable`; do
990 if test -f src/modules/$bar/configure; then
991 mysubdirs="$mysubdirs src/modules/$bar"
996 dnl ############################################################
997 dnl # make modules by list
998 dnl #############################################################
1000 if test "x$EXPERIMENTAL" = "xyes"; then
1001 for foo in `ls -1 src/modules | grep rlm_`; do
1002 MODULES="$MODULES $foo"
1006 dnl # make ONLY the stable modules
1008 for foo in `cat src/modules/stable`; do
1009 MODULES="$MODULES $foo"
1014 dnl # Don't change the variable name here. Autoconf goes bonkers
1017 AC_CONFIG_SUBDIRS($mysubdirs)
1020 dnl #############################################################
1022 dnl # And finally, output the results.
1024 dnl #############################################################
1026 AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h])
1027 AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)])
1028 AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main && chmod +x checkrad.pl radlast radtest)])
1029 AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])
1032 dnl # Substitute whatever libraries we found to be necessary
1035 AC_SUBST(INSTALLSTRIP)
1037 USE_SHARED_LIBS=$enable_shared
1038 AC_SUBST(USE_SHARED_LIBS)
1039 USE_STATIC_LIBS=$enable_static
1040 AC_SUBST(USE_STATIC_LIBS)
1041 AC_SUBST(STATIC_MODULES)
1042 AC_SUBST(RADIUSD_MAJOR_VERSION)
1043 AC_SUBST(RADIUSD_MINOR_VERSION)
1044 AC_SUBST(RADIUSD_VERSION)
1048 ./src/include/build-radpaths-h \
1049 ./src/main/Makefile \
1050 ./src/main/checkrad.pl \
1051 ./src/main/radlast \
1052 ./src/main/radtest \
1053 ./scripts/rc.radiusd \
1054 ./scripts/radwatch \
1055 ./scripts/check-radiusd-config \
1056 ./scripts/radiusd.cron.daily \
1057 ./scripts/radiusd.cron.monthly \
1058 ./scripts/cryptpasswd \
1059 ./raddb/dictionary \
1060 ./raddb/radiusd.conf \
1061 ./raddb/radrelay.conf