Make subdirs before modules
[freeradius.git] / configure.in
index 3cf8fb5..a7412ed 100644 (file)
@@ -50,7 +50,6 @@ AC_AIX
 
 AC_PROG_GCC_TRADITIONAL
 AC_PROG_CC_SUNPRO
-AC_PROG_RANLIB
 
 dnl Compile in large (2G+) file support.
 AC_SYS_LARGEFILE
@@ -81,6 +80,11 @@ if test x"$enable_ltdl_install" = x"yes"; then
 fi
 AC_SUBST(LTDL_SUBDIRS)
 
+
+AC_CONFIG_MACRO_DIR([libltdl/m4])
+dnl Stupid autoconf doesn't set ac_aux_dir  WTF?
+AC_CONFIG_AUX_DIR([.])
+
 dnl use system-wide libtool, if it exists
 AC_ARG_WITH(system-libtool,
 [  --with-system-libtool              try to use libtool installed in your system [default=use our own]],
@@ -89,6 +93,10 @@ AC_ARG_WITH(system-libtool,
   LIBTOOL="`pwd`/libtool"
   AC_SUBST(LIBTOOL)
   dnl ensure that we're looking for dlopen
+  LT_CONFIG_LTDL_DIR([libltdl])
+  LT_INIT
+  LTDL_INIT
+  AC_CONFIG_AUX_DIR([libltdl/config])
   AC_LIBTOOL_DLOPEN
 
   dnl Figure out how to build shared libraries
@@ -291,6 +299,11 @@ if test "x$developer" != "xno" -a -d $srcdir/CVS; then
   developer="yes"
 fi
 
+if test "x$developer" != "xno" -a -d $srcdir/.git; then
+  dnl turn on the developer flag when taken from a git checkout (not a release)
+  developer="yes"
+fi
+
 dnl extra argument: --with-experimental-modules
 EXPERIMENTAL=
 AC_ARG_WITH(experimental-modules,
@@ -507,8 +520,9 @@ dnl Check for OpenSSL libraries.
 OPENSSL_LIBS=
 if test "x$WITH_OPENSSL" = xyes; then
   old_LIBS=$LIBS
+  old_LDFLAGS="$LDFLAGS"
   if test "x$OPENSSL_LIB_DIR" != "x"; then
-    LIBS="-L$OPENSSL_LIB_DIR $LIBS"
+    LDFLAGS="$LDFLAGS -L$OPENSSL_LIB_DIR"
   fi
   AC_CHECK_LIB(crypto, DH_new,
     [
@@ -526,6 +540,7 @@ if test "x$WITH_OPENSSL" = xyes; then
            ], [])
     ], [])
   LIBS=$old_LIBS
+  LDFLAGS="$old_LDFLAGS"
 fi
 
 AC_CHECK_LIB(ws2_32, htonl)
@@ -539,6 +554,8 @@ AC_CHECK_LIB(pcap, pcap_open_live,
        ],
        [ AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer.]) ])
 
+AC_LIB_READLINE
+
 dnl #############################################################
 dnl #
 dnl #  3. Checks for header files
@@ -594,6 +611,7 @@ AC_CHECK_HEADERS( \
        fcntl.h \
        sys/fcntl.h \
        sys/prctl.h \
+       sys/un.h \
        glob.h \
        prot.h \
        pwd.h \
@@ -817,6 +835,10 @@ AC_CHECK_FUNCS( \
        getnameinfo \
        closefrom \
        gettimeofday \
+       getpeereid \
+       setuid \
+       setresuid \
+       getresuid \
        strlcat \
        strlcpy
 )
@@ -902,6 +924,8 @@ else
   AC_MSG_RESULT(no.)
 fi
 
+FR_TLS
+
 dnl #############################################################
 dnl #
 dnl #  7. Checks for library functions