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.5
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] ],
118 AC_MSG_ERROR(Need docdir)
122 [[\\/$]]* | ?:[[\\/]]* )
126 AC_MSG_ERROR([expected an absolute directory name for --with-docdir: $withval])
131 AC_MSG_RESULT($docdir)
133 dnl extra argument: --with-logdir
134 logdir='${localstatedir}/log/radius'
135 AC_MSG_CHECKING(logdir)
137 [ --with-logdir=DIR Directory for logfiles [LOCALSTATEDIR/log/radius] ],
140 AC_MSG_ERROR(Need logdir)
144 [[\\/$]]* | ?:[[\\/]]* )
148 AC_MSG_ERROR([expected an absolute directory name for --with-logdir: $withval])
153 AC_MSG_RESULT($logdir)
155 dnl extra argument: --with-radacctdir
156 radacctdir='${logdir}/radacct'
157 AC_MSG_CHECKING(radacctdir)
158 AC_ARG_WITH(radacctdir,
159 [ --with-radacctdir=DIR Directory for detail files [LOGDIR/radacct] ],
162 AC_MSG_ERROR(Need radacctdir)
166 [[\\/$]]* | ?:[[\\/]]* )
167 radacctdir="$withval"
170 AC_MSG_ERROR([expected an absolute directory name for --with-radacctdir: $withval])
175 AC_MSG_RESULT($radacctdir)
177 dnl extra argument: --with-raddbdir
178 raddbdir='${sysconfdir}/raddb'
179 AC_MSG_CHECKING(raddbdir)
180 AC_ARG_WITH(raddbdir,
181 [ --with-raddbdir=DIR Directory for config files [SYSCONFDIR/raddb] ],
184 AC_MSG_ERROR(Need raddbdir)
188 [[\\/$]]* | ?:[[\\/]]* )
192 AC_MSG_ERROR([expected an absolute directory name for --with-raddbdir: $withval])
197 AC_MSG_RESULT($raddbdir)
199 dnl extra argument: --with-ascend-binary
201 AC_ARG_WITH(ascend-binary,
202 [ --with-ascend-binary Include support for Ascend binary filter attributes (default=yes)],
210 if test "X$ASCEND_BINARY" = "Xyes"; then
211 AC_DEFINE(ASCEND_BINARY)
214 dnl extra argument: --with-threads
217 [ --with-threads Use threads, if available. (default=yes) ],
226 dnl extra argument: --with-snmp
229 [ --with-snmp Compile in SNMP support. (default=yes)],
238 dnl extra argument: --with-large-files
239 rad_enable_largefiles=no
240 AC_ARG_WITH(large-files,
241 [ --with-large-files Compile in large (2G+) file support. (default=no)],
244 rad_enable_largefiles=yes
253 dnl # Allow the user to specify a list of modules to be linked
254 dnl # statically to the server.
257 AC_ARG_WITH(static_modules,
258 [ --with-static-modules=QUOTED-MODULE-LIST],[
259 for i in $withval; do
260 STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
266 [ --with-modules=QUOTED-MODULE-LIST],[
267 for i in $withval; do
268 MODULES="$MODULES $i"
273 dnl # Enable developer C compiler warnings
275 AC_ARG_ENABLE(developer,
276 [ --enable-developer Enables features of interest to developers.],
277 [ case "$enableval" in
286 if test "x$developer" != "xno" -a -d $srcdir/CVS; then
287 dnl turn on the developer flag when taken from a CVS checkout (not a release)
291 dnl extra argument: --with-experimental-modules
293 AC_ARG_WITH(experimental-modules,
294 [ --with-experimental-modules Use experimental and unstable modules. (default=no) ],
304 dnl # extra argument: --with-openssl-includes=dir
307 AC_ARG_WITH(openssl-includes,
308 [ --with-openssl-includes=DIR Directory to look for OpenSSL include files],
310 *) OPENSSL_INCLUDE_DIR="$withval"
316 dnl # extra argument: --with-openssl-libraries=dir
319 AC_ARG_WITH(openssl-libraries,
320 [ --with-openssl-libraries=DIR Directory to look for OpenSSL library files],
322 *) OPENSSL_LIB_DIR="$withval"
328 dnl # These next two arguments don't actually do anything. They're
329 dnl # place holders so that the top-level configure script can tell
330 dnl # the user how to configure lower-level modules
334 dnl # extra argument: --with-rlm-FOO-lib-dir
336 AC_ARG_WITH(rlm-FOO-lib-dir,
337 [ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO],
345 dnl # extra argument: --with-rlm-FOO-include-dir
347 AC_ARG_WITH(rlm-FOO-include-dir,
348 [ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO],
355 dnl See what include-style is used by the make program.
356 dnl AC_MSG_CHECKING(include style for make)
357 dnl echo "include /dev/null" > testmake.$$
358 dnl echo "all:" >> testmake.$$
359 dnl make -f testmake.$$ >/dev/null 2>&1
368 dnl rm -f testmake.$$
369 dnl AC_MSG_RESULT(" $INCLUDE")
370 dnl AC_SUBST(INCLUDE)
373 dnl extra argument: --with-udpfromto
375 AC_ARG_WITH(udpfromto,
376 [ --with-udpfromto Compile in UDPFROMTO support. (default=no)],
386 if test "x$WITH_UDPFROMTO" = "xyes"; then
387 AC_DEFINE(WITH_UDPFROMTO)
390 dnl extra argument: --with-edir
391 dnl If using Novell eDirectory, enable UP and Novell specific code
393 [ --with-edir Enable Novell eDirectory integration. (default=no) ] , [] )
395 dnl #############################################################
397 dnl # 1. Checks for programs
399 dnl #############################################################
402 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
403 if test "x$ac_cv_path_PERL" = "x"; then
404 AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
406 AC_PATH_PROG(SNMPGET, snmpget)
407 if test "x$ac_cv_path_SNMPGET" = "x"; then
408 AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
411 AC_PATH_PROG(SNMPWALK, snmpwalk)
412 if test "x$ac_cv_path_SNMPWALK" = "x"; then
413 AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
416 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
418 dnl FIXME This is truly gross.
419 missing_dir=`cd $ac_aux_dir && pwd`
420 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
421 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
422 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
424 AC_PATH_PROG(LOCATE,locate)
425 AC_PATH_PROG(DIRNAME,dirname)
426 AC_PATH_PROG(GREP,grep)
428 dnl #############################################################
430 dnl # 2. Checks for libraries
432 dnl #############################################################
434 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
436 if test "x$WITH_THREADS" = "xyes"; then
437 if test $ac_cv_prog_suncc = "yes"; then
441 AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
444 dnl # pthread stuff is usually in -lpthread
445 dnl # or in -lc_r, on *BSD
447 dnl # On Some systems, we need extra pre-processor flags, to get them to
448 dnl # to do the threading properly.
450 AC_CHECK_LIB(pthread, pthread_create,
451 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
452 LIBS="$LIBS -lpthread" ],
453 AC_CHECK_LIB(c_r, pthread_create,
454 [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
455 [ WITH_THREADS="no" ]
461 dnl # If we have NO pthread libraries, remove any knowledge of threads.
463 if test "x$WITH_THREADS" != "xyes"; then
465 ac_cv_header_pthread_h="no"
469 dnl # We need sem_init() and friends, as they're the friendliest
470 dnl # semaphore functions for threading.
472 dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
473 dnl # Some systems have them in -lsem
474 dnl # Solaris has them in -lposix4
476 AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt,
478 [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)]
482 dnl Check if we need -lsocket
483 AC_CHECK_LIB(socket, getsockname)
485 dnl Check for -lresolv
486 dnl This library may be needed later.
487 AC_CHECK_LIB(resolv, inet_aton)
489 dnl Check if we need -lnsl. Usually if we want to
490 dnl link against -lsocket we need to include -lnsl as well.
491 AC_CHECK_LIB(nsl, inet_ntoa)
493 dnl Check for OpenSSL libraries.
496 if test "x$OPENSSL_LIB_DIR" != "x"; then
497 LIBS="-L$OPENSSL_LIB_DIR $LIBS"
499 AC_CHECK_LIB(crypto, DH_new,
501 AC_DEFINE(HAVE_LIBCRYPTO, 1,
502 [Define to 1 if you have the `crypto' library (-lcrypto).])
503 AC_CHECK_LIB(ssl, SSL_new,
505 AC_DEFINE(HAVE_LIBSSL, 1,
506 [Define to 1 if you have the `ssl' library (-lssl).])
507 if test "x$OPENSSL_LIB_DIR" != "x"; then
508 OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
510 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
515 dnl #############################################################
517 dnl # 3. Checks for header files
519 dnl #############################################################
522 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
523 dnl # getopt will be #included, but won't link. <sigh>
528 CFLAGS="$CFLAGS -D_ALL_SOURCE"
531 CFLAGS="$CFLAGS -DDARWIN"
574 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H))
575 if test "x$ac_cv_header_regex_h" = "xyes"; then
583 ], [AC_DEFINE(HAVE_REG_EXTENDED) REGEX_EXTENDED=yes])
586 AC_SUBST(REGEX_EXTENDED)
589 dnl # other checks which require headers
591 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
596 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
601 dnl Check for OpenSSL includes.
602 OPENSSL_INCLUDE="-DNO_OPENSSL"
603 if test "x$OPENSSL_LIBS" = "x"; then
604 AC_MSG_WARN([skipping test for openssl/ssl.h])
606 old_CPPFLAGS=$CPPFLAGS
607 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
608 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR"
610 dnl # stupid RedHat shit
611 CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
620 if test "x$OPENSSL_LIBS" != "x"; then
621 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
623 [#include <openssl/crypto.h>
624 #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
628 if test "x$goodssl" != "xyes"; then
633 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
634 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5"
636 OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
640 CPPFLAGS=$old_CPPFLAGS
642 AC_SUBST(OPENSSL_INCLUDE)
643 AC_SUBST(OPENSSL_LIBS)
646 dnl #############################################################
648 dnl # 4. Checks for typedefs
650 dnl #############################################################
653 dnl # Ensure that these are defined
660 dnl check for socklen_t
661 AC_CHECK_TYPE_INCLUDE([
662 #ifdef HAVE_SYS_TYPES_H
663 #include <sys/types.h>
665 #ifdef HAVE_SYS_SOCKET_H
666 #include <sys/socket.h>
670 dnl check for uint8_t
671 AC_CHECK_TYPE_INCLUDE([
672 #ifdef HAVE_INTTYPES_H
673 #include <inttypes.h>
678 ],uint8_t, unsigned char)
680 dnl check for uint16_t
681 AC_CHECK_TYPE_INCLUDE([
682 #ifdef HAVE_INTTYPES_H
683 #include <inttypes.h>
688 ],uint16_t, unsigned short)
690 dnl check for uint32_t
691 AC_CHECK_TYPE_INCLUDE([
692 #ifdef HAVE_INTTYPES_H
693 #include <inttypes.h>
698 ],uint32_t, unsigned int)
700 dnl #############################################################
702 dnl # 5. Checks for structures and functions
704 dnl #############################################################
731 RADIUSD_NEED_DECLARATIONS( \
744 dnl # check if we have utmpx.h
745 dnl # if so, check if struct utmpx has entry ut_xtime
746 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
747 if test "x$ac_cv_header_utmpx_h" = "xyes"
749 AC_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
750 if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
752 AC_DEFINE(ut_xtime,ut_tv.tv_sec)
756 dnl # struct ip_pktinfo
757 AC_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
758 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
760 AC_DEFINE(HAVE_IP_PKTINFO)
763 dnl #############################################################
765 dnl # 6. Checks for compiler characteristics
767 dnl #############################################################
770 dnl # Ensure that these are defined
775 dnl # See if this is OS/2
777 AC_MSG_CHECKING(type of OS)
780 if test "$OS" = "OS/2"; then
788 dnl # Set Default CFLAGS
790 if test "x$GCC" = "xyes"; then
791 CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
794 AC_MSG_CHECKING(for developer gcc flags)
795 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
796 devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"
797 CFLAGS="$CFLAGS $devflags"
799 AC_MSG_RESULT(yes. Using $devflags)
802 CFLAGS="$CFLAGS -DNDEBUG"
807 dnl #############################################################
809 dnl # 7. Checks for library functions
811 dnl #############################################################
813 dnl Check for libcrypt
814 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
815 AC_CHECK_LIB(crypt, crypt,
818 if test "$CRYPTLIB" != ""; then
819 AC_DEFINE(HAVE_CRYPT)
821 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
824 dnl Check for libcipher
825 AC_CHECK_LIB(cipher, setkey,
826 CRYPTLIB="${CRYPTLIB} -lcipher"
830 if test "x$WITH_SNMP" = "xyes"; then
834 dnl Check the style of gethostbyaddr, in order of preference
835 dnl GNU (_r eight args)
836 dnl SYSV (_r six args)
837 dnl BSD (three args, may not be thread safe)
838 dnl Tru64 has BSD version, but it is thread safe
839 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
840 dnl We need #stdio.h to define NULL on FreeBSD (at least)
841 gethostbyaddrrstyle=""
842 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
845 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
846 gethostbyaddrrstyle=BSD
847 AC_MSG_WARN([FreeBSD overridden to BSD-style])
850 if test "x$gethostbyaddrrstyle" = "x"; then
854 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
855 AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE)
856 gethostbyaddrrstyle=GNU
859 if test "x$gethostbyaddrrstyle" = "x"; then
863 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
864 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE)
865 gethostbyaddrrstyle=SYSV
868 if test "x$gethostbyaddrrstyle" = "x"; then
872 ], [ gethostbyaddr(NULL, 0, 0) ], [
873 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
874 gethostbyaddrrstyle=BSD
878 if test "x$gethostbyaddrrstyle" = "x"; then
879 AC_MSG_RESULT([none! It must not exist, here.])
881 AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
884 if test "x$gethostbyaddrrstyle" = "xBSD"; then
885 AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
888 dnl Check the style of gethostbyname, in order of preference
889 dnl GNU (_r seven args)
890 dnl SYSV (_r five args)
891 dnl BSD (two args, may not be thread safe)
892 dnl Tru64 has BSD version, but it _is_ thread safe
893 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
894 dnl We need #stdio.h to define NULL on FreeBSD (at least)
895 gethostbynamerstyle=""
896 AC_MSG_CHECKING([gethostbyname_r() syntax])
900 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
901 AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE)
902 gethostbynamerstyle=GNU
904 if test "x$gethostbynamerstyle" = "x"; then
908 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
909 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE)
910 gethostbynamerstyle=SYSV
913 if test "x$gethostbynamerstyle" = "x"; then
917 ], [ gethostbyname(NULL) ], [
918 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE)
919 gethostbynamerstyle=BSD
923 if test "x$gethostbynamerstyle" = "x"; then
924 AC_MSG_RESULT([none! It must not exist, here.])
926 AC_MSG_RESULT([${gethostbynamerstyle}-style])
929 if test "x$gethostbynamerstyle" = "xBSD"; then
930 AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
933 dnl check for non-posix solaris ctime_r (extra buflen int arg)
935 AC_MSG_CHECKING([ctime_r() syntax])
938 ], [ ctime_r(NULL, NULL, 0) ], [
939 AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE)
940 ctimerstyle="SOLARIS"
942 if test "x$ctimerstyle" = "x"; then
945 ], [ ctime_r(NULL, NULL) ], [
946 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE)
951 if test "x$ctimerstyle" = "x"; then
952 AC_MSG_RESULT([none! It must not exist, here.])
954 AC_MSG_RESULT([${ctimerstyle}-style])
958 dnl If configuring with large file support, determine the right flags to
959 dnl use based on the platform. This is the wrong approach; autoconf 2.50
960 dnl comes with a macro that takes the right approach. But this works well
961 dnl enough until we switch to autoconf 2.50 or later.
962 if test x"$rad_enable_largefiles" = xyes ; then
963 AC_MSG_CHECKING(for largefile linkage)
967 AC_MSG_ERROR([AIX before 4.2 does not support large files])
971 LFS_CFLAGS="-D_LARGE_FILES"
977 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
983 AC_MSG_ERROR([Large files not supported on this platform])
987 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
990 AC_DEFINE([_GNU_SOURCE], 1,
991 [Some versions of glibc need this defined for pread/pwrite.])
995 AC_PATH_PROG(GETCONF, getconf)
996 if test -z "$GETCONF" ; then
997 AC_MSG_ERROR([getconf required to configure large file support])
999 LFS_CFLAGS=`$GETCONF LFS_CFLAGS`
1000 LFS_LDFLAGS=`$GETCONF LFS_LDFLAGS`
1001 LFS_LIBS=`$GETCONF LFS_LIBS`
1004 AC_MSG_RESULT(maybe)
1005 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1010 AC_SUBST(LFS_CFLAGS)
1011 AC_SUBST(LFS_LDFLAGS)
1015 AC_SUBST(HOSTINFO, $host)
1017 dnl #############################################################
1019 dnl # 8. Checks for system services
1021 dnl #############################################################
1024 dnl # Figure out where libtool is located,
1028 AC_MSG_RESULT([top_builddir=$top_builddir])
1029 dnl # AC_SUBST(top_builddir)
1033 dnl import libtool stuff
1035 dnl #############################################################
1037 dnl # Configure in any module directories.
1039 dnl #############################################################
1042 if test "x$EXPERIMENTAL" = "xyes"; then
1043 bar=`ls -1 src/modules/rlm_*/configure | sed 's%/configure%%'`
1044 dnl # get rid of LF's.
1045 mysubdirs=`echo $bar`
1048 dnl # Find 'configure' in ONLY the stable modules
1050 for bar in `cat src/modules/stable`; do
1051 if test -f src/modules/$bar/configure; then
1052 mysubdirs="$mysubdirs src/modules/$bar"
1057 dnl ############################################################
1058 dnl # make modules by list
1059 dnl #############################################################
1060 if test "x$EXPERIMENTAL" = "xyes"; then
1061 for foo in `ls -1 src/modules | grep rlm_`; do
1062 MODULES="$MODULES $foo"
1066 dnl # make ONLY the stable modules
1068 for foo in `cat src/modules/stable`; do
1069 MODULES="$MODULES $foo"
1074 dnl # Don't change the variable name here. Autoconf goes bonkers
1077 AC_CONFIG_SUBDIRS($LTDL_SUBDIRS $mysubdirs)
1080 dnl #############################################################
1082 dnl # And finally, output the results.
1084 dnl #############################################################
1087 dnl # Substitute whatever libraries we found to be necessary
1090 AC_SUBST(INSTALLSTRIP)
1092 USE_SHARED_LIBS=$enable_shared
1093 AC_SUBST(USE_SHARED_LIBS)
1094 USE_STATIC_LIBS=$enable_static
1095 AC_SUBST(USE_STATIC_LIBS)
1096 AC_SUBST(STATIC_MODULES)
1097 AC_SUBST(RADIUSD_MAJOR_VERSION)
1098 AC_SUBST(RADIUSD_MINOR_VERSION)
1099 AC_SUBST(RADIUSD_VERSION)
1104 ./src/include/build-radpaths-h \
1105 ./src/main/Makefile \
1106 ./src/main/checkrad.pl \
1107 ./src/main/radlast \
1108 ./src/main/radtest \
1109 ./scripts/rc.radiusd \
1110 ./scripts/radwatch \
1111 ./scripts/check-radiusd-config \
1112 ./scripts/radiusd.cron.daily \
1113 ./scripts/radiusd.cron.monthly \
1114 ./scripts/cryptpasswd \
1115 ./raddb/dictionary \
1116 ./raddb/radiusd.conf
1119 AC_OUTPUT_COMMANDS([echo timestamp > src/include/stamp-h])
1120 AC_OUTPUT_COMMANDS([(cd ./src/include && /bin/sh ./build-radpaths-h)])
1121 AC_OUTPUT_COMMANDS([(cd ./src/main && chmod +x checkrad.pl radlast radtest)])
1122 AC_OUTPUT_COMMANDS([(cd ./scripts && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])