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
27 dnl # The version of the software
28 RADIUSD_MAJOR_VERSION=1
29 RADIUSD_MINOR_VERSION=1.1
30 RADIUSD_VERSION="${RADIUSD_MAJOR_VERSION}.${RADIUSD_MINOR_VERSION}"
32 dnl #############################################################
34 dnl # 0. Checks for compiler, libtool, and command line options.
36 dnl #############################################################
42 dnl # check for AIX, to allow us to use some BSD functions
43 dnl # must be before macros that call the compiler.
47 AC_PROG_GCC_TRADITIONAL
51 abs_top_builddir=`pwd`
52 AC_SUBST(abs_top_builddir)
54 dnl # autoconf 2.50 and later
55 dnl # AC_SYS_LARGEFILE
59 dnl # check for system bytesex
60 dnl # AC_DEFINES WORDS_BIGENDIAN
64 AC_CHECK_PROG(GMAKE, gmake, yes, no)
65 if test $GMAKE = no; then
66 AC_PATH_PROG(MAKE, make, /usr/local/bin/make)
68 AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make)
70 makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"`
71 if test -z "$makever"; then
72 AC_MSG_ERROR(GNU Make is not installed. Please download and install it
73 from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.)
76 dnl libltdl is installable
77 AC_LIBLTDL_INSTALLABLE
79 dnl use system-wide libtool, if it exists
80 AC_ARG_WITH(system-libtool,
81 [ --with-system-libtool try to use libtool installed in your system [default=use our own]],
82 [ AC_PATH_PROG(LIBTOOL, libtool,,$PATH:/usr/local/bin) ],
84 LIBTOOL="`pwd`/libtool"
86 dnl ensure that we're looking for dlopen
89 dnl Figure out how to build shared libraries
94 dnl Put this in later, when all distributed modules use autoconf.
95 dnl AC_ARG_WITH(disablemodulefoo,
96 dnl [ --without-rlm_foo Disables module compilation. Module list:]
97 dnl esyscmd([find src/modules -type d -name rlm_\* -print |\
98 dnl sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\
99 dnl awk '{print " "$0}']))
101 AC_ARG_ENABLE(strict-dependencies,
102 [ --enable-strict-dependencies Fail configure on lack of module dependancy.])
104 dnl extra argument: --with-logdir
105 logdir='${localstatedir}/log/radius'
106 AC_MSG_CHECKING(logdir)
108 [ --with-logdir=DIR Directory for logfiles [LOCALSTATEDIR/log/radius] ],
111 AC_MSG_ERROR(Need logdir)
121 AC_MSG_RESULT($logdir)
123 dnl extra argument: --with-radacctdir
124 radacctdir='${logdir}/radacct'
125 AC_MSG_CHECKING(radacctdir)
126 AC_ARG_WITH(radacctdir,
127 [ --with-radacctdir=PATH Directory for detail files [LOGDIR/radacct] ],
130 AC_MSG_ERROR(Need radacctdir)
135 radacctdir="$withval"
140 AC_MSG_RESULT($radacctdir)
142 dnl extra argument: --with-raddbdir
143 raddbdir='${sysconfdir}/raddb'
144 AC_MSG_CHECKING(raddbdir)
145 AC_ARG_WITH(raddbdir,
146 [ --with-raddbdir=DIR Directory for config files [SYSCONFDIR/raddb] ],
149 AC_MSG_ERROR(Need raddbdir)
159 AC_MSG_RESULT($raddbdir)
161 dnl extra argument: --with-ascend-binary
163 AC_ARG_WITH(ascend-binary,
164 [ --with-ascend-binary Include support for Ascend binary filter attributes (default=yes)],
172 if test "X$ASCEND_BINARY" = "Xyes"; then
173 AC_DEFINE(ASCEND_BINARY)
176 dnl extra argument: --with-threads
179 [ --with-threads Use threads, if available. (default=yes) ],
188 dnl extra argument: --with-snmp
191 [ --with-snmp Compile in SNMP support. (default=yes)],
200 dnl extra argument: --with-large-files
201 rad_enable_largefiles=no
202 AC_ARG_WITH(large-files,
203 [ --with-large-files Compile in large (2G+) file support. (default=no)],
206 rad_enable_largefiles=yes
214 dnl AC_ARG_ENABLE(ltdl-install,
215 dnl [ --disable-ltdl-install do not install libltdl])
216 dnl if test x"${enable_ltdl_install+set}" != xset; then
217 dnl enable_ltdl_install=yes
218 dnl ac_configure_args="$ac_configure_args --enable-ltdl-install"
220 dnl AC_CONFIG_SUBDIRS(libltdl)
223 dnl # Allow the user to specify a list of modules to be linked
224 dnl # statically to the server.
227 AC_ARG_WITH(static_modules,
228 [ --with-static-modules=QUOTED-MODULE-LIST],[
229 for i in $withval; do
230 STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
236 [ --with-modules=QUOTED-MODULE-LIST],[
237 for i in $withval; do
238 MODULES="$MODULES $i"
243 dnl # Enable developer C compiler warnings
245 AC_ARG_ENABLE(developer,
246 [ --enable-developer Enables features of interest to developers.],
247 [ case "$enableval" in
256 if test "x$developer" != "xno" -a -d $srcdir/CVS; then
257 dnl turn on the developer flag when taken from a CVS checkout (not a release)
261 dnl extra argument: --with-experimental-modules
263 AC_ARG_WITH(experimental-modules,
264 [ --with-experimental-modules Use experimental and unstable modules. (default=no) ],
274 dnl # extra argument: --with-openssl-includes=dir
277 AC_ARG_WITH(openssl-includes,
278 [ --with-openssl-includes=DIR Directory to look for OpenSSL include files],
280 *) OPENSSL_INCLUDE_DIR="$withval"
286 dnl # extra argument: --with-openssl-libraries=dir
289 AC_ARG_WITH(openssl-libraries,
290 [ --with-openssl-libraries=DIR Directory to look for OpenSSL library files],
292 *) OPENSSL_LIB_DIR="$withval"
298 dnl # These next two arguments don't actually do anything. They're
299 dnl # place holders so that the top-level configure script can tell
300 dnl # the user how to configure lower-level modules
304 dnl # extra argument: --with-rlm-FOO-lib-dir
306 AC_ARG_WITH(rlm-FOO-lib-dir,
307 [ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO],
315 dnl # extra argument: --with-rlm-FOO-include-dir
317 AC_ARG_WITH(rlm-FOO-include-dir,
318 [ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO],
325 dnl See what include-style is used by the make program.
326 dnl AC_MSG_CHECKING(include style for make)
327 dnl echo "include /dev/null" > testmake.$$
328 dnl echo "all:" >> testmake.$$
329 dnl make -f testmake.$$ >/dev/null 2>&1
338 dnl rm -f testmake.$$
339 dnl AC_MSG_RESULT(" $INCLUDE")
340 dnl AC_SUBST(INCLUDE)
343 dnl extra argument: --with-udpfromto
345 AC_ARG_WITH(udpfromto,
346 [ --with-udpfromto Compile in UDPFROMTO support. (default=no)],
356 if test "x$WITH_UDPFROMTO" = "xyes"; then
357 AC_DEFINE(WITH_UDPFROMTO)
360 dnl extra argument: --with-edir
361 dnl If using Novell eDirectory, enable UP and Novell specific code
363 [ --with-edir Enable Novell eDirectory integration. (default=no) ] , [] )
365 dnl #############################################################
367 dnl # 1. Checks for programs
369 dnl #############################################################
372 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
373 if test "x$ac_cv_path_PERL" = "x"; then
374 AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
376 AC_PATH_PROG(SNMPGET, snmpget)
377 if test "x$ac_cv_path_SNMPGET" = "x"; then
378 AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
381 AC_PATH_PROG(SNMPWALK, snmpwalk)
382 if test "x$ac_cv_path_SNMPWALK" = "x"; then
383 AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
386 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
388 dnl FIXME This is truly gross.
389 missing_dir=`cd $ac_aux_dir && pwd`
390 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
391 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
392 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
394 AC_PATH_PROG(LOCATE,locate)
395 AC_PATH_PROG(DIRNAME,dirname)
396 AC_PATH_PROG(GREP,grep)
398 dnl #############################################################
400 dnl # 2. Checks for libraries
402 dnl #############################################################
404 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
406 if test "x$WITH_THREADS" = "xyes"; then
407 if test $ac_cv_prog_suncc = "yes"; then
411 AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
414 dnl # pthread stuff is usually in -lpthread
415 dnl # or in -lc_r, on *BSD
417 dnl # On Some systems, we need extra pre-processor flags, to get them to
418 dnl # to do the threading properly.
420 AC_CHECK_LIB(pthread, pthread_create,
421 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
422 LIBS="$LIBS -lpthread" ],
423 AC_CHECK_LIB(c_r, pthread_create,
424 [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
425 [ WITH_THREADS="no" ]
431 dnl # If we have NO pthread libraries, remove any knowledge of threads.
433 if test "x$WITH_THREADS" != "xyes"; then
435 ac_cv_header_pthread_h="no"
439 dnl # We need sem_init() and friends, as they're the friendliest
440 dnl # semaphore functions for threading.
442 dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
443 dnl # Some systems have them in -lsem
444 dnl # Solaris has them in -lposix4
446 AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt,
448 [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)]
452 dnl Check if we need -lsocket
453 AC_CHECK_LIB(socket, getsockname)
455 dnl Check for -lresolv
456 dnl This library may be needed later.
457 AC_CHECK_LIB(resolv, inet_aton)
459 dnl Check if we need -lnsl. Usually if we want to
460 dnl link against -lsocket we need to include -lnsl as well.
461 AC_CHECK_LIB(nsl, inet_ntoa)
463 dnl Check for OpenSSL libraries.
466 if test "x$OPENSSL_LIB_DIR" != "x"; then
467 LIBS="-L$OPENSSL_LIB_DIR $LIBS"
469 AC_CHECK_LIB(crypto, DH_new,
471 AC_DEFINE(HAVE_LIBCRYPTO, 1,
472 [Define to 1 if you have the `crypto' library (-lcrypto).])
473 AC_CHECK_LIB(ssl, SSL_new,
475 AC_DEFINE(HAVE_LIBSSL, 1,
476 [Define to 1 if you have the `ssl' library (-lssl).])
477 if test "x$OPENSSL_LIB_DIR" != "x"; then
478 OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
480 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
485 dnl #############################################################
487 dnl # 3. Checks for header files
489 dnl #############################################################
492 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
493 dnl # getopt will be #included, but won't link. <sigh>
498 CFLAGS="$CFLAGS -D_ALL_SOURCE"
501 CFLAGS="$CFLAGS -DDARWIN"
544 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H))
545 if test "x$ac_cv_header_regex_h" = "xyes"; then
553 ], [AC_DEFINE(HAVE_REG_EXTENDED) REGEX_EXTENDED=yes])
556 AC_SUBST(REGEX_EXTENDED)
559 dnl # other checks which require headers
561 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
566 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
571 dnl Check for OpenSSL includes.
572 OPENSSL_INCLUDE="-DNO_OPENSSL"
573 if test "x$OPENSSL_LIBS" = "x"; then
574 AC_MSG_WARN([skipping test for openssl/ssl.h])
576 old_CPPFLAGS=$CPPFLAGS
577 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
578 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR"
580 dnl # stupid RedHat shit
581 CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
590 if test "x$OPENSSL_LIBS" != "x"; then
591 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
593 [#include <openssl/crypto.h>
594 #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
598 if test "x$goodssl" != "xyes"; then
603 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
604 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5"
606 OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
610 CPPFLAGS=$old_CPPFLAGS
612 AC_SUBST(OPENSSL_INCLUDE)
613 AC_SUBST(OPENSSL_LIBS)
616 dnl #############################################################
618 dnl # 4. Checks for typedefs
620 dnl #############################################################
623 dnl # Ensure that these are defined
630 dnl check for socklen_t
631 AC_CHECK_TYPE_INCLUDE([
632 #ifdef HAVE_SYS_TYPES_H
633 #include <sys/types.h>
635 #ifdef HAVE_SYS_SOCKET_H
636 #include <sys/socket.h>
640 dnl check for uint8_t
641 AC_CHECK_TYPE_INCLUDE([
642 #ifdef HAVE_INTTYPES_H
643 #include <inttypes.h>
648 ],uint8_t, unsigned char)
650 dnl check for uint16_t
651 AC_CHECK_TYPE_INCLUDE([
652 #ifdef HAVE_INTTYPES_H
653 #include <inttypes.h>
658 ],uint16_t, unsigned short)
660 dnl check for uint32_t
661 AC_CHECK_TYPE_INCLUDE([
662 #ifdef HAVE_INTTYPES_H
663 #include <inttypes.h>
668 ],uint32_t, unsigned int)
670 dnl #############################################################
672 dnl # 5. Checks for structures and functions
674 dnl #############################################################
701 RADIUSD_NEED_DECLARATIONS( \
714 dnl # check if we have utmpx.h
715 dnl # if so, check if struct utmpx has entry ut_xtime
716 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
717 if test "x$ac_cv_header_utmpx_h" = "xyes"
719 AC_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
720 if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
722 AC_DEFINE(ut_xtime,ut_tv.tv_sec)
726 dnl # struct ip_pktinfo
727 AC_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
728 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
730 AC_DEFINE(HAVE_IP_PKTINFO)
733 dnl #############################################################
735 dnl # 6. Checks for compiler characteristics
737 dnl #############################################################
740 dnl # Ensure that these are defined
745 dnl # See if this is OS/2
747 AC_MSG_CHECKING(type of OS)
750 if test "$OS" = "OS/2"; then
758 dnl # Set Default CFLAGS
760 if test "x$GCC" = "xyes"; then
761 CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
764 AC_MSG_CHECKING(for developer gcc flags)
765 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
766 devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"
767 CFLAGS="$CFLAGS $devflags"
769 AC_MSG_RESULT(yes. Using $devflags)
772 CFLAGS="$CFLAGS -DNDEBUG"
777 dnl #############################################################
779 dnl # 7. Checks for library functions
781 dnl #############################################################
783 dnl Check for libcrypt
784 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
785 AC_CHECK_LIB(crypt, crypt,
788 if test "$CRYPTLIB" != ""; then
789 AC_DEFINE(HAVE_CRYPT)
791 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
794 dnl Check for libcipher
795 AC_CHECK_LIB(cipher, setkey,
796 CRYPTLIB="${CRYPTLIB} -lcipher"
800 if test "x$WITH_SNMP" = "xyes"; then
804 dnl Check the style of gethostbyaddr, in order of preference
805 dnl GNU (_r eight args)
806 dnl SYSV (_r six args)
807 dnl BSD (three args, may not be thread safe)
808 dnl Tru64 has BSD version, but it is thread safe
809 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
810 dnl We need #stdio.h to define NULL on FreeBSD (at least)
811 gethostbyaddrrstyle=""
812 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
815 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
816 gethostbyaddrrstyle=BSD
817 AC_MSG_WARN([FreeBSD overridden to BSD-style])
820 if test "x$gethostbyaddrrstyle" = "x"; then
824 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
825 AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE)
826 gethostbyaddrrstyle=GNU
829 if test "x$gethostbyaddrrstyle" = "x"; then
833 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
834 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE)
835 gethostbyaddrrstyle=SYSV
838 if test "x$gethostbyaddrrstyle" = "x"; then
842 ], [ gethostbyaddr(NULL, 0, 0) ], [
843 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
844 gethostbyaddrrstyle=BSD
848 if test "x$gethostbyaddrrstyle" = "x"; then
849 AC_MSG_RESULT([none! It must not exist, here.])
851 AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
854 if test "x$gethostbyaddrrstyle" = "xBSD"; then
855 AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
858 dnl Check the style of gethostbyname, in order of preference
859 dnl GNU (_r seven args)
860 dnl SYSV (_r five args)
861 dnl BSD (two args, may not be thread safe)
862 dnl Tru64 has BSD version, but it _is_ thread safe
863 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
864 dnl We need #stdio.h to define NULL on FreeBSD (at least)
865 gethostbynamerstyle=""
866 AC_MSG_CHECKING([gethostbyname_r() syntax])
870 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
871 AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE)
872 gethostbynamerstyle=GNU
874 if test "x$gethostbynamerstyle" = "x"; then
878 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
879 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE)
880 gethostbynamerstyle=SYSV
883 if test "x$gethostbynamerstyle" = "x"; then
887 ], [ gethostbyname(NULL) ], [
888 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE)
889 gethostbynamerstyle=BSD
893 if test "x$gethostbynamerstyle" = "x"; then
894 AC_MSG_RESULT([none! It must not exist, here.])
896 AC_MSG_RESULT([${gethostbynamerstyle}-style])
899 if test "x$gethostbynamerstyle" = "xBSD"; then
900 AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
903 dnl check for non-posix solaris ctime_r (extra buflen int arg)
905 AC_MSG_CHECKING([ctime_r() syntax])
908 ], [ ctime_r(NULL, NULL, 0) ], [
909 AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE)
910 ctimerstyle="SOLARIS"
912 if test "x$ctimerstyle" = "x"; then
915 ], [ ctime_r(NULL, NULL) ], [
916 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE)
921 if test "x$ctimerstyle" = "x"; then
922 AC_MSG_RESULT([none! It must not exist, here.])
924 AC_MSG_RESULT([${ctimerstyle}-style])
928 dnl If configuring with large file support, determine the right flags to
929 dnl use based on the platform. This is the wrong approach; autoconf 2.50
930 dnl comes with a macro that takes the right approach. But this works well
931 dnl enough until we switch to autoconf 2.50 or later.
932 if test x"$rad_enable_largefiles" = xyes ; then
933 AC_MSG_CHECKING(for largefile linkage)
937 AC_MSG_ERROR([AIX before 4.2 does not support large files])
941 LFS_CFLAGS="-D_LARGE_FILES"
947 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
953 AC_MSG_ERROR([Large files not supported on this platform])
957 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
960 AC_DEFINE([_GNU_SOURCE], 1,
961 [Some versions of glibc need this defined for pread/pwrite.])
965 AC_PATH_PROG(GETCONF, getconf)
966 if test -z "$GETCONF" ; then
967 AC_MSG_ERROR([getconf required to configure large file support])
969 LFS_CFLAGS=`$GETCONF LFS_CFLAGS`
970 LFS_LDFLAGS=`$GETCONF LFS_LDFLAGS`
971 LFS_LIBS=`$GETCONF LFS_LIBS`
975 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
981 AC_SUBST(LFS_LDFLAGS)
985 AC_SUBST(HOSTINFO, $host)
987 dnl #############################################################
989 dnl # 8. Checks for system services
991 dnl #############################################################
994 dnl # Figure out where libtool is located,
998 AC_MSG_RESULT([top_builddir=$top_builddir])
999 dnl # AC_SUBST(top_builddir)
1004 dnl # Work around stupid autoconf crap
1006 if test "x$INCLTDL" != "x";then
1007 INCLTDL='-I${top_builddir}/''libltdl'
1010 dnl import libtool stuff
1012 dnl #############################################################
1014 dnl # Configure in any module directories.
1016 dnl #############################################################
1019 if test "x$EXPERIMENTAL" = "xyes"; then
1020 bar=`ls -1 src/modules/rlm_*/configure | sed 's%/configure%%'`
1021 dnl # get rid of LF's.
1022 mysubdirs=`echo $bar`
1025 dnl # Find 'configure' in ONLY the stable modules
1027 for bar in `cat src/modules/stable`; do
1028 if test -f src/modules/$bar/configure; then
1029 mysubdirs="$mysubdirs src/modules/$bar"
1034 dnl ############################################################
1035 dnl # make modules by list
1036 dnl #############################################################
1037 if test "x$EXPERIMENTAL" = "xyes"; then
1038 for foo in `ls -1 src/modules | grep rlm_`; do
1039 MODULES="$MODULES $foo"
1043 dnl # make ONLY the stable modules
1045 for foo in `cat src/modules/stable`; do
1046 MODULES="$MODULES $foo"
1051 dnl # Don't change the variable name here. Autoconf goes bonkers
1054 AC_CONFIG_SUBDIRS($mysubdirs)
1057 dnl #############################################################
1059 dnl # And finally, output the results.
1061 dnl #############################################################
1064 dnl # Substitute whatever libraries we found to be necessary
1067 AC_SUBST(INSTALLSTRIP)
1069 USE_SHARED_LIBS=$enable_shared
1070 AC_SUBST(USE_SHARED_LIBS)
1071 USE_STATIC_LIBS=$enable_static
1072 AC_SUBST(USE_STATIC_LIBS)
1073 AC_SUBST(STATIC_MODULES)
1074 AC_SUBST(RADIUSD_MAJOR_VERSION)
1075 AC_SUBST(RADIUSD_MINOR_VERSION)
1076 AC_SUBST(RADIUSD_VERSION)
1081 ./src/include/build-radpaths-h \
1082 ./src/main/Makefile \
1083 ./src/main/checkrad.pl \
1084 ./src/main/radlast \
1085 ./src/main/radtest \
1086 ./scripts/rc.radiusd \
1087 ./scripts/radwatch \
1088 ./scripts/check-radiusd-config \
1089 ./scripts/radiusd.cron.daily \
1090 ./scripts/radiusd.cron.monthly \
1091 ./scripts/cryptpasswd \
1092 ./raddb/dictionary \
1093 ./raddb/radiusd.conf
1096 AC_OUTPUT_COMMANDS([echo timestamp > src/include/stamp-h])
1097 AC_OUTPUT_COMMANDS([(cd ./src/include && /bin/sh ./build-radpaths-h)])
1098 AC_OUTPUT_COMMANDS([(cd ./src/main && chmod +x checkrad.pl radlast radtest)])
1099 AC_OUTPUT_COMMANDS([(cd ./scripts && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])