diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | cel/cel_odbc.c | 2 | ||||
-rwxr-xr-x | configure | 134 | ||||
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | main/loader.c | 28 |
5 files changed, 127 insertions, 50 deletions
@@ -624,7 +624,7 @@ oldmodcheck: ld-cache-update: ifneq ($(LDCONFIG),) ifeq ($(DESTDIR),) # DESTDIR means binary archive creation; ldconfig should be run on postinst - @if [ $${EUID} -eq 0 ] ; then \ + @if [ $$(id -u) -eq 0 ] ; then \ $(LDCONFIG) "$(ASTLIBDIR)/" ; \ else \ echo " WARNING WARNING WARNING" ;\ diff --git a/cel/cel_odbc.c b/cel/cel_odbc.c index a289b877c..05c1095cb 100644 --- a/cel/cel_odbc.c +++ b/cel/cel_odbc.c @@ -849,7 +849,7 @@ static int reload(void) return AST_MODULE_LOAD_SUCCESS; } -AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, ODBC_BACKEND_NAME, +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "ODBC CEL backend", .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, @@ -3710,36 +3710,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # check existence of the package -ac_aux_dir= -for ac_dir in "$srcdir"/; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\"/" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - - # preserve any CFLAGS or LDFLAGS that may be set @@ -30267,6 +30237,110 @@ if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaL_newstate in -llua5.3" >&5 +$as_echo_n "checking for luaL_newstate in -llua5.3... " >&6; } +if ${ac_cv_lib_lua5_3_luaL_newstate+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llua5.3 ${pbxlibdir} -lm $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 luaL_newstate (); +int +main () +{ +return luaL_newstate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lua5_3_luaL_newstate=yes +else + ac_cv_lib_lua5_3_luaL_newstate=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_lua5_3_luaL_newstate" >&5 +$as_echo "$ac_cv_lib_lua5_3_luaL_newstate" >&6; } +if test "x$ac_cv_lib_lua5_3_luaL_newstate" = xyes; then : + AST_LUA_FOUND=yes +else + AST_LUA_FOUND=no +fi + + CFLAGS="${ast_ext_lib_check_save_CFLAGS}" + + + # now check for the header. + if test "${AST_LUA_FOUND}" = "yes"; then + LUA_LIB="${pbxlibdir} -llua5.3 -lm" + # if --with-LUA=DIR has been specified, use it. + if test "x${LUA_DIR}" != "x"; then + LUA_INCLUDE="-I${LUA_DIR}/include" + fi + LUA_INCLUDE="${LUA_INCLUDE} " + + # check for the header + ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${LUA_INCLUDE}" + ac_fn_c_check_header_mongrel "$LINENO" "lua5.3/lua.h" "ac_cv_header_lua5_3_lua_h" "$ac_includes_default" +if test "x$ac_cv_header_lua5_3_lua_h" = xyes; then : + LUA_HEADER_FOUND=1 +else + LUA_HEADER_FOUND=0 +fi + + + CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" + + if test "x${LUA_HEADER_FOUND}" = "x0" ; then + LUA_LIB="" + LUA_INCLUDE="" + else + + PBX_LUA=1 + cat >>confdefs.h <<_ACEOF +#define HAVE_LUA 1 +_ACEOF + + fi + fi +fi + + +if test "x${PBX_LUA}" = "x1" ; then + if test x"${LUA_DIR}" = x; then + LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.3" + else + LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.3" + fi +fi + + +if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then + pbxlibdir="" + # if --with-LUA=DIR has been specified, use it. + if test "x${LUA_DIR}" != "x"; then + if test -d ${LUA_DIR}/lib; then + pbxlibdir="-L${LUA_DIR}/lib" + else + pbxlibdir="-L${LUA_DIR}" + fi + fi + + ast_ext_lib_check_save_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} " { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaL_newstate in -llua5.2" >&5 $as_echo_n "checking for luaL_newstate in -llua5.2... " >&6; } if ${ac_cv_lib_lua5_2_luaL_newstate+:} false; then : diff --git a/configure.ac b/configure.ac index 64ecbfab3..c590c6b0b 100644 --- a/configure.ac +++ b/configure.ac @@ -17,8 +17,6 @@ AC_CANONICAL_HOST # check existence of the package AC_CONFIG_SRCDIR([main/asterisk.c]) -AC_CONFIG_AUX_DIR() - AC_COPYRIGHT("Asterisk") # preserve any CFLAGS or LDFLAGS that may be set @@ -2409,6 +2407,15 @@ if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then [${PWLIB_INCLUDE}], [${PWLIB_LIB}]) fi +AST_EXT_LIB_CHECK([LUA], [lua5.3], [luaL_newstate], [lua5.3/lua.h], [-lm]) +if test "x${PBX_LUA}" = "x1" ; then + if test x"${LUA_DIR}" = x; then + LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.3" + else + LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.3" + fi +fi + AST_EXT_LIB_CHECK([LUA], [lua5.2], [luaL_newstate], [lua5.2/lua.h], [-lm]) if test "x${PBX_LUA}" = "x1" ; then if test x"${LUA_DIR}" = x; then diff --git a/main/loader.c b/main/loader.c index 88c1cda97..8f3fbe0c9 100644 --- a/main/loader.c +++ b/main/loader.c @@ -524,9 +524,6 @@ static void unload_dynamic_module(struct ast_module *mod) * If somehow there was another dlopen() on the same module (unlikely, * since that all is supposed to happen in loader.c). * - * Or the lazy resolution of a global symbol (very likely, since that is - * how we load all of our modules that export global symbols). - * * Avoid the temptation of repeating the dlclose(). The other code that * dlopened the module still has its module reference, and should close * it itself. In other situations, dlclose() will happily return success @@ -631,7 +628,8 @@ static struct ast_module *load_dynamic_module(const char *resource_in, unsigned int modules_shutdown(void) { struct ast_module *mod; - int somethingchanged = 1, final = 0; + int somethingchanged; + int res; AST_DLLIST_LOCK(&module_list); @@ -639,17 +637,11 @@ int modules_shutdown(void) * may be still in use, even if all channels are dead. We must therefore * check the usecount before asking modules to unload. */ do { - if (!somethingchanged) { - /*!\note If we go through the entire list without changing - * anything, ignore the usecounts and unload, then exit. */ - final = 1; - } - /* Reset flag before traversing the list */ somethingchanged = 0; AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN(&module_list, mod, entry) { - if (!final && mod->usecount) { + if (mod->usecount) { ast_debug(1, "Passing on %s: its use count is %d\n", mod->resource, mod->usecount); continue; @@ -672,12 +664,12 @@ int modules_shutdown(void) } } } - } while (somethingchanged && !final); + } while (somethingchanged); - final = AST_DLLIST_EMPTY(&module_list); + res = AST_DLLIST_EMPTY(&module_list); AST_DLLIST_UNLOCK(&module_list); - return !final; + return !res; } int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode force) @@ -1168,7 +1160,7 @@ static enum ast_module_load_result load_resource(const char *resource_name, unsi if ((mod = find_resource(resource_name, 0))) { if (mod->flags.running) { - ast_log(LOG_WARNING, "Module '%s' already exists.\n", resource_name); + ast_log(LOG_WARNING, "Module '%s' already loaded and running.\n", resource_name); return AST_MODULE_LOAD_DECLINE; } if (global_symbols_only && !ast_test_flag(mod->info, AST_MODFLAG_GLOBAL_SYMBOLS)) @@ -1248,6 +1240,11 @@ static struct load_order_entry *add_to_load_order(const char *resource, struct l return NULL; order->resource = ast_strdup(resource); + if (!order->resource) { + ast_free(order); + + return NULL; + } order->required = required; AST_LIST_INSERT_TAIL(load_order, order, entry); @@ -1430,7 +1427,6 @@ int load_modules(unsigned int preload_only) add_to_load_order(v->value, &load_order, 1); ast_debug(2, "Adding module to required list: %s (%s)\n", v->value, v->name); } - } /* check if 'autoload' is on */ |