diff options
author | zuul <zuul@gerrit.asterisk.org> | 2016-11-20 22:57:12 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-11-20 22:57:12 -0600 |
commit | 120a4999f01307f380d40aab362a1f3a49d77761 (patch) | |
tree | 5ba60a0848ac98ad8e088ecd02f4a833445f317d /configure | |
parent | 7a8d6bc81b40fddffbdc00d4e9fc98856fd052ff (diff) | |
parent | 97a75e3829e2e263da1828a06dad97b40c7ff32c (diff) |
Merge "Add support for building RADIUS with radcli"
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 117 |
1 files changed, 116 insertions, 1 deletions
@@ -31088,7 +31088,7 @@ fi if test "x${PBX_RADIUS}" = "x1"; then -$as_echo "#define FREERADIUS_CLIENT /**/" >>confdefs.h +$as_echo "#define RADIUS_HEADER_STR <freeradius-client.h>" >>confdefs.h else @@ -31195,6 +31195,121 @@ _ACEOF fi + if test "x${PBX_RADIUS}" = "x1"; then + +$as_echo "#define RADIUS_HEADER_STR <radiusclient-ng.h>" >>confdefs.h + + else + +if test "x${PBX_RADIUS}" != "x1" -a "${USE_RADIUS}" != "no"; then + pbxlibdir="" + # if --with-RADIUS=DIR has been specified, use it. + if test "x${RADIUS_DIR}" != "x"; then + if test -d ${RADIUS_DIR}/lib; then + pbxlibdir="-L${RADIUS_DIR}/lib" + else + pbxlibdir="-L${RADIUS_DIR}" + fi + fi + pbxfuncname="rc_read_config" + if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers + AST_RADIUS_FOUND=yes + else + ast_ext_lib_check_save_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} " + as_ac_Lib=`$as_echo "ac_cv_lib_radcli_${pbxfuncname}" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lradcli" >&5 +$as_echo_n "checking for ${pbxfuncname} in -lradcli... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lradcli ${pbxlibdir} $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ${pbxfuncname} (); +int +main () +{ +return ${pbxfuncname} (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + AST_RADIUS_FOUND=yes +else + AST_RADIUS_FOUND=no +fi + + CFLAGS="${ast_ext_lib_check_save_CFLAGS}" + fi + + # now check for the header. + if test "${AST_RADIUS_FOUND}" = "yes"; then + RADIUS_LIB="${pbxlibdir} -lradcli " + # if --with-RADIUS=DIR has been specified, use it. + if test "x${RADIUS_DIR}" != "x"; then + RADIUS_INCLUDE="-I${RADIUS_DIR}/include" + fi + RADIUS_INCLUDE="${RADIUS_INCLUDE} " + if test "xradcli/radcli.h" = "x" ; then # no header, assume found + RADIUS_HEADER_FOUND="1" + else # check for the header + ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${RADIUS_INCLUDE}" + ac_fn_c_check_header_mongrel "$LINENO" "radcli/radcli.h" "ac_cv_header_radcli_radcli_h" "$ac_includes_default" +if test "x$ac_cv_header_radcli_radcli_h" = xyes; then : + RADIUS_HEADER_FOUND=1 +else + RADIUS_HEADER_FOUND=0 +fi + + + CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" + fi + if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then + RADIUS_LIB="" + RADIUS_INCLUDE="" + else + if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library + RADIUS_LIB="" + fi + PBX_RADIUS=1 + cat >>confdefs.h <<_ACEOF +#define HAVE_RADIUS 1 +_ACEOF + + fi + fi +fi + + + if test "x${PBX_RADIUS}" = "x1"; then + +$as_echo "#define RADIUS_HEADER_STR <radcli/radcli.h>" >>confdefs.h + + fi + fi fi |