import from HEAD:
[freeradius.git] / configure.in
index 9b10e41..28ba5ef 100644 (file)
@@ -26,7 +26,7 @@ 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 #############################################################
@@ -37,6 +37,13 @@ dnl #############################################################
 
 dnl Check for GNU cc
 AC_PROG_CC
+
+dnl #
+dnl # check for AIX, to allow us to use some BSD functions
+dnl # must be before macros that call the compiler.
+dnl #
+AC_AIX
+
 AC_PROG_GCC_TRADITIONAL
 AC_PROG_CC_SUNPRO
 AC_PROG_RANLIB
@@ -49,11 +56,9 @@ dnl # AC_SYS_LARGEFILE
 
 PACKAGE=freeradius
 
-dnl #
-dnl # check for AIX, to allow us to use some BSD functions
-dnl # must be before macros that call the compiler.
-dnl #
-AC_AIX
+dnl # check for system bytesex
+dnl # AC_DEFINES WORDS_BIGENDIAN
+AC_C_BIGENDIAN
 
 dnl Find GNU Make.
 AC_CHECK_PROG(GMAKE, gmake, yes, no)
@@ -258,29 +263,28 @@ 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
-    *) OPENSSL_INCLUDE="$withval"
+    *) OPENSSL_INCLUDE_DIR="$withval"
        ;;
   esac ]
 )
-AC_SUBST(OPENSSL_INCLUDE)
 
 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
-    *) OPENSSL_LIBS="$withval"
+    *) OPENSSL_LIB_DIR="$withval"
        ;;
   esac ]
 )
-AC_SUBST(OPENSSL_LIBS)
-
 
 dnl #
 dnl #  These next two arguments don't actually do anything.  They're
@@ -345,6 +349,11 @@ if test "x$WITH_UDPFROMTO" = "xyes"; then
        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
@@ -443,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
@@ -458,6 +489,9 @@ case "$host" in
 *-interix*)
        CFLAGS="$CFLAGS -D_ALL_SOURCE"
        ;;
+*-darwin*)
+       CFLAGS="$CFLAGS -DDARWIN"
+       ;;
 esac
 
 AC_HEADER_DIRENT
@@ -491,6 +525,7 @@ AC_CHECK_HEADERS( \
        sys/security.h \
        fcntl.h \
        sys/fcntl.h \
+       sys/stat.h \
        prot.h \
        sia.h \
        siad.h
@@ -524,56 +559,50 @@ then
   AC_DEFINE(OSFSIA)
 fi
 
-smart_try_dir="$OPENSSL_INCLUDE"
-dnl # stupid RedHat shit
-CFLAGS="$CFLAGS -DOPENSSL_NO_KRB5"
-AC_SMART_CHECK_INCLUDE(openssl/ssl.h)
-if test "x$ac_cv_header_openssl_ssl_h" = "xyes"; then
-  AC_DEFINE(HAVE_OPENSSL_SSL_H)
-  old_CPPFLAGS="$CPPFLAGS"
-  if test "x$OPENSSL_INCLUDE" != "x"; then
-      CPPFLAGS="-I$OPENSSL_INCLUDE $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
-       if test "x$OPENSSL_INCLUDE" != "x"; then
-           CPPFLAGS="-I$OPENSSL_INCLUDE"
-          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_LIBS
-            AC_SMART_CHECK_LIB(crypto, DH_new)
-            if test "x$ac_cv_lib_crypto_DH_new" = "xyes"; then
-              AC_SMART_CHECK_LIB(ssl, SSL_new)
-              if test "x$ac_cv_lib_ssl_SSL_new" != "xyes"; then
-                OPENSSL_INCLUDE=
-                OPENSSL_LIBS=
-              fi
-              export OPENSSL_INCLUDE OPENSSL_LIBS
-            fi
-           fi
-       CPPFLAGS=$old_CPPFLAGS
+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)
+export OPENSSL_LIBS
 
 dnl #############################################################
 dnl #
@@ -651,6 +680,8 @@ AC_CHECK_FUNCS( \
        gmtime_r \
        strsep \
        inet_aton \
+       inet_pton \
+       inet_ntop \
        gethostname \
        setlinebuf \
        setvbuf \