kamailio源文件modules.lst的内容解释

news/2025/2/16 3:03:34

在执行make cfg 后,在kamailio/src目录下有一个文件modules.lst,内容如下:

# this file is autogenerated by make modules-cfg

# the list of sub-directories with modules
modules_dirs:=modules

# the list of module groups to compile
cfg_group_include=

# the list of extra modules to compile
include_modules= 

# the list of static modules
static_modules= 

# the list of modules to skip from compile list
skip_modules= 

# the list of modules to exclude from compile list
exclude_modules= acc_json acc_radius app_java app_lua app_perl app_python app_python3 app_python3s app_ruby app_ruby_proc auth_ephemeral auth_radius cdp cdp_avp cnxcc cplc crypto db2_ldap db_berkeley db_cassandra db_mongodb db_mysql db_oracle db_perlvdb db_postgres db_redis db_sqlite db_unixodbc dialplan dnssec erlang evapi gcrypt geoip geoip2 gzcompress h350 http_async_client http_client ims_auth ims_charging ims_dialog ims_diameter_server ims_icscf ims_ipsec_pcscf ims_isc ims_ocs ims_qos ims_qos_npn ims_registrar_pcscf ims_registrar_scscf ims_usrloc_pcscf ims_usrloc_scscf jansson janssonrpcc json jsonrpcc jwt kafka kazoo lcr ldap log_systemd lost lwsc memcached microhttpd misc_radius mqtt nats ndb_cassandra ndb_mongodb ndb_redis nghttp2 nsq outbound peering phonenum presence presence_conference presence_dfks presence_dialoginfo presence_mwi presence_profile presence_reginfo presence_xml pua pua_bla pua_dialoginfo pua_json pua_reginfo pua_rpc pua_usrloc pua_xmpp rabbitmq regex rls rtp_media_server ruxc sctp secsipid secsipid_proc slack snmpstats stirshaken systemdops tls tls_wolfssl tlsa topos_redis utils uuid websocket xcap_client xcap_server xhttp_pi xmlops xmlrpc xmpp $(skip_modules)

modules_all= $(filter-out modules/CVS modules/CMakeLists.txt, $(wildcard modules/*))
modules_noinc= $(filter-out $(addprefix modules/, $(exclude_modules) $(static_modules)), $(modules_all)) 
modules= $(filter-out $(modules_noinc), $(addprefix modules/, $(include_modules) )) $(modules_noinc) 
modules_configured:=1

这段代码是一个Makefile片段,用于配置和选择要编译的模块。它定义了一些变量和规则,用于控制哪些模块应该被编译,哪些模块应该被排除。以下是对代码的详细解释:

1. 模块目录

modules_dirs:=modules
  • modules_dirs 变量指定了包含模块的子目录。这里只有一个目录 modules

2. 模块组

cfg_group_include=
  • cfg_group_include 变量用于指定要编译的模块组。这里为空,表示没有特定的模块组被包含。

3. 额外模块

include_modules= 
  • include_modules 变量用于指定额外的模块,这些模块将被包含在编译列表中。这里为空,表示没有额外的模块被包含。

4. 静态模块

static_modules= 
  • static_modules 变量用于指定静态模块。静态模块通常是必须包含的模块。这里为空,表示没有静态模块。

5. 跳过模块

skip_modules= 
  • skip_modules 变量用于指定要跳过的模块。这些模块将不会被编译。这里为空,表示没有模块被跳过。

6. 排除模块

exclude_modules= acc_json acc_radius app_java app_lua app_perl app_python app_python3 app_python3s app_ruby app_ruby_proc auth_ephemeral auth_radius cdp cdp_avp cnxcc cplc crypto db2_ldap db_berkeley db_cassandra db_mongodb db_mysql db_oracle db_perlvdb db_postgres db_redis db_sqlite db_unixodbc dialplan dnssec erlang evapi gcrypt geoip geoip2 gzcompress h350 http_async_client http_client ims_auth ims_charging ims_dialog ims_diameter_server ims_icscf ims_ipsec_pcscf ims_isc ims_ocs ims_qos ims_qos_npn ims_registrar_pcscf ims_registrar_scscf ims_usrloc_pcscf ims_usrloc_scscf jansson janssonrpcc json jsonrpcc jwt kafka kazoo lcr ldap log_systemd lost lwsc memcached microhttpd misc_radius mqtt nats ndb_cassandra ndb_mongodb ndb_redis nghttp2 nsq outbound peering phonenum presence presence_conference presence_dfks presence_dialoginfo presence_mwi presence_profile presence_reginfo presence_xml pua pua_bla pua_dialoginfo pua_json pua_reginfo pua_rpc pua_usrloc pua_xmpp rabbitmq regex rls rtp_media_server ruxc sctp secsipid secsipid_proc slack snmpstats stirshaken systemdops tls tls_wolfssl tlsa topos_redis utils uuid websocket xcap_client xcap_server xhttp_pi xmlops xmlrpc xmpp $(skip_modules)
  • exclude_modules 变量列出了所有要排除的模块。这些模块将不会被编译。列表中包含了许多模块名称,并且还包含了 $(skip_modules),这意味着 skip_modules 中的模块也会被排除。

7. 所有模块

modules_all= $(filter-out modules/CVS modules/CMakeLists.txt, $(wildcard modules/*))
  • modules_all 变量列出了 modules 目录下的所有模块,但排除了 CVSCMakeLists.txt 文件。

8. 不包含的模块

modules_noinc= $(filter-out $(addprefix modules/, $(exclude_modules) $(static_modules)), $(modules_all)) 
  • modules_noinc 变量列出了所有不被包含的模块。它从 modules_all 中排除了 exclude_modulesstatic_modules 中指定的模块。

9. 最终模块列表

modules= $(filter-out $(modules_noinc), $(addprefix modules/, $(include_modules) )) $(modules_noinc) 
  • modules 变量是最终的模块列表。它包含了 include_modules 中指定的模块,并且排除了 modules_noinc 中的模块。

10. 配置标志

modules_configured:=1
  • modules_configured 变量被设置为 1,表示模块配置已经完成。

总结

这段代码的主要目的是根据配置变量(如 include_modulesexclude_modulesstatic_modules 等)来生成最终的模块列表 modules,以便在编译时只编译需要的模块。通过这种方式,可以灵活地控制哪些模块被包含在编译过程中,哪些模块被排除。

如果要编译所有模块,进行如下操作

如果你想要编译所有模块,可以按照以下步骤操作:

1. 修改 exclude_modules 变量

将所有需要排除的模块都从 exclude_modules 中移除,确保没有模块被排除。你可以直接清空 exclude_modules 变量,或者确保没有任何模块在其中。

exclude_modules = 

2. 清空 include_modulesstatic_modules

确保没有在 include_modulesstatic_modules 中指定特定的模块,这样所有模块都会按照默认的设置进行编译。

include_modules = 
static_modules = 

3. 保持 modules_all 变量

保持原样,不需要做任何修改。modules_all 会列出所有的模块。

modules_all = $(filter-out modules/CVS modules/CMakeLists.txt, $(wildcard modules/*))

4. 重新生成配置文件

完成上述修改后,重新运行 make modules-cfg 来重新生成配置文件。所有模块应该都包含在内。

5. 编译 Kamailio

最后,运行 make 来开始编译,所有模块都会被编译。

make

通过这些步骤,你可以确保编译所有的模块。如果之前已经修改过配置文件,只需清空排除和特定包含的模块设置,默认情况下会编译所有模块。

最终的内容

如果你想要编译所有模块,最终的配置文件内容应该类似于以下内容:

# this file is autogenerated by make modules-cfg

# the list of sub-directories with modules
modules_dirs := modules

# the list of module groups to compile
cfg_group_include =

# the list of extra modules to compile
include_modules = 

# the list of static modules
static_modules = 

# the list of modules to skip from compile list
skip_modules = 

# the list of modules to exclude from compile list
exclude_modules = 

# the list of modules that will be compiled
modules_all = $(filter-out modules/CVS modules/CMakeLists.txt, $(wildcard modules/*))

# the list of modules to compile (no exclusions or specific includes)
modules_noinc = $(modules_all) 

modules = $(modules_noinc)

modules_configured := 1

解释:

  1. include_modules = static_modules = :这两个变量是空的,意味着没有额外指定要包含或静态编译的模块。
  2. exclude_modules = :这个变量是空的,意味着没有模块被排除。
  3. modules_noinc = $(modules_all):这个变量包含了所有模块,因为没有排除任何模块。
  4. modules = $(modules_noinc):最终的 modules 变量包含了所有模块,即所有模块都会被编译。

结果:

通过这些修改,Kamailio 将编译所有模块,没有任何排除或指定的模块。你只需要执行 make 来编译所有模块了。


http://www.niftyadmin.cn/n/5841899.html

相关文章

C++ 字面量深度解析:从基础到实战进阶

在 C 开发中,字面量(Literal)不仅是基础语法的一部分,更是提升代码可读性、安全性和性能的关键工具。本文将深入探讨 C 字面量的高级特性、最新标准支持(C11/14/17/20)以及实际开发中的应用技巧&#xff0c…

CH340G上传程序到ESP8266-01(S)模块

文章目录 概要ESP8266模块外形尺寸模块原理图模块引脚功能 CH340G模块外形及其引脚模块引脚功能USB TO TTL引脚 程序上传接线Arduino IDE 安装ESP8266开发板Arduino IDE 开发板上传失败上传成功 正常工作 概要 使用USB TO TTL(CH340G)将Arduino将程序上传…

【Redis_2】短信登录

一、基于Session实现登录 RegexUtils:是定义的关于一些格式的正则表达式的工具箱 package com.hmdp.utils;import cn.hutool.core.util.StrUtil;public class RegexUtils {/*** 是否是无效手机格式* param phone 要校验的手机号* return true:符合,false&#xff…

Kotlin 使用 Springboot 反射执行方法并自动传参

在使用反射的时候,执行方法的时候在想如果Springboot 能对需要执行的反射方法的参数自动注入就好了。所以就有了下文。 知识点 获取上下文通过上下文获取 Bean通过上下文创建一个对象,该对象所需的参数由 Springboot 自己注入 创建参数 因为需要对反…

Rust场景示例:为什么要使用切片类型

通过对比 不用切片 和 使用切片 的场景,说明切片类型在 Rust 中的必要性: 场景:提取字符串中的单词 假设我们需要编写一个函数,从一个句子中提取第一个单词。我们将分别展示 不用切片 和 使用切片 的实现,并对比二者的…

网络编程套接字(中)

文章目录 🍏简单的TCP网络程序服务端创建套接字服务端绑定服务端监听服务端获取连接服务端处理请求客户端创建套接字客户端连接服务器客户端发起请求服务器测试单执行流服务器的弊端 🍐多进程版的TCP网络程序捕捉SIGCHLD信号让孙子进程提供服务 &#x1…

【数据结构】(4) 线性表 List

一、什么是线性表 线性表就是 n 个相同类型元素的有限序列,每一个元素只有一个前驱和后继(除了第一个和最后一个元素)。 数据结构中,常见的线性表有:顺序表、链表、栈、队列。 二、什么是 List List 是 Java 中的线性…

Rust `struct`和 `enum`番外《哪吒、白蛇传?》

第一章:混天绫引发的血案——没有 struct 的江湖有多乱 天庭码农哪吒最近很头疼。 他写了个程序管理法宝库,结果代码乱成一锅粥: // 哪吒的早期代码:法宝属性分散传递 fn print_treasure(name: String, power_level: u32, is_…