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) ],
317 dnl extra argument: --with-openssl
320 [ --with-openssl Use OpenSSL. (default=yes)],
332 dnl # extra argument: --with-openssl-includes=dir
335 AC_ARG_WITH(openssl-includes,
336 [ --with-openssl-includes=DIR Directory to look for OpenSSL include files],
338 *) OPENSSL_INCLUDE_DIR="$withval"
344 dnl # extra argument: --with-openssl-libraries=dir
347 AC_ARG_WITH(openssl-libraries,
348 [ --with-openssl-libraries=DIR Directory to look for OpenSSL library files],
350 *) OPENSSL_LIB_DIR="$withval"
356 dnl # These next two arguments don't actually do anything. They're
357 dnl # place holders so that the top-level configure script can tell
358 dnl # the user how to configure lower-level modules
362 dnl # extra argument: --with-rlm-FOO-lib-dir
364 AC_ARG_WITH(rlm-FOO-lib-dir,
365 [ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO],
373 dnl # extra argument: --with-rlm-FOO-include-dir
375 AC_ARG_WITH(rlm-FOO-include-dir,
376 [ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO],
383 dnl See what include-style is used by the make program.
384 dnl AC_MSG_CHECKING(include style for make)
385 dnl echo "include /dev/null" > testmake.$$
386 dnl echo "all:" >> testmake.$$
387 dnl make -f testmake.$$ >/dev/null 2>&1
396 dnl rm -f testmake.$$
397 dnl AC_MSG_RESULT(" $INCLUDE")
398 dnl AC_SUBST(INCLUDE)
401 dnl extra argument: --with-udpfromto
403 AC_ARG_WITH(udpfromto,
404 [ --with-udpfromto Compile in UDPFROMTO support. (default=no)],
414 if test "x$WITH_UDPFROMTO" = "xyes"; then
415 AC_DEFINE(WITH_UDPFROMTO)
418 dnl extra argument: --with-edir
419 dnl If using Novell eDirectory, enable UP and Novell specific code
421 [ --with-edir Enable Novell eDirectory integration. (default=no) ] , [] )
423 dnl #############################################################
425 dnl # 1. Checks for programs
427 dnl #############################################################
430 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
431 if test "x$ac_cv_path_PERL" = "x"; then
432 AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
434 AC_PATH_PROG(SNMPGET, snmpget)
435 if test "x$ac_cv_path_SNMPGET" = "x"; then
436 AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
439 AC_PATH_PROG(SNMPWALK, snmpwalk)
440 if test "x$ac_cv_path_SNMPWALK" = "x"; then
441 AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
444 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
446 dnl FIXME This is truly gross.
447 missing_dir=`cd $ac_aux_dir && pwd`
448 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
449 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
450 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
452 AC_PATH_PROG(LOCATE,locate)
453 AC_PATH_PROG(DIRNAME,dirname)
454 AC_PATH_PROG(GREP,grep)
456 dnl #############################################################
458 dnl # 2. Checks for libraries
460 dnl #############################################################
462 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
464 if test "x$WITH_THREADS" = "xyes"; then
465 if test $ac_cv_prog_suncc = "yes"; then
469 AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
472 dnl # pthread stuff is usually in -lpthread
473 dnl # or in -lc_r, on *BSD
475 dnl # On Some systems, we need extra pre-processor flags, to get them to
476 dnl # to do the threading properly.
478 AC_CHECK_LIB(pthread, pthread_create,
479 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
480 LIBS="$LIBS -lpthread" ],
481 AC_CHECK_LIB(c_r, pthread_create,
482 [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
483 [ WITH_THREADS="no" ]
489 dnl # If we have NO pthread libraries, remove any knowledge of threads.
491 if test "x$WITH_THREADS" != "xyes"; then
493 ac_cv_header_pthread_h="no"
497 dnl # We need sem_init() and friends, as they're the friendliest
498 dnl # semaphore functions for threading.
500 dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
501 dnl # Some systems have them in -lsem
502 dnl # Solaris has them in -lposix4
504 AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt,
506 [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)]
510 dnl Check if we need -lsocket
511 AC_CHECK_LIB(socket, getsockname)
513 dnl Check for -lresolv
514 dnl This library may be needed later.
515 AC_CHECK_LIB(resolv, inet_aton)
517 dnl Check if we need -lnsl. Usually if we want to
518 dnl link against -lsocket we need to include -lnsl as well.
519 AC_CHECK_LIB(nsl, inet_ntoa)
521 dnl Check for OpenSSL libraries.
523 if test "x$WITH_OPENSSL" = xyes; then
525 if test "x$OPENSSL_LIB_DIR" != "x"; then
526 LIBS="-L$OPENSSL_LIB_DIR $LIBS"
528 AC_CHECK_LIB(crypto, DH_new,
530 AC_DEFINE(HAVE_LIBCRYPTO, 1,
531 [Define to 1 if you have the `crypto' library (-lcrypto).])
532 AC_CHECK_LIB(ssl, SSL_new,
534 AC_DEFINE(HAVE_LIBSSL, 1,
535 [Define to 1 if you have the `ssl' library (-lssl).])
536 if test "x$OPENSSL_LIB_DIR" != "x"; then
537 OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
539 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
545 dnl #############################################################
547 dnl # 3. Checks for header files
549 dnl #############################################################
552 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
553 dnl # getopt will be #included, but won't link. <sigh>
558 CFLAGS="$CFLAGS -D_ALL_SOURCE"
561 CFLAGS="$CFLAGS -DDARWIN"
604 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H))
605 if test "x$ac_cv_header_regex_h" = "xyes"; then
613 ], [AC_DEFINE(HAVE_REG_EXTENDED) REGEX_EXTENDED=yes])
616 AC_SUBST(REGEX_EXTENDED)
619 dnl # other checks which require headers
621 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
626 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
631 dnl Check for OpenSSL includes.
632 OPENSSL_INCLUDE="-DNO_OPENSSL"
633 if test "x$WITH_OPENSSL" = xyes; then
634 if test "x$OPENSSL_LIBS" = "x"; then
635 AC_MSG_NOTICE([skipping test for openssl/ssl.h])
637 old_CPPFLAGS=$CPPFLAGS
638 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
639 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR"
641 dnl # stupid RedHat shit
642 CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
651 if test "x$OPENSSL_LIBS" != "x"; then
652 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
654 [#include <openssl/crypto.h>
655 #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
659 if test "x$goodssl" != "xyes"; then
664 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
665 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5"
667 OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
671 CPPFLAGS=$old_CPPFLAGS
674 AC_SUBST(OPENSSL_INCLUDE)
675 AC_SUBST(OPENSSL_LIBS)
678 dnl #############################################################
680 dnl # 4. Checks for typedefs
682 dnl #############################################################
685 dnl # Ensure that these are defined
692 dnl check for socklen_t
693 AC_CHECK_TYPE_INCLUDE([
694 #ifdef HAVE_SYS_TYPES_H
695 #include <sys/types.h>
697 #ifdef HAVE_SYS_SOCKET_H
698 #include <sys/socket.h>
702 dnl check for uint8_t
703 AC_CHECK_TYPE_INCLUDE([
704 #ifdef HAVE_INTTYPES_H
705 #include <inttypes.h>
710 ],uint8_t, unsigned char)
712 dnl check for uint16_t
713 AC_CHECK_TYPE_INCLUDE([
714 #ifdef HAVE_INTTYPES_H
715 #include <inttypes.h>
720 ],uint16_t, unsigned short)
722 dnl check for uint32_t
723 AC_CHECK_TYPE_INCLUDE([
724 #ifdef HAVE_INTTYPES_H
725 #include <inttypes.h>
730 ],uint32_t, unsigned int)
732 dnl #############################################################
734 dnl # 5. Checks for structures and functions
736 dnl #############################################################
763 RADIUSD_NEED_DECLARATIONS( \
776 dnl # check if we have utmpx.h
777 dnl # if so, check if struct utmpx has entry ut_xtime
778 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
779 if test "x$ac_cv_header_utmpx_h" = "xyes"
781 AC_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
782 if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
784 AC_DEFINE(ut_xtime,ut_tv.tv_sec)
788 dnl # struct ip_pktinfo
789 AC_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
790 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
792 AC_DEFINE(HAVE_IP_PKTINFO)
795 dnl #############################################################
797 dnl # 6. Checks for compiler characteristics
799 dnl #############################################################
802 dnl # Ensure that these are defined
807 dnl # See if this is OS/2
809 AC_MSG_CHECKING(type of OS)
812 if test "$OS" = "OS/2"; then
820 dnl # Set Default CFLAGS
822 if test "x$GCC" = "xyes"; then
823 CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
826 AC_MSG_CHECKING(for developer gcc flags)
827 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
828 devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"
829 CFLAGS="$CFLAGS $devflags"
831 AC_MSG_RESULT(yes. Using $devflags)
834 CFLAGS="$CFLAGS -DNDEBUG"
839 dnl #############################################################
841 dnl # 7. Checks for library functions
843 dnl #############################################################
845 dnl Check for libcrypt
846 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
847 AC_CHECK_LIB(crypt, crypt,
850 if test "$CRYPTLIB" != ""; then
851 AC_DEFINE(HAVE_CRYPT)
853 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
856 dnl Check for libcipher
857 AC_CHECK_LIB(cipher, setkey,
858 CRYPTLIB="${CRYPTLIB} -lcipher"
862 if test "x$WITH_SNMP" = "xyes"; then
866 dnl Check the style of gethostbyaddr, in order of preference
867 dnl GNU (_r eight args)
868 dnl SYSV (_r six args)
869 dnl BSD (three args, may not be thread safe)
870 dnl Tru64 has BSD version, but it is thread safe
871 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
872 dnl We need #stdio.h to define NULL on FreeBSD (at least)
873 gethostbyaddrrstyle=""
874 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
877 dnl With FreeBSD, check if there's a prototype for gethostbyaddr_r.
878 dnl Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we
879 dnl override this test to BSDSTYLE. FreeBSD 6.2 and up have proper GNU
881 AC_CHECK_DECLS([gethostbyaddr_r], [], [
882 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE,
883 [style of gethostbyaddr_r functions ])
884 gethostbyaddrrstyle=BSD
885 AC_MSG_WARN([FreeBSD overridden to BSD-style])
893 if test "x$gethostbyaddrrstyle" = "x"; then
897 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
898 AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE)
899 gethostbyaddrrstyle=GNU
902 if test "x$gethostbyaddrrstyle" = "x"; then
906 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
907 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE)
908 gethostbyaddrrstyle=SYSV
911 if test "x$gethostbyaddrrstyle" = "x"; then
915 ], [ gethostbyaddr(NULL, 0, 0) ], [
916 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
917 gethostbyaddrrstyle=BSD
921 if test "x$gethostbyaddrrstyle" = "x"; then
922 AC_MSG_RESULT([none! It must not exist, here.])
924 AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
927 if test "x$gethostbyaddrrstyle" = "xBSD"; then
928 AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
931 dnl Check the style of gethostbyname, in order of preference
932 dnl GNU (_r seven args)
933 dnl SYSV (_r five args)
934 dnl BSD (two args, may not be thread safe)
935 dnl Tru64 has BSD version, but it _is_ thread safe
936 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
937 dnl We need #stdio.h to define NULL on FreeBSD (at least)
938 gethostbynamerstyle=""
939 AC_MSG_CHECKING([gethostbyname_r() syntax])
943 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
944 AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE)
945 gethostbynamerstyle=GNU
947 if test "x$gethostbynamerstyle" = "x"; then
951 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
952 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE)
953 gethostbynamerstyle=SYSV
956 if test "x$gethostbynamerstyle" = "x"; then
960 ], [ gethostbyname(NULL) ], [
961 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE)
962 gethostbynamerstyle=BSD
966 if test "x$gethostbynamerstyle" = "x"; then
967 AC_MSG_RESULT([none! It must not exist, here.])
969 AC_MSG_RESULT([${gethostbynamerstyle}-style])
972 if test "x$gethostbynamerstyle" = "xBSD"; then
973 AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
976 dnl check for non-posix solaris ctime_r (extra buflen int arg)
978 AC_MSG_CHECKING([ctime_r() syntax])
981 ], [ ctime_r(NULL, NULL, 0) ], [
982 AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE)
983 ctimerstyle="SOLARIS"
985 if test "x$ctimerstyle" = "x"; then
988 ], [ ctime_r(NULL, NULL) ], [
989 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE)
994 if test "x$ctimerstyle" = "x"; then
995 AC_MSG_RESULT([none! It must not exist, here.])
997 AC_MSG_RESULT([${ctimerstyle}-style])
1001 dnl If configuring with large file support, determine the right flags to
1002 dnl use based on the platform. This is the wrong approach; autoconf 2.50
1003 dnl comes with a macro that takes the right approach. But this works well
1004 dnl enough until we switch to autoconf 2.50 or later.
1005 if test x"$rad_enable_largefiles" = xyes ; then
1006 AC_MSG_CHECKING(for largefile linkage)
1010 AC_MSG_ERROR([AIX before 4.2 does not support large files])
1014 LFS_CFLAGS="-D_LARGE_FILES"
1020 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1026 AC_MSG_ERROR([Large files not supported on this platform])
1029 AC_MSG_RESULT(maybe)
1030 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1033 AC_DEFINE([_GNU_SOURCE], 1,
1034 [Some versions of glibc need this defined for pread/pwrite.])
1038 AC_PATH_PROG(GETCONF, getconf)
1039 if test -z "$GETCONF" ; then
1040 AC_MSG_ERROR([getconf required to configure large file support])
1042 LFS_CFLAGS=`$GETCONF LFS_CFLAGS`
1043 LFS_LDFLAGS=`$GETCONF LFS_LDFLAGS`
1044 LFS_LIBS=`$GETCONF LFS_LIBS`
1047 AC_MSG_RESULT(maybe)
1048 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1053 AC_SUBST(LFS_CFLAGS)
1054 AC_SUBST(LFS_LDFLAGS)
1058 AC_SUBST(HOSTINFO, $host)
1060 dnl #############################################################
1062 dnl # 8. Checks for system services
1064 dnl #############################################################
1067 dnl # Figure out where libtool is located,
1071 AC_MSG_RESULT([top_builddir=$top_builddir])
1072 dnl # AC_SUBST(top_builddir)
1076 dnl import libtool stuff
1078 dnl #############################################################
1080 dnl # Configure in any module directories.
1082 dnl #############################################################
1085 if test "x$EXPERIMENTAL" = "xyes"; then
1086 bar=`ls -1 src/modules/rlm_*/configure | sed 's%/configure%%'`
1087 dnl # get rid of LF's.
1088 mysubdirs=`echo $bar`
1091 dnl # Find 'configure' in ONLY the stable modules
1093 for bar in `cat src/modules/stable`; do
1094 if test -f src/modules/$bar/configure; then
1095 mysubdirs="$mysubdirs src/modules/$bar"
1100 dnl ############################################################
1101 dnl # make modules by list
1102 dnl #############################################################
1103 if test "x$EXPERIMENTAL" = "xyes"; then
1104 for foo in `ls -1 src/modules | grep rlm_`; do
1105 MODULES="$MODULES $foo"
1109 dnl # make ONLY the stable modules
1111 for foo in `cat src/modules/stable`; do
1112 MODULES="$MODULES $foo"
1117 dnl # Don't change the variable name here. Autoconf goes bonkers
1120 AC_CONFIG_SUBDIRS($LTDL_SUBDIRS $mysubdirs)
1123 dnl #############################################################
1125 dnl # And finally, output the results.
1127 dnl #############################################################
1130 dnl # Substitute whatever libraries we found to be necessary
1133 AC_SUBST(INSTALLSTRIP)
1135 USE_SHARED_LIBS=$enable_shared
1136 AC_SUBST(USE_SHARED_LIBS)
1137 USE_STATIC_LIBS=$enable_static
1138 AC_SUBST(USE_STATIC_LIBS)
1139 AC_SUBST(STATIC_MODULES)
1140 AC_SUBST(RADIUSD_MAJOR_VERSION)
1141 AC_SUBST(RADIUSD_MINOR_VERSION)
1142 AC_SUBST(RADIUSD_VERSION)
1147 ./src/include/build-radpaths-h \
1148 ./src/main/Makefile \
1149 ./src/main/checkrad.pl \
1150 ./src/main/radlast \
1151 ./src/main/radtest \
1152 ./scripts/rc.radiusd \
1153 ./scripts/radwatch \
1154 ./scripts/check-radiusd-config \
1155 ./scripts/radiusd.cron.daily \
1156 ./scripts/radiusd.cron.monthly \
1157 ./scripts/cryptpasswd \
1158 ./raddb/dictionary \
1159 ./raddb/radiusd.conf
1162 AC_OUTPUT_COMMANDS([echo timestamp > src/include/stamp-h])
1163 AC_OUTPUT_COMMANDS([(cd ./src/include && /bin/sh ./build-radpaths-h)])
1164 AC_OUTPUT_COMMANDS([(cd ./src/main && chmod +x checkrad.pl radlast radtest)])
1165 AC_OUTPUT_COMMANDS([(cd ./scripts && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])