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
26 AC_INIT([freeradius],[$]Id[$],[http://bugs.freeradius.org],,[http://www.freeradius.org])
27 AC_CONFIG_SRCDIR([src/main/radiusd.c])
28 AC_CONFIG_HEADER([src/include/autoconf.h])
29 m4_include([m4/ax_cc.m4])
31 dnl #############################################################
33 dnl # Custom hackery to discover version at configure time
35 dnl #############################################################
37 RADIUSD_MAJOR_VERSION=`cat VERSION | sed 's/\..*//'`
38 RADIUSD_MINOR_VERSION=`cat VERSION | sed 's/^[[^\.]]*\.//' | sed 's/\..*$//'`
39 RADIUSD_INCRM_VERSION=`cat VERSION | sed 's/^.*\..*\.//' | sed 's/[[\.-]].*$//'`
41 RADIUSD_VERSION=`echo | awk -v major="$RADIUSD_MAJOR_VERSION" \
42 -v minor="$RADIUSD_MINOR_VERSION" \
43 -v incrm="$RADIUSD_INCRM_VERSION" \
44 '{ printf "%02i%02i%02i", major, minor, incrm }'`
47 dnl # Still useful for custom builds
49 RADIUSD_VERSION_STRING=`cat VERSION`
52 dnl # Add definitions to Make.inc as it's used by various build targets
54 AC_SUBST([RADIUSD_VERSION_STRING])
57 dnl # Add definitions to autoconf.h, so that the headers that we install
58 dnl # contain the version number of the server.
60 AC_DEFINE_UNQUOTED([RADIUSD_VERSION], [${RADIUSD_VERSION}], [Version integer in format <ma><ma><mi><mi><in><in>])
61 AC_DEFINE_UNQUOTED([RADIUSD_VERSION_STRING], ["${RADIUSD_VERSION_STRING}"], [Raw version string from VERSION file])
63 dnl #############################################################
65 dnl # Override some of the default autoconf variables such as
66 dnl # CFLAGS if were building in developer mode
68 dnl #############################################################
71 dnl # Enable developer features like debugging symbols.
72 dnl # These checks must be done before expanding the AC_PROG_CC
73 dnl # and AC_PROG_CXX macros.
75 AC_ARG_ENABLE(developer,
76 [ --enable-developer enables features of interest to developers.],
77 [ case "$enableval" in
87 dnl # Turn on the developer flag when taken from a git checkout (not a release)
89 if test -d $srcdir/.git; then
90 if test "x$developer" != "xno"; then
91 AC_MSG_NOTICE([found .git directory, enabling developer build implicitly, disable with --disable-developer])
97 dnl # Autoconf sets -O2 and -g by default, but this is a PITA for debugging
98 dnl # so we remove the defaults if were building in developer mode, and set
99 dnl # -g3 so nice things like macro values are included. Other arguments are
100 dnl # added later when we know what compiler were using.
102 if test "x$developer" = "xyes"; then
106 dnl #############################################################
108 dnl # 0. Checks for compiler, libtool, and command line options.
110 dnl #############################################################
113 dnl # Get system information
118 dnl # Check for GNU cc
124 dnl # check for AIX, to allow us to use some BSD functions
125 dnl # must be before macros that call the compiler.
129 AC_PROG_GCC_TRADITIONAL
134 dnl # Definitive check for whether the compiler is clang
137 if test "x$ax_cv_cc_clang" = "xyes"; then
138 AC_SUBST(clang_path, "$CC")
140 AC_SUBST(clang_path, "")
145 dnl # Set Default CFLAGS for GCC compatible compilers
147 if test "x$GCC" = "xyes"; then
148 CFLAGS="$CFLAGS -Wall -std=c99 -D_GNU_SOURCE"
152 dnl # -Qunused-arguments means the compiler won't complain about unsupported arguments
154 AX_CC_QUNUSED_ARGUMENTS_FLAG
155 if test "x$ax_cv_cc_qunused_arguments_flag" = "xyes"; then
156 CFLAGS="$CFLAGS -Qunused-arguments"
157 LDFLAGS="$LDFLAGS -Qunused-arguments"
161 dnl # Compile in large (2G+) file support.
166 dnl # check for system bytesex
167 dnl # AC_DEFINES WORDS_BIGENDIAN
170 [AC_DEFINE(BIG_ENDIAN, 1, [Define if your processor stores words with the most significant byte first])],
171 [AC_DEFINE(LITTLE_ENDIAN, 1, [Define if your processor stores words with the least significant byte first])]
177 AC_CHECK_PROG(GMAKE, gmake, yes, no)
178 if test $GMAKE = no; then
179 AC_PATH_PROG(MAKE, make, /usr/local/bin/make)
181 AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make)
183 makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"`
184 if test -z "$makever"; then
185 AC_MSG_ERROR([GNU Make is not installed. Please download and install it from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.])
189 dnl # autoconf explicitly sets MAKEFLAGS and MFLAGS to '' even though we
190 dnl # didn't tell it to, so we have to use FR_MAKEFLAGS.
192 dnl # determine the number of cores available and set the number of build
193 dnl # processes appropriately.
197 dnl # Temporarily disabled because test and installation targets do not
198 dnl # have dependencies set up correctly for multiple build processes.
199 dnl if test "x$ax_cv_system_cores" != "x"; then
200 dnl : ${FR_MAKEFLAGS=-j$ax_cv_system_cores}
202 AC_SUBST(FR_MAKEFLAGS)
205 dnl # See if we have Git.
207 AC_CHECK_PROG(GIT, git, yes, no)
209 dnl Put this in later, when all distributed modules use autoconf.
210 dnl AC_ARG_WITH(disablemodulefoo,
211 dnl [ --without-rlm_foo Disables module compilation. Module list:]
212 dnl esyscmd([find src/modules -type d -name rlm_\* -print |\
213 dnl sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\
214 dnl awk '{print " "$0}']))
216 AC_ARG_ENABLE(strict-dependencies,
217 [ --enable-strict-dependencies fail configure on lack of module dependancy.])
219 AC_ARG_ENABLE(werror,
220 [ --enable-werror causes the build to fail if any warnings are generated.],
221 [ case "$enableval" in
231 dnl # extra argument: --with-docdir
233 docdir='${datadir}/doc/freeradius'
234 AC_MSG_CHECKING([docdir])
236 [ --with-docdir=DIR directory for documentation [DATADIR/doc/freeradius] ],
243 [[\\/$]]* | ?:[[\\/]]* )
247 AC_MSG_ERROR([expected an absolute directory name for --with-docdir: $withval])
252 AC_MSG_RESULT($docdir)
253 if test "x$docdir" = xno; then
254 AC_MSG_WARN([Documentation files will NOT be installed.])
258 dnl # extra argument: --with-logdir
260 logdir='${localstatedir}/log/radius'
261 AC_MSG_CHECKING(logdir)
263 [ --with-logdir=DIR directory for logfiles [LOCALSTATEDIR/log/radius] ],
266 AC_MSG_ERROR([Need logdir])
270 [[\\/$]]* | ?:[[\\/]]* )
274 AC_MSG_ERROR([expected an absolute directory name for --with-logdir: $withval])
279 AC_MSG_RESULT($logdir)
282 dnl # extra argument: --with-radacctdir
284 radacctdir='${logdir}/radacct'
285 AC_MSG_CHECKING(radacctdir)
286 AC_ARG_WITH(radacctdir,
287 [ --with-radacctdir=DIR directory for detail files [LOGDIR/radacct] ],
290 AC_MSG_ERROR([Need radacctdir])
294 [[\\/$]]* | ?:[[\\/]]* )
295 radacctdir="$withval"
298 AC_MSG_ERROR([expected an absolute directory name for --with-radacctdir: $withval])
303 AC_MSG_RESULT($radacctdir)
306 dnl # extra argument: --with-raddbdir
308 raddbdir='${sysconfdir}/raddb'
309 AC_MSG_CHECKING(raddbdir)
310 AC_ARG_WITH(raddbdir,
311 [ --with-raddbdir=DIR directory for config files [SYSCONFDIR/raddb] ],
314 AC_MSG_ERROR([Need raddbdir])
318 [[\\/$]]* | ?:[[\\/]]* )
322 AC_MSG_ERROR([expected an absolute directory name for --with-raddbdir: $withval])
327 AC_MSG_RESULT($raddbdir)
330 dnl # extra argument: --with-dictdir
332 dictdir='${datarootdir}/freeradius'
333 AC_MSG_CHECKING(dictdir)
335 [ --with-dictdir=DIR directory for dictionary files [DATAROOTDIR/freeradius] ],
338 AC_MSG_ERROR([Need dictdir])
342 [[\\/$]]* | ?:[[\\/]]* )
346 AC_MSG_ERROR([expected an absolute directory name for --with-dictdir: $withval])
351 AC_MSG_RESULT($dictdir)
353 modconfdir='${raddbdir}/mods-config'
357 dnl # extra argument: --with-ascend-binary
359 WITH_ASCEND_BINARY=yes
360 AC_ARG_WITH(ascend-binary,
361 [ --with-ascend-binary include support for Ascend binary filter attributes (default=yes)],
366 WITH_ASCEND_BINARY=no
369 if test "x$WITH_ASCEND_BINARY" = "xyes"; then
370 AC_DEFINE(WITH_ASCEND_BINARY, [1], [include support for Ascend binary filter attributes])
374 dnl # extra argument: --with-threads
378 [ --with-threads use threads, if available. (default=yes) ],
388 dnl # extra argument: --with-tcp
392 [ --with-tcp compile in TCP support. (default=yes)],
400 if test "x$WITH_TCP" = "xyes"; then
401 AC_DEFINE(WITH_TCP, [1], [define if you want TCP support (For RADSec et al)])
405 dnl # extra argument: --with-vmps
409 [ --with-vmps compile in VMPS support. (default=yes)],
417 if test "x$WITH_VMPS" = "xyes"; then
418 AC_DEFINE(WITH_VMPS, [1], [define if you want VMPS support])
422 dnl # extra argument: --with-dhcp
426 [ --with-dhcp compile in DHCP support. (default=yes)],
434 if test "x$WITH_DHCP" = "xyes"; then
435 AC_DEFINE(WITH_DHCP, [1], [define if you want DHCP support])
439 dnl # Allow the user to specify a list of modules to be linked
440 dnl # statically to the server.
443 AC_ARG_WITH(static_modules,
444 [ --with-static-modules=QUOTED-MODULE-LIST],[
445 for i in $withval; do
446 STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
451 AC_ARG_WITH(shared-libs,
452 [AS_HELP_STRING([--with-shared-libs ],
453 [build dynamic libraries and link against them. (default=yes)])],
464 [ --with-modules=QUOTED-MODULE-LIST],[
465 for i in $withval; do
466 MODULES="$MODULES $i"
471 dnl # extra argument: --with-experimental-modules
474 AC_ARG_WITH(experimental-modules,
475 [AS_HELP_STRING([--with-experimental-modules],
476 [use experimental and unstable modules. (default=no, unless --enable-developer=yes)])],
489 dnl # extra argument: --with-udpfromto
492 AC_ARG_WITH(udpfromto,
493 [ --with-udpfromto compile in UDPFROMTO support. (default=yes)],
503 if test "x$WITH_UDPFROMTO" = "xyes"; then
504 AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto])
508 dnl # These next two arguments don't actually do anything. They're
509 dnl # place holders so that the top-level configure script can tell
510 dnl # the user how to configure lower-level modules
514 dnl # extra argument: --with-rlm-FOO-lib-dir
516 AC_ARG_WITH(rlm-FOO-lib-dir,
517 [AS_HELP_STRING([--with-rlm-FOO-lib-dir=DIR],
518 [directory in which to look for library files used by module FOO])],
526 dnl # extra argument: --with-rlm-FOO-include-dir
528 AC_ARG_WITH(rlm-FOO-include-dir,
529 [AS_HELP_STRING([--with-rlm-FOO-include-dir=DIR],
530 [directory in which to look for include files used by module FOO])],
538 dnl # extra argument: --with-openssl
542 [ --with-openssl use OpenSSL. (default=yes)],
554 dnl # extra argument: --with-openssl-lib-dir=dir
557 AC_ARG_WITH(openssl-lib-dir,
558 [AS_HELP_STRING([--with-openssl-lib-dir=DIR],
559 [directory to look for OpenSSL library files])],
561 *) openssl_lib_dir="$withval"
567 dnl # extra argument: --with-openssl-includes=dir
570 AC_ARG_WITH(openssl-include-dir,
571 [AS_HELP_STRING([--with-openssl-include-dir=DIR],
572 [directory to look for OpenSSL include files])],
574 *) openssl_include_dir="$withval"
579 dnl #############################################################
581 dnl # 1. Checks for programs
583 dnl #############################################################
586 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
587 if test "x$ac_cv_path_PERL" = "x"; then
588 AC_MSG_WARN([perl not found - Simultaneous-Use and checkrad may not work])
590 AC_PATH_PROG(SNMPGET, snmpget)
591 if test "x$ac_cv_path_SNMPGET" = "x"; then
592 AC_MSG_WARN([snmpget not found - Simultaneous-Use and checkrad may not work])
595 AC_PATH_PROG(SNMPWALK, snmpwalk)
596 if test "x$ac_cv_path_SNMPWALK" = "x"; then
597 AC_MSG_WARN([snmpwalk not found - Simultaneous-Use and checkrad may not work])
600 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
603 dnl # FIXME This is truly gross.
605 missing_dir=`cd $ac_aux_dir && pwd`
606 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
607 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
608 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
610 AC_PATH_PROG(LOCATE,locate)
611 AC_PATH_PROG(DIRNAME,dirname)
612 AC_PATH_PROG(GREP,grep)
614 dnl #############################################################
616 dnl # 2. Checks for libraries
618 dnl #############################################################
621 dnl extra argument: --with-talloc-lib-dir=DIR
623 AC_ARG_WITH(talloc-lib-dir,
624 [AS_HELP_STRING([--with-talloc-lib-dir=DIR],
625 [directory in which to look for talloc library files])],
628 AC_MSG_ERROR([Need talloc-lib-dir])
633 talloc_lib_dir="$withval"
637 dnl extra argument: --with-talloc-include-dir=DIR
639 AC_ARG_WITH(talloc-include-dir,
640 [AS_HELP_STRING([--with-talloc-include-dir=DIR],
641 [directory in which to look for talloc include files])],
644 AC_MSG_ERROR([Need talloc-include-dir])
649 talloc_include_dir="$withval"
653 smart_try_dir="$talloc_lib_dir"
654 FR_SMART_CHECK_LIB(talloc, _talloc)
655 if test "x$ac_cv_lib_talloc__talloc" != "xyes"; then
656 AC_MSG_WARN([talloc library not found. Use --with-talloc-lib-dir=<path>.])
657 AC_MSG_ERROR([FreeRADIUS requires libtalloc])
660 TALLOC_LIBS="${smart_lib}"
661 TALLOC_LDFLAGS="${smart_ldflags}"
662 AC_SUBST(TALLOC_LIBS)
663 AC_SUBST(TALLOC_LDFLAGS)
667 dnl # If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
670 if test "x$WITH_THREADS" = "xyes"; then
671 if test $ac_cv_prog_suncc = "yes"; then
675 AC_CHECK_HEADERS(pthread.h, [],
682 dnl # pthread stuff is usually in -lpthread
683 dnl # or in -lc_r, on *BSD
685 dnl # On Some systems, we need extra pre-processor flags, to get them to
686 dnl # to do the threading properly.
688 AC_CHECK_LIB(pthread, pthread_create,
690 CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
691 LIBS="-lpthread $LIBS"
695 dnl # -pthread is not a typo, it's a GCC option which sets additional flags required
696 dnl # for multithreading with the pthreads library.
698 AC_CHECK_LIB(c_r, pthread_create,
699 [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
708 if test "x$WITH_THREADS" != "xyes"; then
709 AC_MSG_WARN([silently not building with thread support.])
710 AC_MSG_WARN([FAILURE: thread support requires: $fail.])
712 AC_DEFINE(WITH_THREADS, [1], [define if you want thread support])
717 dnl # If we have NO pthread libraries, remove any knowledge of threads.
719 if test "x$WITH_THREADS" != "xyes"; then
721 ac_cv_header_pthread_h="no"
725 dnl # We need sem_init() and friends, as they're the friendliest
726 dnl # semaphore functions for threading.
728 dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
729 dnl # Some systems have them in -lsem
730 dnl # Solaris has them in -lposix4
731 dnl # NetBSD has them in -lsemaphore
734 AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore,
736 [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]])]
741 dnl # Check if we need -lsocket
743 AC_CHECK_LIB(dl, dlopen)
746 dnl # Check if we need -lsocket
748 AC_CHECK_LIB(socket, getsockname)
751 dnl # Check for -lresolv
752 dnl # This library may be needed later.
754 AC_CHECK_LIB(resolv, inet_aton)
757 dnl # Check if we need -lnsl. Usually if we want to
758 dnl # link against -lsocket we need to include -lnsl as well.
760 AC_CHECK_LIB(nsl, inet_ntoa)
761 AC_CHECK_LIB(ws2_32, htonl)
764 dnl # Check the pcap library for the RADIUS sniffer.
766 dnl extra argument: --with-pcap-lib-dir=DIR
768 AC_ARG_WITH(pcap-lib-dir,
769 [AS_HELP_STRING([--with-pcap-lib-dir=DIR],
770 [directory in which to look for pcap library files])],
773 AC_MSG_ERROR([Need pcap-lib-dir])
778 pcap_lib_dir="$withval"
782 dnl extra argument: --with-pcap-include-dir=DIR
784 AC_ARG_WITH(pcap-include-dir,
785 [AS_HELP_STRING([--with-pcap-include-dir=DIR],
786 [directory in which to look for pcap include files])],
789 AC_MSG_ERROR([Need pcap-include-dir])
794 pcap_include_dir="$withval"
798 smart_try_dir="$pcap_lib_dir"
799 FR_SMART_CHECK_LIB(pcap, pcap_open_live)
800 if test "x$ac_cv_lib_pcap_pcap_open_live" != "xyes"; then
801 AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-lib-dir=<path>.])
803 AC_DEFINE(HAVE_LIBPCAP, 1,
804 [Define to 1 if you have the `pcap' library (-lpcap).]
814 PCAP_LIBS="${smart_lib}"
815 PCAP_LDFLAGS="${smart_ldflags}"
817 dnl Set by FR_SMART_CHECK_LIB
820 dnl Check for collectdclient
821 dnl extra argument: --with-collectdclient-lib-dir=DIR
822 collectdclient_lib_dir=
823 AC_ARG_WITH(collectdclient-lib-dir,
824 [AS_HELP_STRING([--with-collectdclient-lib-dir=DIR],
825 [directory in which to look for collectdclient library files])],
828 AC_MSG_ERROR([Need collectdclient-lib-dir])
833 collectdclient_lib_dir="$withval"
837 dnl extra argument: --with-collectdclient-include-dir=DIR
838 collectdclient_include_dir=
839 AC_ARG_WITH(collectdclient-include-dir,
840 [AS_HELP_STRING([--with-collectdclient-include-dir=DIR],
841 [directory in which to look for collectdclient include files])],
844 AC_MSG_ERROR([Need collectdclient-include-dir])
849 collectdclient_include_dir="$withval"
853 smart_try_dir="$collectdclient_lib_dir"
854 FR_SMART_CHECK_LIB(collectdclient, lcc_connect)
855 if test "x$ac_cv_lib_collectdclient_lcc_connect" != "xyes"; then
856 AC_MSG_WARN([collectdclient library not found. Use --with-collectdclient-lib-dir=<path>.])
858 COLLECTDC_LIBS="${smart_lib}"
859 COLLECTDC_LDFLAGS="${smart_ldflags}"
861 dnl Set by FR_SMART_CHECKLIB
866 dnl #############################################################
868 dnl # 3. Checks for header files
870 dnl #############################################################
873 dnl # Check for talloc header files
875 smart_try_dir="$talloc_include_dir"
876 FR_SMART_CHECK_INCLUDE([talloc.h])
877 if test "x$ac_cv_header_talloc_h" != "xyes"; then
878 AC_MSG_WARN([talloc headers not found. Use --with-talloc-include-dir=<path>.])
879 AC_MSG_ERROR([FreeRADIUS requires libtalloc])
883 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
884 dnl # getopt will be #included, but won't link. <sigh>
888 CFLAGS="$CFLAGS -D_ALL_SOURCE"
891 CFLAGS="$CFLAGS -DDARWIN"
892 LIBS="-framework DirectoryService $LIBS"
893 AC_DEFINE([__APPLE_USE_RFC_2292], 1, [Force OSX >= 10.7 Lion to use RFC2292 IPv6 socket options])
948 dnl # FreeBSD requires sys/socket.h before net/if.h
950 AC_CHECK_HEADERS(net/if.h, [], [],
952 #ifdef HAVE_SYS_SOCKET_H
953 # include <sys/socket.h>
959 dnl # other checks which require headers
961 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
963 AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication])
966 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
968 AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication])
972 dnl # Were we told to use OpenSSL, if we were and we find an error, call AC_MSG_FAILURE and exit
974 if test "x$WITH_OPENSSL" = xyes; then
978 dnl # Apparently OpenSSL will attempt to build with kerberos if we don't pass this?!
980 CFLAGS="$CFLAGS -DOPENSSL_NO_KRB5"
983 dnl # Check we can link to libcrypto and libssl
985 smart_try_dir="$openssl_lib_dir"
986 FR_SMART_CHECK_LIB(crypto, DH_new)
987 if test "x$ac_cv_lib_crypto_DH_new" = "xyes"; then
988 AC_DEFINE(HAVE_LIBCRYPTO, 1, [Define to 1 if you have the `crypto' library (-lcrypto).])
989 OPENSSL_LIBS="$smart_lib"
990 OPENSSL_LDFLAGS="$smart_ldflags"
992 FR_SMART_CHECK_LIB(ssl, SSL_new)
993 if test "x$ac_cv_lib_ssl_SSL_new" != "xyes"; then
994 AC_MSG_FAILURE([failed linking to libssl. Use --with-openssl-lib-dir=<path>, or --with-openssl=no (builds without OpenSSL)])
996 AC_DEFINE(HAVE_LIBSSL, 1, [Define to 1 if you have the `ssl' library (-lssl).])
997 OPENSSL_LIBS="$OPENSSL_LIBS $smart_lib"
999 if test "$OPENSSL_LDFLAGS" != "$smart_ldflags"; then
1000 AC_MSG_FAILURE(["inconsistent LDFLAGS between -lssl '$smart_ldflags' and -lcrypto '$OPENSSL_LDFLAGS'"])
1004 AC_MSG_FAILURE([failed linking to libcrypto. Use --with-openssl-lib-dir=<path>, or --with-openssl=no (builds without OpenSSL)])
1007 smart_try_dir="$openssl_include_dir"
1008 FR_SMART_CHECK_INCLUDE(openssl/ssl.h)
1009 if test "x$ac_cv_header_openssl_ssl_h" = "xyes"; then
1010 AC_DEFINE(HAVE_OPENSSL_SSL_H, 1, [Define to 1 if you have the <openssl/ssl.h> header file.])
1023 AC_MSG_FAILURE([failed locating OpenSSL headers. Use --with-openssl-include-dir=<path>, or --with-openssl=no (builds without OpenSSL)])
1027 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
1029 [#include <openssl/crypto.h>
1030 #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
1039 AC_MSG_FAILURE([OpenSSL version too old])
1044 dnl # CPPFLAGS are passed to the compiler first, so we use
1045 dnl # them to ensure things like --sysroot don't override the
1046 dnl # library location we discovered previously.
1048 old_CPPFLAGS="$CPPFLAGS"
1049 CPPFLAGS="$OPENSSL_LDFLAGS $CPPFLAGS"
1052 dnl # Now check that the header versions match the library
1054 AC_MSG_CHECKING([OpenSSL library and header version consistency])
1059 #include <openssl/opensslv.h>
1060 #include <openssl/crypto.h>
1063 printf("library: %lx header: %lx... ", (unsigned long) SSLeay(), (unsigned long) OPENSSL_VERSION_NUMBER);
1064 if (SSLeay() == OPENSSL_VERSION_NUMBER) {
1076 AC_MSG_FAILURE([OpenSSL library version does not match header version])
1079 CPPFLAGS="$old_CPPFLAGS"
1083 AC_SUBST(OPENSSL_LIBS)
1084 AC_SUBST(OPENSSL_LDFLAGS)
1085 export OPENSSL_LIBS OPENSSL_LDFLAGS
1089 dnl # Check the pcap includes for the RADIUS sniffer.
1091 if test "x$PCAP_LIBS" = x; then
1092 AC_MSG_NOTICE([skipping test for pcap.h.])
1095 dnl # Check for pcap header files
1097 smart_try_dir="$pcap_include_dir"
1098 FR_SMART_CHECK_INCLUDE([pcap.h])
1099 if test "x$ac_cv_header_pcap_h" == "xyes"; then
1100 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1102 AC_SUBST(PCAP_LDFLAGS)
1104 AC_MSG_WARN([pcap headers not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-include-dir=<path>.])
1108 dnl Check for collectd-client
1109 if test "x$COLLECTDC_LIBS" = x; then
1110 AC_MSG_NOTICE([skipping test for collectd/client.h.])
1113 dnl # Check for collectd-client header files
1115 smart_try_dir="$collectdclient_include_dir"
1116 FR_SMART_CHECK_INCLUDE([collectd/client.h])
1117 if test "x$ac_cv_header_collectd_client_h" == "xyes"; then
1118 AC_DEFINE(HAVE_COLLECTDC_H, 1, [Define to 1 if you have the `collectdclient' library (-lcollectdclient).])
1119 AC_SUBST(COLLECTDC_LIBS)
1120 AC_SUBST(COLLECTDC_LDFLAGS)
1122 AC_MSG_WARN([collectdclient headers not found. Use --with-collectdclient-include-dir=<path>.])
1126 dnl #############################################################
1128 dnl # 4. Checks for typedefs
1130 dnl #############################################################
1133 dnl # Ensure that these are defined
1141 dnl # Check for socklen_t
1143 FR_CHECK_TYPE_INCLUDE(
1145 #ifdef HAVE_SYS_TYPES_H
1146 # include <sys/types.h>
1149 #ifdef HAVE_SYS_SOCKET_H
1150 # include <sys/socket.h>
1153 socklen_t, int, [socklen_t is generally 'int' on systems which don't use it]
1157 dnl # Check for uint8_t
1159 FR_CHECK_TYPE_INCLUDE(
1161 #ifdef HAVE_INTTYPES_H
1162 # include <inttypes.h>
1165 #ifdef HAVE_STDINT_H
1166 # include <stdint.h>
1169 uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic]
1173 dnl # Check for uint16_t
1175 FR_CHECK_TYPE_INCLUDE(
1177 #ifdef HAVE_INTTYPES_H
1178 # include <inttypes.h>
1181 #ifdef HAVE_STDINT_H
1182 # include <stdint.h>
1185 uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic]
1189 dnl # Check for uint32_t
1191 FR_CHECK_TYPE_INCLUDE(
1193 #ifdef HAVE_INTTYPES_H
1194 # include <inttypes.h>
1197 #ifdef HAVE_STDINT_H
1198 # include <stdint.h>
1201 uint32_t, unsigned int, [uint32_t should be the canonical 'network integer']
1205 dnl # Check for uint64_t
1207 FR_CHECK_TYPE_INCLUDE(
1209 #ifdef HAVE_INTTYPES_H
1210 # include <inttypes.h>
1213 #ifdef HAVE_STDINT_H
1214 # include <stdint.h>
1217 uint64_t, unsigned long long, [uint64_t is required for larger counters]
1221 dnl # Check for __uint128_t (compiler builtin)
1223 AC_CHECK_TYPE(__uint128_t, AC_DEFINE(HAVE___UINT128_T, 1, [compiler specific 128 bit unsigned integer]), [], [])
1226 dnl # Check for uint128_t (fictitious future data type)
1228 AC_CHECK_TYPE(uint128_t, AC_DEFINE(HAVE_UINT128_T, 1, [128 bit unsigned integer]), [],
1230 #ifdef HAVE_INTTYPES_H
1231 # include <inttypes.h>
1234 #ifdef HAVE_STDINT_H
1235 # include <stdint.h>
1240 AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [],
1242 #ifdef HAVE_NETINET_IN_H
1243 # include <netinet/in.h>
1248 AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [],
1250 #ifdef HAVE_NETINET_IN_H
1251 # include <netinet/in.h>
1254 #ifdef HAVE_SYS_SOCKET_H
1255 # include <sys/socket.h>
1259 AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [],
1261 #ifdef HAVE_NETINET_IN_H
1262 # include <netinet/in.h>
1266 AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [],
1268 #ifdef HAVE_SYS_TYPES_H
1269 # include <sys/types.h>
1272 #ifdef HAVE_SYS_SOCKET_H
1273 # include <sys/socket.h>
1283 dnl # Check for sig_t
1285 dnl # FR_CHECK_TYPE_INCLUDE doesn't work for callbacks as it doesn't produce typedefs
1287 AC_MSG_CHECKING([if sig_t is defined])
1291 #ifdef HAVE_SIGNAL_H
1292 # include <signal.h>
1302 AC_DEFINE(HAVE_SIG_T, 1, [Define if the type sig_t is defined by signal.h])
1309 dnl #############################################################
1311 dnl # 5. Checks for structures and functions
1313 dnl #############################################################
1353 dnl # Check if we have utmpx.h
1354 dnl # if so, check if struct utmpx has entry ut_xtime
1355 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
1357 if test "x$ac_cv_header_utmpx_h" = "xyes"; then
1358 FR_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
1359 if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"; then
1360 AC_DEFINE(ut_xtime, ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx])
1365 dnl # struct ip_pktinfo
1367 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
1368 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"; then
1369 AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)])
1373 dnl # struct in6_pktinfo
1375 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in6_pktinfo], ipi6_addr)
1376 if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes"; then
1377 AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)])
1381 dnl # Check for htonll and htonlll
1383 AC_MSG_CHECKING([if htonll is defined])
1387 #include <sys/types.h>
1388 #include <netinet/in.h>
1396 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function (or macro) htonll exists.])
1403 AC_MSG_CHECKING([if htonlll is defined])
1407 #include <sys/types.h>
1408 #include <netinet/in.h>
1416 AC_DEFINE(HAVE_HTONLLL, 1, [Define if the function (or macro) htonlll exists.])
1423 dnl #############################################################
1425 dnl # 6. Checks for compiler characteristics
1427 dnl #############################################################
1430 dnl # Ensure that these are defined
1435 dnl # See if this is OS/2
1437 AC_MSG_CHECKING([type of OS])
1440 if test "$OS" = "OS/2"; then
1447 if test "x$developer" = "xyes"; then
1448 AC_MSG_NOTICE([Setting additional developer CFLAGS])
1451 dnl # Tell the compiler to parse doxygen documentation and verify it against function and variable declarations
1453 AX_CC_WDOCUMENTATION_FLAG
1454 if test "x$ax_cv_cc_wdocumentation_flag" = "xyes"; then
1455 devflags="-Wdocumentation"
1458 if test "x$GCC" = "xyes"; then
1459 devflags="$devflags -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wno-cast-align -Wformat-nonliteral -Wformat-security -Wformat=2 -DWITH_VERIFY_PTR=1"
1463 AC_MSG_NOTICE([Developer CFLAGS are "$devflags"])
1465 CFLAGS="$CFLAGS $devflags"
1467 dnl # Enable experimental modules (we want to know if code changes breaks one of them)
1469 if test "x$EXPERIMENTAL" != "xno"; then
1470 AC_MSG_NOTICE([is developer build, enabling experimental modules implicitly, disable with --without-experimental-modules])
1475 CFLAGS="$CFLAGS -DNDEBUG"
1480 dnl # May of been set outside of this configure script
1482 AC_MSG_CHECKING([if building with -DNDEBUG])
1483 if echo "$CFLAGS" | grep '\-DNDEBUG' > /dev/null; then
1484 AC_MSG_RESULT([yes])
1485 AC_DEFINE([WITH_NDEBUG], [1], [define if the server was built with -DNDEBUG])
1493 dnl # append the current git hash onto the version string
1495 if test -d $srcdir/.git -a "x$GIT" = "xyes"; then
1496 RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1`
1497 AC_DEFINE_UNQUOTED([RADIUSD_VERSION_COMMIT],[${RADIUSD_VERSION_COMMIT}],[Commit HEAD at time of configuring])
1501 dnl # check for some compiler features
1504 FR_HAVE_BUILTIN_CHOOSE_EXPR
1505 FR_HAVE_BUILTIN_TYPES_COMPATIBLE_P
1506 FR_HAVE_BUILTIN_BSWAP_64
1508 dnl #############################################################
1510 dnl # 7. Checks for library functions
1512 dnl #############################################################
1515 dnl # Check for talloc_set_memlimit
1516 dnl # This was only included in version 2.0.8
1518 AC_CHECK_LIB(talloc, talloc_set_memlimit,
1520 AC_DEFINE(HAVE_TALLOC_SET_MEMLIMIT, 1, [Define to 1 if you have the function talloc_set_memlimit.])
1525 dnl # Check for libcrypt
1526 dnl # We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
1528 AC_CHECK_LIB(crypt, crypt,
1532 if test "$CRYPTLIB" != ""; then
1533 AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])
1535 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]))
1538 dnl Check for libcipher
1539 AC_CHECK_LIB(cipher, setkey,
1540 CRYPTLIB="${CRYPTLIB} -lcipher"
1545 dnl # Check for libexecinfo support, on some systems this is built into libc
1546 dnl # on others it's a separate library.
1548 dnl extra argument: --with-execinfo-lib-dir
1550 AC_ARG_WITH(execinfo-lib-dir,
1551 [AS_HELP_STRING([--with-execinfo-lib-dir=DIR],
1552 [directory in which to look for execinfo library files])],
1553 [ case "$withval" in
1555 AC_MSG_ERROR([Need execinfo-lib-dir])
1560 execinfo_lib_dir="$withval"
1565 dnl extra argument: --with-execinfo-include-dir
1566 execinfo_include_dir=
1567 AC_ARG_WITH(execinfo-include-dir,
1568 [AS_HELP_STRING([--with-execinfo-include-dir=DIR],
1569 [directory in which to look for execinfo include files])],
1570 [ case "$withval" in
1572 AC_MSG_ERROR([Need execinfo-include-dir])
1577 execinfo_include_dir="$withval"
1583 dnl # Look for execinfo.h and symbols
1585 smart_try_dir=$execinfo_include_dir
1586 FR_SMART_CHECK_INCLUDE(execinfo.h)
1587 if test "x$ac_cv_header_execinfo_h" = "xyes"; then
1588 smart_try_dir=$execinfo_lib_dir
1589 FR_SMART_CHECK_LIB(execinfo, backtrace_symbols)
1590 if test "x$ac_cv_lib_execinfo_backtrace_symbols" != "xyes"; then
1591 dnl # Might be provided as part of libc
1592 AC_MSG_CHECKING([if execinfo provided as part of libc])
1595 #include <execinfo.h>
1599 backtrace_symbols(&sym, sizeof(sym)) ],
1602 ac_cv_lib_execinfo_backtrace_symbols="yes"
1610 if test "x$ac_cv_lib_execinfo_backtrace_symbols" = "xyes"; then
1611 AC_DEFINE(HAVE_EXECINFO, [1], [define this if we have <execinfo.h> and symbols])
1616 dnl # Check for regular expression support, if were using PCRE it MUST be included
1617 dnl # before all others, else we seem to still pickup the posix symbols for regcomp
1618 dnl # and regexec, which results in crashes as soon as we call any posix regex
1621 dnl extra argument: --with-pcre-lib-dir
1623 AC_ARG_WITH(pcre-lib-dir,
1624 [AS_HELP_STRING([--with-pcre-lib-dir=DIR],
1625 [directory in which to look for pcre library files])],
1626 [ case "$withval" in
1628 AC_MSG_ERROR(Need pcre-lib-dir)
1633 pcre_lib_dir="$withval"
1638 dnl extra argument: --with-pcre-include--dir
1640 AC_ARG_WITH(pcre-include-dir,
1641 [AS_HELP_STRING([--with-pcre-include-dir=DIR],
1642 [directory in which to look for pcre include files])],
1643 [ case "$withval" in
1645 AC_MSG_ERROR(Need pcre-include-dir)
1650 pcre_include_dir="$withval"
1660 dnl # First look for PCRE
1662 smart_try_dir=$pcre_include_dir
1663 FR_SMART_CHECK_INCLUDE(pcreposix.h)
1664 if test "x$ac_cv_header_pcreposix_h" = "xyes"; then
1665 AC_DEFINE(HAVE_REGEX_H, [1], [define if we have any regex])
1666 AC_DEFINE(HAVE_PCREPOSIX_H, [1], [define this if we have the <pcreposix.h> header file])
1670 LIBS="-lpcre -lpcreposix $LIBS"
1673 dnl # Then fallback to POSIX regular expressions
1677 FR_SMART_CHECK_INCLUDE(regex.h)
1678 if test "x$ac_cv_header_regex_h" = "xyes"; then
1679 AC_DEFINE(HAVE_REGEX_H, [1], [define if we have any regex])
1688 [AC_DEFINE(HAVE_REG_EXTENDED, [1], [define this if we have REG_EXTENDED (from <regex.h>)]) REGEX_EXTENDED=yes]
1691 dnl # Fixme, this is needed for mingw builds, but not available on some Linux systems
1692 dnl # despite the presence of regex.h
1694 dnl # LIBS="$LIBS -lregex"
1699 AC_SUBST(REGEX_PCRE)
1700 AC_SUBST(REGEX_EXTENDED)
1703 dnl # Check the style of gethostbyaddr, in order of preference
1704 dnl # GNU (_r eight args)
1706 AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r])
1709 dnl # SYSV (_r six args)
1711 AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r])
1714 dnl # BSD (three args, may not be thread safe)
1716 AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r])
1719 dnl # Tru64 has BSD version, but it is thread safe
1720 dnl # http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
1721 dnl # We need #stdio.h to define NULL on FreeBSD (at least)
1723 gethostbyaddrrstyle=""
1724 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
1728 dnl # With FreeBSD, check if there's a prototype for gethostbyaddr_r.
1729 dnl # Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we
1730 dnl # override this test to BSDSTYLE. FreeBSD 6.2 and up have proper GNU
1731 dnl # style support.
1733 AC_CHECK_DECLS([gethostbyaddr_r], [],
1735 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE,
1736 [style of gethostbyaddr_r functions ])
1737 gethostbyaddrrstyle=BSD
1738 AC_MSG_WARN([FreeBSD overridden to BSD-style])
1748 if test "x$gethostbyaddrrstyle" = "x"; then
1754 [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ],
1756 AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ])
1757 gethostbyaddrrstyle=GNU
1762 if test "x$gethostbyaddrrstyle" = "x"; then
1768 [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] ,
1770 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ])
1771 gethostbyaddrrstyle=SYSV
1777 if test "x$gethostbyaddrrstyle" = "x"; then
1783 [ gethostbyaddr(NULL, 0, 0) ],
1785 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
1786 gethostbyaddrrstyle=BSD
1791 if test "x$gethostbyaddrrstyle" = "x"; then
1792 AC_MSG_RESULT([none! It must not exist, here.])
1794 AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
1797 if test "x$gethostbyaddrrstyle" = "xBSD"; then
1798 AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
1802 dnl # Check the style of gethostbyname, in order of preference
1803 dnl # GNU (_r seven args)
1804 dnl # SYSV (_r five args)
1805 dnl # BSD (two args, may not be thread safe)
1806 dnl # Tru64 has BSD version, but it _is_ thread safe
1807 dnl # http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
1808 dnl # We need #stdio.h to define NULL on FreeBSD (at least)
1810 gethostbynamerstyle=""
1811 AC_MSG_CHECKING([gethostbyname_r() syntax])
1817 [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ],
1819 AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ])
1820 gethostbynamerstyle=GNU
1824 if test "x$gethostbynamerstyle" = "x"; then
1830 [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] ,
1832 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ])
1833 gethostbynamerstyle=SYSV
1838 if test "x$gethostbynamerstyle" = "x"; then
1844 [ gethostbyname(NULL) ],
1846 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ])
1847 gethostbynamerstyle=BSD
1852 if test "x$gethostbynamerstyle" = "x"; then
1853 AC_MSG_RESULT([none! It must not exist, here.])
1855 AC_MSG_RESULT([${gethostbynamerstyle}-style])
1858 if test "x$gethostbynamerstyle" = "xBSD"; then
1859 AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
1863 dnl # Check for non-posix solaris ctime_r (extra buflen int arg)
1865 AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r])
1866 AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r])
1868 AC_MSG_CHECKING([ctime_r() syntax])
1873 [ ctime_r(NULL, NULL, 0) ],
1875 AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function])
1876 ctimerstyle="SOLARIS"
1880 if test "x$ctimerstyle" = "x"; then
1885 [ ctime_r(NULL, NULL) ],
1887 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function])
1893 if test "x$ctimerstyle" = "x"; then
1894 AC_MSG_RESULT([none! It must not exist, here.])
1896 AC_MSG_RESULT([${ctimerstyle}-style])
1899 AC_SUBST(HOSTINFO, $host)
1901 dnl #############################################################
1903 dnl # 8. Checks for system services
1905 dnl #############################################################
1908 dnl # Figure out where libtool is located,
1912 AC_MSG_RESULT([top_builddir=$top_builddir])
1913 dnl # AC_SUBST(top_builddir)
1916 dnl # import libtool stuff
1918 dnl #############################################################
1920 dnl # Configure in any module directories.
1922 dnl #############################################################
1924 dnl ############################################################
1925 dnl # Remove any conflicting definitions if autoconf.h
1926 dnl # is being included by a module.
1927 dnl #############################################################
1928 AH_BOTTOM([#include <freeradius-devel/automask.h>])
1930 dnl ############################################################
1931 dnl # make modules by list
1932 dnl #############################################################
1933 if test "x$EXPERIMENTAL" = "xyes"; then
1934 for foo in `ls -1 "${srcdir}"/src/modules | grep rlm_`; do
1935 MODULES="$MODULES $foo"
1939 dnl # make ONLY the stable modules
1941 for foo in `cat "${srcdir}"/src/modules/stable`; do
1942 MODULES="$MODULES $foo"
1946 dnl ############################################################
1947 dnl # Add autoconf subdirs, based on the module list we
1948 dnl # previously created.
1949 dnl #############################################################
1951 for bar in $MODULES; do
1952 if test -f "${srcdir}"/src/modules/$bar/configure; then
1953 mysubdirs="$mysubdirs src/modules/$bar"
1958 dnl # Don't change the variable name here. Autoconf goes bonkers
1961 AC_CONFIG_SUBDIRS($mysubdirs)
1964 dnl #############################################################
1966 dnl # Add -Werror last, so it doesn't interfere with autoconf's
1967 dnl # test programs.
1969 dnl #############################################################
1970 if test "x$werror" == "xyes"; then
1971 CFLAGS="-Werror $CFLAGS"
1974 dnl #############################################################
1976 dnl # And finally, output the results.
1978 dnl #############################################################
1979 AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h])
1980 AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)])
1981 AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main && chmod +x checkrad radlast radtest)])
1982 AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts && chmod +x rc.radiusd cron/radiusd.cron.daily cron/radiusd.cron.monthly cryptpasswd)])
1985 dnl # Substitute whatever libraries we found to be necessary
1988 AC_SUBST(INSTALLSTRIP)
1990 AC_SUBST(USE_SHARED_LIBS)
1991 USE_STATIC_LIBS="yes"
1992 AC_SUBST(USE_STATIC_LIBS)
1993 AC_SUBST(STATIC_MODULES)
1997 ./src/include/build-radpaths-h \
1998 ./src/main/radsniff.mk \
1999 ./src/main/checkrad \
2000 ./src/main/radlast \
2001 ./src/main/radtest \
2002 ./scripts/rc.radiusd \
2003 ./scripts/cron/radiusd.cron.daily \
2004 ./scripts/cron/radiusd.cron.monthly \
2005 ./scripts/cryptpasswd \
2006 ./raddb/radrelay.conf \
2007 ./raddb/radiusd.conf