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.6
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)],
241 dnl extra argument: --with-large-files
242 rad_enable_largefiles=no
243 AC_ARG_WITH(large-files,
244 [ --with-large-files Compile in large (2G+) file support. (default=no)],
247 rad_enable_largefiles=yes
256 dnl # Allow the user to specify a list of modules to be linked
257 dnl # statically to the server.
260 AC_ARG_WITH(static_modules,
261 [ --with-static-modules=QUOTED-MODULE-LIST],[
262 for i in $withval; do
263 STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
269 [ --with-modules=QUOTED-MODULE-LIST],[
270 for i in $withval; do
271 MODULES="$MODULES $i"
276 dnl # Enable developer C compiler warnings
278 AC_ARG_ENABLE(developer,
279 [ --enable-developer Enables features of interest to developers.],
280 [ case "$enableval" in
289 if test "x$developer" != "xno" -a -d $srcdir/CVS; then
290 dnl turn on the developer flag when taken from a CVS checkout (not a release)
294 dnl extra argument: --with-experimental-modules
296 AC_ARG_WITH(experimental-modules,
297 [ --with-experimental-modules Use experimental and unstable modules. (default=no) ],
307 dnl # extra argument: --with-openssl-includes=dir
310 AC_ARG_WITH(openssl-includes,
311 [ --with-openssl-includes=DIR Directory to look for OpenSSL include files],
313 *) OPENSSL_INCLUDE_DIR="$withval"
319 dnl # extra argument: --with-openssl-libraries=dir
322 AC_ARG_WITH(openssl-libraries,
323 [ --with-openssl-libraries=DIR Directory to look for OpenSSL library files],
325 *) OPENSSL_LIB_DIR="$withval"
331 dnl # These next two arguments don't actually do anything. They're
332 dnl # place holders so that the top-level configure script can tell
333 dnl # the user how to configure lower-level modules
337 dnl # extra argument: --with-rlm-FOO-lib-dir
339 AC_ARG_WITH(rlm-FOO-lib-dir,
340 [ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO],
348 dnl # extra argument: --with-rlm-FOO-include-dir
350 AC_ARG_WITH(rlm-FOO-include-dir,
351 [ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO],
358 dnl See what include-style is used by the make program.
359 dnl AC_MSG_CHECKING(include style for make)
360 dnl echo "include /dev/null" > testmake.$$
361 dnl echo "all:" >> testmake.$$
362 dnl make -f testmake.$$ >/dev/null 2>&1
371 dnl rm -f testmake.$$
372 dnl AC_MSG_RESULT(" $INCLUDE")
373 dnl AC_SUBST(INCLUDE)
376 dnl extra argument: --with-udpfromto
378 AC_ARG_WITH(udpfromto,
379 [ --with-udpfromto Compile in UDPFROMTO support. (default=no)],
389 if test "x$WITH_UDPFROMTO" = "xyes"; then
390 AC_DEFINE(WITH_UDPFROMTO)
393 dnl extra argument: --with-edir
394 dnl If using Novell eDirectory, enable UP and Novell specific code
396 [ --with-edir Enable Novell eDirectory integration. (default=no) ] , [] )
398 dnl #############################################################
400 dnl # 1. Checks for programs
402 dnl #############################################################
405 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
406 if test "x$ac_cv_path_PERL" = "x"; then
407 AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
409 AC_PATH_PROG(SNMPGET, snmpget)
410 if test "x$ac_cv_path_SNMPGET" = "x"; then
411 AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
414 AC_PATH_PROG(SNMPWALK, snmpwalk)
415 if test "x$ac_cv_path_SNMPWALK" = "x"; then
416 AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
419 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
421 dnl FIXME This is truly gross.
422 missing_dir=`cd $ac_aux_dir && pwd`
423 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
424 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
425 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
427 AC_PATH_PROG(LOCATE,locate)
428 AC_PATH_PROG(DIRNAME,dirname)
429 AC_PATH_PROG(GREP,grep)
431 dnl #############################################################
433 dnl # 2. Checks for libraries
435 dnl #############################################################
437 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
439 if test "x$WITH_THREADS" = "xyes"; then
440 if test $ac_cv_prog_suncc = "yes"; then
444 AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
447 dnl # pthread stuff is usually in -lpthread
448 dnl # or in -lc_r, on *BSD
450 dnl # On Some systems, we need extra pre-processor flags, to get them to
451 dnl # to do the threading properly.
453 AC_CHECK_LIB(pthread, pthread_create,
454 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
455 LIBS="$LIBS -lpthread" ],
456 AC_CHECK_LIB(c_r, pthread_create,
457 [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
458 [ WITH_THREADS="no" ]
464 dnl # If we have NO pthread libraries, remove any knowledge of threads.
466 if test "x$WITH_THREADS" != "xyes"; then
468 ac_cv_header_pthread_h="no"
472 dnl # We need sem_init() and friends, as they're the friendliest
473 dnl # semaphore functions for threading.
475 dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
476 dnl # Some systems have them in -lsem
477 dnl # Solaris has them in -lposix4
479 AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt,
481 [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)]
485 dnl Check if we need -lsocket
486 AC_CHECK_LIB(socket, getsockname)
488 dnl Check for -lresolv
489 dnl This library may be needed later.
490 AC_CHECK_LIB(resolv, inet_aton)
492 dnl Check if we need -lnsl. Usually if we want to
493 dnl link against -lsocket we need to include -lnsl as well.
494 AC_CHECK_LIB(nsl, inet_ntoa)
496 dnl Check for OpenSSL libraries.
499 if test "x$OPENSSL_LIB_DIR" != "x"; then
500 LIBS="-L$OPENSSL_LIB_DIR $LIBS"
502 AC_CHECK_LIB(crypto, DH_new,
504 AC_DEFINE(HAVE_LIBCRYPTO, 1,
505 [Define to 1 if you have the `crypto' library (-lcrypto).])
506 AC_CHECK_LIB(ssl, SSL_new,
508 AC_DEFINE(HAVE_LIBSSL, 1,
509 [Define to 1 if you have the `ssl' library (-lssl).])
510 if test "x$OPENSSL_LIB_DIR" != "x"; then
511 OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
513 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
518 dnl #############################################################
520 dnl # 3. Checks for header files
522 dnl #############################################################
525 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
526 dnl # getopt will be #included, but won't link. <sigh>
531 CFLAGS="$CFLAGS -D_ALL_SOURCE"
534 CFLAGS="$CFLAGS -DDARWIN"
577 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H))
578 if test "x$ac_cv_header_regex_h" = "xyes"; then
586 ], [AC_DEFINE(HAVE_REG_EXTENDED) REGEX_EXTENDED=yes])
589 AC_SUBST(REGEX_EXTENDED)
592 dnl # other checks which require headers
594 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
599 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
604 dnl Check for OpenSSL includes.
605 OPENSSL_INCLUDE="-DNO_OPENSSL"
606 if test "x$OPENSSL_LIBS" = "x"; then
607 AC_MSG_WARN([skipping test for openssl/ssl.h])
609 old_CPPFLAGS=$CPPFLAGS
610 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
611 CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR"
613 dnl # stupid RedHat shit
614 CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
623 if test "x$OPENSSL_LIBS" != "x"; then
624 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
626 [#include <openssl/crypto.h>
627 #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
631 if test "x$goodssl" != "xyes"; then
636 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
637 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5"
639 OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
643 CPPFLAGS=$old_CPPFLAGS
645 AC_SUBST(OPENSSL_INCLUDE)
646 AC_SUBST(OPENSSL_LIBS)
649 dnl #############################################################
651 dnl # 4. Checks for typedefs
653 dnl #############################################################
656 dnl # Ensure that these are defined
663 dnl check for socklen_t
664 AC_CHECK_TYPE_INCLUDE([
665 #ifdef HAVE_SYS_TYPES_H
666 #include <sys/types.h>
668 #ifdef HAVE_SYS_SOCKET_H
669 #include <sys/socket.h>
673 dnl check for uint8_t
674 AC_CHECK_TYPE_INCLUDE([
675 #ifdef HAVE_INTTYPES_H
676 #include <inttypes.h>
681 ],uint8_t, unsigned char)
683 dnl check for uint16_t
684 AC_CHECK_TYPE_INCLUDE([
685 #ifdef HAVE_INTTYPES_H
686 #include <inttypes.h>
691 ],uint16_t, unsigned short)
693 dnl check for uint32_t
694 AC_CHECK_TYPE_INCLUDE([
695 #ifdef HAVE_INTTYPES_H
696 #include <inttypes.h>
701 ],uint32_t, unsigned int)
703 dnl #############################################################
705 dnl # 5. Checks for structures and functions
707 dnl #############################################################
734 RADIUSD_NEED_DECLARATIONS( \
747 dnl # check if we have utmpx.h
748 dnl # if so, check if struct utmpx has entry ut_xtime
749 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
750 if test "x$ac_cv_header_utmpx_h" = "xyes"
752 AC_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
753 if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
755 AC_DEFINE(ut_xtime,ut_tv.tv_sec)
759 dnl # struct ip_pktinfo
760 AC_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
761 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
763 AC_DEFINE(HAVE_IP_PKTINFO)
766 dnl #############################################################
768 dnl # 6. Checks for compiler characteristics
770 dnl #############################################################
773 dnl # Ensure that these are defined
778 dnl # See if this is OS/2
780 AC_MSG_CHECKING(type of OS)
783 if test "$OS" = "OS/2"; then
791 dnl # Set Default CFLAGS
793 if test "x$GCC" = "xyes"; then
794 CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
797 AC_MSG_CHECKING(for developer gcc flags)
798 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
799 devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"
800 CFLAGS="$CFLAGS $devflags"
802 AC_MSG_RESULT(yes. Using $devflags)
805 CFLAGS="$CFLAGS -DNDEBUG"
810 dnl #############################################################
812 dnl # 7. Checks for library functions
814 dnl #############################################################
816 dnl Check for libcrypt
817 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
818 AC_CHECK_LIB(crypt, crypt,
821 if test "$CRYPTLIB" != ""; then
822 AC_DEFINE(HAVE_CRYPT)
824 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
827 dnl Check for libcipher
828 AC_CHECK_LIB(cipher, setkey,
829 CRYPTLIB="${CRYPTLIB} -lcipher"
833 if test "x$WITH_SNMP" = "xyes"; then
837 dnl Check the style of gethostbyaddr, in order of preference
838 dnl GNU (_r eight args)
839 dnl SYSV (_r six args)
840 dnl BSD (three args, may not be thread safe)
841 dnl Tru64 has BSD version, but it is thread safe
842 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
843 dnl We need #stdio.h to define NULL on FreeBSD (at least)
844 gethostbyaddrrstyle=""
845 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
848 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
849 gethostbyaddrrstyle=BSD
850 AC_MSG_WARN([FreeBSD overridden to BSD-style])
853 if test "x$gethostbyaddrrstyle" = "x"; then
857 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
858 AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE)
859 gethostbyaddrrstyle=GNU
862 if test "x$gethostbyaddrrstyle" = "x"; then
866 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
867 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE)
868 gethostbyaddrrstyle=SYSV
871 if test "x$gethostbyaddrrstyle" = "x"; then
875 ], [ gethostbyaddr(NULL, 0, 0) ], [
876 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
877 gethostbyaddrrstyle=BSD
881 if test "x$gethostbyaddrrstyle" = "x"; then
882 AC_MSG_RESULT([none! It must not exist, here.])
884 AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
887 if test "x$gethostbyaddrrstyle" = "xBSD"; then
888 AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
891 dnl Check the style of gethostbyname, in order of preference
892 dnl GNU (_r seven args)
893 dnl SYSV (_r five args)
894 dnl BSD (two args, may not be thread safe)
895 dnl Tru64 has BSD version, but it _is_ thread safe
896 dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
897 dnl We need #stdio.h to define NULL on FreeBSD (at least)
898 gethostbynamerstyle=""
899 AC_MSG_CHECKING([gethostbyname_r() syntax])
903 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
904 AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE)
905 gethostbynamerstyle=GNU
907 if test "x$gethostbynamerstyle" = "x"; then
911 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
912 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE)
913 gethostbynamerstyle=SYSV
916 if test "x$gethostbynamerstyle" = "x"; then
920 ], [ gethostbyname(NULL) ], [
921 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE)
922 gethostbynamerstyle=BSD
926 if test "x$gethostbynamerstyle" = "x"; then
927 AC_MSG_RESULT([none! It must not exist, here.])
929 AC_MSG_RESULT([${gethostbynamerstyle}-style])
932 if test "x$gethostbynamerstyle" = "xBSD"; then
933 AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
936 dnl check for non-posix solaris ctime_r (extra buflen int arg)
938 AC_MSG_CHECKING([ctime_r() syntax])
941 ], [ ctime_r(NULL, NULL, 0) ], [
942 AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE)
943 ctimerstyle="SOLARIS"
945 if test "x$ctimerstyle" = "x"; then
948 ], [ ctime_r(NULL, NULL) ], [
949 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE)
954 if test "x$ctimerstyle" = "x"; then
955 AC_MSG_RESULT([none! It must not exist, here.])
957 AC_MSG_RESULT([${ctimerstyle}-style])
961 dnl If configuring with large file support, determine the right flags to
962 dnl use based on the platform. This is the wrong approach; autoconf 2.50
963 dnl comes with a macro that takes the right approach. But this works well
964 dnl enough until we switch to autoconf 2.50 or later.
965 if test x"$rad_enable_largefiles" = xyes ; then
966 AC_MSG_CHECKING(for largefile linkage)
970 AC_MSG_ERROR([AIX before 4.2 does not support large files])
974 LFS_CFLAGS="-D_LARGE_FILES"
980 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
986 AC_MSG_ERROR([Large files not supported on this platform])
990 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
993 AC_DEFINE([_GNU_SOURCE], 1,
994 [Some versions of glibc need this defined for pread/pwrite.])
998 AC_PATH_PROG(GETCONF, getconf)
999 if test -z "$GETCONF" ; then
1000 AC_MSG_ERROR([getconf required to configure large file support])
1002 LFS_CFLAGS=`$GETCONF LFS_CFLAGS`
1003 LFS_LDFLAGS=`$GETCONF LFS_LDFLAGS`
1004 LFS_LIBS=`$GETCONF LFS_LIBS`
1007 AC_MSG_RESULT(maybe)
1008 LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
1013 AC_SUBST(LFS_CFLAGS)
1014 AC_SUBST(LFS_LDFLAGS)
1018 AC_SUBST(HOSTINFO, $host)
1020 dnl #############################################################
1022 dnl # 8. Checks for system services
1024 dnl #############################################################
1027 dnl # Figure out where libtool is located,
1031 AC_MSG_RESULT([top_builddir=$top_builddir])
1032 dnl # AC_SUBST(top_builddir)
1036 dnl import libtool stuff
1038 dnl #############################################################
1040 dnl # Configure in any module directories.
1042 dnl #############################################################
1045 if test "x$EXPERIMENTAL" = "xyes"; then
1046 bar=`ls -1 src/modules/rlm_*/configure | sed 's%/configure%%'`
1047 dnl # get rid of LF's.
1048 mysubdirs=`echo $bar`
1051 dnl # Find 'configure' in ONLY the stable modules
1053 for bar in `cat src/modules/stable`; do
1054 if test -f src/modules/$bar/configure; then
1055 mysubdirs="$mysubdirs src/modules/$bar"
1060 dnl ############################################################
1061 dnl # make modules by list
1062 dnl #############################################################
1063 if test "x$EXPERIMENTAL" = "xyes"; then
1064 for foo in `ls -1 src/modules | grep rlm_`; do
1065 MODULES="$MODULES $foo"
1069 dnl # make ONLY the stable modules
1071 for foo in `cat src/modules/stable`; do
1072 MODULES="$MODULES $foo"
1077 dnl # Don't change the variable name here. Autoconf goes bonkers
1080 AC_CONFIG_SUBDIRS($LTDL_SUBDIRS $mysubdirs)
1083 dnl #############################################################
1085 dnl # And finally, output the results.
1087 dnl #############################################################
1090 dnl # Substitute whatever libraries we found to be necessary
1093 AC_SUBST(INSTALLSTRIP)
1095 USE_SHARED_LIBS=$enable_shared
1096 AC_SUBST(USE_SHARED_LIBS)
1097 USE_STATIC_LIBS=$enable_static
1098 AC_SUBST(USE_STATIC_LIBS)
1099 AC_SUBST(STATIC_MODULES)
1100 AC_SUBST(RADIUSD_MAJOR_VERSION)
1101 AC_SUBST(RADIUSD_MINOR_VERSION)
1102 AC_SUBST(RADIUSD_VERSION)
1107 ./src/include/build-radpaths-h \
1108 ./src/main/Makefile \
1109 ./src/main/checkrad.pl \
1110 ./src/main/radlast \
1111 ./src/main/radtest \
1112 ./scripts/rc.radiusd \
1113 ./scripts/radwatch \
1114 ./scripts/check-radiusd-config \
1115 ./scripts/radiusd.cron.daily \
1116 ./scripts/radiusd.cron.monthly \
1117 ./scripts/cryptpasswd \
1118 ./raddb/dictionary \
1119 ./raddb/radiusd.conf
1122 AC_OUTPUT_COMMANDS([echo timestamp > src/include/stamp-h])
1123 AC_OUTPUT_COMMANDS([(cd ./src/include && /bin/sh ./build-radpaths-h)])
1124 AC_OUTPUT_COMMANDS([(cd ./src/main && chmod +x checkrad.pl radlast radtest)])
1125 AC_OUTPUT_COMMANDS([(cd ./scripts && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])