]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Update configure script to add -ltalloc
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 19 Feb 2013 17:48:53 +0000 (12:48 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 19 Feb 2013 19:07:16 +0000 (14:07 -0500)
Make.inc.in
configure
configure.in
src/main/radiusd.mk

index c3c9f8902cfa51abadd608022bb590b54b68f31e..89e22f5cbfc43ecf2e5427b197d8d30ec35f70bd 100644 (file)
@@ -59,7 +59,7 @@ RADDBDIR      = ${raddbdir}
 RUNDIR         = ${localstatedir}/run/radiusd
 SBINDIR                = ${sbindir}
 RADIR          = ${radacctdir}
-LIBRADIUS      = $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la
+LIBRADIUS      = $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la -l talloc
 
 #USE_SHARED_LIBS = @USE_SHARED_LIBS@
 #USE_STATIC_LIBS = @USE_STATIC_LIBS@
index ae9c35f7c94ac986181057cbb0834b6e8a5a9253..2429a7e12e2b935fe8d9c64f4bfb6e6aa7150a51 100755 (executable)
--- a/configure
+++ b/configure
@@ -786,6 +786,7 @@ with_openssl_libraries
 with_rlm_FOO_lib_dir
 with_rlm_FOO_include_dir
 with_udpfromto
+with_talloc_include_dir
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1451,6 +1452,8 @@ Optional Packages:
   --with-rlm-FOO-lib-dir=DIR       Directory to look for library files used by module FOO
   --with-rlm-FOO-include-dir=DIR   Directory to look for include files used by module FOO
   --with-udpfromto        Compile in UDPFROMTO support. (default=no)
+  --with-talloc-include-dir=DIR
+                          Directory where the talloc includes may be found
 
 Some influential environment variables:
   CC          C compiler command
 
 LIBS="$old_LIBS"
 
+talloc_include_dir=
+
+# Check whether --with-talloc-include-dir was given.
+if test "${with_talloc_include_dir+set}" = set; then :
+  withval=$with_talloc_include_dir; case "$withval" in
+           no)
+               as_fn_error $? "Need talloc-include-dir" "$LINENO" 5
+           ;;
+               yes)
+           ;;
+           *)
+               talloc_include_dir="$withval"
+           ;;
+       esac
+fi
+
+
+
+smart_try_dir="$talloc_include_dir"
+
+
+ac_safe=`echo "talloc.h" | sed 'y%./+-%__pm%'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for talloc.h" >&5
+$as_echo_n "checking for talloc.h... " >&6; }
+
+old_CFLAGS="$CFLAGS"
+smart_include=
+smart_include_dir=
+
+if test "x$smart_try_dir" != "x"; then
+  for try in $smart_try_dir; do
+    CFLAGS="$old_CFLAGS -I$try"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                   #include <talloc.h>
+int
+main ()
+{
+ int a = 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  smart_include="-I$try"
+else
+  smart_include=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test "x$smart_include" != "x"; then
+      break;
+    fi
+  done
+  CFLAGS="$old_CFLAGS"
+fi
+
+if test "x$smart_include" = "x"; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                 #include <talloc.h>
+int
+main ()
+{
+ int a = 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  smart_include=" "
+else
+  smart_include=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test "x$smart_include" = "x"; then
+
+
+if test "x$LOCATE" != "x"; then
+        DIRS=
+  file=talloc.h
+
+  for x in `${LOCATE} $file 2>/dev/null`; do
+                                        base=`echo $x | sed "s%/${file}%%"`
+    if test "x$x" = "x$base"; then
+      continue;
+    fi
+
+    dir=`${DIRNAME} $x 2>/dev/null`
+                exclude=`echo ${dir} | ${GREP} /home`
+    if test "x$exclude" != "x"; then
+      continue
+    fi
+
+                    already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
+    if test "x$already" = "x"; then
+      DIRS="$DIRS $dir"
+    fi
+  done
+fi
+
+eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
+
+
+  for try in $smart_include_dir /usr/local/include /opt/include; do
+    CFLAGS="$old_CFLAGS -I$try"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                   #include <talloc.h>
+int
+main ()
+{
+ int a = 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  smart_include="-I$try"
+else
+  smart_include=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test "x$smart_include" != "x"; then
+      break;
+    fi
+  done
+  CFLAGS="$old_CFLAGS"
+fi
+
+if test "x$smart_include" != "x"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  eval "ac_cv_header_$ac_safe=yes"
+  CFLAGS="$old_CFLAGS $smart_include"
+  SMART_CFLAGS="$SMART_CFLAGS $smart_include"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+if test "x$ac_cv_header_talloc_h" != "xyes"; then
+       have_taloc="no"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: talloc headers not found. Use --with-talloc-include-dir=<path>." >&5
+$as_echo "$as_me: WARNING: talloc headers not found. Use --with-talloc-include-dir=<path>." >&2;}
+       as_fn_error $? "FreeRADIUS requires libtalloc" "$LINENO" 5
+else
+       INCLUDE+="${SMART_CFLAGS}"
+       LIBS+=" -ltalloc"
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
 $as_echo_n "checking for crypt in -lcrypt... " >&6; }
 if ${ac_cv_lib_crypt_crypt+:} false; then :
index 7104f582e6352b0a8e5d8c06a9a3ed547f53fd4d..e25bcdd747e983183ab4addb3802ee8560ac18fe 100644 (file)
@@ -1067,6 +1067,35 @@ LIBS="$LIBS $LIBLTDL"
 AC_CHECK_FUNC(lt_dladvise_init, AC_DEFINE(HAVE_LT_DLADVISE_INIT, [], [Do we have the lt_dladvise_init function]))
 LIBS="$old_LIBS"
 
+dnl Check for talloc
+dnl extra argument: --with-talloc-include-dir=DIR
+talloc_include_dir=
+AC_ARG_WITH(talloc-include-dir,
+       [AS_HELP_STRING([--with-talloc-include-dir=DIR],
+       [Directory where the talloc includes may be found])],
+       [case "$withval" in
+           no)
+               AC_MSG_ERROR(Need talloc-include-dir)
+           ;;
+               yes)
+           ;;
+           *)
+               talloc_include_dir="$withval"
+           ;;
+       esac])
+
+dnl Check for talloc header files
+
+smart_try_dir="$talloc_include_dir"
+FR_SMART_CHECK_INCLUDE([talloc.h])
+if test "x$ac_cv_header_talloc_h" != "xyes"; then
+       AC_MSG_WARN([talloc headers not found. Use --with-talloc-include-dir=<path>.])
+       AC_MSG_ERROR([FreeRADIUS requires libtalloc])
+else
+       INCLUDE="${SMART_CFLAGS} ${INCLUDE}"
+       LIBS="-ltalloc ${LIBS}"
+fi
+
 dnl Check for libcrypt
 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
 AC_CHECK_LIB(crypt, crypt,
index 9819c950a36a8e09995db9b166a8ab1dfca6fe7b..149087ffa611b5553e09bdded04754c8862e3854 100644 (file)
@@ -12,8 +12,6 @@ SRC_CFLAGS    := -DHOSTINFO=\"${HOSTINFO}\"
 TGT_INSTALLDIR  := ${sbindir}
 TGT_LDLIBS     := $(LIBS) $(LCRYPT) $(OPENSSL_LIBS)
 
-TGT_PREREQS    := libfreeradius-radius.a
-
 # Libraries can't depend on libraries (oops), so make the binary
 # depend on the EAP code...
 ifneq "$(filter rlm_eap_%,${ALL_TGTS})" ""