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}"
34 dnl #############################################################
36 dnl # 0. Checks for compiler, libtool, and command line options.
38 dnl #############################################################
45 dnl # check for AIX, to allow us to use some BSD functions
46 dnl # must be before macros that call the compiler.
50 AC_PROG_GCC_TRADITIONAL
54 abs_top_builddir=`pwd`
55 AC_SUBST(abs_top_builddir)
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 extra argument: --with-large-files
203 rad_enable_largefiles=no
204 AC_ARG_WITH(large-files,
205 [ --with-large-files Compile in large (2G+) file support. (default=no)],
208 rad_enable_largefiles=yes
216 dnl AC_ARG_ENABLE(ltdl-install,
217 dnl [ --disable-ltdl-install do not install libltdl])
218 dnl if test x"${enable_ltdl_install+set}" != xset; then
219 dnl enable_ltdl_install=yes
220 dnl ac_configure_args="$ac_configure_args --enable-ltdl-install"
222 dnl AC_CONFIG_SUBDIRS(libltdl)
225 dnl # Allow the user to specify a list of modules to be linked
226 dnl # statically to the server.
229 AC_ARG_WITH(static_modules,
230 [ --with-static-modules=QUOTED-MODULE-LIST],[
231 for i in $withval; do
232 STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
237 dnl # Enable developer C compiler warnings
239 AC_ARG_ENABLE(developer,
240 [ --enable-developer Enables features of interest to developers.],
241 [ case "$enableval" in
250 if test "x$developer" != "xno" -a -d $srcdir/CVS; then
251 dnl turn on the developer flag when taken from a CVS checkout (not a release)
255 dnl extra argument: --with-experimental-modules
257 AC_ARG_WITH(experimental-modules,
258 [ --with-experimental-modules Use experimental and unstable modules. (default=no) ],
268 dnl # extra argument: --openssl-includes=dir
270 AC_ARG_WITH(openssl-includes,
271 [ --with-openssl-includes=DIR Directory to look for OpenSSL include files],
273 *) OPENSSL_INCLUDE_DIR="$withval"
279 dnl # extra argument: --openssl-libraries=dir
281 AC_ARG_WITH(openssl-libraries,
282 [ --with-openssl-libraries=DIR Directory to look for OpenSSL library files],
284 *) OPENSSL_LIB_DIR="$withval"
290 dnl # These next two arguments don't actually do anything. They're
291 dnl # place holders so that the top-level configure script can tell
292 dnl # the user how to configure lower-level modules
296 dnl # extra argument: --with-rlm-FOO-lib-dir
298 AC_ARG_WITH(rlm-FOO-lib-dir,
299 [ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO],
307 dnl # extra argument: --with-rlm-FOO-include-dir
309 AC_ARG_WITH(rlm-FOO-include-dir,
310 [ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO],
317 dnl See what include-style is used by the make program.
318 dnl AC_MSG_CHECKING(include style for make)
319 dnl echo "include /dev/null" > testmake.$$
320 dnl echo "all:" >> testmake.$$
321 dnl make -f testmake.$$ >/dev/null 2>&1
330 dnl rm -f testmake.$$
331 dnl AC_MSG_RESULT(" $INCLUDE")
332 dnl AC_SUBST(INCLUDE)
335 dnl extra argument: --with-udpfromto
337 AC_ARG_WITH(udpfromto,
338 [ --with-udpfromto Compile in UDPFROMTO support. (default=no)],
348 if test "x$WITH_UDPFROMTO" = "xyes"; then
349 AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto])
352 dnl #############################################################
354 dnl # 1. Checks for programs
356 dnl #############################################################
359 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
360 if test "x$ac_cv_path_PERL" = "x"; then
361 AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
363 AC_PATH_PROG(SNMPGET, snmpget)
364 if test "x$ac_cv_path_SNMPGET" = "x"; then
365 AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
368 AC_PATH_PROG(SNMPWALK, snmpwalk)
369 if test "x$ac_cv_path_SNMPWALK" = "x"; then
370 AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
373 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
375 dnl FIXME This is truly gross.
376 missing_dir=`cd $ac_aux_dir && pwd`
377 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
378 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
379 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
381 AC_PATH_PROG(LOCATE,locate)
382 AC_PATH_PROG(DIRNAME,dirname)
383 AC_PATH_PROG(GREP,grep)
385 dnl #############################################################
387 dnl # 2. Checks for libraries
389 dnl #############################################################
391 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
393 if test "x$WITH_THREADS" = "xyes"; then
394 if test $ac_cv_prog_suncc = "yes"; then
398 AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
401 dnl # pthread stuff is usually in -lpthread
402 dnl # or in -lc_r, on *BSD
404 dnl # On Some systems, we need extra pre-processor flags, to get them to
405 dnl # to do the threading properly.
407 AC_CHECK_LIB(pthread, pthread_create,
408 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
409 LIBS="$LIBS -lpthread" ],
410 AC_CHECK_LIB(c_r, pthread_create,
411 [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
412 [ WITH_THREADS="no" ]
418 dnl # If we have NO pthread libraries, remove any knowledge of threads.
420 if test "x$WITH_THREADS" != "xyes"; then
422 ac_cv_header_pthread_h="no"
426 dnl # We need sem_init() and friends, as they're the friendliest
427 dnl # semaphore functions for threading.
429 dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
430 dnl # Some systems have them in -lsem
431 dnl # Solaris has them in -lposix4
432 dnl # NetBSD has them in -lsemaphore
434 AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore,
436 [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)]
440 dnl Check if we need -lsocket
441 AC_CHECK_LIB(socket, getsockname)
443 dnl Check for -lresolv
444 dnl This library may be needed later.
445 AC_CHECK_LIB(resolv, inet_aton)
447 dnl Check if we need -lnsl. Usually if we want to
448 dnl link against -lsocket we need to include -lnsl as well.
449 AC_CHECK_LIB(nsl, inet_ntoa)
451 dnl #############################################################
453 dnl # 3. Checks for header files
455 dnl #############################################################
458 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
459 dnl # getopt will be #included, but won't link. <sigh>
464 CFLAGS="$CFLAGS -D_ALL_SOURCE"
467 CFLAGS="$CFLAGS -DDARWIN"
509 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H, [], [define this if we have the <regex.h> header file]))
510 if test "x$ac_cv_header_regex_h" = "xyes"; then
518 ], [AC_DEFINE(HAVE_REG_EXTENDED, [], [define this if we have REG_EXTENDED (from <regex.h>)]) REGEX_EXTENDED=yes])
521 AC_SUBST(REGEX_EXTENDED)
524 dnl # other checks which require headers
526 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
528 AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication])
531 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
533 AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication])
536 smart_try_dir="$OPENSSL_INCLUDE_DIR"
537 dnl # stupid RedHat shit
538 CFLAGS="$CFLAGS -DOPENSSL_NO_KRB5"
539 FR_SMART_CHECK_INCLUDE(openssl/ssl.h)
542 if test "x$ac_cv_header_openssl_ssl_h" = "xyes"; then
543 AC_DEFINE(HAVE_OPENSSL_SSL_H, [], [define if you have openssl/ssl.h])
544 old_CPPFLAGS="$CPPFLAGS"
545 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
546 CPPFLAGS="-I$OPENSSL_INCLUDE_DIR $CPPFLAGS"
554 CPPFLAGS="$old_CPPFLAGS"
556 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
557 old_CPPFLAGS=$CPPFLAGS
559 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
560 CPPFLAGS="-I$OPENSSL_INCLUDE_DIR"
563 [#include <openssl/crypto.h>
564 #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
568 if test "x$goodssl" != "xyes"; then
575 # Look for the OpenSSL libraries.
576 smart_try_dir=$OPENSSL_LIB_DIR
577 FR_SMART_CHECK_LIB(crypto, DH_new)
578 if test "x$ac_cv_lib_crypto_DH_new" = "xyes"; then
579 FR_SMART_CHECK_LIB(ssl, SSL_new)
580 if test "x$ac_cv_lib_ssl_SSL_new" = "xyes"; then
581 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
582 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR"
584 if test "x$OPENSSL_LIB_DIR" != "x"; then
585 OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
587 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
594 CPPFLAGS=$old_CPPFLAGS
597 AC_SUBST(OPENSSL_INCLUDE)
598 AC_SUBST(OPENSSL_LIBS)
601 dnl #############################################################
603 dnl # 4. Checks for typedefs
605 dnl #############################################################
608 dnl # Ensure that these are defined
615 dnl check for socklen_t
616 FR_CHECK_TYPE_INCLUDE([
617 #ifdef HAVE_SYS_TYPES_H
618 #include <sys/types.h>
620 #ifdef HAVE_SYS_SOCKET_H
621 #include <sys/socket.h>
623 ],socklen_t, int, [socklen_t is generally 'int' on systems which don't use it])
625 dnl check for uint8_t
626 FR_CHECK_TYPE_INCLUDE([
627 #ifdef HAVE_INTTYPES_H
628 #include <inttypes.h>
633 ],uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic])
635 dnl check for uint16_t
636 FR_CHECK_TYPE_INCLUDE([
637 #ifdef HAVE_INTTYPES_H
638 #include <inttypes.h>
643 ],uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic])
645 dnl check for uint32_t
646 FR_CHECK_TYPE_INCLUDE([
647 #ifdef HAVE_INTTYPES_H
648 #include <inttypes.h>
653 ],uint32_t, unsigned int, [uint32_t should be the canonical 'network integer])
655 AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [], [
656 #ifdef HAVE_NETINET_IN_H
657 #include <netinet/in.h>
661 AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [], [
662 #ifdef HAVE_NETINET_IN_H
663 #include <netinet/in.h>
665 #ifdef HAVE_SYS_SOCKET_H
666 #include <sys/socket.h>
670 AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], [
671 #ifdef HAVE_NETINET_IN_H
672 #include <netinet/in.h>
676 AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [], [
677 #ifdef HAVE_SYS_TYPES_H
678 #include <sys/types.h>
680 #ifdef HAVE_SYS_SOCKET_H
681 #include <sys/socket.h>
688 dnl #############################################################
690 dnl # 5. Checks for structures and functions
692 dnl #############################################################
723 RADIUSD_NEED_DECLARATIONS( \
736 dnl # check if we have utmpx.h
737 dnl # if so, check if struct utmpx has entry ut_xtime
738 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
739 if test "x$ac_cv_header_utmpx_h" = "xyes"
741 FR_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
742 if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
744 AC_DEFINE(ut_xtime,ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx])
748 dnl # struct ip_pktinfo
749 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
750 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
752 AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)])
755 dnl # struct in6_pktinfo
756 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in6_pktinfo], ipi6_addr)
757 if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes"
759 AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)])
762 dnl #############################################################
764 dnl # 6. Checks for compiler characteristics
766 dnl #############################################################
769 dnl # Ensure that these are defined
774 dnl # See if this is OS/2
776 AC_MSG_CHECKING(type of OS)
779 if test "$OS" = "OS/2"; then
787 dnl # Set Default CFLAGS
789 if test "x$GCC" = "xyes"; then
790 CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
793 AC_MSG_CHECKING(for developer gcc flags)
794 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
795 devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"
796 CFLAGS="$CFLAGS $devflags"
798 AC_MSG_RESULT(yes. Using $devflags)
801 CFLAGS="$CFLAGS -DNDEBUG"
806 dnl #############################################################
808 dnl # 7. Checks for library functions
810 dnl #############################################################
812 dnl Check for libcrypt
813 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
814 AC_CHECK_LIB(crypt, crypt,
817 if test "$CRYPTLIB" != ""; then
818 AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])
820 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]))
823 dnl Check for libcipher
824 AC_CHECK_LIB(cipher, setkey,
825 CRYPTLIB="${CRYPTLIB} -lcipher"
829 if test "x$WITH_SNMP" = "xyes"; then
833 dnl Check the style of gethostbyaddr, in order of preference
834 dnl GNU (_r eight args)
835 AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r])
836 dnl SYSV (_r six args)
837 AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r])
838 dnl BSD (three args, may not be thread safe)
839 AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r])
840 dnl Tru64 has BSD version, but it is thread safe
841 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
842 dnl We need #stdio.h to define NULL on FreeBSD (at least)
843 gethostbyaddrrstyle=""
844 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
847 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
848 gethostbyaddrrstyle=BSD
849 AC_MSG_WARN([FreeBSD overridden to BSD-style])
852 if test "x$gethostbyaddrrstyle" = "x"; then
856 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
857 AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ])
858 gethostbyaddrrstyle=GNU
861 if test "x$gethostbyaddrrstyle" = "x"; then
865 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
866 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ])
867 gethostbyaddrrstyle=SYSV
870 if test "x$gethostbyaddrrstyle" = "x"; then
874 ], [ gethostbyaddr(NULL, 0, 0) ], [
875 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
876 gethostbyaddrrstyle=BSD
880 if test "x$gethostbyaddrrstyle" = "x"; then
881 AC_MSG_RESULT([none! It must not exist, here.])
883 AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
886 if test "x$gethostbyaddrrstyle" = "xBSD"; then
887 AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
890 dnl Check the style of gethostbyname, in order of preference
891 dnl GNU (_r seven args)
892 dnl SYSV (_r five args)
893 dnl BSD (two args, may not be thread safe)
894 dnl Tru64 has BSD version, but it _is_ thread safe
895 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
896 dnl We need #stdio.h to define NULL on FreeBSD (at least)
897 gethostbynamerstyle=""
898 AC_MSG_CHECKING([gethostbyname_r() syntax])
902 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
903 AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ])
904 gethostbynamerstyle=GNU
906 if test "x$gethostbynamerstyle" = "x"; then
910 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
911 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ])
912 gethostbynamerstyle=SYSV
915 if test "x$gethostbynamerstyle" = "x"; then
919 ], [ gethostbyname(NULL) ], [
920 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ])
921 gethostbynamerstyle=BSD
925 if test "x$gethostbynamerstyle" = "x"; then
926 AC_MSG_RESULT([none! It must not exist, here.])
928 AC_MSG_RESULT([${gethostbynamerstyle}-style])
931 if test "x$gethostbynamerstyle" = "xBSD"; then
932 AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
935 dnl check for non-posix solaris ctime_r (extra buflen int arg)
936 AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r])
937 AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r])
939 AC_MSG_CHECKING([ctime_r() syntax])
942 ], [ ctime_r(NULL, NULL, 0) ], [
943 AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function])
944 ctimerstyle="SOLARIS"
946 if test "x$ctimerstyle" = "x"; then
949 ], [ ctime_r(NULL, NULL) ], [
950 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function])
955 if test "x$ctimerstyle" = "x"; then
956 AC_MSG_RESULT([none! It must not exist, here.])
958 AC_MSG_RESULT([${ctimerstyle}-style])
961 AC_SUBST(HOSTINFO, $host)
963 dnl #############################################################
965 dnl # 8. Checks for system services
967 dnl #############################################################
970 dnl # Figure out where libtool is located,
974 AC_MSG_RESULT([top_builddir=$top_builddir])
975 dnl # AC_SUBST(top_builddir)
980 dnl # Work around stupid autoconf crap
982 if test "x$INCLTDL" != "x";then
983 INCLTDL='-I${top_builddir}/''libltdl'
986 dnl import libtool stuff
988 dnl #############################################################
990 dnl # Configure in any module directories.
992 dnl #############################################################
994 mysubdirs="$LIBLTDLPATH"
995 if test "x$EXPERIMENTAL" = "xyes"; then
996 bar=`ls -1 src/modules/rlm_*/configure | sed 's%/configure%%'`
997 dnl # get rid of LF's.
998 mysubdirs=`echo $mysubdirs $bar`
1001 dnl # Find 'configure' in ONLY the stable modules
1003 for bar in `cat src/modules/stable`; do
1004 if test -f src/modules/$bar/configure; then
1005 mysubdirs="$mysubdirs src/modules/$bar"
1010 dnl ############################################################
1011 dnl # make modules by list
1012 dnl #############################################################
1014 if test "x$EXPERIMENTAL" = "xyes"; then
1015 for foo in `ls -1 src/modules | grep rlm_`; do
1016 MODULES="$MODULES $foo"
1020 dnl # make ONLY the stable modules
1022 for foo in `cat src/modules/stable`; do
1023 MODULES="$MODULES $foo"
1028 dnl # Don't change the variable name here. Autoconf goes bonkers
1031 AC_CONFIG_SUBDIRS($mysubdirs)
1034 dnl #############################################################
1036 dnl # And finally, output the results.
1038 dnl #############################################################
1040 AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h])
1041 AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)])
1042 AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main && chmod +x checkrad.pl radlast radtest)])
1043 AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])
1046 dnl # Substitute whatever libraries we found to be necessary
1049 AC_SUBST(INSTALLSTRIP)
1051 USE_SHARED_LIBS=$enable_shared
1052 AC_SUBST(USE_SHARED_LIBS)
1053 USE_STATIC_LIBS=$enable_static
1054 AC_SUBST(USE_STATIC_LIBS)
1055 AC_SUBST(STATIC_MODULES)
1056 AC_SUBST(RADIUSD_MAJOR_VERSION)
1057 AC_SUBST(RADIUSD_MINOR_VERSION)
1058 AC_SUBST(RADIUSD_VERSION)
1062 ./src/include/build-radpaths-h \
1063 ./src/main/Makefile \
1064 ./src/main/checkrad.pl \
1065 ./src/main/radlast \
1066 ./src/main/radtest \
1067 ./scripts/rc.radiusd \
1068 ./scripts/radwatch \
1069 ./scripts/check-radiusd-config \
1070 ./scripts/radiusd.cron.daily \
1071 ./scripts/radiusd.cron.monthly \
1072 ./scripts/cryptpasswd \
1073 ./raddb/dictionary \
1074 ./raddb/radiusd.conf \
1075 ./raddb/radrelay.conf