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 #############################################################
23 AC_INIT(src/main/radiusd.c)
24 AC_CONFIG_HEADER(src/include/autoconf.h)
25 AC_REVISION($Revision$)dnl
28 dnl # The version of the software
29 RADIUSD_MAJOR_VERSION=1
30 RADIUSD_MINOR_VERSION=1.7
31 RADIUSD_VERSION="${RADIUSD_MAJOR_VERSION}.${RADIUSD_MINOR_VERSION}"
33 dnl #############################################################
35 dnl # 0. Checks for compiler, libtool, and command line options.
37 dnl #############################################################
43 dnl # check for AIX, to allow us to use some BSD functions
44 dnl # must be before macros that call the compiler.
48 AC_PROG_GCC_TRADITIONAL
52 abs_top_builddir=`pwd`
53 AC_SUBST(abs_top_builddir)
55 dnl # autoconf 2.50 and later
56 dnl # AC_SYS_LARGEFILE
60 dnl # check for system bytesex
61 dnl # AC_DEFINES WORDS_BIGENDIAN
65 AC_CHECK_PROG(GMAKE, gmake, yes, no)
66 if test $GMAKE = no; then
67 AC_PATH_PROG(MAKE, make, /usr/local/bin/make)
69 AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make)
71 makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"`
72 if test -z "$makever"; then
73 AC_MSG_ERROR(GNU Make is not installed. Please download and install it
74 from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.)
77 dnl libltdl is installable
78 AC_LIBLTDL_INSTALLABLE
80 dnl tell Makefile to build ltdl if needed
81 if test x"$enable_ltdl_install" = x"yes"; then
84 AC_SUBST(LTDL_SUBDIRS)
86 dnl use system-wide libtool, if it exists
87 AC_ARG_WITH(system-libtool,
88 [ --with-system-libtool try to use libtool installed in your system [default=use our own]],
89 [ AC_PATH_PROG(LIBTOOL, libtool,,$PATH:/usr/local/bin) ],
91 LIBTOOL="`pwd`/libtool"
93 dnl ensure that we're looking for dlopen
96 dnl Figure out how to build shared libraries
101 dnl Put this in later, when all distributed modules use autoconf.
102 dnl AC_ARG_WITH(disablemodulefoo,
103 dnl [ --without-rlm_foo Disables module compilation. Module list:]
104 dnl esyscmd([find src/modules -type d -name rlm_\* -print |\
105 dnl sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\
106 dnl awk '{print " "$0}']))
108 AC_ARG_ENABLE(strict-dependencies,
109 [ --enable-strict-dependencies Fail configure on lack of module dependancy.])
111 dnl extra argument: --with-docdir
112 docdir='${datadir}/doc/freeradius'
113 AC_MSG_CHECKING(docdir)
115 [ --with-docdir=DIR Directory for documentation [DATADIR/doc/freeradius] ],
122 [[\\/$]]* | ?:[[\\/]]* )
126 AC_MSG_ERROR([expected an absolute directory name for --with-docdir: $withval])
131 AC_MSG_RESULT($docdir)
132 if test "x$docdir" = xno; then
133 AC_MSG_WARN(Documentation files will NOT be installed.)
136 dnl extra argument: --with-logdir
137 logdir='${localstatedir}/log/radius'
138 AC_MSG_CHECKING(logdir)
140 [ --with-logdir=DIR Directory for logfiles [LOCALSTATEDIR/log/radius] ],
143 AC_MSG_ERROR(Need logdir)
147 [[\\/$]]* | ?:[[\\/]]* )
151 AC_MSG_ERROR([expected an absolute directory name for --with-logdir: $withval])
156 AC_MSG_RESULT($logdir)
158 dnl extra argument: --with-radacctdir
159 radacctdir='${logdir}/radacct'
160 AC_MSG_CHECKING(radacctdir)
161 AC_ARG_WITH(radacctdir,
162 [ --with-radacctdir=DIR Directory for detail files [LOGDIR/radacct] ],
165 AC_MSG_ERROR(Need radacctdir)
169 [[\\/$]]* | ?:[[\\/]]* )
170 radacctdir="$withval"
173 AC_MSG_ERROR([expected an absolute directory name for --with-radacctdir: $withval])
178 AC_MSG_RESULT($radacctdir)
180 dnl extra argument: --with-raddbdir
181 raddbdir='${sysconfdir}/raddb'
182 AC_MSG_CHECKING(raddbdir)
183 AC_ARG_WITH(raddbdir,
184 [ --with-raddbdir=DIR Directory for config files [SYSCONFDIR/raddb] ],
187 AC_MSG_ERROR(Need raddbdir)
191 [[\\/$]]* | ?:[[\\/]]* )
195 AC_MSG_ERROR([expected an absolute directory name for --with-raddbdir: $withval])
200 AC_MSG_RESULT($raddbdir)
202 dnl extra argument: --with-ascend-binary
204 AC_ARG_WITH(ascend-binary,
205 [ --with-ascend-binary Include support for Ascend binary filter attributes (default=yes)],
213 if test "X$ASCEND_BINARY" = "Xyes"; then
214 AC_DEFINE(ASCEND_BINARY)
217 dnl extra argument: --with-threads
220 [ --with-threads Use threads, if available. (default=yes) ],
229 dnl extra argument: --with-snmp
232 [ --with-snmp Compile in SNMP support. (default=yes)],
242 dnl # extra argument: --with-snmp-include-dir
244 AC_ARG_WITH(snmp-include-dir,
245 [ --with-snmp-include-dir=DIR Directory to look for include files used by SNMP],
252 dnl extra argument: --with-large-files
253 rad_enable_largefiles=no
254 AC_ARG_WITH(large-files,
255 [ --with-large-files Compile in large (2G+) file support. (default=no)],
258 rad_enable_largefiles=yes
267 dnl # Allow the user to specify a list of modules to be linked
268 dnl # statically to the server.
271 AC_ARG_WITH(static_modules,
272 [ --with-static-modules=QUOTED-MODULE-LIST],[
273 for i in $withval; do
274 STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
280 [ --with-modules=QUOTED-MODULE-LIST],[
281 for i in $withval; do
282 MODULES="$MODULES $i"
287 dnl # Enable developer C compiler warnings
289 AC_ARG_ENABLE(developer,
290 [ --enable-developer Enables features of interest to developers.],
291 [ case "$enableval" in
300 if test "x$developer" != "xno" -a -d $srcdir/CVS; then
301 dnl turn on the developer flag when taken from a CVS checkout (not a release)
305 dnl extra argument: --with-experimental-modules
307 AC_ARG_WITH(experimental-modules,
308 [ --with-experimental-modules Use experimental and unstable modules. (default=no) ],
318 dnl # extra argument: --with-openssl-includes=dir
321 AC_ARG_WITH(openssl-includes,
322 [ --with-openssl-includes=DIR Directory to look for OpenSSL include files],
324 *) OPENSSL_INCLUDE_DIR="$withval"
330 dnl # extra argument: --with-openssl-libraries=dir
333 AC_ARG_WITH(openssl-libraries,
334 [ --with-openssl-libraries=DIR Directory to look for OpenSSL library files],
336 *) OPENSSL_LIB_DIR="$withval"
342 dnl # These next two arguments don't actually do anything. They're
343 dnl # place holders so that the top-level configure script can tell
344 dnl # the user how to configure lower-level modules
348 dnl # extra argument: --with-rlm-FOO-lib-dir
350 AC_ARG_WITH(rlm-FOO-lib-dir,
351 [ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO],
359 dnl # extra argument: --with-rlm-FOO-include-dir
361 AC_ARG_WITH(rlm-FOO-include-dir,
362 [ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO],
369 dnl See what include-style is used by the make program.
370 dnl AC_MSG_CHECKING(include style for make)
371 dnl echo "include /dev/null" > testmake.$$
372 dnl echo "all:" >> testmake.$$
373 dnl make -f testmake.$$ >/dev/null 2>&1
382 dnl rm -f testmake.$$
383 dnl AC_MSG_RESULT(" $INCLUDE")
384 dnl AC_SUBST(INCLUDE)
387 dnl extra argument: --with-udpfromto
389 AC_ARG_WITH(udpfromto,
390 [ --with-udpfromto Compile in UDPFROMTO support. (default=no)],
400 if test "x$WITH_UDPFROMTO" = "xyes"; then
401 AC_DEFINE(WITH_UDPFROMTO)
404 dnl extra argument: --with-edir
405 dnl If using Novell eDirectory, enable UP and Novell specific code
407 [ --with-edir Enable Novell eDirectory integration. (default=no) ] , [] )
409 dnl #############################################################
411 dnl # 1. Checks for programs
413 dnl #############################################################
416 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
417 if test "x$ac_cv_path_PERL" = "x"; then
418 AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
420 AC_PATH_PROG(SNMPGET, snmpget)
421 if test "x$ac_cv_path_SNMPGET" = "x"; then
422 AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
425 AC_PATH_PROG(SNMPWALK, snmpwalk)
426 if test "x$ac_cv_path_SNMPWALK" = "x"; then
427 AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
430 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
432 dnl FIXME This is truly gross.
433 missing_dir=`cd $ac_aux_dir && pwd`
434 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
435 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
436 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
438 AC_PATH_PROG(LOCATE,locate)
439 AC_PATH_PROG(DIRNAME,dirname)
440 AC_PATH_PROG(GREP,grep)
442 dnl #############################################################
444 dnl # 2. Checks for libraries
446 dnl #############################################################
448 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
450 if test "x$WITH_THREADS" = "xyes"; then
451 if test $ac_cv_prog_suncc = "yes"; then
455 AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
458 dnl # pthread stuff is usually in -lpthread
459 dnl # or in -lc_r, on *BSD
461 dnl # On Some systems, we need extra pre-processor flags, to get them to
462 dnl # to do the threading properly.
464 AC_CHECK_LIB(pthread, pthread_create,
465 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
466 LIBS="$LIBS -lpthread" ],
467 AC_CHECK_LIB(c_r, pthread_create,
468 [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
469 [ WITH_THREADS="no" ]
475 dnl # If we have NO pthread libraries, remove any knowledge of threads.
477 if test "x$WITH_THREADS" != "xyes"; then
479 ac_cv_header_pthread_h="no"
483 dnl # We need sem_init() and friends, as they're the friendliest
484 dnl # semaphore functions for threading.
486 dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
487 dnl # Some systems have them in -lsem
488 dnl # Solaris has them in -lposix4
490 AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt,
492 [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)]
496 dnl Check if we need -lsocket
497 AC_CHECK_LIB(socket, getsockname)
499 dnl Check for -lresolv
500 dnl This library may be needed later.
501 AC_CHECK_LIB(resolv, inet_aton)
503 dnl Check if we need -lnsl. Usually if we want to
504 dnl link against -lsocket we need to include -lnsl as well.
505 AC_CHECK_LIB(nsl, inet_ntoa)
507 dnl Check for OpenSSL libraries.
510 if test "x$OPENSSL_LIB_DIR" != "x"; then
511 LIBS="-L$OPENSSL_LIB_DIR $LIBS"
513 AC_CHECK_LIB(crypto, DH_new,
515 AC_DEFINE(HAVE_LIBCRYPTO, 1,
516 [Define to 1 if you have the `crypto' library (-lcrypto).])
517 AC_CHECK_LIB(ssl, SSL_new,
519 AC_DEFINE(HAVE_LIBSSL, 1,
520 [Define to 1 if you have the `ssl' library (-lssl).])
521 if test "x$OPENSSL_LIB_DIR" != "x"; then
522 OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
524 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
529 dnl #############################################################
531 dnl # 3. Checks for header files
533 dnl #############################################################
536 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
537 dnl # getopt will be #included, but won't link. <sigh>
542 CFLAGS="$CFLAGS -D_ALL_SOURCE"
545 CFLAGS="$CFLAGS -DDARWIN"
588 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H))
589 if test "x$ac_cv_header_regex_h" = "xyes"; then
597 ], [AC_DEFINE(HAVE_REG_EXTENDED) REGEX_EXTENDED=yes])
600 AC_SUBST(REGEX_EXTENDED)
603 dnl # other checks which require headers
605 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
610 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
615 dnl Check for OpenSSL includes.
616 OPENSSL_INCLUDE="-DNO_OPENSSL"
617 if test "x$OPENSSL_LIBS" = "x"; then
618 AC_MSG_WARN([skipping test for openssl/ssl.h])
620 old_CPPFLAGS=$CPPFLAGS
621 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
622 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR"
624 dnl # stupid RedHat shit
625 CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
634 if test "x$OPENSSL_LIBS" != "x"; then
635 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
637 [#include <openssl/crypto.h>
638 #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
642 if test "x$goodssl" != "xyes"; then
647 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
648 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5"
650 OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
654 CPPFLAGS=$old_CPPFLAGS
656 AC_SUBST(OPENSSL_INCLUDE)
657 AC_SUBST(OPENSSL_LIBS)
660 dnl #############################################################
662 dnl # 4. Checks for typedefs
664 dnl #############################################################
667 dnl # Ensure that these are defined
674 dnl check for socklen_t
675 AC_CHECK_TYPE_INCLUDE([
676 #ifdef HAVE_SYS_TYPES_H
677 #include <sys/types.h>
679 #ifdef HAVE_SYS_SOCKET_H
680 #include <sys/socket.h>
684 dnl check for uint8_t
685 AC_CHECK_TYPE_INCLUDE([
686 #ifdef HAVE_INTTYPES_H
687 #include <inttypes.h>
692 ],uint8_t, unsigned char)
694 dnl check for uint16_t
695 AC_CHECK_TYPE_INCLUDE([
696 #ifdef HAVE_INTTYPES_H
697 #include <inttypes.h>
702 ],uint16_t, unsigned short)
704 dnl check for uint32_t
705 AC_CHECK_TYPE_INCLUDE([
706 #ifdef HAVE_INTTYPES_H
707 #include <inttypes.h>
712 ],uint32_t, unsigned int)
714 dnl #############################################################
716 dnl # 5. Checks for structures and functions
718 dnl #############################################################
745 RADIUSD_NEED_DECLARATIONS( \
758 dnl # check if we have utmpx.h
759 dnl # if so, check if struct utmpx has entry ut_xtime
760 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
761 if test "x$ac_cv_header_utmpx_h" = "xyes"
763 AC_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
764 if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
766 AC_DEFINE(ut_xtime,ut_tv.tv_sec)
770 dnl # struct ip_pktinfo
771 AC_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
772 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
774 AC_DEFINE(HAVE_IP_PKTINFO)
777 dnl #############################################################
779 dnl # 6. Checks for compiler characteristics
781 dnl #############################################################
784 dnl # Ensure that these are defined
789 dnl # See if this is OS/2
791 AC_MSG_CHECKING(type of OS)
794 if test "$OS" = "OS/2"; then
802 dnl # Set Default CFLAGS
804 if test "x$GCC" = "xyes"; then
805 CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
808 AC_MSG_CHECKING(for developer gcc flags)
809 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
810 devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"
811 CFLAGS="$CFLAGS $devflags"
813 AC_MSG_RESULT(yes. Using $devflags)
816 CFLAGS="$CFLAGS -DNDEBUG"
821 dnl #############################################################
823 dnl # 7. Checks for library functions
825 dnl #############################################################
827 dnl Check for libcrypt
828 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
829 AC_CHECK_LIB(crypt, crypt,
832 if test "$CRYPTLIB" != ""; then
833 AC_DEFINE(HAVE_CRYPT)
835 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
838 dnl Check for libcipher
839 AC_CHECK_LIB(cipher, setkey,
840 CRYPTLIB="${CRYPTLIB} -lcipher"
844 if test "x$WITH_SNMP" = "xyes"; then
848 dnl Check the style of gethostbyaddr, in order of preference
849 dnl GNU (_r eight args)
850 dnl SYSV (_r six args)
851 dnl BSD (three args, may not be thread safe)
852 dnl Tru64 has BSD version, but it is thread safe
853 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
854 dnl We need #stdio.h to define NULL on FreeBSD (at least)
855 gethostbyaddrrstyle=""
856 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
859 dnl With FreeBSD, check if there's a prototype for gethostbyaddr_r.
860 dnl Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we
861 dnl override this test to BSDSTYLE. FreeBSD 6.2 and up have proper GNU
863 AC_CHECK_DECLS([gethostbyaddr_r], [], [
864 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE,
865 [style of gethostbyaddr_r functions ])
866 gethostbyaddrrstyle=BSD
867 AC_MSG_WARN([FreeBSD overridden to BSD-style])
875 if test "x$gethostbyaddrrstyle" = "x"; then
879 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
880 AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE)
881 gethostbyaddrrstyle=GNU
884 if test "x$gethostbyaddrrstyle" = "x"; then
888 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
889 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE)
890 gethostbyaddrrstyle=SYSV
893 if test "x$gethostbyaddrrstyle" = "x"; then
897 ], [ gethostbyaddr(NULL, 0, 0) ], [
898 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
899 gethostbyaddrrstyle=BSD
903 if test "x$gethostbyaddrrstyle" = "x"; then
904 AC_MSG_RESULT([none! It must not exist, here.])
906 AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
909 if test "x$gethostbyaddrrstyle" = "xBSD"; then
910 AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
913 dnl Check the style of gethostbyname, in order of preference
914 dnl GNU (_r seven args)
915 dnl SYSV (_r five args)
916 dnl BSD (two args, may not be thread safe)
917 dnl Tru64 has BSD version, but it _is_ thread safe
918 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
919 dnl We need #stdio.h to define NULL on FreeBSD (at least)
920 gethostbynamerstyle=""
921 AC_MSG_CHECKING([gethostbyname_r() syntax])
925 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
926 AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE)
927 gethostbynamerstyle=GNU
929 if test "x$gethostbynamerstyle" = "x"; then
933 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
934 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE)
935 gethostbynamerstyle=SYSV
938 if test "x$gethostbynamerstyle" = "x"; then
942 ], [ gethostbyname(NULL) ], [
943 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE)
944 gethostbynamerstyle=BSD
948 if test "x$gethostbynamerstyle" = "x"; then
949 AC_MSG_RESULT([none! It must not exist, here.])
951 AC_MSG_RESULT([${gethostbynamerstyle}-style])
954 if test "x$gethostbynamerstyle" = "xBSD"; then
955 AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
958 dnl check for non-posix solaris ctime_r (extra buflen int arg)
960 AC_MSG_CHECKING([ctime_r() syntax])
963 ], [ ctime_r(NULL, NULL, 0) ], [
964 AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE)
965 ctimerstyle="SOLARIS"
967 if test "x$ctimerstyle" = "x"; then
970 ], [ ctime_r(NULL, NULL) ], [
971 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE)
976 if test "x$ctimerstyle" = "x"; then
977 AC_MSG_RESULT([none! It must not exist, here.])
979 AC_MSG_RESULT([${ctimerstyle}-style])
983 dnl If configuring with large file support, determine the right flags to
984 dnl use based on the platform. This is the wrong approach; autoconf 2.50
985 dnl comes with a macro that takes the right approach. But this works well
986 dnl enough until we switch to autoconf 2.50 or later.
987 if test x"$rad_enable_largefiles" = xyes ; then
988 AC_MSG_CHECKING(for largefile linkage)
992 AC_MSG_ERROR([AIX before 4.2 does not support large files])
996 LFS_CFLAGS="-D_LARGE_FILES"
1002 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1008 AC_MSG_ERROR([Large files not supported on this platform])
1011 AC_MSG_RESULT(maybe)
1012 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1015 AC_DEFINE([_GNU_SOURCE], 1,
1016 [Some versions of glibc need this defined for pread/pwrite.])
1020 AC_PATH_PROG(GETCONF, getconf)
1021 if test -z "$GETCONF" ; then
1022 AC_MSG_ERROR([getconf required to configure large file support])
1024 LFS_CFLAGS=`$GETCONF LFS_CFLAGS`
1025 LFS_LDFLAGS=`$GETCONF LFS_LDFLAGS`
1026 LFS_LIBS=`$GETCONF LFS_LIBS`
1029 AC_MSG_RESULT(maybe)
1030 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1035 AC_SUBST(LFS_CFLAGS)
1036 AC_SUBST(LFS_LDFLAGS)
1040 AC_SUBST(HOSTINFO, $host)
1042 dnl #############################################################
1044 dnl # 8. Checks for system services
1046 dnl #############################################################
1049 dnl # Figure out where libtool is located,
1053 AC_MSG_RESULT([top_builddir=$top_builddir])
1054 dnl # AC_SUBST(top_builddir)
1058 dnl import libtool stuff
1060 dnl #############################################################
1062 dnl # Configure in any module directories.
1064 dnl #############################################################
1067 if test "x$EXPERIMENTAL" = "xyes"; then
1068 bar=`ls -1 src/modules/rlm_*/configure | sed 's%/configure%%'`
1069 dnl # get rid of LF's.
1070 mysubdirs=`echo $bar`
1073 dnl # Find 'configure' in ONLY the stable modules
1075 for bar in `cat src/modules/stable`; do
1076 if test -f src/modules/$bar/configure; then
1077 mysubdirs="$mysubdirs src/modules/$bar"
1082 dnl ############################################################
1083 dnl # make modules by list
1084 dnl #############################################################
1085 if test "x$EXPERIMENTAL" = "xyes"; then
1086 for foo in `ls -1 src/modules | grep rlm_`; do
1087 MODULES="$MODULES $foo"
1091 dnl # make ONLY the stable modules
1093 for foo in `cat src/modules/stable`; do
1094 MODULES="$MODULES $foo"
1099 dnl # Don't change the variable name here. Autoconf goes bonkers
1102 AC_CONFIG_SUBDIRS($LTDL_SUBDIRS $mysubdirs)
1105 dnl #############################################################
1107 dnl # And finally, output the results.
1109 dnl #############################################################
1112 dnl # Substitute whatever libraries we found to be necessary
1115 AC_SUBST(INSTALLSTRIP)
1117 USE_SHARED_LIBS=$enable_shared
1118 AC_SUBST(USE_SHARED_LIBS)
1119 USE_STATIC_LIBS=$enable_static
1120 AC_SUBST(USE_STATIC_LIBS)
1121 AC_SUBST(STATIC_MODULES)
1122 AC_SUBST(RADIUSD_MAJOR_VERSION)
1123 AC_SUBST(RADIUSD_MINOR_VERSION)
1124 AC_SUBST(RADIUSD_VERSION)
1129 ./src/include/build-radpaths-h \
1130 ./src/main/Makefile \
1131 ./src/main/checkrad.pl \
1132 ./src/main/radlast \
1133 ./src/main/radtest \
1134 ./scripts/rc.radiusd \
1135 ./scripts/radwatch \
1136 ./scripts/check-radiusd-config \
1137 ./scripts/radiusd.cron.daily \
1138 ./scripts/radiusd.cron.monthly \
1139 ./scripts/cryptpasswd \
1140 ./raddb/dictionary \
1141 ./raddb/radiusd.conf
1144 AC_OUTPUT_COMMANDS([echo timestamp > src/include/stamp-h])
1145 AC_OUTPUT_COMMANDS([(cd ./src/include && /bin/sh ./build-radpaths-h)])
1146 AC_OUTPUT_COMMANDS([(cd ./src/main && chmod +x checkrad.pl radlast radtest)])
1147 AC_OUTPUT_COMMANDS([(cd ./scripts && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])