import from HEAD:
[freeradius.git] / configure.in
index 9eefd51..28ba5ef 100644 (file)
@@ -20,14 +20,13 @@ dnl #  AC_OUTPUT([file...])
 dnl #
 dnl #############################################################
 
-AC_PREREQ([2.50])
 AC_INIT(src/main/radiusd.c)
 AC_CONFIG_HEADER(src/include/autoconf.h)
 AC_REVISION($Revision$)dnl
 
 dnl # The version of the software
 RADIUSD_MAJOR_VERSION=1
-RADIUSD_MINOR_VERSION=1.0-pre0
+RADIUSD_MINOR_VERSION=1.1
 RADIUSD_VERSION="${RADIUSD_MAJOR_VERSION}.${RADIUSD_MINOR_VERSION}"
 
 dnl #############################################################
@@ -52,7 +51,8 @@ AC_PROG_RANLIB
 abs_top_builddir=`pwd`
 AC_SUBST(abs_top_builddir)
 
-AC_SYS_LARGEFILE
+dnl # autoconf 2.50 and later
+dnl # AC_SYS_LARGEFILE
 
 PACKAGE=freeradius
 
@@ -170,7 +170,7 @@ AC_ARG_WITH(ascend-binary,
   esac ]
 )
 if test "X$ASCEND_BINARY" = "Xyes"; then
-  AC_DEFINE(ASCEND_BINARY, [], [Include support for Ascend binary filter attributes])
+  AC_DEFINE(ASCEND_BINARY)
 fi
 
 dnl extra argument: --with-threads
@@ -263,8 +263,9 @@ AC_ARG_WITH(experimental-modules,
 )
 
 dnl #
-dnl # extra argument: --openssl-includes=dir
+dnl # extra argument: --with-openssl-includes=dir
 dnl #
+OPENSSL_INCLUDE_DIR=
 AC_ARG_WITH(openssl-includes,
 [  --with-openssl-includes=DIR      Directory to look for OpenSSL include files],
 [ case "$withval" in
@@ -274,8 +275,9 @@ AC_ARG_WITH(openssl-includes,
 )
 
 dnl #
-dnl # extra argument: --openssl-libraries=dir
+dnl # extra argument: --with-openssl-libraries=dir
 dnl #
+OPENSSL_LIB_DIR=
 AC_ARG_WITH(openssl-libraries,
 [  --with-openssl-libraries=DIR     Directory to look for OpenSSL library files],
 [ case "$withval" in
@@ -344,9 +346,14 @@ AC_ARG_WITH(udpfromto,
 )
 
 if test "x$WITH_UDPFROMTO" = "xyes"; then
-       AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto])
+       AC_DEFINE(WITH_UDPFROMTO)
 fi
 
+dnl extra argument: --with-edir
+dnl If using Novell eDirectory, enable UP and Novell specific code
+AC_ARG_WITH(edir,
+[  --with-edir             Enable Novell eDirectory integration.  (default=no) ] , [] )
+
 dnl #############################################################
 dnl #
 dnl #  1. Checks for programs
@@ -427,9 +434,8 @@ else
   dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
   dnl # Some systems have them in -lsem
   dnl # Solaris has them in -lposix4
-  dnl # NetBSD has them in -lsemaphore
 
-  AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore,
+  AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt,
        [],
        [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)]
    )
@@ -446,6 +452,28 @@ dnl Check if we need -lnsl. Usually if we want to
 dnl link against -lsocket we need to include -lnsl as well.
 AC_CHECK_LIB(nsl, inet_ntoa)
 
+dnl Check for OpenSSL libraries.
+OPENSSL_LIBS=
+old_LIBS=$LIBS
+if test "x$OPENSSL_LIB_DIR" != "x"; then
+    LIBS="-L$OPENSSL_LIB_DIR $LIBS"
+fi
+AC_CHECK_LIB(crypto, DH_new,
+    [
+       AC_DEFINE(HAVE_LIBCRYPTO, 1,
+           [Define to 1 if you have the `crypto' library (-lcrypto).])
+       AC_CHECK_LIB(ssl, SSL_new,
+           [
+               AC_DEFINE(HAVE_LIBSSL, 1,
+                   [Define to 1 if you have the `ssl' library (-lssl).])
+               if test "x$OPENSSL_LIB_DIR" != "x"; then
+                   OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
+               fi
+               OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
+           ], [])
+    ], [])
+LIBS=$old_LIBS
+
 dnl #############################################################
 dnl #
 dnl #  3. Checks for header files
@@ -497,14 +525,14 @@ AC_CHECK_HEADERS( \
        sys/security.h \
        fcntl.h \
        sys/fcntl.h \
-       net/if.h \
+       sys/stat.h \
        prot.h \
        sia.h \
        siad.h
 )
 
 REGEX=no
-AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H, [], [define this if we have the <regex.h> header file]))
+AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H))
 if test "x$ac_cv_header_regex_h" = "xyes"; then
   REGEX_EXTENDED=no
   REGEX=yes
@@ -513,7 +541,7 @@ if test "x$ac_cv_header_regex_h" = "xyes"; then
      #ifdef REG_EXTENDED
        yes
      #endif
-     ], [AC_DEFINE(HAVE_REG_EXTENDED, [], [define this if we have REG_EXTENDED (from <regex.h>)]) REGEX_EXTENDED=yes])
+     ], [AC_DEFINE(HAVE_REG_EXTENDED) REGEX_EXTENDED=yes])
 fi
 AC_SUBST(REGEX)
 AC_SUBST(REGEX_EXTENDED)
@@ -523,74 +551,54 @@ dnl #  other checks which require headers
 dnl #
 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
 then
-  AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication])
+  AC_DEFINE(OSFC2)
 fi
 
 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
 then
-  AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication])
+  AC_DEFINE(OSFSIA)
 fi
 
-smart_try_dir="$OPENSSL_INCLUDE_DIR"
-dnl # stupid RedHat shit
-CFLAGS="$CFLAGS -DOPENSSL_NO_KRB5"
-FR_SMART_CHECK_INCLUDE(openssl/ssl.h)
-OPENSSL_INCLUDE=
-OPENSSL_LIBS=
-if test "x$ac_cv_header_openssl_ssl_h" = "xyes"; then
-  AC_DEFINE(HAVE_OPENSSL_SSL_H, [], [define if you have openssl/ssl.h])
-  old_CPPFLAGS="$CPPFLAGS"
-  if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
-      CPPFLAGS="-I$OPENSSL_INCLUDE_DIR $CPPFLAGS"
-  fi
-  AC_CHECK_HEADERS( \
-         openssl/err.h \
-         openssl/crypto.h \
-         openssl/rand.h \
-         openssl/engine.h
-  )
-  CPPFLAGS="$old_CPPFLAGS"
-
-  AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
-       old_CPPFLAGS=$CPPFLAGS
-       old_LIBS="$LIBS"
-       if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
-           CPPFLAGS="-I$OPENSSL_INCLUDE_DIR"
-          fi
-       AC_EGREP_CPP(yes,
-       [#include <openssl/crypto.h>
-       #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
-        yes
-       #endif
-       ], goodssl="yes")
-           if test "x$goodssl" != "xyes"; then
-             AC_MSG_RESULT(no)
-            OPENSSL_INCLUDE=
-            OPENSSL_LIBS=
-           else
-             AC_MSG_RESULT(yes)
-
-             # Look for the OpenSSL libraries.
-            smart_try_dir=$OPENSSL_LIB_DIR
-            FR_SMART_CHECK_LIB(crypto, DH_new)
-            if test "x$ac_cv_lib_crypto_DH_new" = "xyes"; then
-              FR_SMART_CHECK_LIB(ssl, SSL_new)
-              if test "x$ac_cv_lib_ssl_SSL_new" = "xyes"; then
-                 if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
-                  OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR"
-                fi
-                if test "x$OPENSSL_LIB_DIR" != "x"; then
-                  OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
-                fi
-                 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
-              else
-                OPENSSL_INCLUDE=
-                OPENSSL_LIBS=
-              fi
-            fi
-           fi
-       CPPFLAGS=$old_CPPFLAGS
-       LIBS="$old_LIBS"
+dnl Check for OpenSSL includes.
+OPENSSL_INCLUDE="-DNO_OPENSSL"
+if test "x$OPENSSL_LIBS" = "x"; then
+    AC_MSG_WARN([skipping test for openssl/ssl.h])
+else
+    old_CPPFLAGS=$CPPFLAGS
+    if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
+       CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR"
+    fi
+    dnl # stupid RedHat shit
+    CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
+    AC_CHECK_HEADERS( \
+       openssl/ssl.h \
+       openssl/crypto.h \
+       openssl/err.h \
+       openssl/engine.h,
+       [],
+       OPENSSL_LIBS=
+    )
+    if test "x$OPENSSL_LIBS" != "x"; then
+       AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
+       AC_EGREP_CPP(yes,
+           [#include <openssl/crypto.h>
+            #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
+            yes
+            #endif
+           ], goodssl="yes")
+       if test "x$goodssl" != "xyes"; then
+           AC_MSG_RESULT(no)
+           OPENSSL_LIBS=
+       else
+           AC_MSG_RESULT(yes)
+           if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
+               OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5"
+           else
+               OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
+           fi
+       fi
+    fi
+    CPPFLAGS=$old_CPPFLAGS
 fi
 AC_SUBST(OPENSSL_INCLUDE)
 AC_SUBST(OPENSSL_LIBS)
@@ -611,74 +619,44 @@ AC_TYPE_SIZE_T
 AC_TYPE_UID_T
 
 dnl check for socklen_t
-FR_CHECK_TYPE_INCLUDE([
+AC_CHECK_TYPE_INCLUDE([
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-],socklen_t, int, [socklen_t is generally 'int' on systems which don't use it])
+],socklen_t, int)
 
 dnl check for uint8_t
-FR_CHECK_TYPE_INCLUDE([
+AC_CHECK_TYPE_INCLUDE([
 #ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
-],uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic])
+],uint8_t, unsigned char)
 
 dnl check for uint16_t
-FR_CHECK_TYPE_INCLUDE([
+AC_CHECK_TYPE_INCLUDE([
 #ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
-],uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic])
+],uint16_t, unsigned short)
 
 dnl check for uint32_t
-FR_CHECK_TYPE_INCLUDE([
+AC_CHECK_TYPE_INCLUDE([
 #ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
-],uint32_t, unsigned int, [uint32_t should be the canonical 'network integer])
-
-AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [], [
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-])
-
-AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [], [
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-])
-
-AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], [
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-])
-
-AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [], [
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-])
+],uint32_t, unsigned int)
 
 dnl #############################################################
 dnl #
@@ -708,9 +686,7 @@ AC_CHECK_FUNCS( \
        setlinebuf \
        setvbuf \
        getusershell \
-       initgroups \
-       getaddrinfo \
-       getnameinfo
+       initgroups
 )
 RADIUSD_NEED_DECLARATIONS( \
        crypt \
@@ -730,25 +706,18 @@ dnl # if so, check if struct utmpx has entry ut_xtime
 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
 if test "x$ac_cv_header_utmpx_h" = "xyes"
 then
FR_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
AC_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
  if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
  then
-   AC_DEFINE(ut_xtime,ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx])
+   AC_DEFINE(ut_xtime,ut_tv.tv_sec)
  fi
 fi
 
 dnl # struct ip_pktinfo
-FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
+AC_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
 then
-       AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)])
-fi
-
-dnl # struct in6_pktinfo
-FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in6_pktinfo], ipi6_addr)
-if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes"
-then
-       AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)])
+       AC_DEFINE(HAVE_IP_PKTINFO)
 fi
 
 dnl #############################################################
@@ -807,9 +776,9 @@ AC_CHECK_LIB(crypt, crypt,
   CRYPTLIB="-lcrypt"
 )
 if test "$CRYPTLIB" != ""; then
-  AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])
+  AC_DEFINE(HAVE_CRYPT)
 else
-  AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]))
+  AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
 fi
 
 dnl Check for libcipher
@@ -824,11 +793,8 @@ fi
 
 dnl Check the style of gethostbyaddr, in order of preference
 dnl GNU (_r eight args)
-AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r])
 dnl SYSV (_r six args)
-AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r])
 dnl BSD (three args, may not be thread safe)
-AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r])
 dnl Tru64 has BSD version, but it is thread safe
 dnl    http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
 dnl We need #stdio.h to define NULL on FreeBSD (at least)
@@ -836,7 +802,7 @@ gethostbyaddrrstyle=""
 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
 case "$host" in
 *-freebsd*)
-       AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
+       AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
        gethostbyaddrrstyle=BSD
        AC_MSG_WARN([FreeBSD overridden to BSD-style])
        ;;
@@ -846,7 +812,7 @@ if test "x$gethostbyaddrrstyle" = "x"; then
 #include <stdio.h>
 #include <netdb.h>
 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
-       AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ])
+       AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE)
        gethostbyaddrrstyle=GNU
 ])
 fi
@@ -855,7 +821,7 @@ if test "x$gethostbyaddrrstyle" = "x"; then
 #include <stdio.h>
 #include <netdb.h>
 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
-               AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ])
+               AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE)
                gethostbyaddrrstyle=SYSV
        ])
 fi
@@ -864,7 +830,7 @@ if test "x$gethostbyaddrrstyle" = "x"; then
 #include <stdio.h>
 #include <netdb.h>
 ], [ gethostbyaddr(NULL, 0, 0)  ], [
-               AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
+               AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
                gethostbyaddrrstyle=BSD
        ])
 fi
@@ -892,7 +858,7 @@ AC_TRY_LINK([
 #include <stdio.h>
 #include <netdb.h>
 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
-       AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ])
+       AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE)
        gethostbynamerstyle=GNU
 ])
 if test "x$gethostbynamerstyle" = "x"; then
@@ -900,7 +866,7 @@ if test "x$gethostbynamerstyle" = "x"; then
 #include <stdio.h>
 #include <netdb.h>
 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
-               AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ])
+               AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE)
                gethostbynamerstyle=SYSV
        ])
 fi
@@ -909,7 +875,7 @@ if test "x$gethostbynamerstyle" = "x"; then
 #include <stdio.h>
 #include <netdb.h>
 ], [ gethostbyname(NULL)  ], [
-               AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ])
+               AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE)
                gethostbynamerstyle=BSD
        ])
 fi
@@ -925,21 +891,19 @@ if test "x$gethostbynamerstyle" = "xBSD"; then
 fi
 
 dnl check for non-posix solaris ctime_r (extra buflen int arg)
-AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r])
-AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r])
 ctimerstyle=""
 AC_MSG_CHECKING([ctime_r() syntax])
 AC_TRY_LINK([
 #include <time.h>
 ], [ ctime_r(NULL, NULL, 0) ], [
-       AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function])
+       AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE)
        ctimerstyle="SOLARIS"
 ])
 if test "x$ctimerstyle" = "x"; then
        AC_TRY_LINK([
 #include <time.h>
 ], [ ctime_r(NULL, NULL) ], [
-               AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function])
+               AC_DEFINE(CTIMERSTYLE, POSIXSTYLE)
                ctimerstyle="POSIX"
        ])
 fi
@@ -950,6 +914,64 @@ else
         AC_MSG_RESULT([${ctimerstyle}-style])
 fi
 
+
+dnl If configuring with large file support, determine the right flags to
+dnl use based on the platform.  This is the wrong approach; autoconf 2.50
+dnl comes with a macro that takes the right approach.  But this works well
+dnl enough until we switch to autoconf 2.50 or later.
+if test x"$rad_enable_largefiles" = xyes ; then
+    AC_MSG_CHECKING(for largefile linkage)
+    case "$host" in
+    *-aix4.[01]*)
+        AC_MSG_RESULT(no)
+        AC_MSG_ERROR([AIX before 4.2 does not support large files])
+        ;;
+    *-aix4*)
+        AC_MSG_RESULT(ok)
+        LFS_CFLAGS="-D_LARGE_FILES"
+        LFS_LDFLAGS=""
+        LFS_LIBS=""
+        ;;
+    *-hpux*)
+        AC_MSG_RESULT(ok)
+        LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+        LFS_LDFLAGS=""
+        LFS_LIBS=""
+        ;;
+    *-irix*)
+        AC_MSG_RESULT(no)
+        AC_MSG_ERROR([Large files not supported on this platform])
+        ;;
+    *-linux*)
+        AC_MSG_RESULT(maybe)
+        LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+        LFS_LDFLAGS=""
+        LFS_LIBS=""
+        AC_DEFINE([_GNU_SOURCE], 1,
+                  [Some versions of glibc need this defined for pread/pwrite.])
+        ;;
+    *-solaris*)
+        AC_MSG_RESULT(ok)
+        AC_PATH_PROG(GETCONF, getconf)
+        if test -z "$GETCONF" ; then
+            AC_MSG_ERROR([getconf required to configure large file support])
+        fi
+        LFS_CFLAGS=`$GETCONF LFS_CFLAGS`
+        LFS_LDFLAGS=`$GETCONF LFS_LDFLAGS`
+        LFS_LIBS=`$GETCONF LFS_LIBS`
+        ;;
+    *)
+        AC_MSG_RESULT(maybe)
+        LFS_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+        LFS_LDFLAGS=""
+        LFS_LIBS=""
+        ;;
+    esac
+    AC_SUBST(LFS_CFLAGS)
+    AC_SUBST(LFS_LDFLAGS)
+    AC_SUBST(LFS_LIBS)
+fi
+
 AC_SUBST(HOSTINFO, $host)
 
 dnl #############################################################
@@ -983,11 +1005,11 @@ dnl #  Configure in any module directories.
 dnl #
 dnl #############################################################
 
-mysubdirs="$LIBLTDLPATH"
+mysubdirs=
 if test "x$EXPERIMENTAL" = "xyes"; then
   bar=`ls -1 src/modules/rlm_*/configure | sed 's%/configure%%'`
   dnl # get rid of LF's.
-  mysubdirs=`echo $mysubdirs $bar`
+  mysubdirs=`echo $bar`
 else
   dnl # 
   dnl # Find 'configure' in ONLY the stable modules
@@ -1029,11 +1051,6 @@ dnl #  And finally, output the results.
 dnl #
 dnl #############################################################
 
-AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h])
-AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)])
-AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main   && chmod +x checkrad.pl radlast radtest)])
-AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts    && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])
-
 dnl #
 dnl #  Substitute whatever libraries we found to be necessary
 dnl #
@@ -1048,7 +1065,7 @@ AC_SUBST(STATIC_MODULES)
 AC_SUBST(RADIUSD_MAJOR_VERSION)
 AC_SUBST(RADIUSD_MINOR_VERSION)
 AC_SUBST(RADIUSD_VERSION)
-export CFLAGS LIBS LDFLAGS CPPFLAGS
+export CFLAGS LIBS
 
 AC_OUTPUT(\
        ./Make.inc \
@@ -1064,6 +1081,10 @@ AC_OUTPUT(\
        ./scripts/radiusd.cron.monthly \
        ./scripts/cryptpasswd \
        ./raddb/dictionary \
-       ./raddb/radiusd.conf \
-       ./raddb/radrelay.conf
+       ./raddb/radiusd.conf
 )
+
+AC_OUTPUT_COMMANDS([echo timestamp > src/include/stamp-h])
+AC_OUTPUT_COMMANDS([(cd ./src/include && /bin/sh ./build-radpaths-h)])
+AC_OUTPUT_COMMANDS([(cd ./src/main   && chmod +x checkrad.pl radlast radtest)])
+AC_OUTPUT_COMMANDS([(cd ./scripts    && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])