From: Arran Cudbard-Bell Date: Tue, 19 Feb 2013 17:48:53 +0000 (-0500) Subject: Update configure script to add -ltalloc X-Git-Tag: release_3_0_0_beta1~1023 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f564d88701cdba9441b6e23ed681c28fd35fcaaf;p=thirdparty%2Ffreeradius-server.git Update configure script to add -ltalloc --- diff --git a/Make.inc.in b/Make.inc.in index c3c9f8902cf..89e22f5cbfc 100644 --- a/Make.inc.in +++ b/Make.inc.in @@ -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@ diff --git a/configure b/configure index ae9c35f7c94..2429a7e12e2 100755 --- 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 @@ -18098,6 +18101,161 @@ fi 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 +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 +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 +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=." >&5 +$as_echo "$as_me: WARNING: talloc headers not found. Use --with-talloc-include-dir=." >&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 : diff --git a/configure.in b/configure.in index 7104f582e63..e25bcdd747e 100644 --- a/configure.in +++ b/configure.in @@ -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=.]) + 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, diff --git a/src/main/radiusd.mk b/src/main/radiusd.mk index 9819c950a36..149087ffa61 100644 --- a/src/main/radiusd.mk +++ b/src/main/radiusd.mk @@ -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})" ""