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=2
31 RADIUSD_MINOR_VERSION=0.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 dnl Compile in large (2G+) file support.
58 dnl # check for system bytesex
59 dnl # AC_DEFINES WORDS_BIGENDIAN
63 AC_CHECK_PROG(GMAKE, gmake, yes, no)
64 if test $GMAKE = no; then
65 AC_PATH_PROG(MAKE, make, /usr/local/bin/make)
67 AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make)
69 makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"`
70 if test -z "$makever"; then
71 AC_MSG_ERROR(GNU Make is not installed. Please download and install it
72 from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.)
75 dnl libltdl is installable
76 AC_LIBLTDL_INSTALLABLE
78 dnl use system-wide libtool, if it exists
79 AC_ARG_WITH(system-libtool,
80 [ --with-system-libtool try to use libtool installed in your system [default=use our own]],
81 [ AC_PATH_PROG(LIBTOOL, libtool,,$PATH:/usr/local/bin) ],
83 LIBTOOL="`pwd`/libtool"
85 dnl ensure that we're looking for dlopen
88 dnl Figure out how to build shared libraries
93 dnl Put this in later, when all distributed modules use autoconf.
94 dnl AC_ARG_WITH(disablemodulefoo,
95 dnl [ --without-rlm_foo Disables module compilation. Module list:]
96 dnl esyscmd([find src/modules -type d -name rlm_\* -print |\
97 dnl sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\
98 dnl awk '{print " "$0}']))
100 AC_ARG_ENABLE(strict-dependencies,
101 [ --enable-strict-dependencies Fail configure on lack of module dependancy.])
103 dnl extra argument: --with-docdir
104 docdir='${datadir}/doc/freeradius'
105 AC_MSG_CHECKING(docdir)
107 [ --with-docdir=DIR Directory for documentation [DATADIR/doc/freeradius] ],
110 AC_MSG_ERROR(Need docdir)
114 [[\\/$]]* | ?:[[\\/]]* )
118 AC_MSG_ERROR([expected an absolute directory name for --with-docdir: $withval])
123 AC_MSG_RESULT($docdir)
125 dnl extra argument: --with-logdir
126 logdir='${localstatedir}/log/radius'
127 AC_MSG_CHECKING(logdir)
129 [ --with-logdir=DIR Directory for logfiles [LOCALSTATEDIR/log/radius] ],
132 AC_MSG_ERROR(Need logdir)
136 [[\\/$]]* | ?:[[\\/]]* )
140 AC_MSG_ERROR([expected an absolute directory name for --with-logdir: $withval])
145 AC_MSG_RESULT($logdir)
147 dnl extra argument: --with-radacctdir
148 radacctdir='${logdir}/radacct'
149 AC_MSG_CHECKING(radacctdir)
150 AC_ARG_WITH(radacctdir,
151 [ --with-radacctdir=DIR Directory for detail files [LOGDIR/radacct] ],
154 AC_MSG_ERROR(Need radacctdir)
158 [[\\/$]]* | ?:[[\\/]]* )
159 radacctdir="$withval"
162 AC_MSG_ERROR([expected an absolute directory name for --with-radacctdir: $withval])
167 AC_MSG_RESULT($radacctdir)
169 dnl extra argument: --with-raddbdir
170 raddbdir='${sysconfdir}/raddb'
171 AC_MSG_CHECKING(raddbdir)
172 AC_ARG_WITH(raddbdir,
173 [ --with-raddbdir=DIR Directory for config files [SYSCONFDIR/raddb] ],
176 AC_MSG_ERROR(Need raddbdir)
180 [[\\/$]]* | ?:[[\\/]]* )
184 AC_MSG_ERROR([expected an absolute directory name for --with-raddbdir: $withval])
189 AC_MSG_RESULT($raddbdir)
191 dnl extra argument: --with-ascend-binary
193 AC_ARG_WITH(ascend-binary,
194 [ --with-ascend-binary Include support for Ascend binary filter attributes (default=yes)],
202 if test "X$ASCEND_BINARY" = "Xyes"; then
203 AC_DEFINE(ASCEND_BINARY, [], [Include support for Ascend binary filter attributes])
206 dnl extra argument: --with-threads
209 [ --with-threads Use threads, if available. (default=yes) ],
218 dnl extra argument: --with-snmp
221 [ --with-snmp Compile in SNMP support. (default=yes)],
230 dnl AC_ARG_ENABLE(ltdl-install,
231 dnl [ --disable-ltdl-install do not install libltdl])
232 dnl if test x"${enable_ltdl_install+set}" != xset; then
233 dnl enable_ltdl_install=yes
234 dnl ac_configure_args="$ac_configure_args --enable-ltdl-install"
236 dnl AC_CONFIG_SUBDIRS(libltdl)
239 dnl # Allow the user to specify a list of modules to be linked
240 dnl # statically to the server.
243 AC_ARG_WITH(static_modules,
244 [ --with-static-modules=QUOTED-MODULE-LIST],[
245 for i in $withval; do
246 STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
252 [ --with-modules=QUOTED-MODULE-LIST],[
253 for i in $withval; do
254 MODULES="$MODULES $i"
259 dnl # Enable developer C compiler warnings
261 AC_ARG_ENABLE(developer,
262 [ --enable-developer Enables features of interest to developers.],
263 [ case "$enableval" in
272 if test "x$developer" != "xno" -a -d $srcdir/CVS; then
273 dnl turn on the developer flag when taken from a CVS checkout (not a release)
277 dnl extra argument: --with-experimental-modules
279 AC_ARG_WITH(experimental-modules,
280 [ --with-experimental-modules Use experimental and unstable modules. (default=no) ],
290 dnl # extra argument: --with-openssl-includes=dir
293 AC_ARG_WITH(openssl-includes,
294 [ --with-openssl-includes=DIR Directory to look for OpenSSL include files],
296 *) OPENSSL_INCLUDE_DIR="$withval"
302 dnl # extra argument: --with-openssl-libraries=dir
305 AC_ARG_WITH(openssl-libraries,
306 [ --with-openssl-libraries=DIR Directory to look for OpenSSL library files],
308 *) OPENSSL_LIB_DIR="$withval"
314 dnl # These next two arguments don't actually do anything. They're
315 dnl # place holders so that the top-level configure script can tell
316 dnl # the user how to configure lower-level modules
320 dnl # extra argument: --with-rlm-FOO-lib-dir
322 AC_ARG_WITH(rlm-FOO-lib-dir,
323 [ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO],
331 dnl # extra argument: --with-rlm-FOO-include-dir
333 AC_ARG_WITH(rlm-FOO-include-dir,
334 [ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO],
341 dnl See what include-style is used by the make program.
342 dnl AC_MSG_CHECKING(include style for make)
343 dnl echo "include /dev/null" > testmake.$$
344 dnl echo "all:" >> testmake.$$
345 dnl make -f testmake.$$ >/dev/null 2>&1
354 dnl rm -f testmake.$$
355 dnl AC_MSG_RESULT(" $INCLUDE")
356 dnl AC_SUBST(INCLUDE)
359 dnl extra argument: --with-udpfromto
361 AC_ARG_WITH(udpfromto,
362 [ --with-udpfromto Compile in UDPFROMTO support. (default=no)],
372 if test "x$WITH_UDPFROMTO" = "xyes"; then
373 AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto])
376 dnl #############################################################
378 dnl # 1. Checks for programs
380 dnl #############################################################
383 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
384 if test "x$ac_cv_path_PERL" = "x"; then
385 AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
387 AC_PATH_PROG(SNMPGET, snmpget)
388 if test "x$ac_cv_path_SNMPGET" = "x"; then
389 AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
392 AC_PATH_PROG(SNMPWALK, snmpwalk)
393 if test "x$ac_cv_path_SNMPWALK" = "x"; then
394 AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
397 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
399 dnl FIXME This is truly gross.
400 missing_dir=`cd $ac_aux_dir && pwd`
401 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
402 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
403 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
405 AC_PATH_PROG(LOCATE,locate)
406 AC_PATH_PROG(DIRNAME,dirname)
407 AC_PATH_PROG(GREP,grep)
409 dnl #############################################################
411 dnl # 2. Checks for libraries
413 dnl #############################################################
415 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
417 if test "x$WITH_THREADS" = "xyes"; then
418 if test $ac_cv_prog_suncc = "yes"; then
422 AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
425 dnl # pthread stuff is usually in -lpthread
426 dnl # or in -lc_r, on *BSD
428 dnl # On Some systems, we need extra pre-processor flags, to get them to
429 dnl # to do the threading properly.
431 AC_CHECK_LIB(pthread, pthread_create,
432 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
433 LIBS="$LIBS -lpthread" ],
434 AC_CHECK_LIB(c_r, pthread_create,
435 [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
436 [ WITH_THREADS="no" ]
442 dnl # If we have NO pthread libraries, remove any knowledge of threads.
444 if test "x$WITH_THREADS" != "xyes"; then
446 ac_cv_header_pthread_h="no"
450 dnl # We need sem_init() and friends, as they're the friendliest
451 dnl # semaphore functions for threading.
453 dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
454 dnl # Some systems have them in -lsem
455 dnl # Solaris has them in -lposix4
456 dnl # NetBSD has them in -lsemaphore
458 AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore,
460 [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)]
464 dnl Check if we need -lsocket
465 AC_CHECK_LIB(socket, getsockname)
467 dnl Check for -lresolv
468 dnl This library may be needed later.
469 AC_CHECK_LIB(resolv, inet_aton)
471 dnl Check if we need -lnsl. Usually if we want to
472 dnl link against -lsocket we need to include -lnsl as well.
473 AC_CHECK_LIB(nsl, inet_ntoa)
475 dnl Check for OpenSSL libraries.
478 if test "x$OPENSSL_LIB_DIR" != "x"; then
479 LIBS="-L$OPENSSL_LIB_DIR $LIBS"
481 AC_CHECK_LIB(crypto, DH_new,
483 AC_DEFINE(HAVE_LIBCRYPTO, 1,
484 [Define to 1 if you have the `crypto' library (-lcrypto).])
485 AC_CHECK_LIB(ssl, SSL_new,
487 AC_DEFINE(HAVE_LIBSSL, 1,
488 [Define to 1 if you have the `ssl' library (-lssl).])
489 if test "x$OPENSSL_LIB_DIR" != "x"; then
490 OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
492 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
497 dnl Check the pcap library for the RADIUS sniffer.
499 AC_CHECK_LIB(pcap, pcap_open_live,
501 AC_DEFINE(HAVE_LIBPCAP, 1,
502 [Define to 1 if you have the `pcap' library (-lpcap).])
504 [ AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer.]) ])
506 dnl #############################################################
508 dnl # 3. Checks for header files
510 dnl #############################################################
513 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
514 dnl # getopt will be #included, but won't link. <sigh>
519 CFLAGS="$CFLAGS -D_ALL_SOURCE"
522 CFLAGS="$CFLAGS -DDARWIN"
564 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H, [], [define this if we have the <regex.h> header file]))
565 if test "x$ac_cv_header_regex_h" = "xyes"; then
573 ], [AC_DEFINE(HAVE_REG_EXTENDED, [], [define this if we have REG_EXTENDED (from <regex.h>)]) REGEX_EXTENDED=yes])
576 AC_SUBST(REGEX_EXTENDED)
579 dnl # other checks which require headers
581 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
583 AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication])
586 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
588 AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication])
591 dnl Check for OpenSSL includes.
592 OPENSSL_INCLUDE="-DNO_OPENSSL"
593 if test "x$OPENSSL_LIBS" = "x"; then
594 AC_MSG_NOTICE([skipping test for openssl/ssl.h])
596 old_CPPFLAGS=$CPPFLAGS
597 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
598 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR"
600 dnl # stupid RedHat shit
601 CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
610 if test "x$OPENSSL_LIBS" != "x"; then
611 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
613 [#include <openssl/crypto.h>
614 #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
618 if test "x$goodssl" != "xyes"; then
623 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
624 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5"
626 OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
630 CPPFLAGS=$old_CPPFLAGS
632 AC_SUBST(OPENSSL_INCLUDE)
633 AC_SUBST(OPENSSL_LIBS)
636 dnl Check the pcap includes for the RADIUS sniffer.
637 if test "x$PCAP_LIBS" = x; then
638 AC_MSG_NOTICE([skipping test for pcap.h.])
640 AC_CHECK_HEADER(pcap.h,
641 AC_DEFINE(HAVE_PCAP_H, 1,
642 [Define to 1 if you have the <pcap.h> header file.]),
644 AC_MSG_WARN([pcap.h not found, silently disabling the RADIUS sniffer.])
649 dnl #############################################################
651 dnl # 4. Checks for typedefs
653 dnl #############################################################
656 dnl # Ensure that these are defined
663 dnl check for socklen_t
664 FR_CHECK_TYPE_INCLUDE([
665 #ifdef HAVE_SYS_TYPES_H
666 #include <sys/types.h>
668 #ifdef HAVE_SYS_SOCKET_H
669 #include <sys/socket.h>
671 ],socklen_t, int, [socklen_t is generally 'int' on systems which don't use it])
673 dnl check for uint8_t
674 FR_CHECK_TYPE_INCLUDE([
675 #ifdef HAVE_INTTYPES_H
676 #include <inttypes.h>
681 ],uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic])
683 dnl check for uint16_t
684 FR_CHECK_TYPE_INCLUDE([
685 #ifdef HAVE_INTTYPES_H
686 #include <inttypes.h>
691 ],uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic])
693 dnl check for uint32_t
694 FR_CHECK_TYPE_INCLUDE([
695 #ifdef HAVE_INTTYPES_H
696 #include <inttypes.h>
701 ],uint32_t, unsigned int, [uint32_t should be the canonical 'network integer])
703 AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [], [
704 #ifdef HAVE_NETINET_IN_H
705 #include <netinet/in.h>
709 AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [], [
710 #ifdef HAVE_NETINET_IN_H
711 #include <netinet/in.h>
713 #ifdef HAVE_SYS_SOCKET_H
714 #include <sys/socket.h>
718 AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], [
719 #ifdef HAVE_NETINET_IN_H
720 #include <netinet/in.h>
724 AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [], [
725 #ifdef HAVE_SYS_TYPES_H
726 #include <sys/types.h>
728 #ifdef HAVE_SYS_SOCKET_H
729 #include <sys/socket.h>
736 dnl #############################################################
738 dnl # 5. Checks for structures and functions
740 dnl #############################################################
771 RADIUSD_NEED_DECLARATIONS( \
784 dnl # check if we have utmpx.h
785 dnl # if so, check if struct utmpx has entry ut_xtime
786 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
787 if test "x$ac_cv_header_utmpx_h" = "xyes"
789 FR_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
790 if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
792 AC_DEFINE(ut_xtime,ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx])
796 dnl # struct ip_pktinfo
797 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
798 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
800 AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)])
803 dnl # struct in6_pktinfo
804 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in6_pktinfo], ipi6_addr)
805 if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes"
807 AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)])
810 dnl #############################################################
812 dnl # 6. Checks for compiler characteristics
814 dnl #############################################################
817 dnl # Ensure that these are defined
822 dnl # See if this is OS/2
824 AC_MSG_CHECKING(type of OS)
827 if test "$OS" = "OS/2"; then
835 dnl # Set Default CFLAGS
837 if test "x$GCC" = "xyes"; then
838 CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
841 AC_MSG_CHECKING(for developer gcc flags)
842 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
843 devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"
844 CFLAGS="$CFLAGS $devflags"
846 AC_MSG_RESULT(yes. Using $devflags)
849 CFLAGS="$CFLAGS -DNDEBUG"
854 dnl #############################################################
856 dnl # 7. Checks for library functions
858 dnl #############################################################
860 dnl Check for libcrypt
861 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
862 AC_CHECK_LIB(crypt, crypt,
865 if test "$CRYPTLIB" != ""; then
866 AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])
868 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]))
871 dnl Check for libcipher
872 AC_CHECK_LIB(cipher, setkey,
873 CRYPTLIB="${CRYPTLIB} -lcipher"
877 if test "x$WITH_SNMP" = "xyes"; then
881 dnl Check the style of gethostbyaddr, in order of preference
882 dnl GNU (_r eight args)
883 AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r])
884 dnl SYSV (_r six args)
885 AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r])
886 dnl BSD (three args, may not be thread safe)
887 AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r])
888 dnl Tru64 has BSD version, but it is thread safe
889 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
890 dnl We need #stdio.h to define NULL on FreeBSD (at least)
891 gethostbyaddrrstyle=""
892 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
895 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
896 gethostbyaddrrstyle=BSD
897 AC_MSG_WARN([FreeBSD overridden to BSD-style])
900 if test "x$gethostbyaddrrstyle" = "x"; then
904 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
905 AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ])
906 gethostbyaddrrstyle=GNU
909 if test "x$gethostbyaddrrstyle" = "x"; then
913 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
914 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ])
915 gethostbyaddrrstyle=SYSV
918 if test "x$gethostbyaddrrstyle" = "x"; then
922 ], [ gethostbyaddr(NULL, 0, 0) ], [
923 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
924 gethostbyaddrrstyle=BSD
928 if test "x$gethostbyaddrrstyle" = "x"; then
929 AC_MSG_RESULT([none! It must not exist, here.])
931 AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
934 if test "x$gethostbyaddrrstyle" = "xBSD"; then
935 AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
938 dnl Check the style of gethostbyname, in order of preference
939 dnl GNU (_r seven args)
940 dnl SYSV (_r five args)
941 dnl BSD (two args, may not be thread safe)
942 dnl Tru64 has BSD version, but it _is_ thread safe
943 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
944 dnl We need #stdio.h to define NULL on FreeBSD (at least)
945 gethostbynamerstyle=""
946 AC_MSG_CHECKING([gethostbyname_r() syntax])
950 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
951 AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ])
952 gethostbynamerstyle=GNU
954 if test "x$gethostbynamerstyle" = "x"; then
958 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
959 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ])
960 gethostbynamerstyle=SYSV
963 if test "x$gethostbynamerstyle" = "x"; then
967 ], [ gethostbyname(NULL) ], [
968 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ])
969 gethostbynamerstyle=BSD
973 if test "x$gethostbynamerstyle" = "x"; then
974 AC_MSG_RESULT([none! It must not exist, here.])
976 AC_MSG_RESULT([${gethostbynamerstyle}-style])
979 if test "x$gethostbynamerstyle" = "xBSD"; then
980 AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
983 dnl check for non-posix solaris ctime_r (extra buflen int arg)
984 AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r])
985 AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r])
987 AC_MSG_CHECKING([ctime_r() syntax])
990 ], [ ctime_r(NULL, NULL, 0) ], [
991 AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function])
992 ctimerstyle="SOLARIS"
994 if test "x$ctimerstyle" = "x"; then
997 ], [ ctime_r(NULL, NULL) ], [
998 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function])
1003 if test "x$ctimerstyle" = "x"; then
1004 AC_MSG_RESULT([none! It must not exist, here.])
1006 AC_MSG_RESULT([${ctimerstyle}-style])
1009 AC_SUBST(HOSTINFO, $host)
1011 dnl #############################################################
1013 dnl # 8. Checks for system services
1015 dnl #############################################################
1018 dnl # Figure out where libtool is located,
1022 AC_MSG_RESULT([top_builddir=$top_builddir])
1023 dnl # AC_SUBST(top_builddir)
1028 dnl # Work around stupid autoconf crap
1030 if test "x$INCLTDL" != "x";then
1031 INCLTDL='-I${top_builddir}/''libltdl'
1034 dnl import libtool stuff
1036 dnl #############################################################
1038 dnl # Configure in any module directories.
1040 dnl #############################################################
1042 mysubdirs="$LIBLTDLPATH"
1043 if test "x$EXPERIMENTAL" = "xyes"; then
1044 bar=`ls -1 "${srcdir}"/src/modules/rlm_*/configure | sed 's%/configure%%'`
1045 dnl # get rid of LF's.
1046 mysubdirs=`echo $mysubdirs $bar`
1049 dnl # Find 'configure' in ONLY the stable modules
1051 for bar in `cat "${srcdir}"/src/modules/stable`; do
1052 if test -f "${srcdir}"/src/modules/$bar/configure; then
1053 mysubdirs="$mysubdirs src/modules/$bar"
1058 dnl ############################################################
1059 dnl # make modules by list
1060 dnl #############################################################
1061 if test "x$EXPERIMENTAL" = "xyes"; then
1062 for foo in `ls -1 "${srcdir}"/src/modules | grep rlm_`; do
1063 MODULES="$MODULES $foo"
1067 dnl # make ONLY the stable modules
1069 for foo in `cat "${srcdir}"/src/modules/stable`; do
1070 MODULES="$MODULES $foo"
1075 dnl # Don't change the variable name here. Autoconf goes bonkers
1078 AC_CONFIG_SUBDIRS($mysubdirs)
1081 dnl #############################################################
1083 dnl # And finally, output the results.
1085 dnl #############################################################
1087 AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h])
1088 AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)])
1089 AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main && chmod +x checkrad.pl radlast radtest)])
1090 AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])
1093 dnl # Substitute whatever libraries we found to be necessary
1096 AC_SUBST(INSTALLSTRIP)
1098 USE_SHARED_LIBS=$enable_shared
1099 AC_SUBST(USE_SHARED_LIBS)
1100 USE_STATIC_LIBS=$enable_static
1101 AC_SUBST(USE_STATIC_LIBS)
1102 AC_SUBST(STATIC_MODULES)
1103 AC_SUBST(RADIUSD_MAJOR_VERSION)
1104 AC_SUBST(RADIUSD_MINOR_VERSION)
1105 AC_SUBST(RADIUSD_VERSION)
1109 ./src/include/build-radpaths-h \
1110 ./src/main/Makefile \
1111 ./src/main/checkrad.pl \
1112 ./src/main/radlast \
1113 ./src/main/radtest \
1114 ./scripts/rc.radiusd \
1115 ./scripts/radwatch \
1116 ./scripts/check-radiusd-config \
1117 ./scripts/radiusd.cron.daily \
1118 ./scripts/radiusd.cron.monthly \
1119 ./scripts/cryptpasswd \
1120 ./raddb/dictionary \
1121 ./raddb/radiusd.conf \
1122 ./raddb/radrelay.conf