mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
BuildSystem: Add support for building RADIUS with radcli.
Radcli is yet another RADIUS client library, generally compatible with freeradius and radiusclient-ng. This commit adds autoconf option for detecting it as well and changes cdr_radius and cel_radius to use its header file in that case. ASTERISK-26540 Reported by: Tzafrir Cohen Change-Id: Icc056d476b7acf481309219e9abdca416866c6ec
This commit is contained in:
committed by
George Joseph
parent
e9313920e5
commit
83353997f4
6
CHANGES
6
CHANGES
@@ -12,6 +12,12 @@
|
|||||||
--- Functionality changes from Asterisk 13.20.0 to Asterisk 13.21.0 ----------
|
--- Functionality changes from Asterisk 13.20.0 to Asterisk 13.21.0 ----------
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Build System
|
||||||
|
------------------
|
||||||
|
* RADIUS backends for CEL and CDR can now also be built using the radcli
|
||||||
|
client library, in addition to the existing support for building them
|
||||||
|
using either freeradius or radiusclient-ng.
|
||||||
|
|
||||||
Core
|
Core
|
||||||
------------------
|
------------------
|
||||||
* A new configuration option "genericplc_on_equal_codecs" was added to the
|
* A new configuration option "genericplc_on_equal_codecs" was added to the
|
||||||
|
@@ -41,11 +41,7 @@
|
|||||||
|
|
||||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||||
|
|
||||||
#ifdef FREERADIUS_CLIENT
|
#include RADIUS_HEADER_STR
|
||||||
#include <freeradius-client.h>
|
|
||||||
#else
|
|
||||||
#include <radiusclient-ng.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "asterisk/channel.h"
|
#include "asterisk/channel.h"
|
||||||
#include "asterisk/cdr.h"
|
#include "asterisk/cdr.h"
|
||||||
|
@@ -35,11 +35,7 @@
|
|||||||
|
|
||||||
ASTERISK_FILE_VERSION(__FILE__, "$Rev$")
|
ASTERISK_FILE_VERSION(__FILE__, "$Rev$")
|
||||||
|
|
||||||
#ifdef FREERADIUS_CLIENT
|
#include RADIUS_HEADER_STR
|
||||||
#include <freeradius-client.h>
|
|
||||||
#else
|
|
||||||
#include <radiusclient-ng.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "asterisk/channel.h"
|
#include "asterisk/channel.h"
|
||||||
#include "asterisk/cel.h"
|
#include "asterisk/cel.h"
|
||||||
|
109
configure
vendored
109
configure
vendored
@@ -29083,7 +29083,7 @@ fi
|
|||||||
|
|
||||||
if test "x${PBX_RADIUS}" = "x1"; then
|
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
|
else
|
||||||
|
|
||||||
@@ -29182,6 +29182,113 @@ _ACEOF
|
|||||||
fi
|
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
|
||||||
|
|
||||||
|
ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
|
||||||
|
CFLAGS="${CFLAGS} "
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lradcli" >&5
|
||||||
|
$as_echo_n "checking for rc_read_config in -lradcli... " >&6; }
|
||||||
|
if ${ac_cv_lib_radcli_rc_read_config+:} 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 rc_read_config ();
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return rc_read_config ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
ac_cv_lib_radcli_rc_read_config=yes
|
||||||
|
else
|
||||||
|
ac_cv_lib_radcli_rc_read_config=no
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_radcli_rc_read_config" >&5
|
||||||
|
$as_echo "$ac_cv_lib_radcli_rc_read_config" >&6; }
|
||||||
|
if test "x$ac_cv_lib_radcli_rc_read_config" = xyes; then :
|
||||||
|
AST_RADIUS_FOUND=yes
|
||||||
|
else
|
||||||
|
AST_RADIUS_FOUND=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
|
||||||
|
|
||||||
|
|
||||||
|
# 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} "
|
||||||
|
|
||||||
|
# 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}"
|
||||||
|
|
||||||
|
if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then
|
||||||
|
RADIUS_LIB=""
|
||||||
|
RADIUS_INCLUDE=""
|
||||||
|
else
|
||||||
|
|
||||||
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
10
configure.ac
10
configure.ac
@@ -2370,9 +2370,17 @@ AST_EXT_LIB_CHECK([LUA], [lua], [luaL_newstate], [lua.h], [-lm])
|
|||||||
# just different header filenames and different SONAMEs
|
# just different header filenames and different SONAMEs
|
||||||
AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h])
|
AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h])
|
||||||
if test "x${PBX_RADIUS}" = "x1"; then
|
if test "x${PBX_RADIUS}" = "x1"; then
|
||||||
AC_DEFINE(FREERADIUS_CLIENT, [], [Use the FreeRADIUS-client library])
|
AC_DEFINE(RADIUS_HEADER_STR, [<freeradius-client.h>], [Name of RADIUS library include header])
|
||||||
else
|
else
|
||||||
AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
|
AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
|
||||||
|
if test "x${PBX_RADIUS}" = "x1"; then
|
||||||
|
AC_DEFINE(RADIUS_HEADER_STR, [<radiusclient-ng.h>], [Name of RADIUS library include header])
|
||||||
|
else
|
||||||
|
AST_EXT_LIB_CHECK([RADIUS], [radcli], [rc_read_config], [radcli/radcli.h])
|
||||||
|
if test "x${PBX_RADIUS}" = "x1"; then
|
||||||
|
AC_DEFINE(RADIUS_HEADER_STR, [<radcli/radcli.h>], [Name of RADIUS library include header])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcpg -lcfg])
|
AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcpg -lcfg])
|
||||||
|
@@ -32,9 +32,6 @@
|
|||||||
/* Define to 1 if using `alloca.c'. */
|
/* Define to 1 if using `alloca.c'. */
|
||||||
#undef C_ALLOCA
|
#undef C_ALLOCA
|
||||||
|
|
||||||
/* Use the FreeRADIUS-client library */
|
|
||||||
#undef FREERADIUS_CLIENT
|
|
||||||
|
|
||||||
/* Define to 1 if anonymous semaphores work. */
|
/* Define to 1 if anonymous semaphores work. */
|
||||||
#undef HAS_WORKING_SEMAPHORE
|
#undef HAS_WORKING_SEMAPHORE
|
||||||
|
|
||||||
@@ -1298,6 +1295,9 @@
|
|||||||
/* Define if your system needs braces around PTHREAD_ONCE_INIT */
|
/* Define if your system needs braces around PTHREAD_ONCE_INIT */
|
||||||
#undef PTHREAD_ONCE_INIT_NEEDS_BRACES
|
#undef PTHREAD_ONCE_INIT_NEEDS_BRACES
|
||||||
|
|
||||||
|
/* Name of RADIUS library include header */
|
||||||
|
#undef RADIUS_HEADER_STR
|
||||||
|
|
||||||
/* Define to the type of arg 1 for `select'. */
|
/* Define to the type of arg 1 for `select'. */
|
||||||
#undef SELECT_TYPE_ARG1
|
#undef SELECT_TYPE_ARG1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user